", $string); $content = str_replace("[:-p]", "", $content); $content = str_replace(":p", "", $content); $content = str_replace("[;-)]", "", $content); $content = str_replace("[:-@]", "", $content); $content = str_replace("[|-/]", "", $content); $content = str_replace("[:'-|]", "", $content); $content = str_replace("[:-D]", "", $content); $content = str_replace(":D", "", $content); $content = str_replace("[:-S]", "", $content); $content = str_replace("[:-O]", "", $content); $content = str_replace("[(F)]", "", $content); $content = str_replace("[:-|]", "", $content); $content = str_replace("^:)^", "", $content); $content = str_replace(":$", "", $content); $content = str_replace(":*", "", $content); $content = str_replace("<:-P", "", $content); $content = str_replace("[-(", "", $content); return $content; } function getUrlFormat($text) { $text = strtolower($text); $text = str_replace('^o^', '', $text); $text = str_replace('^', '', $text); $text = str_replace('.', ' ', $text); $text = str_replace('!', '', $text); $text = str_replace('?', '', $text); $text = trim($text); $patterns = array ('/ /','/,/','/-/','/:/','/@/','/&/','/\'/'); $replace = array ('_','','_','','','',''); $text = preg_replace($patterns, $replace, $text); return $text; } function getPageTitleMenu($menu,$id,$subMenu=NULL) { global $con, $db; if($id) { switch($menu) { case "book": $title = "Book Reviews » "; $SQL = "SELECT title FROM ms_books WHERE id='$id'"; break; case "film": $title = "Film Reviews » "; $SQL = "SELECT title FROM ms_films WHERE id='$id'"; break; case "p_love": $title = "Love Poetry » "; $SQL = "SELECT title FROM poet_love WHERE Id='$id'"; break; case "p_life": $title = "Life Poetry » "; $SQL = "SELECT title FROM poet_life WHERE Id='$id'"; break; case "p_friend": $title = "Friendship Poetry » "; $SQL = "SELECT title FROM poet_friendship WHERE Id='$id'"; break; case "blog": $title = "Vini's Blog » "; $SQL = "SELECT title FROM blog WHERE Id='$id'"; break; /* case "db": if(!$submenu) $submenu = "javel_db"; $SQL = "SELECT title FROM ".$submenu." WHERE Id='$id'"; break; */ case "portfolio": $title = "Vini's Portfolio » "; $SQL = "SELECT judul AS title FROM bio_portfolio WHERE Id='$id'"; break; } if($SQL) { $q = mysql_query($SQL); $d = mysql_fetch_array($q); $title .= $d["title"]; } return $title; } } function showPaging($currPage=1, $rowsPerPage=5, $maxtotalpage=8, $rowCount, $totalPage, $url) { //Paging ..... $showstart = floor(($currPage-1)/$maxtotalpage) * $maxtotalpage + 1; $buffPage = "Page : "; if ((($showstart-1)*$rowsPerPage) > 1) { $buffPage .= "« Prev ".$maxtotalpage." | "; } for ($i=$showstart,$j=1; $i <= $totalPage && ($j <= $maxtotalpage);$i++) { if($j>1) $buffPage .= "- "; if ($i == $currPage) { if($i == 1) $buffPage .= "".$i." "; else $buffPage .= "".$i." "; } else { if($i == 1) $buffPage .= "".$i." "; else $buffPage .= "".$i." "; } $j++; } $next = $totalPage > $maxtotalpage ? $maxtotalpage : $totalPage; if ((($i-1)*$rowsPerPage) < $rowCount) { $buffPage .= "| Next ".$maxtotalpage." » "; } return $buffPage; } ?>