vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   First page change (https://vborg.vbsupport.ru/showthread.php?t=172761)

iNod 03-11-2008 11:53 PM

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?

iNod 03-12-2008 05:46 PM

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:

Code:

<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.


All times are GMT. The time now is 07:07 AM.

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.01080 seconds
  • Memory Usage 1,718KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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