View Full Version : Context-Sensitive News Archive Sidebar...
Milorad
07-08-2004, 12:05 PM
I would like to display the News Archive as a Sidebar on the forumdisplay page... however, I would like it to change which forum its pulling the news from, depending on which forum the forumdisplay page is currently displaying.
I hope that made sense :)
Could someone please give me a hint about this?
mm... sorry i cant help you on this one, but sounds interesting... so interesting that i'm interested.... hope that made sense... because your post really did :)
regards,
Milorad
07-08-2004, 12:11 PM
yeah I hope so... the CMPS has enormous potential if one can exercise a little creativity.
I'm hoping to be able to make a pretty decent forum-sensitive article system out of the news and news archive modules.
I agree with you, how are you doing so far?
Milorad
07-08-2004, 12:31 PM
well, I have a pretty solid concept in mind.... this is the only part I don't know how to do. There is a bit of work in making it 'neat' but thats all just details.
Chuckie
07-08-2004, 12:57 PM
If I am understanding you correct? You have the sidebar installed in the forums you just want to change the forum that active topics gets it feed from.
If I am understanding correct, that is easy to some degree.
1. 1st active topics module needs to be displayed in the left hand colum or the side you added the bar too.
2. The page you added for the side bar allows you to set the pull forums that active topics displays from.
3. Under 'Latest Threads Options' - 'Latest Threads Forums' add the forums ID numbers you wish to pull from.
You can create a new 'Latest Forum Topics' module using the same templates and name it anything you want for the new 'News' Module.
Chuck
Brian
07-08-2004, 01:32 PM
So the module would need to display threads from a different forum for each forum you are in? Should it display threads from that forum, or what?
Milorad
07-08-2004, 02:44 PM
So the module would need to display threads from a different forum for each forum you are in? Should it display threads from that forum, or what?
no... not THAT forum, but a subforum of that forum.
if you imagine....
Technology
-- Articles
Web Development
-- Articles
when browsing the Technology forum, I would like the sidebar 'news archive' to display threads in the technology/articles subforum and so for the web dev forum.
Ideally, these subforums would be hidden to most users, but you get the point.
I'm thinking that conditionals based on forumid would be required, but I don't know where.
Basically, what I'm hoping to achieve is a 'latest articles' view The reason I chose 'news' rather than the latest threads module, is that I would also like to head up that forum view with a small preview of the latest article (that is, a character-limited news view).
I think this could be incredibly powerful, and blow away lesser article systems.
Milorad
07-08-2004, 02:47 PM
If I am understanding you correct?
not quite... :)
You see, I need a SINGLE CMPS page (which has been integrated into forumdisplay.php) to change the information depending on which forum you're viewing.
Brian
07-08-2004, 03:19 PM
Pulling the threads from that specified forum would be fairly easy... Pulling from a specific sub-forum would require a bit of work though.
Milorad
07-08-2004, 03:31 PM
Yeah, there doesnt seem to be any point in pulling them from the forum you're currently looking at though :)
It would be IDEAL for the module to pull the listing from either the first, or the last subforum without having a complex nesting of conditionals.... but I'll gladly deal with whatever works :)
sounds more complex that what I was thinking...
Milorad
07-08-2004, 03:35 PM
Polo, why do you think I'm asking? LOL :) - I can do 'easy' all by myself
i'm still interested to know... i may be able to use it.
Milorad
07-09-2004, 05:57 PM
OK... here's a further thought about this....
In order to display a CMPS page in conjunction with forumdisplay.php, code naming the page must be inserted into forumdisplay.php... is there a way to insert a variable into that which equates to the forumID?
that way I could make a page for each forum... that would do just fine.
Brian
07-09-2004, 06:10 PM
Something like this should work...
if (isset(intval($_REQUEST['f'])))
{
$_REQUEST['forumid'] = $_REQUEST['f'];
}
$page = 'forum_' . $_REQUEST['forumid'];
That would result in the $page variable being forum_1 if that specific forumid was 1. ;)
Also, note that it would have to be inserted somewhere before the call to global.php in your forumdisplay.php file.
Milorad
07-10-2004, 04:56 PM
I'm yet to try this Brian, but I wanted say thanks for your help.
I'm a bit reluctant to put myself in the situation where I NEED to create a page for every forum and subforum on my site... thats a lot of pages.
if thats what I have to do, then thats what I have to do.... but I wonder, is there a way to default to another page, if a forum-specific one does not exist?
I know I'm asking a lot... but I can't be the only one who would use forum-specific pages.
Brian
07-10-2004, 05:16 PM
Something like this would probably work better... In your modules/latesttopics.php file look for:
if ($vba_options['portal_threads_forumids'])
Right above this, you would need to add something like this:
switch ($forumid)
{
case 1:
$vba_options['portal_threads_forumids'] = 2;
break;
case 4:
$vba_options['portal_threads_forumids'] = 6;
break;
case 8:
$vba_options['portal_threads_forumids'] = 9;
break;
case 10:
$vba_options['portal_threads_forumids'] = 12;
break;
}
Incase you're not familiar with how the switch function works... Where you see:
case 1:
case 4:
case 8:
etc
That would be the forumid that a user is currently looking at (I just used the numbers above for example purposes). Right below each of those you'll see this:
$vba_options['portal_threads_forumids'] = 12;
Replace the number in each of those with the forumid that you would like to pull threads from when on the forum specified in the case part. ;)
Milorad
07-10-2004, 05:40 PM
see now that's definitely more like it ;)
I'm re-energised about actually making this work as I imagine it now... when I get some sleep, I'll give this a shot.
thanks a lot Brian :)
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.