'0') { $ww = $w+1; $meta_title_end = " - page $_REQUEST[w]"; } } else { $sqlcdb = "SELECT * FROM `messages_categories` WHERE `sub_cat_url` = '$cat' AND `sub` = 'no'"; $resultcdb = mysql_query($sqlcdb) or die('Error, query failed ' . mysql_error()); $count_if_exist = mysql_num_rows($resultcdb); if($count_if_exist != '0') { $rowcdb = mysql_fetch_array($resultcdb); $catnamedb = $rowcdb['cat_name']; $subcatnamedb = $rowcdb['sub_cat_name']; $sub_cat_url = $rowcdb['sub_cat_url']; $head_title = $rowcdb['sub_cat_name']; $head_title_text = $rowcdb['cat_name']; $cat_url = $rowcdb['cat_url']; $q_cat_url = $rowcdb['cat_url']; $title = $rowcdb['sub_cat_title']; $keywords = $rowcdb['sub_cat_keywords']; $description = $rowcdb['sub_cat_description']; $cat_text = $rowcdb['sub_cat_text']; $inccat = 1; if($_REQUEST['w'] > '0') { $meta_title_end = " - page $_REQUEST[w]"; } } else { $sql_q = "SELECT * FROM `messages_sub_categories` WHERE `ss_cat_url` = '$cat'"; $result_q = mysql_query($sql_q) or die('Error, query failed ' . mysql_error()); $count_ext = mysql_num_rows($result_q); if($count_ext != '0') { $dlist = mysql_fetch_array($result_q); $cat_name = $dlist['cat_name']; $cat_url = $dlist['cat_url']; $sub_cat_name = $dlist['sub_cat_name']; $sub_cat_url = $dlist['sub_cat_url']; $ss_cat_name = $dlist['ss_cat_name']; $ss_cat_url = $dlist['ss_cat_url']; $head_title = $dlist['ss_cat_name']; $head_title_text = $dlist['sub_cat_name']; $title = $dlist['ss_cat_title']; $keywords = $dlist['ss_cat_keywords']; $description = $dlist['ss_cat_description']; $cat_text = $dlist['ss_cat_text']; $inccat = 0; if($_REQUEST['w'] > '0') { $meta_title_end = " - page $_REQUEST[w]"; } } else { $sqlcdb = "SELECT * FROM `messages_sub_categories` WHERE `sub_cat_url` = '$cat'"; $resultcdb = mysql_query($sqlcdb) or die('Error, query failed ' . mysql_error()); $count_if_exist = mysql_num_rows($resultcdb); if($count_if_exist == '0') { $error_status = '404'; //header("Location: http://sms.greet2k.com/404.html"); } else { $rowcdb = mysql_fetch_array($resultcdb); $cat_name = $rowcdb['cat_name']; $cat_url = $rowcdb['cat_url']; $sub_cat_name = $rowcdb['sub_cat_name']; $sub_cat_url = $rowcdb['sub_cat_url']; $ss_cat_name = $rowcdb['ss_cat_name']; $ss_cat_url = $rowcdb['ss_cat_url']; $head_title = $rowcdb['sub_cat_name']; $head_title_text = $rowcdb['cat_name']; $title = $rowcdb['ss_cat_title']; $keywords = $rowcdb['ss_cat_keywords']; $description = $rowcdb['ss_cat_description']; $sqlsub = "SELECT * FROM `messages_categories` WHERE `sub_cat_url` = '$cat'"; $resultsub = mysql_query($sqlsub ) or die('Error, query failed ' . mysql_error()); $rowsub = mysql_fetch_array($resultsub); $subch = $rowsub['sub']; $title = $rowsub['sub_cat_title']; $keywords = $rowsub['sub_cat_keywords']; $description = $rowsub['sub_cat_description']; $cat_text = $rowsub['sub_cat_text']; $inccat = 1; if($_REQUEST['w'] > '0') { $meta_title_end = " - page $_REQUEST[w]"; } } } } } if($error_status != '404'){ //============================================================================ if($inccat == '0'){ $topsql_sg = "SELECT SUM(voteup) AS `vtup`, SUM(votedown) AS `vtdown`, SUM(views) AS `totalview` FROM `messages` WHERE `cat_url` = '$cat_url' AND `sub_cat_url` = '$sub_cat_url' AND `ss_cat_url` = '$ss_cat_url'"; }else{ if($rowcdb['sub_cat_url'] != ''){ $topsql_sg = "SELECT SUM(voteup) AS `vtup`, SUM(votedown) AS `vtdown`, SUM(views) AS `totalview` FROM `messages` WHERE `cat_url` = '$cat_url' AND `sub_cat_url` = '$sub_cat_url'"; }else{ $topsql_sg = "SELECT SUM(voteup) AS `vtup`, SUM(votedown) AS `vtdown`, SUM(views) AS `totalview` FROM `messages` WHERE `cat_url` = '$cat_url'"; } } //$topsql_sg = "SELECT SUM(voteup) AS `vtup`, SUM(votedown) AS `vtdown`, SUM(views) AS `totalview` FROM `quotes`"; $topresult_sg = mysql_query($topsql_sg) or die('Error, query failed ' . mysql_error()); $toprow_sg = mysql_fetch_array($topresult_sg); $voteup_sg = $toprow_sg['vtup']; $votedown_sg = $toprow_sg['vtdown']; $totalview = $toprow_sg['totalview']; $total_sg = $voteup_sg + $votedown_sg; if($voteup_sg > 0) { $percenteach = ($voteup_sg/$total_sg) * 5; $rate_sg = round($percenteach, 0); }else{ $rate_sg = "0"; } //============================================================================= ?> <?=$head_title;?> SMS, Text Messages, Wishes, Greetings, Jokes, Quotes<?=$meta_title_end;?> <?=$title;?><?=$meta_title_end;?> "; } }else{ $k_words = explode(", ", $keywords); for($i = 0; $i < count($k_words); $i++){ echo ""; } } ?>