Next Page

Started on the old forum in August 2008 · view the original in the archive · old links redirect here

3 replies · 488 views · started 18 years ago · 1 min read

Guest #1

Can someone please show me where to add the right coding so the online list only shows 10 on each page instead of on one page, it is driving me mad, i know the code to add, and tried it everywhere, i can get it to work on a basic online file but as soon as i add the extras i get errors or it still puts it on one page , it really is driving me round the twist ....Tz

crazybrumi Super moderator Principal · 1,064 posts #2
$from = (($page * $max_results) - $max_results);  

$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM latest"),0); 
$total_pages = ceil($total_results / $max_results); 

$sql = mysql_query("SELECT * FROM latest ORDER by ip asc LIMIT $from, $max_results"); 
while($row = mysql_fetch_array($sql)){ 
$name = $row['ip'];

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

Guest #3

This one shows up everything i want it to but still puts everyone on one page (wall) CODE<?php

header("Content-type: text/vnd.wap.wml");

include("config.inc.php");

header("Cache-Control: no-cache, must-revalidate");

header("Pragma: no-cache");

echo "<?xml version=\"1.0\"?>";

echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";

$time=date("H:i");

echo "<wml>";

$Connect = mysql_connect("$server","$user","$pass");

mysql_select_db("$dbname");

$result=mysql_query("select * from members where username='$username' and password='$password'"); $number_of_rows = mysql_num_rows($result); if ($number_of_rows>0)

{ include("check.inc.php");

}

if ($ok>0) {

include("smilies.inc.php");

include("online.inc.php");

$time=date("H:i");

$uonline = mysql_num_rows(mysql_query("select * from latest"));

echo "<card id="card1" title="$uonline MeMbErZ OnLinE">";

echo " ";

$exp = time() + 100; //300 seconds for 5 minutes

$time = time();

$query = "select * from latest where ip='$username'";

$result = mysql_query($query); //send the query!

if(mysql_num_rows($result) == 1) {

$query = "update latest set time='$exp' where ip='$username'";

mysql_query($query); //send the query!

}else{

$query = "insert into latest VALUES('$username','$exp')";

mysql_query($query);

}

//delete IP's that have expired...

$query = "delete from latest where $time > time ";

// ^^ This query will look in the database for entries where the current time is greater than the expiration time that was entered into the database and delete those entries because those users are expired/not active. For example, if a a visitor visted the site at 8:00 their expiration time would be marked as 8:05. If this script is accessed at 8:10, that query will see that the current time (8:10) is greater than the expiration time of that entry (8:05) and delete it because that user has not been active (online) in the last 5 minutes.

mysql_query($query); //send the query!

$uonline = mysql_num_rows(mysql_query("select * from latest"));

//this variable might seem complicated, but it's really simple. The first thing it does is sends the query "select * from latest" to the database. This finds all the entries in the database. After that, it counts the number of entries with mysql_num_rows to find out exactly how many users are online.

$id=1;

$sqlthing = mysql_query("SELECT * FROM highest WHERE id='$id'");

$highest=(mysql_result($sqlthing,0,"highest"));

if ($highest < $uonline)

{

$highest=$uonline;

$query = "update highest set highest='$highest' where id='$id'";

mysql_query($query); //send the query!

}

$sqlthing = mysql_query("SELECT * FROM members WHERE username='$username'");

$owner=(mysql_result($sqlthing,0,"owner"));

if($owner=="1")

{

//echo "$uonline online ";

} ?>

External image (may be gone)

<?php echo "HiGhEsT OnLiNe: $highest "; echo "* * = My FrIeNdZ "; if(!isset($_GET['page'])){ $page = 1; } else { $page = $_GET['page']; } $max_results = 10; $from = (($page * $max_results) - $max_results); $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM latest"),0); $total_pages = ceil($total_results / $max_results); $from = (($page * $max_results) - $max_results); // $count=0; $result=mysql_query("select * from latest order by ip asc"); while ($count < $uonline) { $name=(mysql_result($result,$count,"ip")); $sqlthing = mysql_query("SELECT * FROM members WHERE username='$name'"); $ha=(mysql_result($sqlthing,0,"ha")); $adm=(mysql_result($sqlthing,0,"admin")); $own=(mysql_result($sqlthing,0,"owner")); $forumadmin=(mysql_result($sqlthing,0,"forumadmin")); $name2=$name; if($forumadmin<1) if($own<1) if($ha<1) if($adm<1) { $status=("<img src=\"me.gif\" alt=\"m\"/>"); $symbol="$status"; $name= $symbol. $name; } if($ha>0){ $status=("<img src=\"ad.gif\" alt=\"ha\"/>"); $symbol="$status"; $name= $symbol. $name; } if($adm>0){ $status=("<img src=\"mo.gif\" alt=\"a\"/>"); $symbol="$status"; $name= $symbol. $name; } if($own>0){ $status=("<img src=\"ow.gif\" alt=\"o\"/>"); $symbol="$status"; $name= $symbol. $name; } if($forumadmin>0){ $status=("<img src=\"fa.gif\" alt=\"o\"/>"); $symbol="$status"; $name= $symbol. $name; } $result5=mysql_query("select * from buddylist where username1='$username' and username2='$name2'"); $number_of_rows2 = mysql_num_rows($result5); if($number_of_rows2>0){ $bud="^"; $name= $bud. $name. $bud; } $sql4 = "SELECT * FROM members WHERE username='$name2'"; $result4 = mysql_query($sql4); $diha=(mysql_result($result4,0,"diha")); $stop=0; if($diha=="1") { $stop=1; $count=$count+1; } if ($stop < 1) { $sqlthing = mysql_query("SELECT * FROM members WHERE ip='$ip'"); $ip=(mysql_result($sqlthing,0,"ip")); $sql8 = "SELECT * FROM members WHERE ip='$name2'"; $sqlM = mysql_query("SELECT * FROM mood WHERE username='$name2'"); $number_of_rowsM = mysql_num_rows($sqlM); if($number_of_rowsM<1) { $gbvalues = "prowling trough the jungle"; } if($number_of_rowsM>0) { $gbvalues=(mysql_result($sqlM,0,"mood"));} include("smilies.inc.php"); $sql8 = "SELECT * FROM members WHERE username='$name2'"; $result8 = mysql_query($sql8); $result3 = mysql_query($sql3); $zero=0; $one=1; if ($number_of_rows4 < $one) { $sqlI = "SELECT * FROM members WHERE username='$name2'"; $resultI = mysql_query($sqlI); $ip=(mysql_result($resultI,0,"ip")); echo "<a title=\"$name2\" href=\"profile.php?username=$username&amp;password=$password&amp;name=$name2\">$name</a> $loc ( $gbvalues) "; $sqlthing = mysql_query("SELECT * FROM members WHERE username='$username'"); $owner=(mysql_result($sqlthing,0,"owner")); if($owner=="1") { echo "$ip "; } $count=$count+1; } if ($number_of_rows4>$zero) { $ip=(mysql_result($resultI,0,"ip")); echo "<a title=\"$name2\" href=\"profile.php?username=$username&amp;password=$password&amp;name=$name2\">$name</a> $loc ( $gbvalues) " ; $sqlthing = mysql_query("SELECT * FROM members WHERE username='$username'"); $owner=(mysql_result($sqlthing,0,"owner")); if($owner=="1") { echo "$ip "; } $count=$count+1; } } } if($page < $total_pages){ $next = ($page + 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next&amp;username=$username&amp;password=$password\">(Next)</a> "; } if($page > 1){ $prev = ($page - 1); echo " <a href=\"".$_SERVER['PHP_SELF']."?page=$prev&amp;username=$username&amp;password=$password\">(Prev)</a> "; } $i = 1; $i <= $total_pages; $i++ ; ?>

External image (may be gone)

<?php $sqlthing = mysql_query("SELECT * FROM members WHERE username='$username'"); $pmname=(mysql_result($sqlthing,0,"pmname")); $buddyname=(mysql_result($sqlthing,0,"buddyname")); $result8=mysql_query("SELECT * FROM privatemessage WHERE `to_username` = '$username' and `has_it_been_read` = 'no'"); $number_of_rows8 = mysql_num_rows($result8); echo "<a title=\"$pmname Menu\" href=\"pm.php?username=$username&amp;password=$password\">($number_of_rows8 NeW PoP Up)</a>"; echo " "; echo "<a title=\"Mood\" href=\"moodset.php?username=$username&amp;password=$password\">(ChAnGe MoOd)</a>"; echo " "; $result7=mysql_query("select * from forumindex"); $number_of_rows7 = mysql_num_rows($result7); echo "<a title=\"Forums\" href=\"forumindex.php?username=$username&amp;password=$password\">($number_of_rows7)ChArMeD FoRuMz)</a>"; echo " "; $result6=mysql_query("select * from chatusers"); $number_of_rows6 = mysql_num_rows($result6); echo "<a title=\"Chat\" href=\"chatindex.php?username=$username&amp;password=$password\">($number_of_rows6) ChAtRoOmZ)</a>"; echo " "; $result5=mysql_query("select * from buddylist where username1='$username'"); $number_of_rows5 = mysql_num_rows($result5); echo "<a title=\"Enter\" href=\"buddylist.php?username=$username&amp;password=$password\">My FrIeNdZ ($count1/$number_of_rows5)</a> "; echo "<a title=\"Main Menu\" href=\"welcome.php?username=$username&amp;password=$password\">MaIn MeNu</a>"; echo " "; } echo " <do type=\"accept\" label=\"MaIn PaGe\"> <go href=\"welcome.php?username=$username&amp;password=$password\" method=\"get\"> </go> </do> <do type=\"accept\" label=\"PoP Up MeNu\"> <go href=\"pm.php?username=$username&amp;password=$password\" method=\"get\"> </go> </do> <do type=\"accept\" label=\" OnLiNe\"> <go href=\"whosonline.php?username=$username&amp;password=$password\" method=\"get\"> </go> </do> <do type=\"accept\" label=\"ChArMeD FoRuMz\"> <go href=\"forumindex.php?username=$username&amp;password=$password\" method=\"get\"> </go> </do> "; $sql = "UPDATE members SET onsite='Viewin Memberz Online' WHERE username='$username'"; $result = mysql_query($sql); echo " "; echo "</card>"; echo "</wml>"; ?>

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close