Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Faults in this code?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="vaulient2" data-source="post: 214235" data-attributes="member: 29433"><p>There is another code</p><p> </p><p>[code]<?PHP</p><p>$p1 = 3;</p><p>$pages = mysql_query("SELECT COUNT(id) FROM cms_comments");</p><p>$p2 = ceil(mysql_result($pages, 0) / $p1);</p><p>$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 0;</p><p>$start = ($page - 1) * $p1;</p><p>if(mysql_num_rows($getComments) == 0) {</p><p> echo "No comments for this article!";</p><p>} else {</p><p>echo '<table width="528px">';</p><p> while($Comments = mysql_fetch_array($getComments)){</p><p> $getUserInfo = mysql_query("SELECT * FROM users WHERE username = '".$Comments['author']."'");</p><p>$userInfo = mysql_fetch_array($getUserInfo);</p><p>$nummy = mysql_query("SELECT * FROM cms_comments");</p><p>$numrows = mysql_num_rows($nummy);</p><p> echo '</p><p> <tr></p><p> <td width="90px" valign="top"></div></p><p> <div style="</p><p>height: 65px;</p><p>width: 50px;</p><p>float: left;</p><p>overflow: hidden;</p><p>"></p><p> <div style="float:left"><img position:absolute; src="http://habbo.fr/habbo-imaging/avatarimage?figure='.$userInfo['look'].'&size=b&direction=2&head_direction=3&gesture=sml&size=2"></div></p><p> '; </p><p> echo '</p><p> </td></p><p> <td width="427px" valign="top"></p><p> <i><a href="/me">'.$userInfo['username'].' </a></i></p><p> <br /><br />'.$Comments['comment'].' </p><p> </td></p><p> </tr></p><p> <tr></p><p> <td width="80px" valign="top"> </p><p> </td></p><p> <td width="400px" align="right"> </p><p></div></div></div></div></p><p><br></p><p><div style="width:125%; height:1px; background-color:#ccc; margin-top:-17px;"></div></p><p> </td></p><p> </tr>';</p><p> }</p><p> echo '</table>';</p><p>}</p><p>echo "Pages: ";</p><p>if($p2 >= 1 && $page <= $p2){</p><p>for($x=1; $x<=$p2; $x++) {</p><p>echo ($x == $page) ? '<strong><a href="' . $_SERVER['PHP_SELF'] . '?page='.$x.'">'.$x.'</a></strong> ' : '<a href="' . $_SERVER['PHP_SELF'] . '?page='.$x.'">'.$x.'</a> ';</p><p>}</p><p>}</p><p>?>[/code]</p><p> </p><p>Given by Monsta on another old thread of mine where I fairly got the pagination to work , where it shows the number of pages but doesn't show the comments. Also , which xampp do you recommend?</p></blockquote><p></p>
[QUOTE="vaulient2, post: 214235, member: 29433"] There is another code [code]<?PHP $p1 = 3; $pages = mysql_query("SELECT COUNT(id) FROM cms_comments"); $p2 = ceil(mysql_result($pages, 0) / $p1); $page = (isset($_GET['page'])) ? (int)$_GET['page'] : 0; $start = ($page - 1) * $p1; if(mysql_num_rows($getComments) == 0) { echo "No comments for this article!"; } else { echo '<table width="528px">'; while($Comments = mysql_fetch_array($getComments)){ $getUserInfo = mysql_query("SELECT * FROM users WHERE username = '".$Comments['author']."'"); $userInfo = mysql_fetch_array($getUserInfo); $nummy = mysql_query("SELECT * FROM cms_comments"); $numrows = mysql_num_rows($nummy); echo ' <tr> <td width="90px" valign="top"></div> <div style=" height: 65px; width: 50px; float: left; overflow: hidden; "> <div style="float:left"><img position:absolute; src="http://habbo.fr/habbo-imaging/avatarimage?figure='.$userInfo['look'].'&size=b&direction=2&head_direction=3&gesture=sml&size=2"></div> '; echo ' </td> <td width="427px" valign="top"> <i><a href="/me">'.$userInfo['username'].' </a></i> <br /><br />'.$Comments['comment'].' </td> </tr> <tr> <td width="80px" valign="top"> </td> <td width="400px" align="right"> </div></div></div></div> <br> <div style="width:125%; height:1px; background-color:#ccc; margin-top:-17px;"></div> </td> </tr>'; } echo '</table>'; } echo "Pages: "; if($p2 >= 1 && $page <= $p2){ for($x=1; $x<=$p2; $x++) { echo ($x == $page) ? '<strong><a href="' . $_SERVER['PHP_SELF'] . '?page='.$x.'">'.$x.'</a></strong> ' : '<a href="' . $_SERVER['PHP_SELF'] . '?page='.$x.'">'.$x.'</a> '; } } ?>[/code] Given by Monsta on another old thread of mine where I fairly got the pagination to work , where it shows the number of pages but doesn't show the comments. Also , which xampp do you recommend? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Faults in this code?
Top