View Full Version : First page change
Hello,
I am wondering if it is possible to change vbulletin so that a user can select from his/her control panel as to view the normal vbulletin front page OR view a search page (Today's Posts)?
For example if I like to see what the posts for today where I would select View Today's Posts and when I went to the http://forumurl.com it would show a search "Today's Posts" rather than the categories. The categories would be selectable via the top menu.
Regards,
- Steve
GameWizard
03-12-2008, 08:33 AM
Either I'm too drunk, or I don't understand exactly what you're asking. First things first, you want this for all your users? Members and Guests, and what exactly do you want them, or a particular group to see?
I want either the ability for them to decide or a particular user group to be forwarded to the "search Today's Posts" rather than the default list of categories, the rest will all be sent to the categories.
So like
if($view_search = "yes") { // If view search button is checked off
print "$display_search_todays_posts"; // Display the search results for todays posts
}else{
// Do regular stuff
}
- Steve
Lynne
03-12-2008, 06:18 PM
Maybe you can do this by making a new User Profile Field and then using that value to set the page?
GameWizard
03-15-2008, 01:51 AM
Indeed, the above posts nails it.
It would go something like this,
Create a new Single-Select user profile field named how you want. Options should be Yes, No. "Yes" to show the Today's Posts as default, and 'No' regular index page.
In your FORUMHOME (or the template/page you want to have redirected) template I would add this somewhere:
<if condition="$userinfo[fieldX]=='Yes'">
<script language="JavaScript"><!--
location.href = 'search.php?do=getdaily';
//--></script>
</if>
This will work, as you can see by simply redirecting users automatically to the "Today's Posts" page if they set that Option to "yes". 'X' of course being the ID of the field.
Since there is no Command for "no" it will do nothing, and show the regular page. However, this is very rudimentary and simple, I can imagine this being fallible in some ways, in case you find an issue, I'd suggest finding a more experienced coder to help you.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.