A PHP Error was encountered

Severity: Notice

Message: Only variable references should be returned by reference

Filename: core/Common.php

Line Number: 257

A PHP Error was encountered

Severity: Notice

Message: Only variables should be assigned by reference

Filename: core/Loader.php

Line Number: 150

$your_desired_width) { break; } } return implode(array_slice($parts, 0, $last_part)); } function truncate($string, $limit, $break = ' ', $pad = '…') { if(strlen($string) <= $limit) { return $string; } if(false !== ($breakpoint = strpos($string, $break, $limit))) { if($breakpoint < strlen($string) - 1) { $string = substr($string, 0, $breakpoint) . $pad; } } return $string; } // Twiter syntax function twitterify($ret) { $ret = preg_replace("#(^|[\n ])([\w]+?://[\w]+[^ \"\n\r\t< ]*)#", "\\1\\2", $ret); $ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r< ]*)#", "\\1\\2", $ret); $ret = preg_replace("/@(\w+)/", "@\\1", $ret); $ret = preg_replace("/#(\w+)/", "#\\1", $ret); return $ret; } // Sanitize HTML function sanitize_html($string) { $string = stripslashes($string); $string = htmlentities(trim($string)); $string = str_replace("#", "#", $string); $string = str_replace("%", "%", $string); return mysql_real_escape_string($string); } // Random greeting function random_greeting() { $greetings = array( 'Welcome back,', '¡Hola!', 'Salut!', 'Goede dag, Hallo', 'Hei', 'Bonjour!', 'Guten Tag', 'Aloha,', 'Namaste', 'Halo', 'Olá', 'Selam' ); shuffle($greetings); echo array_pop($greetings); } // Convert YouTube's durations function yt_duration($duration) { preg_match_all('/[0-9]+[HMS]/',$duration,$matches); $duration=0; foreach($matches as $match){ //echo '
=========
'; //print_r($match); foreach($match as $portion){ $unite=substr($portion,strlen($portion)-1); switch($unite){ case 'H':{ $duration += substr($portion,0,strlen($portion)-1)*60*60; }break; case 'M':{ $duration +=substr($portion,0,strlen($portion)-1)*60; }break; case 'S':{ $duration += substr($portion,0,strlen($portion)-1); }break; } } } return $duration; } // YouTube info function youtube_info($youtube_id) { $obj = new stdClass; $api_key = 'AIzaSyBq9LZ1peiEd_aE8EuNr-D8W0WBKpPcuPM'; // set video data feed URL $video_snippet = json_decode(file_get_contents('https://www.googleapis.com/youtube/v3/videos?part=snippet&id=' . $youtube_id . '&key=' . $api_key))->items[0]->snippet; $video_details = json_decode(file_get_contents('https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id=' . $youtube_id . '&key=' . $api_key))->items[0]->contentDetails; $video_statistics = json_decode(file_get_contents('https://www.googleapis.com/youtube/v3/videos?part=statistics&id=' . $youtube_id . '&key=' . $api_key))->items[0]->statistics; $obj->title = $video_snippet->title; $obj->description = $video_snippet->description; $obj->watchURL = 'https://www.youtube.com/watch?v=' . $youtube_id; $obj->thumbnailURL = $video_snippet->thumbnails->high->url; $obj->length = yt_duration($video_details->duration); $obj->viewCount = $video_statistics->viewCount; $obj->rating = $video_statistics->likeCount; return $obj; } // Convert seconds to minutes function to_minutes($seconds) { $hours = floor($seconds / 3600); $minutes = floor($seconds % 3600 / 60); $seconds = $seconds % 60; return sprintf('%d:%02d:%02d', $hours, $minutes, $seconds); } // Shorten number function shorten_num($num, $precision = 2) { if ($num >= 1000 && $num < 1000000) { $n_format = number_format($num/1000,$precision).'K'; } else if ($num >= 1000000 && $num < 1000000000) { $n_format = number_format($num/1000000,$precision).'M'; } else if ($num >= 1000000000) { $n_format=number_format($num/1000000000,$precision).'B'; } else { $n_format = $num; } return $n_format; } ?>