vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v3.0 Support > "How Do I..." Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-15-2007, 09:27 AM
fxreview fxreview is offline
Junior Member
 
Join Date: Apr 2007
Posts: 28
Default Modules into specific forums

Hello Brian and All,

Is it possible in the new version to add modules to specific forums?

Thx

Regards,
Reply With Quote
  #2  
Old 06-15-2007, 09:49 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Modules into specific forums

You should be able to use some code like this and add it as a plugin to your 'vba_cmps_include_getpage' hook location.

PHP Code:
if (isset($_REQUEST['f'])) 

    
$_REQUEST['forumid'] = intval($_REQUEST['f']); 
}

switch(
$_REQUEST['forumid'])
{
    
// Quick example for just one forumid
    
case 1:
        
$getpage 'forum1';
    break;

    
// Quick example for multiple forumids that should use the same page
    
case 2:
    case 
3:
    case 
4:
        
$getpage 'forum2';
    break;

Change the numbers within the "case:" statements above to match your forumids, and then the "$getpage = 'X'" parts to add the "Page Identifier" for the page you want to integrate with those forums.
Reply With Quote
  #3  
Old 06-16-2007, 06:02 PM
PamBlizzard PamBlizzard is offline
Member
 
Join Date: Apr 2004
Posts: 31
Default Re: Modules into specific forums

Brian, I've been needing to do this for a long time (make different blocks come up based on the folder subject.)

Can you give me a little bit more detail as to how to do what you describe above?

I've searched on the code 'vba_cmps_include_getpage' and found the PHP code in includes/vba_cmps_include_top.php and xml/hooks_vbacmps.xml, but I'm a little lost as to how to connect it all together.

I know how to install plugins that I've gotten from VB.org, but are you saying that I'd need to create the plugin myself?

Any help you could provide would be greatly appreciated
Reply With Quote
  #4  
Old 06-17-2007, 09:39 AM
PamBlizzard PamBlizzard is offline
Member
 
Join Date: Apr 2004
Posts: 31
Default Re: Modules into specific forums

I want to be more clear about what I'm trying to do. I'm trying to make the block that displays "context sensitive" according to the forumid's subject matter.

In human language this is what I'd like to do:

PHP Code:
IF
  
forumdisplay.php?f=2 then display adv_portal_promo2
  forumdisplay
.php?f=7 then display adv_portal_promo7
  forumdisplay
.php?f=15 or 17  then display adv_portal_promo15_17
else 
display adv_portal_promo_default

IF
    
showthread.php?t=16292 belongs to f=2 then display adv_portal_promo2
    showthread
.php?t=99999 belongs to f=7 then display adv_portal_promo7
    showthread
.php?t=33333 belongs to f=15 or 17 then display adv_portal_promo_default
else 
display adv_portal_promo_default 
Would the code above go in forumdisplay.php and showthread.php, or are there other vBADV. modules I need to touch?

Thank you so much!
Reply With Quote
  #5  
Old 06-17-2007, 11:35 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Modules into specific forums

Hi Pam,
The code example above should allow you to do just that.
First, go ahead and integrate your forumdisplay.php and showthread.php files with the CMPS page that you would like to integrate the majority of your forums with, using the "Integration" link in your Admin CP.

Next, go to your plugin manager and click the link to add a new plugin at the bottom of the page there. Enter whatever you would like for the title, and then add the code from my post above in the "Plugin PHP Code" section (after you've changed out the forumid's and $getpage variables to match what you would like for your forum), set the "Active" option to yes, and save the plugin.
Going from the example you gave, the code to add would need to look something like this:
PHP Code:
if (isset($_REQUEST['f']))  
{  
    
$_REQUEST['forumid'] = intval($_REQUEST['f']);  


switch(
$_REQUEST['forumid']) 

    
// Quick example for just one forumid 
    
case 2:
        
$getpage 'adv_portal_promo2'
    break; 

    case 
7:
        
$getpage 'adv_portal_promo7'
    break; 

    case 
15:
    case 
17:
        
$getpage 'adv_portal_promo15_17'
    break; 


Reply With Quote
  #6  
Old 07-12-2007, 09:48 PM
djroppolo djroppolo is offline
Member
 
Join Date: Nov 2004
Location: Louisiana
Posts: 93
Default Re: Modules into specific forums

Have either of you guys had any luck with this? I'm a little confused at what you guys are trying to accomplish and Brian's explanation. I would like to create a new page and have a particular forum and sub forums appear on that page exclusively. Not sure if that's what this is about or not.
Reply With Quote
  #7  
Old 08-18-2007, 01:48 PM
towermatt's Avatar
towermatt towermatt is offline
Senior Member
 
Join Date: Jun 2007
Posts: 516
Default Re: Modules into specific forums

Hey Brian, I am giving this a shot and I am wondering if you change the

Code:
switch($_REQUEST['forumid'])
to the id for my forum. Seems logical but I didn't see it in the example

also, I notice adv_portal_something in the getpage= part. I have that as the identifier for the cmps page that I want to use to display the forum.

Is that right? Or do I need to create a template?

Here is what I changed from what you have above

Code:
if (isset($_REQUEST['f'])) 
{ 
    $_REQUEST['forumid'] = intval($_REQUEST['f']); 
}

switch($_REQUEST['forumid'])
{
    // Quick example for just one forumid
    case 696:
        $getpage = 'towerpedia';
    break;

}
towerpedia being the identifier for the page I want to display
Reply With Quote
  #8  
Old 08-18-2007, 01:52 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Modules into specific forums

No, the "switch($_REQUEST['forumid'])" statement does not need to be changed. The forumid just needs to be changed below, which it seems you've done in your code assuming that the forumid is 696.
Reply With Quote
  #9  
Old 08-18-2007, 01:55 PM
towermatt's Avatar
towermatt towermatt is offline
Senior Member
 
Join Date: Jun 2007
Posts: 516
Default Re: Modules into specific forums

yep, that is done. Then I created a page as a "module" and gave it an identifier as "towerpedia"

Probably should have been a "template" page with that as the identifier.

Glad to know I understood the instructions right though.

this would be the forum I wanted it to use http://www.thedarktower.com/palaver/...read.php?t=696

Last edited by towermatt; 08-18-2007 at 01:58 PM.
Reply With Quote
  #10  
Old 08-18-2007, 02:02 PM
djroppolo djroppolo is offline
Member
 
Join Date: Nov 2004
Location: Louisiana
Posts: 93
Default Re: Modules into specific forums

Anxious to see your results
Reply With Quote
  #11  
Old 08-18-2007, 07:25 PM
towermatt's Avatar
towermatt towermatt is offline
Senior Member
 
Join Date: Jun 2007
Posts: 516
Default Re: Modules into specific forums

Me too!

I forgot to say what the problem is though :slaps head:

when I go out to http://www.thedarktower.com/palaver/...age=towerpedia

I get just a blank CMPS screen
Reply With Quote
  #12  
Old 08-19-2007, 10:47 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Modules into specific forums

696 is the threadid for that thread. 116 seems to be the forumid that your nuwiki.php file is redirecting to, so I would assume that's most of the problem.

Going straight to cmps_index.php?page=towerpedia should not pull up anything besides the modules you have on that page as it does not have any way to pull the forum info or anything else unless you're browsing your normal forum pages.
Reply With Quote
  #13  
Old 08-19-2007, 11:33 AM
towermatt's Avatar
towermatt towermatt is offline
Senior Member
 
Join Date: Jun 2007
Posts: 516
Default Re: Modules into specific forums

Okay so I may be along the wrong path here.

Mostly what I wanted to do was make a location on my server

http://www.thedarktower.com/towerpedia

that would display that forum with a CMPS wrap around it only (without it wrapping my entire forum)

Mostly just because not all folks who visit the site visit the forum and I wanted them to be able to see a view of it with modules like the rest of the pages.

a simple solve is to just put a link in the navbar to that forum but it doesn't have the much loved CMPS wrap
Reply With Quote
  #14  
Old 08-21-2007, 08:44 AM
djroppolo djroppolo is offline
Member
 
Join Date: Nov 2004
Location: Louisiana
Posts: 93
Default Re: Modules into specific forums

Quote:
Originally Posted by towermatt View Post
Okay so I may be along the wrong path here.

Mostly what I wanted to do was make a location on my server

http://www.thedarktower.com/towerpedia

that would display that forum with a CMPS wrap around it only (without it wrapping my entire forum)

Mostly just because not all folks who visit the site visit the forum and I wanted them to be able to see a view of it with modules like the rest of the pages.

a simple solve is to just put a link in the navbar to that forum but it doesn't have the much loved CMPS wrap
Matt, that is exactly what i'd like to do.... I have an idea for a particular forum for my site but i'd like it along with its sub-forums to have their own page wrapped by cmps.... I don't want to have to load an entirely new copy of vB to do this though....
Reply With Quote
  #15  
Old 09-04-2007, 11:57 AM
towermatt's Avatar
towermatt towermatt is offline
Senior Member
 
Join Date: Jun 2007
Posts: 516
Default Re: Modules into specific forums

I have not actually tried this because I was worried about the forum. My members are against a CMPS wrap on the forums (not sure why but that was the vote).

I think, what the code above does, is use the integration to wrap specific forums (that you put in the code), so it integrates without doing it "fully"
Reply With Quote
  #16  
Old 12-24-2007, 05:36 AM
Powerbook Powerbook is offline
Junior Member
 
Join Date: Jun 2006
Posts: 19
Default Re: Modules into specific forums

Hi,

This is working perfectly in one of my forums where I don't use vBSEO and have the forum id as a number like:

case 154:

On another forum where I do use vBSEO I get either a vBulletin database error or it doesn't show at all. Might this just be coincidence? Should you be using the forum ID like in the example above or the name of the forum as vBSEO displays it?

case temptation:

The second forum integration not working was done on a upgraded V2 cmps system where the other one is a new installation of RC2. Might be a issue as well?

Thanks

EDIT: Not too worry got it working like a charm...

Last edited by Powerbook; 12-24-2007 at 09:26 PM.
Reply With Quote
  #17  
Old 03-20-2008, 02:19 PM
Rev O Rev O is offline
Junior Member
 
Join Date: Jan 2008
Posts: 25
Default Re: Modules into specific forums

Quote:
Originally Posted by Brian View Post
Hi Pam,
The code example above should allow you to do just that.
First, go ahead and integrate your forumdisplay.php and showthread.php files with the CMPS page that you would like to integrate the majority of your forums with, using the "Integration" link in your Admin CP.

Next, go to your plugin manager and click the link to add a new plugin at the bottom of the page there. Enter whatever you would like for the title, and then add the code from my post above in the "Plugin PHP Code" section (after you've changed out the forumid's and $getpage variables to match what you would like for your forum), set the "Active" option to yes, and save the plugin.
Going from the example you gave, the code to add would need to look something like this:
PHP Code:
if (isset($_REQUEST['f']))  
{  
    
$_REQUEST['forumid'] = intval($_REQUEST['f']);  


switch(
$_REQUEST['forumid']) 

    
// Quick example for just one forumid 
    
case 2:
        
$getpage 'adv_portal_promo2'
    break; 

    case 
7:
        
$getpage 'adv_portal_promo7'
    break; 

    case 
15:
    case 
17:
        
$getpage 'adv_portal_promo15_17'
    break; 


Ok, so do I have to create another custom page for the specific sub forum that I want to wrap the sidebar/modules around? If not then how do I get it to wrap around a specific subforum in forum display, whilst leaving the original (first) integration unaffected?

I've created the plugin and added the specific forumid - although can i just check, which 'hook location' do you recommend using? (just in case i've used the wrong one - i used CMPS_global)

Thanks for any assistance in this area
Reply With Quote
  #18  
Old 03-21-2008, 09:46 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Modules into specific forums

Yes, you need to add a new CMPS page for each different layout you want to use. The same CMPS page can be used for multiple forums/integration files though if you want the layout to remain the same on each.

Quote:
which 'hook location' do you recommend using?
Quote:
Originally Posted by Brian View Post
You should be able to use some code like this and add it as a plugin to your 'vba_cmps_include_getpage' hook location.
Reply With Quote
  #19  
Old 03-21-2008, 05:48 PM
Rev O Rev O is offline
Junior Member
 
Join Date: Jan 2008
Posts: 25
Default Re: Modules into specific forums

Oops! Thanks again Brian, i'll give that a try.
Reply With Quote
  #20  
Old 04-08-2008, 12:37 PM
HenrikHansen HenrikHansen is offline
Senior Member
 
Join Date: Jul 2004
Location: Copenhagen
Posts: 741
Default Re: Modules into specific forums

Quote:
Originally Posted by Brian View Post
You should be able to use some code like this and add it as a plugin to your 'vba_cmps_include_getpage' hook location.
I have tried the method on pages integrated into the links directory,
using the code in post 2, replacing forumid with catid, but it is not working.

Should other changes be made to make it work with the links directory?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
disable modules for specific style/theme wildo69 "How Do I..." Questions 9 04-15-2011 03:36 PM
Trying to add links to specific forums, in between nav items.. Emraith "How Do I..." Questions 1 03-21-2007 10:38 AM
left side modules - specific forums Rebecca "How Do I..." Questions 2 03-25-2006 07:13 AM
Modules for specific pages angelosms Troubleshooting & Problems 8 12-25-2005 01:08 AM
Modules only one a specific style e-steki "How Do I..." Questions 7 12-23-2005 01:19 PM


All times are GMT -4. The time now is 10:40 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.