Does anyone have a fix for the missing topic id in pnNewsX 1.6?
When viewing news by topic it doesn't have the id for the next or previous pages... the links on the index page works fine for browsing through all topics.
example URL:
modules.php?op=modload&name=News&file=index&catid=&topic=&startrow=10
module available here:
http://mods.postnuke.com/modules.php?op=modload&name=News&file=article&sid=1232
- craigh responded to »TagIt 3.0 for Zikula« 03:58 PM
- jmvaughn responded to »error when i try to upgrade to the last version of dizkus module (3.1)« 12:05 PM
- localrags responded to »Remove contents of nuke_sc_anticracker from Database« 11:30 AM
- jmvaughn responded to »Shoutit for zikula 1.3?« 09:31 AM
- mdee responded to »Different page content under one template (tpl file) based on URL« 07:17 AM
- espaan responded to »Categories disappear when editing ...« 08. Feb
- eledril responded to »How decrease zikula cpu usage« 08. Feb
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
pnNewsX 1.6 topic id prob
-
**unknown user**
- Rank: Helper
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 631
This one is simple. Open up the code and find that link. It will be in index.php or whatever. Post it here and I will tell you what to insert. Simple case of adding in a variable. -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Mar 24, 2004
- Posts: 3
From modules/News/funcs.php (will post full code if needed - thanx by the way for taking a look!):
Code
function printlinks($pagelinks=5, $storynum=5, $num_record )
{
global $startrow;
// Calculate the total number of pages
$pages = intval($num_record / $storynum);
// $pages now contains number of pages needed unless there are left over from division
if ($num_record % $storynum)
{
// has left over from division, so add one page
$pages++;
}
$last = ($pages * $storynum) - $storynum;
if( $pages == 1 )
{
echo(""._PAGETOTAL." "._PAGETEXT.": <b>$pages</b><br><br>");
}
else
{
echo(""._PAGETOTAL." "._PAGETEXTS.": <b>$pages</b><br><br>");
}
$cur_page = ceil( $startrow / $storynum ) + 1;
$check = intval(($cur_page-1) / $pagelinks)*$pagelinks + 1;
// Calculate the previous results, only print 'Previous' if startrow is not equal to zero
if ($startrow != 0 && ($startrow >= ($storynum * $pagelinks)))
{
//$prevrow = $startrow - ($storynum * $links);
$prevrow = ($check-$pagelinks-1) * $storynum;
if ($prevrow < 0)
{
$prevrow = 0;
}
echo("[ <a class=\"pn-normal\" href=\"modules.php?op=modload&name=News&file=index&catid=$catid&topic=$topic&startrow=0\" title=\""._PAGEBEGIN." "._PAGETEXT."\">"._PAGEBEGIN."</a> ] ");
echo("[ <a class=\"pn-normal\" href=\"modules.php?op=modload&name=News&file=index&catid=$catid&topic=$topic&startrow=$prevrow\" title=\""._PAGEPREVTEXT." $links "._PAGETEXTS."\">"._PAGEPREV."</a> ] ");
}
// Print the next pages, first check if there are more pages then 1
if ($pages >= 1)
{
$loop = 0;
$end_page_links = $check + $pagelinks - 1;
if ($end_page_links > $pages)
{
$loop = $pages;
$o = $check;
}
else
{
$loop = $end_page_links;
$o = $check;
}
for ($i=$o; $i <= $loop; $i++)
{ // Begin loop
$nextrow = $storynum * ($i - 1);
//Check for current page - if it is: do not put a link
if($cur_page == $i)
{
echo(" <b>$i</b> ");
}
else
{
$title = ucfirst(_PAGETEXT)." $i";
echo(" <a class=\"pn-normal\" href=\"modules.php?op=modload&name=News&file=index&catid=$catid&topic=$topic&startrow=$nextrow\" title=\"$title\">$i</a> ");
}
}
}
//End loop
// Check if we are at the last page, if so, dont print 'Next'
if ( ($pages > ($check + $pagelinks - 1)) && $pages != 1 && ($num_record > 1))
{
// not the last page so print Next $links pages
$nextrow = $storynum * ($check + $pagelinks - 1);
echo("[ <a class=\"pn-normal\" href=\"modules.php?op=modload&name=News&file=index&catid=$catid&topic=$topic&startrow=$nextrow\" title=\""._PAGENEXTTEXT." $links "._PAGETEXTS."\">"._PAGENEXT."</a> ] ");
echo("[ <a class=\"pn-normal\" href=\"modules.php?op=modload&name=News&file=index&catid=$catid&topic=$topic&startrow=$last\" title=\""._PAGEEND." "._PAGETEXT."\">"._PAGEEND."</a> ]");
}
echo("<br><br>");
}
- Moderated by:
- Support
