vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vBindex v2.1 (https://vborg.vbsupport.ru/showthread.php?t=41916)

mknott 07-30-2003 03:06 PM

is there anyway i could get the forum to load in the middle section by clicking a link for the forum?

NTLDR 07-30-2003 03:25 PM

Yes this is posible, I would say it would be easier to get the side bars to appear on the forum pages then the other way around. I posted a addon-earlier in the thread for a menu for the forums, however it proved to be a bit buggy.

mknott 07-30-2003 04:11 PM

thats a shame :(

i know i need to edit a template to add somthing to the menu on the left...

basicly what im wanting to add is a link to my forums that opens in a new window.

mccollin 07-30-2003 04:35 PM

Quote:

For the news edit find:

...
OK, I'm probably the first person to get burned FOR reading the thread. I spent the last hour reading back through the thread... got through all but about 25 pages and decided that version was too old, pulled out the code and hacked through it, figured it out, came back here excited to post the solution, and OOOPS... you beat me to it!

Thank you for getting back with the answer, just the same. I will post the solution to multiple forums on multiple pages shortly. :rolleyes:

mccollin 07-30-2003 06:30 PM

OK, combining a couple of things here, let me see if this is correct.

Let's use my car example again. I have a main site that deals with all cars. I have various forums for the different types of cars. I want to combine all car news on my home page. I want individual portal pages for the car types that only show news for them... chevy, ford, dodge, etc.

In this example, chevy has one news forum, ford has two, and dodge has one.

I first add the multiple forum hack that was just posted about 5 or 6 posts back. That replaces

PHP Code:

... WHERE forumid '$newsforum' ... 

with

PHP Code:

... WHERE forumid in ($newsforum) ... 

You can then put multiple forums in the field in the control panel and it will work, but you would get all the forums on all the pages. I want to segregate forums on pages. So.....

I add the following just below the opening comments where it says support is only provided in this forum.

PHP Code:

// Set variables for this page

if ($mode=='') { 
  
$newsforum '3, 5, 8, 9';
} elseif (
$mode=='chevy') { 
  
$newsforum '3';
} elseif (
$mode=='ford') { 
  
$newsforum '5, 8';
} elseif (
$mode=='dodge') { 
  
$newsforum '9';
} else { 
  
$newsforum "$newsforum";  // default to what is in cp


Then you would call the home page using

or chevy with

etc, etc.

OK, that solves the multiple forums problem. But, I want to have different page layout as well... in particular I want to have targeted adds, and a panel of different info at the top of each page that talks about that car type. If I modify the code to this...


PHP Code:

// Set variables for this page

if ($mode=='') { 
  
$newsforum '3, 5, 8, 9';
  
$page ''
} elseif (
$mode=='chevy') { 
  
$newsforum '3';
  
$page 'chevypage';     
} elseif (
$mode=='ford') { 
  
$newsforum '5, 8';
  
$page 'fordpage'
} elseif (
$mode=='dodge') { 
  
$newsforum '9';
  
$page 'dodgepage'
} else { 
  
$newsforum "$newsforum";
  
$page ''



I can now have a different template page for each one. These need to be added in the control panel as "home_extra_chevypage", "home_extra_fordpage", and home_extra_dodgepage". No problem, now I have some more control.... but I ran into a problem here... my lack of knowledge on vBulletin.

I want to have other custom templates for the other bits... "home_newsbits", home_header", etc. I tried adding "home_custom_news" and added it to one of the "extra" pages, but I ended up with nothing showing up, telling me that it couldn't find my template. I tried adding the templates in the list at the head of vbindex.php, but that also didn't work. This is probably a basic vB question, but how do I add and call custom templates within the vB template system.

Thanks. (almost done ) ;)

NTLDR 07-30-2003 07:05 PM

The $templatesused list at the top contains all the templates that could be used by vBindex, this removes 1 query for each template, so any you add I strongly recomend that you place them in this list.

For the $mode if clause, make sure this goes after the require global.php line otherwise it will not work.

For the custom templates I assume these are based on $mode? If so then I would rename them in the eval lines to variables, for example:

PHP Code:

eval("\$threadbits .= \"".gettemplate('home_threadbit')."\";"); 

to:

PHP Code:

eval("\$threadbits .= \"".gettemplate($home_threads)."\";"); 

and set $home_threads equal to the template you wish to use in the $mode if statement, this seems the easiest way to me.

I may consider making some of these changes standard in v3 as it seems like many people would find it usefull :)

mccollin 07-30-2003 08:10 PM

Actually, no. I took a left turn on you there. Remember that I'm a phpBB guy and have just been using templates for a few weeks... totally new to me. Assume I'm an idiot with this stuff and may be missing something simple.

In the $mode statement, I've got a new page template for each. Rather than pass two variables in the url, I've just piggy backed on the one you already put there for "page" (it's the last code in vbindex.php at the bottom). So, I'm not passing page... I'm sticking it in there from the $mode conditionals. So, the $page=chevypage is for the template named "home_extra_chevypage" as you've defined in your code.

That works fine. But, it's not enough for me to replace just that home template. I want to let home_extra_chevypage call a different home_news, home_newsbits, home_right, and home_header (than the one that the home page calls).

I created new templates of those names as home_custom_news, etc., then I referenced them in home_extra_chevypage... but they didn't do anything.

The evaluate part of this is probably where I'm missing something. Again, assume I'm an idiot on this. I will keep trying and let you know if I figure it out before you respond. Thanks a ton for your quick responses.

mccollin 07-30-2003 08:22 PM

PHP Code:

// Set variables for this page 

if ($mode=='') { 
  
$newsforum '3, 5, 8, 9'
  
$page ''
} elseif (
$mode=='chevy') { 
  
$newsforum '3'
  
$page 'chevypage';     
  eval(
"\$home_custom_mews = \"".gettemplate('home_custom_news')."\";");
  eval(
"\$home_custom_mewsbits = \"".gettemplate('home_custom_newsbits')."\";");
 
} elseif (
$mode=='ford') { 
  
$newsforum '5, 8'
  
$page 'fordpage'
} elseif (
$mode=='dodge') { 
  
$newsforum '9'
  
$page 'dodgepage'
} else { 
  
$newsforum "$newsforum"
  
$page ''


I tried doing this and it still doesn't work. When I call mode=chevy, it does use the home_extra_chevypage template, but the news part is blank.

mccollin 07-31-2003 05:33 AM

OK,

I still need to get an answer on the template question before I can complete my next phase, but I now have my home page moved from phpBB2/Smartor EZPortal/Heavy Hacking, to vBulletin/vBindex/Heavy Templating. You can see it at pdaPhoneHome New Home Page . The old page that is temporarily still online is at pdaPhoneHome Old Home Page .

So, can you recognize that this started two days ago as a standard vBindex page? ;)

I love this thing... very clean and easy to work with.

By the way, is the users online supposed to only show 12 people? If so, what 12 does it show? I usually have a lot more users online than this.

NTLDR 07-31-2003 11:44 AM

Both links go to the same place for me.

Here is how I would suggest doing the templates:

PHP Code:

// Set variables for this page 

if ($mode=='') { 
  
$newsforum '3, 5, 8, 9'
  
$page ''
} elseif (
$mode=='chevy') { 
  
$newsforum '3'
  
$page 'chevypage';      
  
$news_template "home_custom_news";
  
$newsbits_template "home_custom_newsbits";

} elseif (
$mode=='ford') { 
  
$newsforum '5, 8'
  
$page 'fordpage'
} elseif (
$mode=='dodge') { 
  
$newsforum '9'
  
$page 'dodgepage'
} else { 
  
$newsforum "$newsforum"
  
$page ''
  
$news_template "home_news";
  
$newsbits_template "home_newsbits";


Then change the following lines:

PHP Code:

  eval("\$news = \"".gettemplate('home_news')."\";"); 
  eval(
"\$newsbits .= \"".gettemplate('home_newsbits')."\";"); 

To:

PHP Code:

  eval("\$news = \"".gettemplate($news_template)."\";"); 
  eval(
"\$newsbits .= \"".gettemplate($newsbits_template)."\";"); 

Hope that makes sense ;)


All times are GMT. The time now is 04:13 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.02730 seconds
  • Memory Usage 1,791KB
  • 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
  • (10)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete