Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

My forum-overview script dosent work

Asked Modified Viewed 2,002 times
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
asked
Senior Member

i have try to do a script what me show a list with A to Z and all my Forums But it works not correct

i have some Forums like that:
[AIRLINES A] or [AIRLINES B] or [ADMIN AREA] and and and

Example: when i klick on L in my list i see all forums in moment.
this is my wish when i klick on L but it dosent work

i guess i need a function like this: : .....AND forum_cat > '0'
but it dosent work

[LA/???] LATAM AIRLINES Group S.A.
[LA/045] LAN AIRLINES
[LG/149] LUXAIR
[LH/220] LUFTHANSA
[LO/080] POLSKIE LINIE LOTNICZE LOT
[LX/724] SWISS
[LY/114] EL AL ISRAEL AIRLIN

i have some errors in my code but can find it

What can i do?

in attachment is the complete code
can anyone help me please? smile thanx

FOR ONE PART I FOUND A RESOLUTION.

$orderby = ($_GET['sortby'] == "all" ? "" : "
Where forum_cat >'0'
AND forum_name LIKE '".stripinput($_GET['sortby'])."%'"wink;

This works for ALL but
Edited by Catzenjaeger on 20-01-2016 15:44,
Catzenjaeger attached the following file:
forumoverview.zip [No information available / 145 Downloads]
ww.jpg [No information available / 55 Downloads]
0 replies

18 posts

B
BDMH
B
BDMH 10
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

This Line overwrites your search. And gives you an error undefined index orderby. delete it.
$orderby = preg_replace("[AIRLINE %]", "",  $_GET['orderby']);


For your other problem with [ in forum title:
Find:
$orderby = ($_GET['sortby'] == "all" ? "" : " WHERE forum_name LIKE '".stripinput($_GET['sortby'])."%'");

Replace with:
$orderby = ($_GET['sortby'] == "all" ? "" : " WHERE forum_name LIKE '".stripinput($_GET['sortby'])."%' or forum_name LIKE '['".stripinput($_GET['sortby'])."%'");


I hope it's usefull, it's not tested.
0 replies
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
answered
Senior Member

hmn thx but it was not the reason :(

it shows me only a result when i klick on ALL

give it a code for ignore the first sign? so i can automatic delete [ and ]

my code now:

opentablex($locale['01']);

if (iMEMBER) {
   if (!isset($_GET['sortby']) || !ctype_alnum($_GET['sortby'])) { $_GET['sortby'] = "all"; }
   //$orderby = ($_GET['sortby'] == "all" ? "" : " AND forum_name LIKE '".stripinput($_GET['sortby'])."%'");
   $orderby = ($_GET['sortby'] == "all" ? "" : " WHERE forum_name LIKE '".stripinput($_GET['sortby'])."%' or forum_name LIKE '['".stripinput($_GET['sortby'])."%'");
   $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat != '0'".$orderby);
   $rows = dbrows($result);
   
   if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
   if ($rows) {
      $i = 0;
      echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
      echo "<td class='tbl2'><strong>".$locale['401']."</strong></td>\n";
      echo "<td class='tbl2'><strong>".$locale['405']."</strong></td>\n";
      echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['402']."</strong></td>\n";
      echo "</tr>\n";
      $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat >'0'".$orderby." ORDER BY forum_name ASC LIMIT ".$_GET['rowstart'].",20");
         
   while ($data = dbarray($result)) {
         $cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;

  echo "<tr>\n<td class='$cell_color'>\n
     <a href='".FORUM."viewforum.php?forum_id=".$data['forum_id']."' title='".$data['forum_name']."' class='side'>".$data['forum_name']."</a></td>\n";
     echo "<td align='right' class='$cell_color'>[".($data['forum_postcount'])."]</td>\n</tr>\n";
      echo "</tr>";
      }
      echo "</table>\n";
   } else {
      echo "<center><br />\n".$locale['05']."<b>".$_GET['sortby']."</b><br /><br />\n</center>\n";
   }
   $search = array(
      "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R",
      "S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"
   );
   echo "<hr />\n<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
   echo "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['04']."</a></td>";
   for ($i = 0; $i < 36 != ""; $i++) {
      echo "<td align='center' class='tbl1'><div class='small'><a href='".FUSION_SELF."?sortby=".$search[$i]."'>".$search[$i]."</a></div></td>";
      echo ($i == 17 ? "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['04']."</a></td>\n</tr>\n<tr>\n" : "\n");
   }
   echo "</tr>\n</table>\n";
}
closetable();
Edited by Catzenjaeger on 20-01-2016 17:59,
0 replies
B
BDMH
B
BDMH 10
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

There is a ' too much.
$orderby = ($_GET['sortby'] == "all" ? "" : " WHERE forum_name LIKE '".stripinput($_GET['sortby'])."%' or forum_name LIKE '['".stripinput($_GET['sortby'])."%'");

So is better
$orderby = ($_GET['sortby'] == "all" ? "" : " WHERE forum_name LIKE '".stripinput($_GET['sortby'])."%' or forum_name LIKE '[".stripinput($_GET['sortby'])."%'");
0 replies
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
answered
Senior Member

on question:

it works but i have an idea for a small modification.
How can make this that when i open the side no airlines showing? Now, when i open the side i get a overview over all forums. but i want a empty ... the user have click at first of a letter and then he should see the entries

is this possible?

$panelName = 'a_bis_z_panel'; //dont change
if (file_exists (INFUSIONS.$panelName.'/locale/'.$settings['locale'].'.php'))
   include INFUSIONS.$panelName.'/locale/'.$settings['locale'].'.php';
else
   include INFUSIONS.$panelName.'/locale/English.php';



opentablex($locale['abz01']);

if (iMEMBER) {
   if (!isset($_GET['sortby']) || !ctype_alnum($_GET['sortby'])) { $_GET['sortby'] = "all"; }
   //$orderby = ($_GET['sortby'] == "all" ? "" : " AND forum_name LIKE '".stripinput($_GET['sortby'])."%'");
     $orderby = ($_GET['sortby'] == "all" ? "" : " AND forum_name LIKE '".stripinput($_GET['sortby'])."%' OR forum_name LIKE '[".stripinput($_GET['sortby'])."%'");


   $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat > '0'".$orderby);
   $rows = dbrows($result);

   if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
   if ($rows) {
      $i = 0;

      echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
      echo "<td align='left' class='tbl2'><strong>".$locale['abz02']."</strong></td>\n";
     //echo "<td align='left' width='10%' class='tbl2'><strong>".$locale['abz03']."</strong></td>\n";
      echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['abz07']."</strong></td>\n";
      echo "</tr>\n";
      //$result = dbquery("SELECT * FROM ".DB_FORUMS."".$orderby." ORDER BY forum_name ASC LIMIT ".$_GET['rowstart'].",20");
        $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat>'0'".$orderby." ORDER BY forum_name ASC, forum_name LIMIT ".$_GET['rowstart'].",10");
   while ($data = dbarray($result)) {
         //$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;

     echo "<tr>\n<td class='tbl2'>\n<a href='".FORUM."viewforum.php?forum_id=".$data['forum_id']."' title='".$data['forum_name']."' class='side'>".$data['forum_name']."</a></td>\n";
    
     //echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_threadcount']."</td>\n";
     //echo "<td align='center' class='tbl2'>[".($data['forum_postcount'])."]</td>\n";
     //echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";
      
      if ($data['forum_postcount'] == 0) {
        echo "<td align='left' class='tbl2'>".$locale['abz06']."</td>\n";
         
      } else {
         echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".showdate("forumdate", $data['forum_lastpost'])."</td>\n";
      }   

      echo "</tr>";
      }
      echo "</table>\n";
   } else {
      echo "<center><br />\n".$locale['abz05']."<b>".$_GET['sortby']."</b><br /><br />\n</center>\n";
   }
   $search = array(
      "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R",
      "S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"
   );
   echo "<hr />\n<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
   //echo "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['abz04']."</a></td>";
   for ($i = 0; $i < 36 != ""; $i++) {
      echo "<td align='center' class='tbl1'><div class='small'><a href='".FUSION_SELF."?sortby=".$search[$i]."'>".$search[$i]."</a></div></td>";
      echo ($i == 17 ? "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['abz04']."</a></td>\n</tr>\n<tr>\n" : "\n");
      //echo ($i == 17 ? "<td rowspan='2' class='tbl2'><tr>\n" : "\n");
   }
   echo "</tr>\n</table>\n";
}
closetable();
if ($rows > 10) { echo "<div style='text-align:center;' style='margin-top:5px;'>".makepagenav($_GET['rowstart'], 10, $rows, 3, FUSION_SELF."?sortby=".$_GET['sortby']."&amp;")."</div>\n"; }

?>
Edited by Catzenjaeger on 21-01-2016 11:22,
0 replies
B
BDMH
B
BDMH 10
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

It's not tested

<?
    $panelName = 'a_bis_z_panel'; //dont change
    if (file_exists (INFUSIONS.$panelName.'/locale/'.$settings['locale'].'.php'))
       include INFUSIONS.$panelName.'/locale/'.$settings['locale'].'.php';
    else
       include INFUSIONS.$panelName.'/locale/English.php';



    opentablex($locale['abz01']);

    if (iMEMBER) {
       if (isset($_GET['sortby']) && ctype_alnum($_GET['sortby'])) {
       //$orderby = ($_GET['sortby'] == "all" ? "" : " AND forum_name LIKE '".stripinput($_GET['sortby'])."%'");
         $orderby = ($_GET['sortby'] == "all" ? "" : " AND forum_name LIKE '".stripinput($_GET['sortby'])."%' OR forum_name LIKE '[".stripinput($_GET['sortby'])."%'");


       $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat > '0'".$orderby);
       $rows = dbrows($result);

       if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
       if ($rows) {
          $i = 0;

          echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
          echo "<td align='left' class='tbl2'><strong>".$locale['abz02']."</strong></td>\n";
         //echo "<td align='left' width='10%' class='tbl2'><strong>".$locale['abz03']."</strong></td>\n";
          echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['abz07']."</strong></td>\n";
          echo "</tr>\n";
          //$result = dbquery("SELECT * FROM ".DB_FORUMS."".$orderby." ORDER BY forum_name ASC LIMIT ".$_GET['rowstart'].",20");
            $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat>'0'".$orderby." ORDER BY forum_name ASC, forum_name LIMIT ".$_GET['rowstart'].",10");
       while ($data = dbarray($result)) {
             //$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;

         echo "<tr>\n<td class='tbl2'>\n<a href='".FORUM."viewforum.php?forum_id=".$data['forum_id']."' title='".$data['forum_name']."' class='side'>".$data['forum_name']."</a></td>\n";

         //echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_threadcount']."</td>\n";
         //echo "<td align='center' class='tbl2'>[".($data['forum_postcount'])."]</td>\n";
         //echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";

          if ($data['forum_postcount'] == 0) {
            echo "<td align='left' class='tbl2'>".$locale['abz06']."</td>\n";

          } else {
             echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".showdate("forumdate", $data['forum_lastpost'])."</td>\n";
          }

          echo "</tr>";
          }
          echo "</table>\n";
       } else {
          echo "<center><br />\n".$locale['abz05']."<b>".$_GET['sortby']."</b><br /><br />\n</center>\n";
       }
       }
       $search = array(
          "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R",
          "S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"
       );
       echo "<hr />\n<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
       //echo "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['abz04']."</a></td>";
       for ($i = 0; $i < 36 != ""; $i++) {
          echo "<td align='center' class='tbl1'><div class='small'><a href='".FUSION_SELF."?sortby=".$search[$i]."'>".$search[$i]."</a></div></td>";
          echo ($i == 17 ? "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['abz04']."</a></td>\n</tr>\n<tr>\n" : "\n");
          //echo ($i == 17 ? "<td rowspan='2' class='tbl2'><tr>\n" : "\n");
       }
       echo "</tr>\n</table>\n";
    }
    closetable();
    if ($rows > 10) { echo "<div style='text-align:center;' style='margin-top:5px;'>".makepagenav($_GET['rowstart'], 10, $rows, 3, FUSION_SELF."?sortby=".$_GET['sortby']."&amp;")."</div>\n"; }
0 replies
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
answered
Senior Member

thanx so much .. this works great :)

Merged on Jan 21 2016 at 14:39:20:
Hole again .. i need little support again :)

in my errorlog i can find this:

Undefined variable: rows Zeile: 81
when i add this --> $rows = dbrows($result);
i get a new error line

Undefined index: rowstart Zeile: 77
Undefined index: sortby Zeile: 79

i think there some smal errors in my code

<?
/*---------------------------------------------------+
| PHPFusion 7 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
| INFUSION: Forum Overview
+----------------------------------------------------+
| Copyright © 2016
+---------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."forumoverview.php";

    opentablex($locale['abz01']);

    if (iMEMBER) {

       if (isset($_GET['sortby']) && ctype_alnum($_GET['sortby'])) {

       //$orderby = ($_GET['sortby'] == "all" ? "" : " AND forum_name LIKE '".stripinput($_GET['sortby'])."%'");
         $orderby = ($_GET['sortby'] == "all" ? "" : " AND ".groupaccess('forum_access')." AND forum_name LIKE '".stripinput($_GET['sortby'])."%' OR forum_name LIKE '[".stripinput($_GET['sortby'])."%'");
         $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat > '0'".$orderby);
         $rows = dbrows($result);

       if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
       if ($rows) {

          $i = 0;

          echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
          echo "<td align='left' class='tbl2'><strong>".$locale['abz02']."</strong></td>\n";
         //echo "<td align='left' width='10%' class='tbl2'><strong>".$locale['abz03']."</strong></td>\n";
          echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['abz07']."</strong></td>\n";
          echo "</tr>\n";
          //$result = dbquery("SELECT * FROM ".DB_FORUMS."".$orderby." ORDER BY forum_name ASC LIMIT ".$_GET['rowstart'].",20");

            $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat>'0'".$orderby." AND ".groupaccess('forum_access')." ORDER BY forum_name ASC, forum_name LIMIT ".$_GET['rowstart'].",10");

       while ($data = dbarray($result)) {

             //$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;

         echo "<tr>\n<td class='tbl2'>\n<a href='".FORUM."viewforum.php?forum_id=".$data['forum_id']."' title='".$data['forum_name']."' class='side'>".$data['forum_name']."</a></td>\n";

         //echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_threadcount']."</td>\n";
         //echo "<td align='center' class='tbl2'>[".($data['forum_postcount'])."]</td>\n";
         //echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";

          if ($data['forum_postcount'] == 0) {
            echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['abz06']."</td>\n";
          } else {
            echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".showdate("forumdate", $data['forum_lastpost'])."</td>\n";
          }
          echo "</tr>";
          }
          echo "</table>\n";
       } else {
          echo "<center><br />\n".$locale['abz05']."<b>".$_GET['sortby']."</b>".$locale['abz10']."<br /><br />\n</center>\n";
       }
       }
       $search = array(
          "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R",
          "S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"
       );
       echo "<hr />\n<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
       //echo "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['abz04']."</a></td>";
       for ($i = 0; $i < 36 != ""; $i++) {
          echo "<td align='center' class='tbl1'><div class='small'><a href='".FUSION_SELF."?sortby=".$search[$i]."'>".$search[$i]."</a></div></td>";
          echo ($i == 17 ? "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['abz04']."</a></td>\n</tr>\n<tr>\n" : "\n");
          //echo ($i == 17 ? "<td rowspan='2' class='tbl2'><tr>\n" : "\n");
       }
       echo "</tr>\n</table>\n";
    }
    closetable();
if ($rows > 10) { echo "<div style='text-align:center;' style='margin-top:5px;'>".makepagenav($_GET['rowstart'], 10, $rows, 3, FUSION_SELF."?sortby=".$_GET['sortby']."&amp;")."</div>\n"; }
require_once THEMES."templates/footer.php";
?>
Edited by Catzenjaeger on 21-01-2016 15:57,
0 replies
B
BDMH
B
BDMH 10
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

Add after:
opentablex($locale['abz01']);

This
if(!isset($_GET['rowstart']) && !isnum($_GET['rowstart'])) $_GET['rowstart']=0;
$row=0;
if(!isset($_GET['sortby'])) $_GET['sortby']='';
0 replies
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
answered
Senior Member

thanx i have add this lines but i get always errors:

adb/forumoverview.php Undefined index: rowstart Zeile: 22
adb/forumoverview.php Undefined variable: rows Zeile: 92

+ we can i mdd this on startscreen (atm is only the letters to see)

Quote

In our Database we have 125 threads with 1079 entries


when i click on a letter i see this text :)

<?
/*---------------------------------------------------+
| PHPFusion 7 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
| INFUSION: Forum Overview
+----------------------------------------------------+
| Copyright © 2016
+---------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."forumoverview.php";

    opentablex($locale['abz01']);
   
       if(!isset($_GET['rowstart']) && !isnum($_GET['rowstart'])) $_GET['rowstart']=0;
    $row=0;
    if(!isset($_GET['sortby'])) $_GET['sortby']='';

    if (iMEMBER) {

       if (isset($_GET['sortby']) && ctype_alnum($_GET['sortby'])) {

       //$orderby = ($_GET['sortby'] == "all" ? "" : " AND forum_name LIKE '".stripinput($_GET['sortby'])."%'");
         $orderby = ($_GET['sortby'] == "all" ? "" : " AND ".groupaccess('forum_access')." AND forum_name LIKE '".stripinput($_GET['sortby'])."%' OR forum_name LIKE '[".stripinput($_GET['sortby'])."%'");
         $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat > '0'".$orderby);
         $rows = dbrows($result);

       if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
       if ($rows) {

          $i = 0;

          echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
       
        echo "<td class='tbl1' align='center' colspan='4'>".$locale['abz11']."<b>$forums_rows</b> ".$locale['abz12']." <b>$threads_rows</b>".$locale['abz13']."</td>\n";
        echo "</tr>\n<tr>\n";
       
          echo "<td align='left' class='tbl2'><strong>".$locale['abz02']."</strong></td>\n";
         //echo "<td align='left' width='10%' class='tbl2'><strong>".$locale['abz03']."</strong></td>\n";
          echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['abz07']."</strong></td>\n";
          echo "</tr>\n";
          //$result = dbquery("SELECT * FROM ".DB_FORUMS."".$orderby." ORDER BY forum_name ASC LIMIT ".$_GET['rowstart'].",20");

            $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat>'0'".$orderby." AND ".groupaccess('forum_access')." ORDER BY forum_name ASC, forum_name LIMIT ".$_GET['rowstart'].",10");

       while ($data = dbarray($result)) {

             //$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;

         echo "<tr>\n<td class='tbl2'>\n<a href='".FORUM."viewforum.php?forum_id=".$data['forum_id']."' title='".$data['forum_name']."' class='side'>".$data['forum_name']."</a></td>\n";

         //echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_threadcount']."</td>\n";
         //echo "<td align='center' class='tbl2'>[".($data['forum_postcount'])."]</td>\n";
         //echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";

          if ($data['forum_postcount'] == 0) {
            echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['abz06']."</td>\n";
          } else {
            echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".showdate("forumdate", $data['forum_lastpost'])."</td>\n";
          }
          echo "</tr>";
          }
          echo "</table>\n";
       } else {
          echo "<center><br />\n".$locale['abz05']."<b>".$_GET['sortby']."</b>".$locale['abz10']."<br /><br />\n</center>\n";
       }
       }
       $search = array(
          "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R",
          "S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"
       );
       echo "<hr />\n<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
       //echo "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['abz04']."</a></td>";
       for ($i = 0; $i < 36 != ""; $i++) {
          echo "<td align='center' class='tbl1'><div class='small'><a href='".FUSION_SELF."?sortby=".$search[$i]."'>".$search[$i]."</a></div></td>";
          echo ($i == 17 ? "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['abz04']."</a></td>\n</tr>\n<tr>\n" : "\n");
          //echo ($i == 17 ? "<td rowspan='2' class='tbl2'><tr>\n" : "\n");
       }
       echo "</tr>\n</table>\n";
} else {
   redirect("index.php");
}
closetable();

if ($rows > 10) { echo "<div style='text-align:center;' style='margin-top:5px;'>".makepagenav($_GET['rowstart'], 10, $rows, 3, FUSION_SELF."?sortby=".$_GET['sortby']."&amp;")."</div>\n"; }
require_once THEMES."templates/footer.php";
?>
0 replies
B
BDMH
B
BDMH 10
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

Oh sorry,
it must be
if(!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) $_GET['rowstart']=0;
    $rows=0;
0 replies
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
answered
Senior Member

yea thx so much ... i guess now it works.

so my last question for this:

we can i add this on startscreen (atm is only the letters to see)

Quote

In our Database we have 125 threads with 1079 entries

when i click on a letter i see this text :) when i call forumoverview.php i see only the letters but none text
0 replies
B
BDMH
B
BDMH 10
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

I haven't the locale file.
See in the locale file and look for the text. Then see in the script where the text is.
0 replies
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
answered
Senior Member

no no ... i mean at the moment i see this line only when i click a letter before. When i click nothing before i dont see this text.
But it is not soo important ... :)
0 replies
B
BDMH
B
BDMH 10
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

I must see wich $locale is it. So i can locate it in teh script
0 replies
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
answered
Senior Member

$locale['abz11'] = "In unserer Datenbank befinden sich ";
$locale['abz12'] = " Airlines mit";
$locale['abz13'] = " Beiträgen!";

sorry its german but this is the text :)

I FORGET TO DECLARE IT
$threads_rows = dbcount("(thread_id)", DB_THREADS,"");
$forums_rows = dbcount("(forum_id)-36", DB_FORUMS,"");


THE COMPLETE CODE.

<?
/*---------------------------------------------------+
| PHPFusion 7 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
| INFUSION: Forum Overview
+----------------------------------------------------+
| Copyright © 2016
+---------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."forumoverview.php";

    opentablex($locale['abz01']);
   
    if(!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) $_GET['rowstart']=0;
        $rows=0;

    if (iMEMBER) {

       if (isset($_GET['sortby']) && ctype_alnum($_GET['sortby'])) {

       //$orderby = ($_GET['sortby'] == "all" ? "" : " AND forum_name LIKE '".stripinput($_GET['sortby'])."%'");
         $orderby = ($_GET['sortby'] == "all" ? "" : " AND ".groupaccess('forum_access')." AND forum_name LIKE '".stripinput($_GET['sortby'])."%' OR forum_name LIKE '[".stripinput($_GET['sortby'])."%'");
         $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat > '0'".$orderby);
         $rows = dbrows($result);
       $threads_rows = dbcount("(thread_id)", DB_THREADS,"");
       $forums_rows = dbcount("(forum_id)-36", DB_FORUMS,"");

       if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
       if ($rows) {

          $i = 0;

          echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
       
        echo "<td class='tbl1' align='center' colspan='4'>".$locale['abz11']."<b>$forums_rows</b> ".$locale['abz12']." <b>$threads_rows</b>".$locale['abz13']."</td>\n";
        echo "</tr>\n<tr>\n";
       
          echo "<td align='left' class='tbl2'><strong>".$locale['abz02']."</strong></td>\n";
         //echo "<td align='left' width='10%' class='tbl2'><strong>".$locale['abz03']."</strong></td>\n";
          echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['abz07']."</strong></td>\n";
          echo "</tr>\n";
          //$result = dbquery("SELECT * FROM ".DB_FORUMS."".$orderby." ORDER BY forum_name ASC LIMIT ".$_GET['rowstart'].",20");

            $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat>'0'".$orderby." AND ".groupaccess('forum_access')." ORDER BY forum_name ASC, forum_name LIMIT ".$_GET['rowstart'].",10");

       while ($data = dbarray($result)) {

             //$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;

         echo "<tr>\n<td class='tbl2'>\n<a href='".FORUM."viewforum.php?forum_id=".$data['forum_id']."' title='".$data['forum_name']."' class='side'>".$data['forum_name']."</a></td>\n";

         //echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_threadcount']."</td>\n";
         //echo "<td align='center' class='tbl2'>[".($data['forum_postcount'])."]</td>\n";
         //echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";

          if ($data['forum_postcount'] == 0) {
            echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['abz06']."</td>\n";
          } else {
            echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".showdate("forumdate", $data['forum_lastpost'])."</td>\n";
          }
          echo "</tr>";
          }
          echo "</table>\n";
       } else {
          echo "<center><br />\n".$locale['abz05']."<b>".$_GET['sortby']."</b>".$locale['abz10']."<br /><br />\n</center>\n";
       }
       }
       $search = array(
          "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R",
          "S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"
       );
       echo "<hr />\n<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
       //echo "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['abz04']."</a></td>";
       for ($i = 0; $i < 36 != ""; $i++) {
          echo "<td align='center' class='tbl1'><div class='small'><a href='".FUSION_SELF."?sortby=".$search[$i]."'>".$search[$i]."</a></div></td>";
          echo ($i == 17 ? "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['abz04']."</a></td>\n</tr>\n<tr>\n" : "\n");
          //echo ($i == 17 ? "<td rowspan='2' class='tbl2'><tr>\n" : "\n");
       }
       echo "</tr>\n</table>\n";
} else {
   redirect("index.php");
}
closetable();

if ($rows > 10) { echo "<div style='text-align:center;' style='margin-top:5px;'>".makepagenav($_GET['rowstart'], 10, $rows, 3, FUSION_SELF."?sortby=".$_GET['sortby']."&amp;")."</div>\n"; }
require_once THEMES."templates/footer.php";
?>
Edited by Catzenjaeger on 22-01-2016 14:31,
0 replies
B
BDMH
B
BDMH 10
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

I hope it's perfect.;)
<?
/*---------------------------------------------------+
| PHPFusion 7 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
| INFUSION: Forum Overview
+----------------------------------------------------+
| Copyright © 2016
+---------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."forumoverview.php";

opentablex($locale['abz01']);

if(!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) $_GET['rowstart']=0;
    $rows=0;
    $threads_rows = dbcount("(thread_id)", DB_THREADS,"");
    $forums_rows = dbcount("(forum_id)-36", DB_FORUMS,"");

    echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";

    echo "<td class='tbl1' align='center' colspan='4'>".$locale['abz11']."<b>$forums_rows</b> ".$locale['abz12']." <b>$threads_rows</b>".$locale['abz13']."</td>\n";
    echo "</tr>\n";

    if (iMEMBER) {
        if (isset($_GET['sortby']) && ctype_alnum($_GET['sortby'])) {
            //$orderby = ($_GET['sortby'] == "all" ? "" : " AND forum_name LIKE '".stripinput($_GET['sortby'])."%'");
            $orderby = ($_GET['sortby'] == "all" ? "" : " AND ".groupaccess('forum_access')." AND forum_name LIKE '".stripinput($_GET['sortby'])."%' OR forum_name LIKE '[".stripinput($_GET['sortby'])."%'");
            $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat > '0'".$orderby);
            $rows = dbrows($result);

            if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
            if ($rows) {
                $i = 0;

                echo "<tr>\n";

                echo "<td align='left' class='tbl2'><strong>".$locale['abz02']."</strong></td>\n";
                //echo "<td align='left' width='10%' class='tbl2'><strong>".$locale['abz03']."</strong></td>\n";
                echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['abz07']."</strong></td>\n";
                echo "</tr>\n";
                //$result = dbquery("SELECT * FROM ".DB_FORUMS."".$orderby." ORDER BY forum_name ASC LIMIT ".$_GET['rowstart'].",20");

                $result = dbquery("SELECT * FROM ".DB_FORUMS." WHERE forum_cat>'0'".$orderby." AND ".groupaccess('forum_access')." ORDER BY forum_name ASC, forum_name LIMIT ".$_GET['rowstart'].",10");

                while ($data = dbarray($result)) {

                //$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;

                echo "<tr>\n<td class='tbl2'>\n<a href='".FORUM."viewforum.php?forum_id=".$data['forum_id']."' title='".$data['forum_name']."' class='side'>".$data['forum_name']."</a></td>\n";

                //echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_threadcount']."</td>\n";
                //echo "<td align='center' class='tbl2'>[".($data['forum_postcount'])."]</td>\n";
                //echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";

                if ($data['forum_postcount'] == 0) {
                    echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['abz06']."</td>\n";
                } else {
                    echo "<td align='left' width='1%' class='tbl2' style='white-space:nowrap'>".showdate("forumdate", $data['forum_lastpost'])."</td>\n";
                }
                echo "</tr>";
            }
            echo "</table>\n";
        } else {
            echo "<center><br />\n".$locale['abz05']."<b>".$_GET['sortby']."</b>".$locale['abz10']."<br /><br />\n</center>\n";
        }else echo "</table>\n";
    }
    $search = array(
              "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R",
              "S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"
           );
    echo "<hr />\n<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
    //echo "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['abz04']."</a></td>";
    for ($i = 0; $i < 36 != ""; $i++) {
        echo "<td align='center' class='tbl1'><div class='small'><a href='".FUSION_SELF."?sortby=".$search[$i]."'>".$search[$i]."</a></div></td>";
        echo ($i == 17 ? "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>".$locale['abz04']."</a></td>\n</tr>\n<tr>\n" : "\n");
        //echo ($i == 17 ? "<td rowspan='2' class='tbl2'><tr>\n" : "\n");
    }
    echo "</tr>\n</table>\n";
} else {
    redirect("index.php");
}
closetable();

if ($rows > 10) { echo "<div style='text-align:center;' style='margin-top:5px;'>".makepagenav($_GET['rowstart'], 10, $rows, 3, FUSION_SELF."?sortby=".$_GET['sortby']."&amp;")."</div>\n"; }
require_once THEMES."templates/footer.php";
?>
0 replies
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
answered
Senior Member

thanx but its the same - noch changes.

but i have a other little problem:
no i get a error on my page:

Page loads in an infinite loop

i have change the right to Guest in my system and now i get this error
Edited by Catzenjaeger on 25-01-2016 17:22,
0 replies
B
BDMH
B
BDMH 10
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

Have you deleted only
if(iMEMBER){

?

Then you must kill these lines too:
} else {
    redirect("index.php");
}

or have you changed iMEMBER to iGUEST?
0 replies
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
answered
Senior Member

yes i have delete this lines
iGUEST dosent work :)
hope now all ist good. But the count is always not shown an start. only when i click a letter. but this ist not sooo important
i hope i found a reason for this
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 18 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

C
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
B
B
BDMH 10
  • Junior Member, joined since
  • Contributed 20 posts on the community forums.
  • Started 4 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet