PDA

View Full Version : Only One Forum, Make it the Default Homepage


EricTheRed
11-20-2010, 05:22 AM
I only have one forum at the moment and want to make forumdisplay.php my homepage without doing any type of redirect but I keep getting "Invalid Forum specified. If you followed a valid link, please notify the administrator."

This is what I have done so far:

1) Created a new plugin in the Admin CP with a Hook Location of global_start and with PHP Plugin Code
if(THIS_SCRIPT == 'forumdisplay'){
$_REQUEST['f'] = 4; //4 is the forumid I want to use.
}

2) Rename forumdisplay.php to index.php

I'm brand new to vB so I'm having trouble figuring how to manipulate the forumid variable that forum.php passes over in the URL to forumdisplay.php. If anyone can point me in the right direction I would be very thankful.

EricTheRed
11-26-2010, 05:27 AM
Bump!

Lynne
11-26-2010, 04:47 PM
So, you want it so if users go to index.php, they get shown the forumid 4 forumdisplay page instead? Just leave forumdisplay.php and index.php alone and create a plugin like:
hook - global_bootstrap_init_start
if (THIS_SCRIPT == 'forumdisplay') $_REQUEST['forumid'] = 4; //4 is the forumid I want to use.See if that does what you want.

Set index.php to go to forumdisplay.php (line 62) also.

EricTheRed
11-26-2010, 11:47 PM
That did the trick! It works exactly as I wanted now. Thank you very much Lynne! I'm naming my first born after you now :D

Lynne
11-26-2010, 11:49 PM
{{{Lynne marks on calendar to check back with Eric in ten years and see if he really did name his firstborn after her.}}} :D

caciocode
02-08-2011, 04:58 PM
Hi Lynne,

I am trying to attempt the same thing. It works well but the url keeps changing (it's redirecting to the actual forum instead). I would like it do display the forum without changing the url.

Thanks.

Lynne
02-08-2011, 05:12 PM
If you don't want to change the actual url, then that is a server setting. You can probably do it using htaccess - try googling it.

caciocode
02-08-2011, 05:24 PM
What I mean is;

When I go to the home page, I would like it to display that one forum without leaving the home page. What is happening in my situation is that when I visit the home page the website redirects me to the forum page instead.

--------------- Added 1297193839 at 1297193839 ---------------

This is the line that keeps redirecting me, how can I overcome it without deleting? I have tried to comment it out and it worked well but I am not sure that won't create errors.

// verify that we are at the canonical SEO url
// and redirect to this if not
verify_seo_url('forum', $foruminfo, array('pagenumber' => $_REQUEST['pagenumber']));

Lynne
02-08-2011, 06:04 PM
Try it on your test site. Your test site is the best place to try out anything before doing it live.

caciocode
02-08-2011, 10:56 PM
I am doing that at the moment. If I comment out this lineverify_seo_url('forum', $foruminfo, array('pagenumber' => $_REQUEST['pagenumber']));

Won't it affect anything? because that is doing the redirection.