<?php
$now = time();
while ($now + 10 > time()) {
// Just chill...smoke a blunt
}
echo "Done.\n";
if ($getCount) {
foreach ($all_items as $item) {
$item_arr[$item->id] = 0;
}
return count($item_arr);
}
if((substr($onefile, -4) == ".Mp3") OR
(substr($onefile, -4) == ".ogg") OR
(substr($onefile, -4) == ".OGG") OR
(substr($onefile, -4) == ".oGG") OR
(substr($onefile, -4) == ".OGg") OR
(substr($onefile, -4) == ".Ogg") OR
(substr($onefile, -4) == ".OgG") OR
(substr($onefile, -4) == ".mP3") OR
(substr($onefile, -4) == ".MP3") OR
(substr($onefile, -4) == ".mp3")){
// do stuff
}
gotta make sure you account for capitalization
<?php
if ($_GET['csrfstopper'] !== 1){
exit();
}
Please don't judge my friend trying to stop CSRF Attacks he's still learning.
try {
$order->addItem($item);
} catch (Exception $ex) {
throw $ex;
}
<input type="button" value="Go and fill later" onclick="javascript:window.location='<?php echo $url; ?>info.php'" />
Well, a
is obsolete, let's do links as buttons!
$gallery = \common\models\UtVideogallery::find()->select(['ut_videogallery.VideogalleryID',
'ut_videogallery.Name_rus','ut_videogallery.TournamentID','ut_videogallery.MatchID', 'Slug',
'ut_videogallery.Date','COUNT(ut_video_to_gallery.VideoToGalleryID) count','ut_matches_videos.Data',
'm1.Data DataP'])
->leftJoin('ut_video_to_gallery','ut_video_to_gallery.VideogalleryID=ut_videogallery.VideogalleryID')
->leftJoin('ut_matches_videos','ut_matches_videos.VideoID=ut_video_to_gallery.VideoID')
->leftJoin('ut_matches_videos m1','m1.VideoID=ut_videogallery.PreviewID')
->where(['ut_videogallery.Active'=>1])
//->andWhere(['TournamentID'=>$list['selected']])
->groupBy('ut_videogallery.VideogalleryID')
->orderBy('ut_videogallery.Date DESC')
->limit(self::$countPerPage)
->asArray()->all();
foreach ($gallery as $key => $value) {
if($value['count']==0) unset($gallery[$key]);
}
foreach($gallery as $k=>$v){
if(isset($v['Data']))
$v['Data'] = str_replace('http:','https:',$v['Data']);
if(isset($v['DataP']))
$v['DataP'] = str_replace('http:','https:',$v['DataP']);
$gallery[$k]=$v;
}
$galleryCount = \common\models\UtVideogallery::find()->select(['ut_videogallery.VideogalleryID',
'ut_videogallery.Name_rus','ut_videogallery.TournamentID','ut_videogallery.MatchID',
'ut_videogallery.Date','COUNT(ut_video_to_gallery.VideoToGalleryID) count','ut_matches_videos.Data'])
->leftJoin('ut_video_to_gallery','ut_video_to_gallery.VideogalleryID=ut_videogallery.VideogalleryID')
->leftJoin('ut_matches_videos','ut_matches_videos.VideoID=ut_video_to_gallery.VideoID')
->leftJoin('ut_matches_videos m1','m1.VideoID=ut_videogallery.PreviewID')
->where(['ut_videogallery.Active'=>1])
//->andWhere(['TournamentID'=>$list['selected']])
->groupBy('ut_videogallery.VideogalleryID')
->orderBy('ut_videogallery.Date DESC')
->asArray()->all();
foreach ($galleryCount as $key => $value) {
if($value['count']==0) unset($galleryCount[$key]);
}
$pagination = new \yii\data\Pagination(
[
'totalCount' => count($galleryCount),
'pageSize' => self::$countPerPage,
]);
Picasso of PHP
//Говорящие названия - такие говорящие!
function asdfasdf (WebAPI_Entity $screenshot_dictionary)
{
$result = array();
foreach ($screenshot_dictionary->getEntities () as $scr)
{
$result [] = $scr->toObject ();
}
usort($result, array ($this, 'sortScreenshots'));
return $this->prepare_screenshots ($result);
}
// вставляем остальные скриншоты
$elements = $this->asdfasdf ($screenshot_dictionary);
$_POST = $this->db->mres($_POST);
$_SESSION['post'] = $_POST;
$sql = "SELECT id, documento, nombre1, nombre2, apellido1, apellido2 "
. "FROM usuarios "
. "WHERE " .
"REPLACE(" .
"REPLACE(" .
"REPLACE(" .
"REPLACE(telefono,' ','')," .
"'(','')," .
"')','')," .
"'-','') LIKE '%{$searchTel}'";
date('Y-m-d').'T'.date("H:i:s", strtotime("- 1 hour")).'Z'
Back to the future
$net_price = "var net_price = " . json_encode($net_price) . ";";
This is a Javascript variable being created inside of a PHP string.
in_array($this->market, ["ru"])
There is an old mysterious legend, which says that those conditions are lightening fast which are using in_array($source, ["target"]) instead of just "==". Is says always that probably you never do code refactoring, and keep all shit alive
<?php
public function parse($package)
{
if(isset($package["type"]) && $package["type"] == "unavailable")
{
if(((time() - self::$xmpp->users[(string)$package["from"]]["jointime"] < 30 && (isset(self::$xmpp->users[(string)$package["from"]]["messages"]) && self::$xmpp->users[(string)$package["from"]]["messages"] < 2) && (time() - self::$xmpp->startTime) > 50)) || (!isset(self::$xmpp->users[(string)$package["from"]]["messages"]) && time() - self::$xmpp->users[(string)$package["from"]]["jointime"] < 900 && (time() - self::$xmpp->startTime) > 900))
{
if(!array_search(strstr(self::$xmpp->users[(string)$package["from"]]["jid"], "/", true), explode("\n", file_get_contents("friends.txt"))))
{
self::$xmpp->ban(strstr($package["from"], "/", true), self::$xmpp->users[(string)$package["from"]]["jid"]);
self::$xmpp->groupMessage(strstr($package["from"], "/", true), substr(strstr($package["from"], "/"), 1)." został zbanowany/a za przeciąg!");
}
}
else
if(!array_search(strstr(self::$xmpp->users[(string)$package["from"]]["jid"], "/", true), explode("\n", file_get_contents("friends.txt"))))
file_put_contents("friends.txt", file_get_contents("friends.txt")."\n".strstr(self::$xmpp->users[(string)$package["from"]]["jid"], "/", true));
}
}
In fact whole project is shitty as hell, if you want have some fun grab popcorn and read all the sources: XPBot on sourceforge