Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-20-2010, 05:22 AM
EricTheRed EricTheRed is offline
 
Join Date: Nov 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 11-26-2010, 05:27 AM
EricTheRed EricTheRed is offline
 
Join Date: Nov 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump!
Reply With Quote
  #3  
Old 11-26-2010, 04:47 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 11-26-2010, 11:47 PM
EricTheRed EricTheRed is offline
 
Join Date: Nov 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 11-26-2010, 11:49 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

{{{Lynne marks on calendar to check back with Eric in ten years and see if he really did name his firstborn after her.}}}
Reply With Quote
  #6  
Old 02-08-2011, 04:58 PM
caciocode caciocode is offline
 
Join Date: Apr 2010
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 02-08-2011, 05:12 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 02-08-2011, 05:24 PM
caciocode caciocode is offline
 
Join Date: Apr 2010
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'])); 
Reply With Quote
  #9  
Old 02-08-2011, 06:04 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try it on your test site. Your test site is the best place to try out anything before doing it live.
Reply With Quote
  #10  
Old 02-08-2011, 10:56 PM
caciocode caciocode is offline
 
Join Date: Apr 2010
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


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


All times are GMT. The time now is 04:09 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.04436 seconds
  • Memory Usage 2,249KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete