Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 6.5
Author Message
Ronin
New Member
New Member



Joined: Jul 30, 2003
Posts: 8

PostPosted: Thu Aug 26, 2004 9:17 pm Reply with quote

Hi,

I'm having a problem viewing old news topics on my nuke6.5 site (many secfix patches installed over the months). You can see what I mean here. The "More -->" links don't take you to more stories for that topic but to the first 5 stories of that topic.

Also if I view one topic, such as this one, it gives no indication that more older ones exist or a way to access them.

Any ideas?

Cheers,
Ronin
 
View user's profile Send private message
chatserv
Member Emeritus



Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico

PostPosted: Fri Aug 27, 2004 11:29 am Reply with quote

The module does not include code to view all available stories in each topic and is limited to the number of stories displayed in the homepage so if as in your case you have stories in home set to 5 you will only see 5 stories when you click on the more link. Problem with this is that it is controlled by the News module so editing how many stories will get displayed when clicking more in Topics will also affect how many stories are shown in home.
 
View user's profile Send private message Visit poster's website
Ronin







PostPosted: Mon Aug 30, 2004 11:34 am Reply with quote

Doh!

Was hoping to use Nuke for a customer's organization interested in having different topics for different departments. Unfortunately if topic submissions effectively dissapear with no way to access them once you go beyond the front page watermark, I won't be able to. To bad the front page uses the same code as it probably wouldn't be a big job to make all topic stories show?
 
Ronin







PostPosted: Mon Aug 30, 2004 12:24 pm Reply with quote

OK,

I think I've got it. Here's a modified section from the "theindex" function in modules/News/index.php. Basically moved the select statement to each side of the if that determined if it was the front page or not. If it was front page the select is limited, as it was originally, otherwise it is a topic specific page so the select is unlimited and collects all topic entries.

Code:
   if ($new_topic == 0) {

        $qdb = "WHERE (ihome='0' OR catid='0')";
        $home_msg = "";
        // Front Page so do limited query
        $sql = "SELECT sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, acomm, score, ratings FROM ".$prefix."_stories $qdb $querylang ORDER BY sid DESC limit $storynum";
    } else {
        $qdb = "WHERE topic='$new_topic'";
        $sql_a = "SELECT topictext FROM ".$prefix."_topics WHERE topicid='$new_topic'";
        $result_a = $db->sql_query($sql_a);
        $row_a = $db->sql_fetchrow($result_a);
        $numrows_a = $db->sql_numrows($result_a);
        $topic_title = $row_a[topictext];
        OpenTable();
        if ($numrows == 0) {
            echo "<center><font class=\"title\">$sitename</font><br><br>"._NOINFO4TOPIC."<br><br>[ <a href=\"news.html\">"._GOTONEWSINDEX."</a> | <a href=\"topics.html\">"._SELECTNEWTOPIC."</a> ]</center>";
        } else {
            echo "<center><font class=\"title\">$sitename: $topic_title</font><br><br>"
                ."<form action=\"search.html\" method=\"post\">"
                ."<input type=\"hidden\" name=\"topic\" value=\"$new_topic\">"
                .""._SEARCHONTOPIC.": <input type=\"name\" name=\"query\" size=\"30\">&nbsp;&nbsp;"
                ."<input type=\"submit\" value=\""._SEARCH."\">"
                ."</form>"
                ."[ <a href=\"index.php\">"._GOTOHOME."</a> | <a href=\"topics.html\">"._SELECTNEWTOPIC."</a> ]</center>";
        }
        CloseTable();
        echo "<br>";
        // Specific topic page so do unlimited query
        $sql = "SELECT sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, acomm, score, ratings FROM ".$prefix."_stories $qdb $querylang ORDER BY sid";
    }


Then made these changes in modules/Topics/index.php:

Code:
   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>&nbsp;<b>"._TOPIC.":</b> $topictext<br>\n"
            ."<big><strong>&middot</strong></big>&nbsp;<b>"._TOTNEWS.":</b> $numrows<br>\n"
            ."<big><strong>&middot</strong></big>&nbsp;<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";

        $result2 = $db->sql_query($sql);
        $num = $db->sql_numrows($result2);
        if ($num != 0) {
                echo "$num entries in this topic<BR><BR>";
            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=''>&nbsp;&nbsp;$cat_link<a href='article.html$row2[sid]$r_options'>$row2[title]</a><br>";
            }
            echo "<div align='right'><big><strong>&middot</strong></big>&nbsp;<a href='article-topic-.html$topicid'><b>"._MORE." --></b></a>&nbsp;&nbsp;</div>";
        } else {
            echo "<i>"._NONEWSYET."</i>";
                }
        echo "</td></tr></table><br><br>";
    }

}


These changes let me see all of the entries in a specific topic unless I'm on the front page in which case it only displays the configurable number or topic entries. I imagine this could become an issue when there are thousands of entries in a topic? So it may be a trade off. Works for me though Smile. NOTE: These changes were made to nuke6.5 files that contain all the published secfixes.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 6.5

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 ©