vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Some basics of vB3(mini howto) (https://vborg.vbsupport.ru/showthread.php?t=59939)

Blue Moose Aaron 07-31-2004 01:36 PM

Quote:

Originally Posted by Zachery
Is all this info in the same database as vBulletins?

Yes.

Ghostsuit 08-03-2004 02:13 AM

Ahh the original :)

Zachery 08-03-2004 02:18 AM

Quote:

Originally Posted by Ted Varnson
Yes.

Then why are you writing out all that mysql info, just use $DB_site or whatever it is.

Your already connected to the Database via global.php

PtP 08-13-2004 06:20 AM

Any way of forcing the page to use a style that is not the default style.?

Davey 08-13-2004 11:51 AM

Quote:

Originally Posted by Faranth
Some basics of vB3(mini howto)
also some basic php junk
the most important thing if you want to make pages based on templates or anything of the such would be to first know how to "

connect" to vbulletin, and then learn how to call and eval templates. so lets take a look at the most BASIC page we can do

This is *exactly* what I was in need of!
Thank you endlessly.

xmitchx 08-13-2004 09:50 PM

Could anyone please explain to me what the $phasegroups variable is for.

Zachery 08-13-2004 10:13 PM

Quote:

Originally Posted by xmitchx
Could anyone please explain to me what the $phasegroups variable is for.

If you need to call any other phrasegroup besides global

PtP 08-13-2004 10:44 PM

Quote:

Originally Posted by PtP
Any way of forcing the page to use a style that is not the default style.?

I feel rejected :(

Zachery 08-14-2004 12:15 AM

Quote:

Originally Posted by PtP
I feel rejected :(

If i knew i would tell you.

PtP 08-14-2004 05:18 AM

My apoligies for thinking you are a guru ;)

Zachery 08-14-2004 05:19 AM

Quote:

Originally Posted by PtP
My apoligies for thinking you are a guru ;)

I am just a simple student who is still learning things himself ;)

colicab-d 09-07-2004 02:05 PM

can this be done Zachery?

say I have a var called $a and i want it evald on its own so that I can use it in the templates how do i assign just a value to that and still eval? i.e value 22

khaleel 10-11-2004 02:09 PM

Thankyou very much this is good newbs like me who have come from along time experince with phpBB and IpB :squareeyed:

Seanie 10-16-2004 06:18 PM

Warning: main(): open_basedir restriction in effect. File(./global.php) is not within the allowed path(s): (/home/latch/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/latch/public_html/test.php on line 16

.... my forums are in /home/forums/public_html/

is there anyway to get it to work :S

C.Birch 10-22-2004 09:00 AM

read the error it tell's you the prob right away.

open_basedir restriction in effect. File(./global.php) is not within the allowed path

in other words the server setup does not let you pull files from other site paths this is because there might be other sites on the server you dont own and if there not any open_basedir restriction you could pull files from other peoples sites and this could let people hack people or nick personal information.

Seanie 10-23-2004 07:39 PM

Quote:

Originally Posted by C.Birch
read the error it tell's you the prob right away.

open_basedir restriction in effect. File(./global.php) is not within the allowed path

in other words the server setup does not let you pull files from other site paths this is because there might be other sites on the server you dont own and if there not any open_basedir restriction you could pull files from other peoples sites and this could let people hack people or nick personal information.

i know that now... we've fixed it

Adrian Schneider 11-07-2004 10:41 PM

PHP Code:


$actiontemplates 
= array(
                            
'small' => array(
                                                     
'other'
                                                    
)
); 

What exactly does this do?

GeZuS P 11-22-2004 09:36 PM

OMG Thanks, I feel like a god now !!!

PaulioTheGreat 01-08-2005 12:13 AM

Hey, i suppose you lot have been asked this loads of times, i am using this code:

Code:

<?php
// ## Changes Directory so it can accesss vBulletin IF we are outside the forums folder, if not this is not nessary ##
chdir("./forum");

// ## Error Reporting ( we use error reporting in php so we can control the display of error messages
// ## we will use this because all vBulletin files follow the same error reporting rules) ##
error_reporting(E_ALL & ~E_NOTICE);

// ## this action here cache's the templates so that everytime their needed a querry wont be needed to run
// ## the names in there are just the template names :), there must be a comma after everyone but the last ##
$globaltemplates = array(
'index.php'
);

// ## Grabs global.php this grabs vbulletins global.php so we can use the most basic of vBulletins functions ##
require_once("./global.php");

// ## this calls to print out one main template ##
eval('print_output("' . fetch_template('index.php') . '");');
?>

And is there any way of fixing the problems with the javascripts and images WITHOUT adding the vb home code to the relative urls?

Here is the page:

http://www.justonxbox.com/test.php

Also i know the template is called index.php, this is so that when i make my site from these they are easily edited as that will be the name for this page once done etc... etc...

Thanks Paul

grooveh 01-16-2005 07:23 PM

yes, thank you!

dwh 01-29-2005 07:56 PM

Quote:

Originally Posted by Zachery
You didnt print any templates...

your missing the most important line

eval('print_output("' . fetch_template('TEMPLATE') . '");');

You just made some varibles, you didnt tell the script to display a template i suggest trying generic shell

eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');

Gosh that would have saved me a lot of time had I known about it. Howdo use it? How do you populate $HTML? Is it a regular variable or aspecial one?

Also, I still don't get actions? Can someone explain the system in more details?

dwh 01-31-2005 10:40 PM

I think I understood actions now. It's no big deal it just pulls outany templates that are defined (somewhere? init.php?) for that action.It's a "shortcut" but it doesn't make any difference as long as youpull out any template you use in globaltemplates you should be ok.Correct me if I'm wrong.

I'd still like to know about the $HTML thing though.

feldon23 02-01-2005 07:51 PM

Quote:

Originally Posted by dwh
I think I understood actions now. It's no big deal it just pulls outany templates that are defined (somewhere? init.php?) for that action.It's a "shortcut" but it doesn't make any difference as long as youpull out any template you use in globaltemplates you should be ok.Correct me if I'm wrong.

I'd still like to know about the $HTML thing though.

I'm using this code and to get images and javascript to load, I'm having to use ugly search-and-replace code that replaces

href=" with href="../forums/

and

src=" with src="../forums/, etc.

There's got to be an easier way. :(

The huge problem I am running into now is that by including global.php, and by extension init.php, cookies are being established. That's not what I want. Is there a way to load templates without all that other stuff happening?

What I may need to do is create a cron task that dumps the evaluated contents of the templates I need to flat HTML files and then include those. :( :(

Razz 04-10-2005 10:29 PM

If your using the action templates as shown in the original post:

PHP Code:

$actiontemplates = array(
                            
'small' => array(
                                                     
'other'
                                                    
)
); 

along with:

PHP Code:

if (empty($_REQUEST['do']))
{
    
$_REQUEST['do'] = 'small';


Then you will need to set a default action template like below:

PHP Code:

$actiontemplates = array(
                            
'small' => array(
                                                     
'other'
                                                    
)
);

$actiontemplates['none'] = &$actiontemplates['small']; 

This should prevent uncached templates on initial page visit if $_REQUEST['do'] is empty. Just change "small" in the last line to the default template array such as "home" or "main".

Razasharp 04-30-2005 12:36 AM

Hi

I've got the page to work, but I'd like to use a custom header and footer because the links do not show correctly at present - I've created the new templates for them and called them in my 'test' template instead of the standard ones. But it doesnt work :-(

Can someone give me a quick run-down of how it can be achieved? thanks.

NxTek 04-30-2005 03:54 PM

Can that be used for this (from another post) -

I've seen a few scripts that prompt a user to login, but nothing that would redirect the user to the internal login page on non-vB pages.

I have a directory structure like this -

/forums
/ads
/games
/faqs
/blog
and so on.

I want to use vB security throughout my entire site, even outside the actual /forums dir.

If you would go straight to /blog/blog.php for example, a piece of code would detect whether the visitor is logged in or not.

If so, display the page normally.

If not, redirect them to the exact same login screen that's invoked when you go to http://www.onlinepokerlistings.com/forums/calendar.php.

Ok, after logging in, the visitor would be directed back to /blog/blog.php.

It would work exactly the same as normally requiring a login to see a vB page, but in this case it's outside of vB.

hexosex 08-21-2005 01:51 AM

Where the hell are the templates stored? :O I just cant find them on the installation i have here... Can anyone help please?

Adrian Schneider 08-21-2005 02:33 AM

In the database (you should access them from vBulletin).

AdminCP > Style Manager > (pick a style) > Edit Templates

lem 09-16-2005 04:56 PM

I have this system setup for my site locksmithcafe.com. However, when I log out of the forum and go to locksmithcafe.com it gives me the following error:

Quote:

Unable to add cookies, header already sent.
File: /home/httpd/vhosts/locksmithcafe.com/httpdocs/index.php
Line: 9

whats up with that do you think?

Here is my index.php page:

PHP Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Welcome to the Locksmith Cafe!</title>
</head>

<body>
<?php 
// OUR CONTENT BEGINS ON LINE 48 -----------------------------------------
// ## Changes Directory so it can accesss vBulletin IF we are outside the forums folder, if not this is not nessary ## 
chdir("./forum"); 

// ## Error Reporting ( we use error reporting in php so we can control the display of error messages 
// ## we will use this because all vBulletin files follow the same error reporting rules) ## 
error_reporting(E_ALL & ~E_NOTICE); 

// ## this here defines the "this_script" function, which if you use template conditionals, it will come in handy :) ## 
define('THIS_SCRIPT''page'); 

// ## this action here cache's the templates so that everytime their needed a querry wont be needed to run 
// ## the names in there are just the template names :), there must be a comma after everyone but the last ## 
$globaltemplates = array( 
'headinclude',
'header'
'navbar'
'footer' 
); 

// ## Grabs global.php this grabs vbulletins global.php so we can use the most basic of vBulletins functions ## 
require_once("./global.php"); 

// ## ok this next set of lines "eval"'s our templates so they can be called inside the template we will print out ## 

eval('$h_include = "' fetch_template('headinclude') . '";'); 
eval(
'$header = "' fetch_template('header') . '";'); 
//eval('$navbar = "' . fetch_template('navbar') . '";'); 
eval('$footer = "' fetch_template('footer') . '";'); 

//eval('print_output("' . fetch_template('headinclude') . '");');

echo $h_include;
echo 
$header;
//echo $navbar;
// ********************************************************************************
// place our content here *********************************************************

echo '
<h3>Welcome to the Locksmith Cafe!</h3>

<br><br><br><br>
<h3>Find a Locksmith in Your area!</h3>
'
;
include 
$_SERVER['DOCUMENT_ROOT'].'/search.html';
// end our content ****************************************************************
// ********************************************************************************
echo $footer;
?>
</body>
</head>

Any ideas?

thanks

Lem

hexosex 09-16-2005 04:59 PM

You are trying to start another page that is trying to set the http headers after they have allready been set. I had this problem and got around it with some php http posts that then caught the output stripped out the headers and then set them on final output!

Contact me gary@behindtheweb.co.uk if you need any more help on this problem. I'd be happy to help.

Marco van Herwaarden 09-16-2005 07:34 PM

Just remove everything above the opening php-tag.

You can not output ANYTHING before you require global.php.

bigtime 09-30-2005 06:58 PM

NxTek - that's exactly what I want to do. Did you find the solution? Any one else?

Thanks.

Quote:

Originally Posted by NxTek
Can that be used for this (from another post) -

I've seen a few scripts that prompt a user to login, but nothing that would redirect the user to the internal login page on non-vB pages.

I have a directory structure like this -

/forums
/ads
/games
/faqs
/blog
and so on.

I want to use vB security throughout my entire site, even outside the actual /forums dir.

If you would go straight to /blog/blog.php for example, a piece of code would detect whether the visitor is logged in or not.

If so, display the page normally.

If not, redirect them to the exact same login screen that's invoked when you go to http://www.onlinepokerlistings.com/forums/calendar.php.

Ok, after logging in, the visitor would be directed back to /blog/blog.php.

It would work exactly the same as normally requiring a login to see a vB page, but in this case it's outside of vB.


NxTek 10-01-2005 03:04 PM

No, but I'm using vBa.

Quote:

Originally Posted by bigtime
NxTek - that's exactly what I want to do. Did you find the solution? Any one else?

Thanks.


PennylessZ28 10-10-2005 09:33 PM

Very nice, good information!


All times are GMT. The time now is 08:34 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.01496 seconds
  • Memory Usage 1,844KB
  • 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
  • (5)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (34)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