Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
problem with page counter
Old 05-17-2009, 05:28 AM problem with page counter
Junior Talker

Posts: 2
Name: hisham
Trades: 0
please anyone help me in making this counter good the original one i'm using is like that

and the one i want to be modified like that

and the original code used is that

PHP Code:
<?
echo"<div class='pagi'>";

for(
$i=1;$i<=$pages;$i++)
{
if(
$page==$i) echo"<span class='current'>&nbsp;$i& nbsp;</span>";
else
{
echo 
"&nbsp;";

echo
"<a class='paginate' href='index.php?page=$i'> &nbsp;$i&nbsp;</a>";
}
}
if(
$page>1)
{
$prev=$page-1;
echo 
"&nbsp;";
echo
"<a class='paginate' href='index.php?page=$pre v'> &nbsp; &laquo; Prev &nbsp; </a>";
}



if(
$page<$pages)
{
$next=$page+1;
echo
" &nbsp;";
echo
"<a class='paginate' href='index.php?page=$nex t'> &nbsp; Next &raquo; &nbsp; </a>";
}

echo
"</div>";
?>

please any one give me the modified previous code to be like modified image

Last edited by dr_ghost; 05-17-2009 at 09:16 AM..
dr_ghost is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-17-2009, 07:57 AM Re: problem with page counter
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
PHP Code:
<?
echo"<div class='pagi'>";

for(
$i=1;$i<=$pages;$i++)
{
if(
$page==$i){ echo"<span class='current'>&nbsp;$i& nbsp;</span>";}
else
{
if(
$page>($pages 3) && $page<($pages 3)){ // If current page it within a range of +-3 show it
echo "&nbsp;";
echo
"<a class='paginate' href='index.php?page=$i'> &nbsp;$i&nbsp;</a>";
}
}
}
if(
$page>1)
{
$prev=$page-1;
echo 
"&nbsp;";
echo
"<a class='paginate' href='index.php?page=$pre v'> &nbsp; &laquo; Prev &nbsp; </a>";
}



if(
$page<$pages)
{
$next=$page+1;
echo
" &nbsp;";
echo
"<a class='paginate' href='index.php?page=$nex t'> &nbsp; Next &raquo; &nbsp; </a>";
}

echo
"</div>";
?>
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 05-17-2009, 09:17 AM Re: problem with page counter
Junior Talker

Posts: 2
Name: hisham
Trades: 0
Hello rogem002 after applying yourr code it appear like that
dr_ghost is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to problem with page counter
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11863 seconds with 12 queries