Please help me to fix the small code problem with chat site

Discussion in 'PHP' started by TheSyndicate, Apr 9, 2007.

  1. #1
    Now all the profiles show 1-47 but i want to it to cut for lets say 1-15 and when they come closer it will show 15-30 and more.

    Now it make the whole layout look funny it press all the pages in one go.

    this is the page http://www.chatthailand.com/index-new.php

    <?
    $sqlpage="select * from frm_users inner join frm_photos where frm_users.userid=frm_photos.userid order by frm_users.userid DESC	 "; 
    $resultpage=mysql_query($sqlpage);
    $totalrecord=mysql_num_rows($resultpage);
    //echo $totalrecord;
    $pagesize=10;
    $totalpage=(int) ($totalrecord/$pagesize);
    if (($totalrecord%$pagesize) != 0) {
    	$totalpage+=1;
    }
    if (isset($pageid)) {
    	$start=$pagesize * ($pageid-1);
    }
    else {
    	$pageid=1;
    	$start=0;
    	}
    ?>
    				<!-- *********************************  Members  *********************************-->
    				<?
    				$sql="select * from frm_users inner join frm_photos where frm_users.userid=frm_photos.userid order by frm_users.userid DESC limit $start,$pagesize"; 
    				//echo $sql;
    				//$sql="select * from frm_users order by userid DESC limit 0,10"; 
    				$res=mysql_query($sql);
    				$rows=mysql_num_rows($res);
    				//echo $rows;
    				while ($row=mysql_fetch_array($res)) {    	  
    					$s_userid=$row["userid"];
    					$s_username=$row["username"];
    					$s_description=$row["em_6phw06020061123"];
    					$s_hits=$row["hits"];
    					$s_birthday=$row["birthday"];
    					$s_gender=$row["gender"];
    					$sub_birthday=substr($s_birthday, 0, 4);
    					//$s_bigimage=$row["bigimage"];
    							$sqlimg="select * from frm_photos where userid='$s_userid'"; 
    							$resimg=mysql_query($sqlimg);
    							$rowimg=mysql_fetch_array($resimg);
    							$img=$rowimg['bigimage'];
    							if ($rowimg['bigimage']=="") {
    								$bigimg="images/image_default_big.gif";
    							}
    							else {
    								$bigimg="upload/thumbs/$img";
    							}
    
    							if ($s_hits==0) {
    								$h="hit";
    							}
    							elseif ($s_hits==1) {
    								$h="hit";
    							}
    							else {
    								$h="hits";
    							}
    
    							if ($s_gender==1) {
    								$gen="Male";
    								$genbg="#78c9c9";
    							}
    							else {
    								$gen="Female";
    								$genbg="#ffc0cb";
    							}
    							
    							if ($s_description=="") {
    								$s_description="-";
    							}
    
    							$tyear=date("Y");
    							$age=$tyear-$sub_birthday;
    				?>
    				<table cellpadding=0 cellspacing=0 width=420 border=0>
    				<tr>
    				<td width=150 align=left valign=top><a href="p.php?id=<?=$s_userid?>"><img src="<?=$bigimg?>" alt=""  border="0" style="border:1px solid #E7E7E7"><!--img src="<?=$bigimg?>" alt=""  border="0" style="border:1px dashed #990000"--></a></td>
    				<td width=10></td>
    				<td width=210 valign=top align=left>
    						<table cellpadding=0 cellspacing=0 width=310 border=0>
    						<tr bgcolor=<?=$genbg?>>
    						<td height=23 colspan=3 align=left>&nbsp;&nbsp;<img src="images/v5/w_arrow.gif" width="12" height="12"> &nbsp;&nbsp;<font size=2 color=white><b><?=$s_username?></b></font></td>
    						</tr>
    						<tr><td height=2></td></tr>
    						<tr>
    						<td height=20 valign=middle bgcolor=#cccccc>&nbsp;&nbsp;<img src="images/v5/w_arrow.gif" width="12" height="12"> &nbsp;&nbsp;<b><?=$gen?></b> &nbsp;&nbsp;<img src="images/v5/w_arrow.gif" width="12" height="12"> &nbsp;&nbsp;<b>Age <?=$age?></b> &nbsp;&nbsp;<img src="images/v5/w_arrow.gif" width="12" height="12"> &nbsp;&nbsp;<b><?=$s_hits?> <?=$h?></b></td>
    						</tr>
    						<tr><td colspan=3 height=10></td></tr>
    						<tr>
    						<td colspan=3><font size=2><?=$s_description?></font></td>
    						</tr>
    						</table>
    				</td>
    				</tr>
    				<tr><td colspan=3 height=10></td></tr>
    				<tr><td colspan=3 height=20></td></tr>
    				<!--tr><td colspan=3 height=1 align=center valign=middle>..............................................................................................</td></tr-->
    				<tr><td colspan=3 height=10></td></tr>
    				<?
    				}
    				?>
    				</table>
    				<!-- *********************************  Members  *********************************-->
    				<table cellpadding=0 cellspacing=0 width='100%' border=0>
    				<tr><td height=5></td></tr>
    				<tr>
    				<td height=30 bgcolor=#d2e1e2>Page : 
    				<?
    				for ($i=1; $i<=$totalpage; $i++) {
    					if ($i == $pageid) {
    						echo "[$i]&nbsp;&nbsp;";
    					}
    					else {
    						echo "<a href='index-new.php?pageid=$i'>$i</a>&nbsp;&nbsp;";
    					}
    				}
    				?>
    				</td>
    				</tr>
    				</table>
    PHP:
     
    TheSyndicate, Apr 9, 2007 IP
  2. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sorry, I really lost you there... What exactly is your problem, and what are you trying to accomplish?
     
    picouli, Apr 9, 2007 IP
  3. Blau

    Blau Peon

    Messages:
    138
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    can you tell us more detail about your problem?
     
    Blau, Apr 9, 2007 IP
  4. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #4
    i fixed it with a help from a forum member thanks for all you can close this now
     
    TheSyndicate, Apr 24, 2007 IP