[:space:]]+[[:alnum:]/]~", "\\0", $text); $text = preg_replace("/\B@(\w+(?!\/))\b/i", '@\\1', $text); $text = preg_replace("/\B(?#\\1', $text); return $text; } function twitter_time($time) { $delta = time() - strtotime($time); if ($delta < 60) { return 'less than a minute ago'; } else if ($delta < 120) { return 'about a minute ago'; } else if ($delta < (60 * 60)) { return floor($delta / 60) . ' minutes ago'; } else if ($delta < (120 * 60)) { return 'about an hour ago'; } else if ($delta < (24 * 60 * 60)) { return floor($delta / 3600) . ' hours ago'; } else if ($delta < (48 * 60 * 60)) { return '1 day ago'; } else { return number_format(floor($delta / 86400)) . ' days ago'; } } function pagination($query,$per_page=8,$page=1,$url='?') { $query = "SELECT COUNT(*) as `num` FROM {$query}"; $row = mysql_fetch_array(mysql_query($query)); $total = $row['num']; $adjacents = "2"; $prevlabel = "‹ Prev"; $nextlabel = "Next ›"; $page = ($page == 0 ? 1 : $page); $start = ($page - 1) * $per_page; $prev = $page - 1; $next = $page + 1; $lastpage = ceil($total/$per_page); $lpm1 = $lastpage - 1; // //last page minus 1 $pagination = ""; if($lastpage > 0){ $pagination .= "