Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
NoFantasy
Worker
Worker



Joined: Apr 26, 2005
Posts: 114

PostPosted: Mon Oct 03, 2005 5:08 pm Reply with quote

Module itself working perfect, just as intended.

The only thing I want to make better is the list at the mainpage.
Let's say i have 6 categories with 2-5 pages in each category, this is how i want the mainpage:
Code:
Categorytitle 1     explain content of 1

    - page in cat one
    - page in cat one
    - page in cat one
Categorytitle 2     explain content of 2
    - page in cat two
    - page in cat two
Categorytitle 3     explain content of 3
    - page in cat three
    - page in cat three
    - page in cat three
    - page in cat three
....and so on

I'm sure it's possible to do some code-trick, but where do i start? It might be like merging function list_pages_categories() and function list_pages(), but i also want the function list_pages() intact as it is.
Any suggestions would be appreciated.

Nuke 7.6.3.1
 
View user's profile Send private message
NoFantasy







PostPosted: Sat Oct 08, 2005 9:49 am Reply with quote

Still can't figure how to achieve this...
I'm aware that the following code will output the title of the category, not the titles of the pages in each category...but what will be the right thing to do? Do i need to have more sql-querys?
Code:
echo "<center><font class=\"content\">"._LISTOFCONTENT."</center><br><br>";

    $result = $db->sql_query("SELECT * FROM ".$prefix."_pages_categories");
    $numrows = $db->sql_numrows($result);
    $numrows2 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_pages WHERE cid!='0' AND active='1'"));
    if ($numrows > 0 AND $numrows2 > 0) {
      echo "<center>"._CONTENTCATEGORIES."</center><br><br>"
            ."<table border=\"0\" align=\"center\" width=\"95%\">";
      while ($row = $db->sql_fetchrow($result)) {
          $cid = intval($row['cid']);
          $title = stripslashes(check_html($row['title'], "nohtml"));
          $description = stripslashes($row['description']);
          $numrows3 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_pages WHERE cid='$cid'"));
         $subcontent = $row['title'];
          if ($numrows3 > 0) {
            echo "<tr><td valign=\"top\">&nbsp;<a href=\"modules.php?name=$module_name&amp;pa=list_pages_categories&amp;cid=$cid\">$title</a>&nbsp;</td><td align=\"left\">$description<br><i>$subcontent</i></td></tr>";
          }
      }
      echo "</td></tr></table><br><br>"
          ."<center>"._NONCLASSCONT."</center><br><br>";
    }
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©