'0') { $ww = $w+1; $meta_title_end = " - $pronounce_page $_REQUEST[w]"; } $incsub = 2; $inccat = 1; } //============================================================================ $topsql_sg = "SELECT SUM(voteup) AS `vtup`, SUM(votedown) AS `vtdown` FROM $game_table WHERE `cat_url` = '$cat' AND `lang` = '$lang_url'"; $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']; $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"; } //============================================================================= } else { $sqlcdb = "SELECT * FROM $sub_cat_table 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_sts = '1'; //header("Location: http://www.dollarcade.com/404.html"); } else { $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']; $cat_url = $rowcdb['cat_url']; $cat_menu = "category_menu/".$cat_url."_menu.html"; $metag = mysql_query($sqlcdb) or die('Error, Subcategory table query failed ' . mysql_error()); $rowmeta = mysql_fetch_array($metag); $title = $rowmeta['sub_cat_title']; $description = $rowmeta['sub_cat_description']; $keywords = $rowmeta['sub_cat_keywords']; $meta_text = $rowmeta['sub_cat_text']; $incsub = 1; $inccat = 1; $sqlch = "SELECT * FROM $cat_table WHERE `cat_url` = '$cat_url'"; $resultch = mysql_query($sqlch) or die('Error, query failed ' . mysql_error()); $rowch = mysql_fetch_array($resultch); if($_REQUEST['w'] > '0') { $meta_title_end = " - $pronounce_page $_REQUEST[w]"; } } //============================================================================ $topsql_sg = "SELECT SUM(voteup) AS `vtup`, SUM(votedown) AS `vtdown` FROM $game_table WHERE `cat_url` = '$cat_url' AND `sub_cat_url` = '$cat' AND `lang` = '$lang_url'"; $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']; $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"; } //============================================================================= } if($error_sts != '1'){ ?> <?php $cat_title = $title; $a_cat_title = str_word_count($cat_title); if($a_cat_title != 0){ ?> <?=$cat_title;?><?=$meta_title_end;?> <?php }else{ ?> <?=$head_title;?> Games, Online <?=($head_title);?> Games, <?=($head_title);?> Games for Girls<?=$meta_title_end;?> <?php } ?> "; } ?>