954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

simple paging help with only prev and next buttons

Hindlist.com Hindlist      Advertise With Us
Contact Us
Add to Favorites (Ctrl+D)     best of Free Ads HomePlace an AdRemove an Ad   Terms of UsePrivacy PolicyScam Alert <?php $continuestr = ''; $hturl = ''; //if(isset($_COOKIE['grou']) && !isset($_GET['grou'])) $_GET['grou'] = $_COOKIE['grou']; if(isset($_GET['grou']) && $_GET['grou'] == 'comm') { $continuestr = 'Community'; $hturl = 'community'; $gid = 1; } else if(isset($_GET['grou']) && $_GET['grou'] == 'pers'){ $continuestr = 'Personals'; $hturl = 'personals'; $gid = 2; } else if(isset($_GET['grou']) && $_GET['grou'] == 'real'){ $continuestr = 'Real Estate'; $hturl = 'realestate'; $gid = 3; } else if(isset($_GET['grou']) && $_GET['grou'] == 'jobs'){ $continuestr = 'Jobs'; $hturl = 'jobs'; $gid = 4; } else if(isset($_GET['grou']) && $_GET['grou'] == 'serv'){ $continuestr = 'Services'; $hturl = 'services'; $gid = 5; } else if(isset($_GET['grou']) && $_GET['grou'] == 'fors'){ $continuestr = 'For Sale'; $hturl = 'forsale'; $gid = 6; } $countryword = ''; $cityword = ''; $groupword = ''; $catgword = ''; $finalword = ''; $urlarray = array("urlname" => array(), "urllink" => array()); $alen = 0; if(isset($_GET['country']) && $_GET['country'] != '') { $urlarray["urlname"][$alen] = setEscapeChar1($_GET['country']); $urlarray["urllink"][$alen++] = ''.setEscapeChar1($_GET['country']).''; if(isset($_GET['city']) && $_GET['city'] != ''){ $urlarray["urlname"][$alen] = setEscapeChar1($_GET['city']); $urlarray["urllink"][$alen++] = ''.setEscapeChar1($_GET['city']).''; } } if($continuestr != '') { $urlarray["urlname"][$alen] = $continuestr; $urlarray["urllink"][$alen++] = ''; $tcity = ''; if(isset($_GET['city'])) $tcity = $_GET['city']; $urlarray["urlname"][$alen] = $_GET['catg']; $uurlstr = $baseurl; if($tcity == '') $uurlstr .= 'group/'.$hturl.'/'; if($_GET['country'] != '') $uurlstr .= 'country/'.$_GET['country'].'/'; if($tcity != '') $uurlstr .= 'city/'.$tcity.'/'; // else //$uurlstr .= 'catg='+catval+'⊂='+subcat; $urlarray["urllink"][$alen++] = ''.resetEscapeChar($_GET['catg']).''; } if(isset($_GET['sub']) && $_GET['sub'] != '') { $tcity = ''; if(isset($_GET['city'])) $tcity = $_GET['city']; $urlarray["urlname"][$alen] = $_GET['sub']; $urlarray["urllink"][$alen++] = ''.resetEscapeChar($_GET['city']).''; //subcat } if(isset($_GET['grou'])) { $disstr = ''; //echo "---------------".$alen; for($i=0;$i<$alen;$i++) { if($i != 0) $disstr .= ' > '; if(($urlarray["urllink"][$i] == '') || ($i == $alen-1)) $disstr .= $urlarray["urlname"][$i]; else $disstr .= $urlarray["urllink"][$i]; } echo resetEscapeChar($disstr); unset($urlarray); }//echo $finalword; ?>
<?php if($_GET['catg'] != '') { //if($_GET['grou'] != 'pers' || (isset($_GET['app']) && $_GET['app'] == 1)){ $myDB = new MySQLDB(); // echo 'In category'; $sql = "SELECT scateno, cateno, scatename FROM hl_subcategory WHERE cateno = (SELECT cateno FROM hl_category WHERE catename = '".resetEscapeChar($_GET['catg'])."')"; //$tarr = array(); $tcount = 0; $cateno = 0; $scateno = 0; //echo $sql."
"; if(isset($_GET['country'])) $country = $_GET['country']; else $country = ''; $result = $myDB->executeSQL($sql) or die("could not execute stored proc
".mysql_error()); while ($result_row = mysql_fetch_array($result, MYSQL_ASSOC)){ //$tarr[$tcount++] = ''.$result_row['scatename'].'(#)

'; $cateno = $result_row['cateno']; //echo $result_row['scatename'] ." ".strcmp($result_row['scatename'],resetEscapeChar($_GET['sub']))." ".resetEscapeChar($_GET['sub'])."
"; if(strcmp(trim($result_row['scatename']),trim(resetEscapeChar($_GET['sub'])))==0) { $scateno = $result_row['scateno']; } // break; } mysql_free_result($result) or die("could not close result set
".mysql_error()); $myDB->close(); $temstr = ''; $countryname = 'World'; $myDB = new MySQLDB(); $nav = 2; $sql = "SELECT artidesc FROM hl_articles"; if($_GET['country'] != ''){ $countryname = $_GET['country']; if($_GET['city'] != '') $countryname = $_GET['city']; $nav = 2; } $sql .= " WHERE groupid = ".$gid." AND cateno = ".$cateno." AND scateno = ".$scateno." AND navigation = ".$nav; //echo $sql; $result = $myDB->executeSQL($sql) or die("could not execute stored proc
".mysql_error()); while ($result_row = mysql_fetch_array($result, MYSQL_ASSOC)){ $temstr = str_replace("|", $countryname, $result_row['artidesc']); } mysql_free_result($result) or die("could not close result set
".mysql_error()); $myDB->close(); echo "".$temstr.""; } else { $myDB = new MySQLDB(); $nav = 1; if($_GET['country'] != '') $countryname = $_GET['country']; $sql = "SELECT artidesc FROM hl_articles WHERE navigation = ".$nav; $result = $myDB->executeSQL($sql) or die("could not execute stored proc
".mysql_error()); while ($result_row = mysql_fetch_array($result, MYSQL_ASSOC)) { $temstr = str_replace("|",$countryname,$result_row['artidesc']); } //echo $sql; echo "".$temstr.""; mysql_free_result($result) or die("could not close result set
".mysql_error()); $myDB->close(); } ?>
  <?php // $_GET['sub']; // $_GET['catg']; $myDB = new MySQLDB(); $sql = "SELECT count(*) FROM hl_adsection LEFT JOIN hl_subcategory ON hl_subcategory.scateno = hl_adsection.aidscat left join hl_category on hl_adsection.aidcategory = hl_category.cateno left join hl_country on hl_country.countryid = hl_adsection.aidcountry left join hl_city on hl_city.cityid = hl_adsection.aidcity WHERE hl_adsection.aidstatus = 2 AND hl_category.catename = '".resetEscapeChar($_GET['catg'])."' AND hl_subcategory.scatename = '".resetEscapeChar($_GET['sub'])."' "; // echo $sql; if($_GET['country'] != ''){ $sql .= " AND hl_country.countryname = '".resetEscapeChar($_GET['country'])."'"; if($_GET['city'] != ''){ $sql .= " AND hl_city.cityname = '".resetEscapeChar($_GET['city'])."'"; } } $googlelimit = 11; $ccount = 0; $paginglimit = 22; $totalRecords = 0; $sql .= " ORDER BY hl_adsection.adposted DESC"; //echo $sql; $result = $myDB->executeSQL($sql) or die("could not execute stored proc
".mysql_error()); while ($result_row = mysql_fetch_array($result, MYSQL_ASSOC)){ $totalRecords = $result_row['count(*)']; } mysql_free_result($result) or die("could not close result set
".mysql_error()); $myDB->close(); $pageSize = $paginglimit; $pageCount = $totalRecords/$pageSize; if ($pageCount > (int)$pageCount) { $pageCount = (int)$pageCount; $pageCount++; } // ******************************************************** This is the paging starting if($_GET['pageno'] > 0){ $urstr = '<Prev              ';

//echo '<Prev  ';
// echo '<Prev';//subcat
}
//echo "          ";
if($_GET['pageno']+1 < $pageCount){
$urstr = 'Next>';

// echo 'Next>'; // echo 'Next>'; } // ******************************************************** This is the paging ending $myDB = new MySQLDB(); $sql = "SELECT aidno, aidimage, aidcategory, aidcountry, aidcity, aidtitle, aiddescription, aidemailid, date_format(hl_adsection.adposted, '%W, %M %d, %Y') as poseteddate FROM hl_adsection LEFT JOIN hl_subcategory ON hl_subcategory.scateno = hl_adsection.aidscat left join hl_category on hl_adsection.aidcategory = hl_category.cateno left join hl_country on hl_country.countryid = hl_adsection.aidcountry left join hl_city on hl_city.cityid = hl_adsection.aidcity WHERE hl_adsection.aidstatus = 2 AND hl_category.catename = '".resetEscapeChar($_GET['catg'])."' AND hl_subcategory.scatename = '".resetEscapeChar($_GET['sub'])."' "; //echo $sql; if($_GET['country'] != ''){ $sql .= " AND hl_country.countryname = '".resetEscapeChar($_GET['country'])."'"; if($_GET['city'] != ''){ $sql .= " AND hl_city.cityname = '".resetEscapeChar($_GET['city'])."'"; } } $googlelimit = 11; $ccount = 0; $paginglimit = 22; $sql .= " ORDER BY hl_adsection.adposted DESC limit ".($_GET['pageno'] * $paginglimit).",$paginglimit"; //echo $sql; $tdate = ''; $result = $myDB->executeSQL($sql) or die("could not execute stored proc
".mysql_error()); while ($result_row = mysql_fetch_array($result, MYSQL_ASSOC)){ if($tdate != $result_row['poseteddate']){ $tdate = $result_row['poseteddate']; echo ''.$tdate.''; } if($ccount == $googlelimit){ echo ' '; } echo ''; echo ''; //buildAdUrl(pageno, grouval, counval, cityval, catval, subcat){ //echo ''.$result_row['aidtitle'].'
'; $urlstr = $baseurl.'add/'; if($country != '') $urlstr .= 'country/'.$country.'/'; if($_GET['city'] != '') $urlstr .= 'city/'.$_GET['city'].'/'; $urlstr .= 'cat/'.$_GET['catg'].'/sub/'.$_GET['sub'].'/pageno/'.$result_row['aidno']; //adpage echo ''.$result_row['aidtitle'].'
'; echo ''.substr($result_row['aiddescription'],0,200).'...'; echo '
Category: '.resetEscapeChar($_GET['catg']).'/'.resetEscapeChar($_GET['sub']).''; echo ''; echo ''; if($result_row['aidimage'] == '' || $result_row['aidimage'] == NULL) echo ''; else echo ''; echo ''; echo ''; $ccount++; } mysql_free_result($result) or die("could not close result set
".mysql_error()); $myDB->close(); ?> <?php echo "
"; // ******************************************************** This is the paging starting if($_GET['pageno'] > 0){ $urstr = '<Prev              ';

//echo '<Prev';
// echo '<Prev ';
}
//echo "          ";
if($_GET['pageno']+1 < $pageCount){
$urstr = 'Next>';

//echo 'Next>';
// echo ' Next>';
}
// ******************************************************** This is the paging ending
?>




<?php include '_includes/hfooter.php'; ?>

hindlist
Newbie Poster
9 posts since Jan 2009
Reputation Points: 10
Solved Threads: 0
 

Read the forum guidelines (Announcements) PLEEEEEEEEEZE.

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 
aburningflame
Newbie Poster
1 post since May 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: