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)

mccollin 07-31-2003 01:45 PM

Quote:

Both links go to the same place for me.
Oh, but they don't. Check the url... one goes to /forums/portal.php (vB and vBi), the other goes to /phpBB/portal.php (phpBB). I have accomplished my goal if you thought they were the same! :smoke:

I'm amazed that I could take your script and exactly replicate (well, not exactly because I now have a registered and unregistered welcome block) my home page in about 2 days.

Back to the

Thanks for your explanation... it makes perfect since. I had been playing with the templates and finally figured it out. I had accidentally typed "m" instead of "n" in the names (i.e. mewsbits). My editor font made it hard to see. Your approach is cleaner, though because it keeps my edits up at the top of the page, and not down in the code. I'm going to add a setting for number of news posts to include, and I'll be all set.

Thanks a ton.

Now I've got to tackle some custom queries to do the FAQ section. I have to make 7 passes through the article forum, and do a join on an index which drives the order, and which of the threads, to include. :classic:

NTLDR 07-31-2003 02:09 PM

*heh* Indeed it is different *hehe*

You've done a great job converting it, it looks totally different and matches your old page perfectly :)

mccollin 07-31-2003 02:40 PM

OK, that works great. In case anyone else is following this discussion, I'll summarize and add in a few details to your last suggestion. This example may not even make sense to do, but it covers all the things you need in order to have multiple forums, multiple templates working together, and called from a single vbindex.php file.

The scenario is this...

You have a vBulletin that is focused on cars. You want to create a home page that shows all the news for all the cars. You also want "portal" pages where each car owner can see just news about their brand of car... chevy owners see chevy news, ford owners see ford news, etc. You can use the concepts here to expand this into covering the whole range of things that you might want to tailor on a portal page. My motivation was to figure out news first.

This documents what I found out. Many thanks to the great and mighty NTLDR, for creating a script that is easy to understand and work with, and for being willing to help someone that dares to alter their work! :banana:

Make the following changes in vbindex.php

FIND:

PHP Code:

$templatesused.=',home_shoutbox,home_postshout'

ADD AFTER:
PHP Code:

$templatesused.=',home_extra_chevy,home_chevy_news,home_chevy_newsbits';
$templatesused.=',home_extra_ford,home_ford_news,home_ford_newsbits';
$templatesused.=',home_extra_dodge,home_dodge_news,home_dodge_newsbits'

FIND:

PHP Code:

require('./global.php'); 

ADD AFTER:

PHP Code:

// Set variables for this page 

if ($mode=='') { 
  
$newsforum '3, 5, 8, 9'
  
$page ''
} elseif (
$mode=='chevy') { 
  
$newsforum '3'
  
$newsposts '10';
  
$page 'chevy';       
  
$news_template "home_chevy_news"
  
$newsbits_template "home_chevy_newsbits"

} elseif (
$mode=='ford') { 
  
$newsforum '5, 8'
  
$newsposts '10';
  
$page 'ford'
  
$news_template "home_ford_news"
  
$newsbits_template "home_ford_newsbits"
} elseif (
$mode=='dodge') { 
  
$newsforum '9'
  
$newsposts '10';
  
$page 'dodge'
  
$news_template "home_dodge_news"
  
$newsbits_template "home_dodge_newsbits"
} else { 
  
$newsforum $newsforum
  
$newsposts $newspost;
  
$page ''
  
$news_template "home_news"
  
$newsbits_template "home_newsbits"


FIND:

PHP Code:

WHERE forumid '$newsforum' 

REPLACE WITH:

PHP Code:

WHERE forumid in ($newsforum

Then go into the admin control panel and setup a default configuration. You can put in multiple forums for default news like this:

Quote:

3, 5, 8, 9
Then create the following templates...

home_extra_chevy (copy of home)
home_chevy_news (copy of home_news)
home_chevy_newsbits (copy of home_newsbits)
home_extra_ford (copy of home)
home_ford_news (copy of home_news)
home_ford_newsbits (copy of home_newsbits)
home_extra_dodge (copy of home)
home_dodge_news (copy of home_news)
home_dodge_newsbits (copy of home_newsbits)

This assumes that there were already the following news forums:
Chevy News - forum number 3
Ford New Car News - forum number 5
Ford Antique News - forum number 8
Dodge News - forum number 9

Edit the custom templates to your liking.

Then upload the new vbindex.php... you could call it something like cars.php.

Then, if you called cars.php with no parameters, you'd get all the news and use the standard templates.

If you called cars.php?mode=chevy, you'd get the chevy news and use the appropriate news templates.

etc, etc,

Like I said, this is a fictional example to show how to do multiple forums and multiple templates from one vbindex.php. If you wanted separate *.php files, like chevy.php, ford.php, etc., then you would do the same changes and drop the conditional logic. If you want to alter more template, then you would make the same template changes shown...
1. create the new template and copy the orginal
2. add it in the list of templates at the top of the page
3. add it to the conditional logic

This could be used to run targeted banners for each car type, or to include colors and images to match a particular theme.

If anyone finds any mistakes with this, let me know and I'll edit it.

mccollin 08-01-2003 02:53 PM

OK, another night of work and I almost have my more complicated portal page built with vBindex. I am really learning the power of vB, templates, and this great script.

I have FAQ content on my site that I stored in forums by category. With phpBB, I had written separate scripts for each device and the maintenance was getting to be difficult with simple changes requiring me to replicate it across all the scripts.

Using vBi and some custom tables, queries, and templates... I have managed to make this all run from one script... my home page news, my faqs, everything. You just pass "device=" in the url and you are in business. Because NTLDR has made this such a clean single file script, it was very easy to get it to work.

Here is a current example of these techniques in action. This page shows a subset of the news from the home page, and then organizes FAQs that are stored in multiple forum by category. I two tables... one for the index of what FAQ threads go to what category, and another that stores all the device info... specs, newsforums, faqforums, image location, etc, etc. I look for device= at the beginning of the script.... if it doesn't find it it runs the vbindex as designed. If it does find it, it loads variables for news and a custom block of code (based on news) to organize and display the device specs and faqs.

I still have some more work to do to add the blocks for new, updates, and popular FAQs... but that should be a piece of cake to add add using these techniques. I have a lot of data to migrate from the phpBB tables to the vB tables, so I need to do that before putting this in production for all devices. I've got a production page of for an older device... the Audiovox Thera to show how it looks...

vBindex version of Thera Portal page

Old phpBB version of Thera Portal Page

By the way, is it necessary to include the HASH info in the url when callling a vbindex.php?

NTLDR 08-01-2003 03:36 PM

Looking good Mike! :) You have done an superb job of converting you pages and to get them all running from the one script. Its good to see someone else use this hack to its full potential.

As for the hash, I recomend including it in all your links (demo.php?s=$session[sessionhash]&device=test) as this is what tracks non-cookie users on your board.

mccollin 08-02-2003 02:55 PM

OK, I have my whole site converted using this script... took about 4 days total... I don't know whether to be impressed or bummed. It took me about 3 months to develop it to start with! I did reuse most of my template code, so that saved a lot time and trial and error. Here are some comments/suggestions/questions for you your new version.

- keep it this clean and simple - I looked at a lot of other portal scripts and they were powerful, but too complicated to use for a custom look and site. I didn't want the standard nuke look. Having one well written, well documented script is a good thing.

- static version possibly - you might want to create a skinnied down version of this that someone can use to create custom content pages. I am using it for that as well... basically a page that has the header, footer, left and right margins, and the user identity stuff... then a variable for a template so that someone can create "static" pages and use the vb control panel to maintain the html code. I did this, but have a slight problem because if I use the welcome header, its showing a different user than me! This is very odd, because all I did was remove the news, poll,shout, etc sections, and left all the info up top that handles users in there. I just removed the username until i can figure that out.

- I noticed you have a downloads and links section on your site. Can you say which hack you used for that, or did you write it yourself. I'm particularly interested in the downloads, because I haven't seen one for vB anywhere.

- At some point if you want vB V3 beta testers for your new script, let me know. I'll be throwing up a vB V3 test site soon.

Thanks for the good work.

NTLDR 08-02-2003 05:42 PM

Thanks for the suggestions, they will be considered while finishing off the vB3 version, I'll let you know when I've a beta ready and your site is a good one for the new version to be tested on :)

Everything you see on my site is part of vBsite, my portal that I wrote for my dissertation. I won't be releasing it though.

vBFreak 08-02-2003 09:10 PM

Can you make an addon that allows to exclode some forums form the latest thread list?

NTLDR 08-02-2003 09:12 PM

Read the thread, this as already been covered.

Elly 08-07-2003 10:19 PM

I hope this hasnt been answered and if so please just point me to the right page x.x

I had to re-install vbindex due to some problems with my forum, I am currently running 2.3.0 and am getting this error on the main page wich would be www.ultimaforce.net

Warning: main(): stream does not support seeking in /home/asuka/public_html/index.php on line 27
Fatal error: Call to undefined function: getpermissions() in /home/asuka/public_html/index.php on line 30


The main page does not seem to recognize log in or display the vbindex features at all, the vbindex is enabled the forums are not at the moment, can someone please tell me were I went wrong or if I forgot to edit something.

Thank you in advance.

EDIT: I dont know if this will help in aiding me I checked the file in question which would be the vbindex.php file renamed to index.php so it is the main page and there is nothing on line 27 or line 30

Code:


----- Start on line 27, End Line 30 which is blank-----
// un-comment and set the path if vBindex is not run from the forums root directory
chdir('./forum');
require('./global.php');



All times are GMT. The time now is 09:00 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.03225 seconds
  • Memory Usage 1,802KB
  • 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
  • (6)bbcode_php_printable
  • (2)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