PDA


View Full Version : 2 news modules, got merged: Try this


eden
07-05-2005, 09:59 AM
on the right column I've clones the news module

news1
news2

all works fine, but when I set news2 not to show separate posts, it shows the news1 posts plus the news2 posts, instead of only the news2 posts

hope you understand

Brian
07-05-2005, 11:16 AM
I can't seem to reproduce this problem... Would you mind submitting a support ticket so I can have a look at things?

eden
07-05-2005, 11:35 AM
Brian, I further examined this problem and it happens when you have 2 news modules, on the same column, and the second one has the option "separate news posts" set to no

If it is ser to "yes" the problem doesnt happen.

It seems the specified forums for the news got combined in that situation

WAR
08-26-2005, 11:52 AM
I wanted to confirm this problem and provide a description to what I am experiencing:

I have two news modules setup on my front page currently.

One (the top one) is supposed to pull from a single forum (my "daily announcements" forum) and I have it set to only show the latest post (number of news items displayed is set to 1)

The next one pulls from 4 different forums to display usergroup specific news.
This module is set to display the 8 latest news bits.

I have double checked, and the daily announcement Forum is not selected in the second news module.

The problem is that when I activate the top, "daily announcement" copy of the news module, the bottom module begins displaying the news posts a second time.

attached is a screenshot of what i am talking about.

I am also having the same problem with the upcoming events module, though i realize that is not one of the standard modules the symptoms seem to be exactly the same.

In both cases the second instance of the module was created using the "module copy" function in the admincp area.

In the Events module, the lower calendar now displays events from both calendars (the one it is set for as well as the events from the upper module's calendar)



The fact that in the case of the two news modules, only the first news post from the "daily announcements" forum is displayed, rather than multiple (since that module is supposed to display the 8 most recent threads from the 4 selected forums) suggests to me that the upper module is somehow passing the information to the lower module.

If I reverse the two modules display order so that the daily announcement module is below the news module, then the single thread displayed from the daily announcement forum is appended to the bottom of the list, and mutiple posts from the daily announcement forum are displayed.

so it looks like:

News module: (8 most recent posts from the correct four forums)
post 1
post 2
post 3
post 4
post 5
post 6
post 7
post 8

Daily Announcements module: (supposed to be only most recent post from daily announcement forum)
post 1 (same as above)
post 2 (same as above)
post 3 (same as above)
post 4 (same as above)
post 5 (same as above)
post 6 (same as above)
post 7 (same as above)
post 8 (same as above)
single post from daily announcement forum (which was posted after all the others listed here)


Did I explain that clearly enough?

WAR
08-26-2005, 12:11 PM
I did also just confirm that changing the "separate news posts" option to 'yes'
corrects this problem. I would rather have the news items remain unseperated though.

The similar problems with the upcoming events hack seems to suggest that there is a problem with the module cloning feature (which was an awesome idea) I know that I could just create a seperate copy of the news file and name it something like news2.php but I would much rather getting it working the way it seems like it was intended to.

Brian
08-26-2005, 02:21 PM
Try looking in your modules/news.php file for this code:
unset($news, $foruminfo['allowratings'], $newsarchivebits, $attachment, $newscount, $newsforumbits, $newsmod, $archivemod);

Replace with this:
unset($news, $foruminfo['allowratings'], $newsarchivebits, $attachment, $newscount, $newsforumbits, $newsmod, $archivemod, $newsbits);

And that should take care of the problem.

WAR
08-26-2005, 02:42 PM
Thanks Brian, I figured it was something like this.

WAR
08-26-2005, 02:52 PM
At the end of the events.php file from this module: http://www.vbadvanced.com/forum/showthread.php?t=9357

is this line:


eval('$home["$mods[modid]"][\'content\'] .= "' . fetch_template('adv_portal_events') . '";');


Is this the reason why a cloned events module is producing a similar problem?

Can this be fixed by adding something like the following line to the end of the file:

unset($home["$mods[modid]"][\'content\'])

? (btw, no this doesn't work)

Brian
08-26-2005, 02:58 PM
Try unsetting $daysevents.

WAR
08-26-2005, 03:00 PM
not sure why it doesn't show that first ' in 'content' as being escaped...

WAR
08-26-2005, 03:00 PM
I am already usetting the following:

unset($events, $eventstore);
unset($calendarinfo, $eventcache, $calendarbits, $usertoday, $range, $daysevents, $day, $eventdate, $eventdates, $comma, $eventinfo);