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
please , help in PHP script
Old 06-06-2009, 07:54 AM please , help in PHP script
Junior Talker

Posts: 1
Name: Ahmed Eltehawy
Trades: 0
Hi All

i have script in my site http://www.tarae3o.com

i want change my page numbers view

see this pic .



i want to do it same as this pic .



haw can me make this change in my site , i don't good in php language

this is my index code

Code:
<?
include "head1.php"?>
<?
include "config.php"?>
<title><?
echo "$site_title , $site_desc"?></title>
<META name="keywords" content="<?
echo "$site_keywords"?>">
<META NAME="description" content="<?
echo "$site_content"?>">
<?
include "head.php"?>
<tr>
 <td>
 <div id="content">
  <p align="center"><iframe name="I1" src="http://www.tarae3o.com/a.php" width="800" height="35" scrolling="no" align="top" border="0" frameborder="0"> 
        Your browser does not support inline frames or is currently configured not to display inline frames. 
        </iframe><br></p>
<?
if (! isset ( $_GET ['page'] )) {
 $page = "1";
} else {
 $page = $_GET ['page'];
}
$from = ($page * $max) - $max;
$query_all = mysql_query ( "select * from `topics` order by `id` DESC limit $from,$max " );
$query_n = mysql_query ( "select * from `topics`" );
$ggg_2 = mysql_num_rows ( $query_n );
$pppp = ceil ( $ggg_2 / $max );
while ( $result_all = mysql_fetch_array ( $query_all ) ) {
 $string = "$result_all[name]";
 $patterns [0] = '/ /';
 $replacements [2] = '-';
 $new_topic_name = preg_replace ( $patterns, $replacements, $string );
 
 $query_in_cat = mysql_query ( "select * from `cats` where `id`=$result_all[in_cat] " );
 $result_in_cat = mysql_fetch_array ( $query_in_cat );
 echo "
<div id='topic'>
<a href='$site_url/$result_in_cat[link]/t$result_all[id]/$new_topic_name.html' title='$result_all[name]'alt='$result_all[name]'><h1>$result_all[name]</h1></a>
<a href='$site_url/go.php?id=$result_all[id]'><img width='250' height='200' border='0' src='$result_all[image]' title='$result_all[name]'alt='$result_all[name]'></a>
<p>$result_all[description]</p>
<div class='url'><a href='$site_url/go.php?id=$result_all[id]' title='$result_all[name]'alt='$result_all[name]'><b>$result_in_cat[name]</b> -التحميل: $result_all[clicks] مرة</a></div>
</div>
";
}
?>
</div>
 
 <div class="pagi">
<?
$sabeq = $page - 1;
$taly = $page + 1;
if ($page > 1) {
 echo " <a  class='paginate' href='$site_url/p$sabeq'>&nbsp; &laquo; السابق &nbsp;</a> ";
}
?>
<?
$nh = 1;
while ( $nh <= $pppp ) {
 $dddd = $nh;
 
 if ($dddd == $page) {
  echo "<span class='current'>&nbsp; $dddd &nbsp;</span>&nbsp;";
 
 } else {
  echo "<a class='paginate'  href='$site_url/p$dddd'>&nbsp;  $dddd &nbsp;</a>&nbsp;";
 
 }
 
 $nh ++;
}
?>
 
<?
if ($page < $pppp) {
 echo " <a  class='paginate' href='$site_url/p$taly'>&nbsp; التالي&raquo; &nbsp;</a> ";
}
?>
</div>
 </td>
</tr>
</table>
</td>
</tr>
<tr>
 <td></td>
</tr>
</table>
 
<?
include "footer.php"
?>
i wait your comments ..

thanks ..
Tarae3o is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-08-2009, 10:47 PM Re: please , help in PHP script
Junior Talker

Posts: 4
Trades: 0
try replacing this
PHP Code:
$nh 1;
while ( 
$nh <= $pppp ) {
 
$dddd $nh;
 
 if (
$dddd == $page) {
  echo 
"<span class='current'>&nbsp; $dddd &nbsp;</span>&nbsp;";
 
 } else {
  echo 
"<a class='paginate'  href='$site_url/p$dddd'>&nbsp;  $dddd &nbsp;</a>&nbsp;";
 
 }
 
 
$nh ++;

with this
PHP Code:
$nh 1;
while ( 
$nh <= $pppp ) {
    
$dddd $nh;
    if (
$dddd <= or $dddd $pppp) {
        if (
$dddd == $page) {
            echo 
"<span class='current'>&nbsp; $dddd &nbsp;</span>&nbsp;";
        } else {
            echo 
"<a class='paginate'  href='$site_url/p$dddd'>&nbsp;  $dddd &nbsp;</a>&nbsp;";
        }
    }
    
$nh ++;

__________________

Please login or register to view this content. Registration is FREE
Torrodon is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to please , help in PHP script
 

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.56039 seconds with 12 queries