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 😉