Results 1 to 4 of 4

Thread: Next Page

  1. #1
    Member
    Join Date
    Sep 2007
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Thumbs up

    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


  2. #2
    Super Moderator crazybrumi's Avatar
    Join Date
    Jun 2007
    Location
    Birmingham, England
    Posts
    1,062
    Thanks
    13
    Thanked 17 Times in 12 Posts
    Rep Power
    0

    Default

    Code:
    $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 [Only registered and activated users can see links. Click Here To Register...] for a prices.



    [Only registered and activated users can see links. Click Here To Register...]

  3. #3
    Member
    Join Date
    Sep 2007
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    This one shows up everything i want it to but still puts everyone on one page (wall) <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?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=&#39;$username&#39; and password=&#39;$password&#39;");
    $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 "<p align=\"center\">";



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

    $time = time();



    $query = "select * from latest where ip=&#39;$username&#39;";

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



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

    $query = "update latest set time=&#39;$exp&#39; where ip=&#39;$username&#39;";

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



    }else{

    $query = "insert into latest VALUES(&#39;$username&#39;,&#39;$exp&#39;)";

    mysql_query($query);

    }



    //delete IP&#39;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&#39;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=&#39;$id&#39;");

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

    if ($highest < $uonline)

    {

    $highest=$uonline;

    $query = "update highest set highest=&#39;$highest&#39; where id=&#39;$id&#39;";

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



    }

    $sqlthing = mysql_query("SELECT * FROM members WHERE username=&#39;$username&#39;");



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

    if($owner=="1")

    {

    //echo "$uonline online
    ";

    }
    ?>


    [img]on.gif[/img]


    <?php
    echo "HiGhEsT OnLiNe: $highest
    ";
    echo "* * = My FrIeNdZ


    ";
    if(!isset($_GET[&#39;page&#39;])){
    $page = 1;
    } else {
    $page = $_GET[&#39;page&#39;];
    }

    $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=&#39;$name&#39;");



    $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=&#39;$username&#39; and username2=&#39;$name2&#39;");



    $number_of_rows2 = mysql_num_rows($result5);

    if($number_of_rows2>0){

    $bud="^";

    $name= $bud. $name. $bud;

    }

    $sql4 = "SELECT * FROM members WHERE username=&#39;$name2&#39;";

    $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=&#39;$ip&#39;");

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


    $sql8 = "SELECT * FROM members WHERE ip=&#39;$name2&#39;";

    $sqlM = mysql_query("SELECT * FROM mood WHERE username=&#39;$name2&#39;");

    $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=&#39;$name2&#39;";

    $result8 = mysql_query($sql;

    $result3 = mysql_query($sql3);

    $zero=0;

    $one=1;

    if ($number_of_rows4 < $one)

    {

    $sqlI = "SELECT * FROM members WHERE username=&#39;$name2&#39;";

    $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=&#39;$username&#39;");

    $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=&#39;$username&#39;");

    $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[&#39;PHP_SELF&#39;]."?page=$next&amp;username=$username&amp;password= $password\">(Next)</a>
    ";
    }
    if($page > 1){
    $prev = ($page - 1);
    echo "
    <a href=\"".$_SERVER[&#39;PHP_SELF&#39;]."?page=$prev&amp;username=$username&amp;password= $password\">(Prev)</a>
    ";
    }
    $i = 1; $i <= $total_pages; $i++ ;






    ?>

    [img]bar.gif[/img]




    <?php

    $sqlthing = mysql_query("SELECT * FROM members WHERE username=&#39;$username&#39;");

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

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

    $result8=mysql_query("SELECT * FROM privatemessage WHERE `to_username` = &#39;$username&#39; and `has_it_been_read` = &#39;no&#39;");

    $number_of_rows8 = mysql_num_rows($result;

    echo "<a title=\"$pmname Menu\" href=\"pm.php?username=$username&amp;password=$pas sword\">($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;passw ord=$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;passwo rd=$password\">($number_of_rows6) ChAtRoOmZ)</a>";

    echo "
    ";

    $result5=mysql_query("select * from buddylist where username1=&#39;$username&#39;");

    $number_of_rows5 = mysql_num_rows($result5);

    echo "<a title=\"Enter\" href=\"buddylist.php?username=$username&amp;passwo rd=$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=$pas sword\" method=\"get\">



    </go>



    </do>



    <do type=\"accept\" label=\" OnLiNe\">



    <go href=\"whosonline.php?username=$username&amp;passw ord=$password\" method=\"get\">



    </go>



    </do>



    <do type=\"accept\" label=\"ChArMeD FoRuMz\">



    <go href=\"forumindex.php?username=$username&amp;passw ord=$password\" method=\"get\">



    </go>



    </do>



    ";


    $sql = "UPDATE members SET onsite=&#39;Viewin Memberz Online&#39; WHERE username=&#39;$username&#39;";
    $result = mysql_query($sql);


    echo "</p>";

    echo "</card>";

    echo "</wml>";

    ?> </div>

  4. #4
    Super Moderator crazybrumi's Avatar
    Join Date
    Jun 2007
    Location
    Birmingham, England
    Posts
    1,062
    Thanks
    13
    Thanked 17 Times in 12 Posts
    Rep Power
    0

    Default

    email me the user and pass for the site and site name al ava look for ya
    Want something coded email me at [Only registered and activated users can see links. Click Here To Register...] for a prices.



    [Only registered and activated users can see links. Click Here To Register...]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [web] 65 Most Needed Php Scripts
    By jayasanka in forum Scripts Forum
    Replies: 19
    Last Post: 09-11-10, 15:30
  2. Next Page Link
    By modfiles in forum Site / Script testing and error fixing
    Replies: 4
    Last Post: 03-04-09, 15:51
  3. Jump To Page
    By wapodium in forum Coding Forum
    Replies: 8
    Last Post: 23-10-07, 08:23
  4. Html Tutorial
    By lamar-wap in forum Tutorials
    Replies: 1
    Last Post: 06-09-06, 22:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19