PDA


View Full Version : Multiple News Module Issues


tfw2005
12-18-2007, 10:56 AM
Can't really show whats going on, but I will try to explain...

Have 3 parent news modules on page.
Have 3 archived news modules on page, attached to the 3 parent news modules.
Have a 4th news module, no archive.

If you place the 4th somewhere without an archive attached to it, it disappears, not in source code anywhere. So it shouldn't be a HTML rendering issue.

If you remove the 3 archive news modules from the page, the 4th parent module will show up anywhere, works fine.

If you add another archive module with the 4th as a parent, and place that on the page along with the other 3 archives, the 4th parent will then show up.

Custom template modules show up fine anywhere.
Buddy List and Stats module show up fine anywhere.

Basically, from what I was able to deduct from testing, if you have multiple parent news modules with archives, then they all must have archives, or else the parent ones without archives will not show up, regardless of where modules are placed on the page order wise.


And one more variable to toss in...

If the 4th parent news module is one that "pulls from thread", and it does not have an archive module attached to it, and you place it BEFORE ALL other modules, then it will show up. If you place it after any of the other 6 news/archive modules, it disappears.

Typing this gave me a headache, so I hope it makes sense.

Later.

Brian
12-18-2007, 05:25 PM
This sounds similar to a bug that I fixed in the dev files a couple of weeks ago. Try opening up your modules/news.php file, look for this code at the very top:
if (!$newsprocessed[$mods['modid']])
{
foreach ($modules AS $omodid)
{
$omods =& $vbulletin->adv_modules[$omodid];
// Archive comes first
if (($mods['parent'] AND $mods['parent'] == $omods['identifier']) OR (!$mods['parent'] AND $mods['modid'] == $omods['modid']))
{
$newsmod = $vbulletin->adv_modules[$omods['modid']];
}
else if (($mods['parent'] AND $mods['modid'] == $omods['modid']) OR (!$mods['parent'] AND $omods['parent'] == $mods['identifier']))
{
$archivemod = $vbulletin->adv_modules[$omods['modid']];
}
}
}

$currentmodule = ($mods['modid'] == $newsmod['modid']) ? 'news' : 'archive';

if (!$newsprocessed[$newsmod['modid']] AND (!$newsprocessed[$archivemod['modid']] OR !$archivemod['modid']))


Replace with this:
$hasarchive = false;
if (!$newsprocessed[$mods['modid']])
{
foreach ($modules AS $omodid)
{
$omods =& $vbulletin->adv_modules[$omodid];
// Archive comes first
if (($mods['parent'] AND $mods['parent'] == $omods['identifier']) OR (!$mods['parent'] AND $mods['modid'] == $omods['modid']))
{
$newsmod = $vbulletin->adv_modules[$omods['modid']];
}
else if (($mods['parent'] AND $mods['modid'] == $omods['modid']) OR (!$mods['parent'] AND $omods['parent'] == $mods['identifier']))
{
$hasarchive = true;
$archivemod = $vbulletin->adv_modules[$omods['modid']];
}
}
}

$currentmodule = ($mods['modid'] == $newsmod['modid']) ? 'news' : 'archive';

if (!$newsprocessed[$newsmod['modid']] AND (!$newsprocessed[$archivemod['modid']] OR !$hasarchive))


And see if that works any better.

tfw2005
12-18-2007, 11:05 PM
That seems to have worked, thanks Brian. Ill post here if there are any other issues, but it looks fixed upon first run.