Pages On Original Unrealx Script?

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

6 replies · 805 views · started 18 years ago · 1 min read

4 participants
chatabox Senior · 361 posts #1

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:

//////////////////////////////////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&id=$row[2]&nick=$nick&pass=$pass&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&id=$row[2]&nick=$nick&pass=$pass&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='".$nick."'");

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&id=$row[2]&nick=$nick&pass=$pass&page=1\"><img src=\"images/forum.gif\" alt=\"*\"/>$txtass(".$postu[0].",".$postuviso[0].")</a>"; echo "
";

}}

}

}

echo "
";

}

/////////////////////////////////////////////////////////////////////////////

index.php snippet:

////////////////////////////////////////////

//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&pass=$pass&page=$pgnxt\">Prev</a>
";

// $page=$page-2;

$pgpwz=$page-1;

if ($page>1) echo "<a href=\"index.php?nick=$nick&pass=$pass&page=$pgpwz\">Next</a>
";

// $page=$page+1;

echo "";                                                //some breaks...

Thanks 😉

chatabox Senior · 361 posts #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't know where/how to set the amount of forums per page.. you see?

GumSlone Administrator Principal · 1,690 posts #4

I don't know where/how to set the amount of forums per page.. you see?

//////////////////////////////////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='".$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&id=$row[2]&nick=$nick&pass=$pass&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&id=$row[2]&nick=$nick&pass=$pass&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='".$nick."'");

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&id=$row[2]&nick=$nick&pass=$pass&page=1\"><img src=\"images/forum.gif\" alt=\"*\"/>$txtass(".$postu[0].",".$postuviso[0].")</a>"; echo "
";

}}

}

}

echo "
";

}

/////////////////////////////////////////////////////////////////////////////

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

wizard Senior · 493 posts #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'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:

//////////////////////////////////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&id=$row[2]&nick=$nick&pass=$pass&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&id=$row[2]&nick=$nick&pass=$pass&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='".$nick."'");

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&id=$row[2]&nick=$nick&pass=$pass&page=1\"><img src=\"images/forum.gif\" alt=\"*\"/>$txtass(".$postu[0].",".$postuviso[0].")</a>"; echo "
";

}}

}

}

echo "
";

}

/////////////////////////////////////////////////////////////////////////////

index.php snippet:

////////////////////////////////////////////

//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&pass=$pass&page=$pgnxt\">Prev</a>
";

// $page=$page-2;

$pgpwz=$page-1;

if ($page>1) echo "<a href=\"index.php?nick=$nick&pass=$pass&page=$pgpwz\">Next</a>
";

// $page=$page+1;

echo "";                                                //some breaks...

Thanks ;-)

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

chatabox Senior · 361 posts #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 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 😉

Write your reply now; next you create a free account (or sign in) and it is posted right away. 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