$b) { $aa = $b; $b = $a; $a = $aa; $q = "away"; } else { $q = "ago"; } $value = $b-$a; if ($value == 1) return "1 second $q"; if ($value < 60) return "$value seconds $q"; $value /= 60; if (round($value) == 1) return "1 minute $q"; if ($value < 60) return round($value) . " minutes $q"; $value /= 60; if (round($value) == 1) return "1 hour $q"; if ($value < 24) return round($value) . " hours $q"; $value /= 24; if (round($value) == 1) if ($q == "ago") return "yesterday"; else return "tomorrow"; if ($value < 31) return round($value) . " days $q"; $value /= 31; if (round($value) == 1) return "1 month $q"; if ($value < 12) return round($value) . " months $q"; $value /= 12; if (round($value) == 1) return "1 year $q"; return round($value) . " years $q"; } if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')) { $libpath = 'lib'; include( $libpath.'/config.php' ); include( $libpath.'/db.php' ); include( $libpath.'/users.php' ); if((empty($_COOKIE[Config::$sessionCookie]) && !empty($_COOKIE[Config::$rememberCookie]))) { if( Config::$vbbIntegration['enabled'] ) { include( 'lib/class.forumops.php' ); } } $user = new User(); $messages = array(); $LoginState = $user->login(); if ( $_POST["q"] == "lastcomments"){ $comments = DB::query("SELECT c.created, i.keyword,c.id,u.name,u.avatar,c.content FROM pl_comments c LEFT JOIN pl_users u ON c.userId = u.id RIGHT JOIN pl_images i ON c.imageId = i.id WHERE c.c_like=0 ORDER BY c.created DESC LIMIT 30"); foreach (array_keys($comments) as $c) { $blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$user->id); $blockeduser = array_map('strtolower', unserialize($blockedrow['users'])); $lower = strtolower($comments[$c]["name"]); if (!in_array($lower,$blockeduser)){ ?>
parse( htmlspecialchars($comments[$i]['content'])) ); } foreach( $comments as $c ) { $commentimg = DB::getRow("SELECT * FROM pl_commentuploads WHERE c_id=:1",$c['id']); if (count($commentimg) != 0){ $min = 'style="min-height:86px;"'; }else{ $min = ''; } $cst = ""; if ($c["color"] != "000000"){ $cst = 'style="color:#'.$c["color"].'"'; } $blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$user->id); $blockeduser = array_map('strtolower', unserialize($blockedrow['users'])); $lower = strtolower($c['name']); if((int)$c["c_like"] ==1 && $likeCount ==0){ ?>