vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Only One Forum, Make it the Default Homepage (https://vborg.vbsupport.ru/showthread.php?t=253986)

EricTheRed 11-20-2010 05:22 AM

Only One Forum, Make it the Default Homepage
 
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
PHP 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
PHP Code:

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 [DATE]1297193839[/DATE] at [TIME]1297193839[/TIME] ---------------

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.

PHP Code:

// 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 line
PHP Code:

verify_seo_url('forum'$foruminfo, array('pagenumber' => $_REQUEST['pagenumber'])); 

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


All times are GMT. The time now is 06:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01108 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete