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
XtraX
Hangin' Around



Joined: Nov 03, 2004
Posts: 43

PostPosted: Sat Nov 13, 2004 2:54 pm Reply with quote

l'm trying to accomplish something here with the topics module, What lm trying to do is set it so theres 2 topics side by side..

The original way it goes down the entire page and runs on.. and on this is not effeciant as it eventually out runs the entire page ...

So what l would like to know is this possible?

Here is the code for the Topics Module from nuke 7.2 l figured you guys where the wizards and Ravens help last time was great advice for the Cache_lite you gave to speed up our site you would know how to do this or how to accomplish this..

Anyway here is the code ..

Code:
<?php 


/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = "- "._ACTIVETOPICS."";
include("header.php");

$sql = "SELECT topicid, topicname, topicimage, topictext FROM ".$prefix."_topics ORDER BY topictext";
$result = $db->sql_query($sql);
if ($db->sql_numrows($result) == 0) {
    include("header.php");
    include("footer.php");
}
if ($db->sql_numrows($result) > 0) {
    $r_options = "";
    if (isset($cookie[4])) { $r_options .= "&amp;mode=$cookie[4]"; }
    if (isset($cookie[5])) { $r_options .= "&amp;order=$cookie[5]"; }
    if (isset($cookie[6])) { $r_options .= "&amp;thold=$cookie[6]"; }
    OpenTable();
    echo "<center><font class=\"title\"><b>"._ACTIVETOPICS."</b></font><br>\n"
   ."<font class=\"content\">"._CLICK2LIST."</font><br><br>\n"
   ."<form action=\"search.html\" method=\"post\">"
   ."<input type=\"name\" name=\"query\" size=\"30\">  "
   ."<input type=\"submit\" value=\""._SEARCH."\">"
   ."</form></center><br><br>";
    while ($row = $db->sql_fetchrow($result)) {
   $topicid = $row[topicid];
   $topicname = $row[topicname];
   $topicimage = $row[topicimage];
   $topictext = $row[topictext];
   $ThemeSel = get_theme();
   if (@file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
       $t_image = "themes/$ThemeSel/images/topics/$topicimage";
   } else {
       $t_image = "$tipath$topicimage";
   }
   $sql = "SELECT counter FROM ".$prefix."_stories WHERE topic='$topicid'";
   $res = $db->sql_query($sql);
   $numrows = $db->sql_numrows($res);
   $reads = 0;
   while ($counting = $db->sql_fetchrow($res)) {
       $reads = $reads+$counting[counter];
   }
   title($topictext);
   echo "<table border=\"1\" width=\"100%\" align=\"center\" cellpadding=\"2\">\n"
       ."<tr><td valign=\"top\" width='25%'>\n"
       ."<a href=\"modules.php?name=News&amp;new_topic=$topicid\"><img src=\"$t_image\" border=\"0\" alt=\"$topictext\" title=\"$topictext\" hspace='5' vspace='5'></a><br><br>\n"
       ."<font class=\"content\">\n"
       ."<big><strong>&middot</strong></big> <b>"._TOPIC.":</b> $topictext<br>\n"
       ."<big><strong>&middot</strong></big> <b>"._TOTNEWS.":</b> $numrows<br>\n"
       ."<big><strong>&middot</strong></big> <b>"._TOTREADS.":</b> $reads</font>\n"
       ."</td>\n"
       ."<td valign='top'>";
   $sql = "SELECT sid, catid, title FROM ".$prefix."_stories WHERE topic='$topicid' ORDER BY sid DESC LIMIT 0,10";
   $result2 = $db->sql_query($sql);
   $num = $db->sql_numrows($result2);
   if ($num != 0) {
       while ($row2 = $db->sql_fetchrow($result2)) {
      $sql = "SELECT title FROM ".$prefix."_stories_cat WHERE catid='$row2[catid]'";
      $result3 = $db->sql_query($sql);
      $row3 = $db->sql_fetchrow($result3);
      if ($row2[catid] == 0) {
          $cat_link = "";
      } else {
          $cat_link = "<a href='modules.php?name=News&file=categories&op=newindex&catid=$row2[catid]'><b>$row3[title]</b></a>: ";
      }
      echo "<img src='modules/$module_name/images/arrow.gif' border='0' alt='' title=''>  $cat_link<a href='modules.php?name=News&file=article&sid=$row2[sid]$r_options'>$row2[title]</a><br>";
       }
       if ($num == 10) {
      echo "<div align='right'><big><strong>&middot</strong></big> <a href='modules.php?name=News&new_topic=$topicid'><b>"._MORE." --></b></a>  </div>";
       }
   } else {
       echo "<i>"._NONEWSYET."</i>";
   }
   echo "</td></tr></table><br><br>";
    }
}
CloseTable();
include("footer.php");

?>


If anyone could help or tell me what it is that needs to be done ! it would be great as l tyred and failed... Sad

XtraX
 
View user's profile Send private message
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 ©