Pages On Original Unrealx Script?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Pages On Original Unrealx Script?

    Hi everyone,i not touch a wap script or site for about a year now but decided to have a little play again after doing a lot of web stuff.

    Anyway i have an old russian copy of the unrealx forum script that i have been translating, evrything is working dine apart from one thing... The pages on index, im not surre how to set them up and don't want to go messing around to much untili have fully translated and zipped up safe..

    In short i wanna show ten forums on index with the Next/Prev links

    Here are the scetions of code showing the forums from core.php and index.php

    core.php snippet:

    Code:
    //////////////////////////////////Get forums/////////////////////////////////
    
    function getforums($permissions,$nick,$pass,$page)
    
    {
    
    echo "
    ";
    
    global $logged;
    
    $page=$page-1;
    
    if (!$page==0) $pagest=$page*15; else $pagest=0;
    
    $userforum=mysql_query("SELECT name,perms,id FROM forums ORDER BY position LIMIT $pagest,15");
    
    while ($row = mysql_fetch_array($userforum))
    
    {
    
    $postu=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM posts WHERE thread=1 AND forum='".$row[2]."'"));
    
    $postuviso=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM posts WHERE forum='".$row[2]."'"));
    
    if ($row[1]=="0") {$txtass=htmlspecialchars($row[0]); echo "<a href=\"index.php?action=viewforum&amp;id=$row[2]&amp;nick=$nick&amp;pass=$pass&amp;page=1\"><img src=\"images/forum.gif\" alt=\"*\"/>$txtass(".$postu[0]."/".$postuviso[0].")</a>"; echo "
    ";}
    
    if ($row[1]=="1" AND $logged) {$txtass=htmlspecialchars($row[0]); echo "<a href=\"index.php?action=viewforum&amp;id=$row[2]&amp;nick=$nick&amp;pass=$pass&amp;page=1\"><img src=\"images/forum.gif\" alt=\"*\"/>$txtass(".$postu[0].",".$postuviso[0].")</a>"; echo "
    ";}
    
    if ($row[1]=="2" AND $logged) {
    
    $forribdforums=mysql_query("SELECT forum FROM permissions WHERE name=&#39;".$nick."&#39;");
    
    while ($frumas=mysql_fetch_array($forribdforums)) {
    
    if ($frumas[0]==$row[2] or $frumas[0]=="*") {
    
    $txtass=htmlspecialchars($row[0]); echo "<a href=\"index.php?action=viewforum&amp;id=$row[2]&amp;nick=$nick&amp;pass=$pass&amp;page=1\"><img src=\"images/forum.gif\" alt=\"*\"/>$txtass(".$postu[0].",".$postuviso[0].")</a>"; echo "
    ";
    
    }}
    
    }
    
    }
    
    echo "
    ";
    
    }
    
    /////////////////////////////////////////////////////////////////////////////
    index.php snippet:

    Code:
    ////////////////////////////////////////////
    
    //few empty lines...
    
    getforums($permissions,$nick,$pass,$page);                         //here are our forums...
    
    $pgnxt=$page+1;
    
    ///////////////////////////////////////
    
    echo "</p><p align=\"center\">";
    
    if ($page<$forstot) echo "<a href=\"index.php?nick=$nick&amp;pass=$pass&amp;page=$pgnxt\">Prev</a>
    ";
    
    // $page=$page-2;
    
    $pgpwz=$page-1;
    
    if ($page>1) echo "<a href=\"index.php?nick=$nick&amp;pass=$pass&amp;page=$pgpwz\">Next</a>
    ";
    
    // $page=$page+1;
    
    echo "";                                                //some breaks...
    Thanks ;-)

    #2
    bro, i think i&#39;ve got a copy of unrealx in english, i&#39;ll just check around and i&#39;ll save you the hassel.

    Click here!!!

    Comment


      #3
      No its ok, the translating is not the hassle, i been into wap for years no doubt i haver the copy you mean (i have many english copies) but all have been messed around with in some way and are not good, the copy i have is perfect.. just need the help i ask above.

      See here http://wapforums.us/

      I don&#39;t know where/how to set the amount of forums per page.. you see?

      Comment


        #4
        I don&#39;t know where/how to set the amount of forums per page.. you see?[/b]
        Code:
        //////////////////////////////////Get forums/////////////////////////////////
        
        function getforums($permissions,$nick,$pass,$page)
        
        {
        
        echo "
        ";
        
        global $logged;
        
        $page=$page-1;
        
        if (!$page==0) $pagest=$page*10; else $pagest=0;
        
        $userforum=mysql_query("SELECT name,perms,id FROM forums ORDER BY position LIMIT $pagest,10"); /* 10 is amount of forums per page, you can change it to 16 etc.*/
        
        while ($row = mysql_fetch_array($userforum))
        
        {
        
        $postu=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM posts WHERE thread=1 AND forum=&#39;".$row[2]."&#39;"));
        
        $postuviso=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM posts WHERE forum=&#39;".$row[2]."&#39;"));
        
        if ($row[1]=="0") {$txtass=htmlspecialchars($row[0]); echo "<a href=\"index.php?action=viewforum&amp;id=$row[2]&amp;nick=$nick&amp;pass=$pass&amp;page=1\"><img src=\"images/forum.gif\" alt=\"*\"/>$txtass(".$postu[0]."/".$postuviso[0].")</a>"; echo "
        ";}
        
        if ($row[1]=="1" AND $logged) {$txtass=htmlspecialchars($row[0]); echo "<a href=\"index.php?action=viewforum&amp;id=$row[2]&amp;nick=$nick&amp;pass=$pass&amp;page=1\"><img src=\"images/forum.gif\" alt=\"*\"/>$txtass(".$postu[0].",".$postuviso[0].")</a>"; echo "
        ";}
        
        if ($row[1]=="2" AND $logged) {
        
        $forribdforums=mysql_query("SELECT forum FROM permissions WHERE name=&#39;".$nick."&#39;");
        
        while ($frumas=mysql_fetch_array($forribdforums)) {
        
        if ($frumas[0]==$row[2] or $frumas[0]=="*") {
        
        $txtass=htmlspecialchars($row[0]); echo "<a href=\"index.php?action=viewforum&amp;id=$row[2]&amp;nick=$nick&amp;pass=$pass&amp;page=1\"><img src=\"images/forum.gif\" alt=\"*\"/>$txtass(".$postu[0].",".$postuviso[0].")</a>"; echo "
        ";
        
        }}
        
        }
        
        }
        
        echo "
        ";
        
        }
        
        /////////////////////////////////////////////////////////////////////////////
        Advertise your mobile site for FREE with AdTwirl

        Comment


          #5
          Hi everyone,i not touch a wap script or site for about a year now but decided to have a little play again after doing a lot of web stuff.

          Anyway i have an old russian copy of the unrealx forum script that i have been translating, evrything is working dine apart from one thing... The pages on index, im not surre how to set them up and don&#39;t want to go messing around to much untili have fully translated and zipped up safe..

          In short i wanna show ten forums on index with the Next/Prev links

          Here are the scetions of code showing the forums from core.php and index.php

          core.php snippet:

          Code:
          //////////////////////////////////Get forums/////////////////////////////////
          
          function getforums($permissions,$nick,$pass,$page)
          
          {
          
          echo "
          ";
          
          global $logged;
          
          $page=$page-1;
          
          if (!$page==0) $pagest=$page*15; else $pagest=0;
          
          $userforum=mysql_query("SELECT name,perms,id FROM forums ORDER BY position LIMIT $pagest,15");
          
          while ($row = mysql_fetch_array($userforum))
          
          {
          
          $postu=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM posts WHERE thread=1 AND forum=&#39;".$row[2]."&#39;"));
          
          $postuviso=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM posts WHERE forum=&#39;".$row[2]."&#39;"));
          
          if ($row[1]=="0") {$txtass=htmlspecialchars($row[0]); echo "<a href=\"index.php?action=viewforum&amp;id=$row[2]&amp;nick=$nick&amp;pass=$pass&amp;page=1\"><img src=\"images/forum.gif\" alt=\"*\"/>$txtass(".$postu[0]."/".$postuviso[0].")</a>"; echo "
          ";}
          
          if ($row[1]=="1" AND $logged) {$txtass=htmlspecialchars($row[0]); echo "<a href=\"index.php?action=viewforum&amp;id=$row[2]&amp;nick=$nick&amp;pass=$pass&amp;page=1\"><img src=\"images/forum.gif\" alt=\"*\"/>$txtass(".$postu[0].",".$postuviso[0].")</a>"; echo "
          ";}
          
          if ($row[1]=="2" AND $logged) {
          
          $forribdforums=mysql_query("SELECT forum FROM permissions WHERE name=&#39;".$nick."&#39;");
          
          while ($frumas=mysql_fetch_array($forribdforums)) {
          
          if ($frumas[0]==$row[2] or $frumas[0]=="*") {
          
          $txtass=htmlspecialchars($row[0]); echo "<a href=\"index.php?action=viewforum&amp;id=$row[2]&amp;nick=$nick&amp;pass=$pass&amp;page=1\"><img src=\"images/forum.gif\" alt=\"*\"/>$txtass(".$postu[0].",".$postuviso[0].")</a>"; echo "
          ";
          
          }}
          
          }
          
          }
          
          echo "
          ";
          
          }
          
          /////////////////////////////////////////////////////////////////////////////
          index.php snippet:

          Code:
          ////////////////////////////////////////////
          
          //few empty lines...
          
          getforums($permissions,$nick,$pass,$page);                         //here are our forums...
          
          $pgnxt=$page+1;
          
          ///////////////////////////////////////
          
          echo "</p><p align=\"center\">";
          
          if ($page<$forstot) echo "<a href=\"index.php?nick=$nick&amp;pass=$pass&amp;page=$pgnxt\">Prev</a>
          ";
          
          // $page=$page-2;
          
          $pgpwz=$page-1;
          
          if ($page>1) echo "<a href=\"index.php?nick=$nick&amp;pass=$pass&amp;page=$pgpwz\">Next</a>
          ";
          
          // $page=$page+1;
          
          echo "";                                                //some breaks...
          Thanks ;-)[/b]

          honestly i think its better to write a new script than to bother with that old script. writin 1 would be a lot less trouble

          Comment


            #6
            btw,

            here is an english version of the forums ive got. [attachment=1472:wapforum.rar]

            and this is the forums i edited which i have installed at 2wap.net [attachment=1473:wapforum_latest.rar]
            Attached Files
            Advertise your mobile site for FREE with AdTwirl

            Comment


              #7
              honestly i think its better to write a new script than to bother with that old script. writin 1 would be a lot less trouble[/b]
              lol, i would find it far harder starting from scratch, i know this script a little, also used it for a long time in the past it has historical value to me.

              I managed to work out the pages thing, translate, and fix any errors.

              @gumslone, thanks for these files they will be a big help for me ;-)

              Comment

              Working...
              X