vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   How to create your own vBulletin-powered page! (uses vB templates) (https://vborg.vbsupport.ru/showthread.php?t=62164)

SVTCobraLTD 01-29-2009 02:35 PM

Quote:

Originally Posted by Lynne (Post 1728154)
It says no such file or directory for global.php. Is global in the same folder that test is in?

It wasnt but now it is. But still get the error below.

Code:

Warning: require_once(/home/svtcobra/public_html/includes/init.php) [function.require-once]: failed to open stream: No such file or directory in /home/svtcobra/public_html/global.php on line 20

Fatal error: require_once() [function.require]: Failed opening required '/home/svtcobra/public_html/includes/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/svtcobra/public_html/global.php on line 20


Lynne 01-29-2009 02:50 PM

And does this file exist at this path?
public_html/includes/init.php

amcd 01-29-2009 05:37 PM

and the answer is one post above yours.

SVTCobraLTD 01-29-2009 05:45 PM

Quote:

Originally Posted by Lynne (Post 1728180)
And does this file exist at this path?
public_html/includes/init.php

No everything is it pointing to is not in the root folder but in public_html/forums folder. But i do not see where to change that

amcd 01-29-2009 06:21 PM

it would be much simpler to put the new file in forums directory and use it as www.example.com/forums/test.php in your browser.

SVTCobraLTD 01-29-2009 10:20 PM

Quote:

Originally Posted by amcd (Post 1728329)
it would be much simpler to put the new file in forums directory and use it as www.example.com/forums/test.php in your browser.

That works but I wanted to design this page to be my home page.

amcd 01-30-2009 04:13 AM

Add a rewrite rule to your web server software. Keep the actual php file in the same directory as your forum. It will make life easier.

figu120 02-05-2009 07:20 PM

are excellent and do as my own personal pages ...

Alefux 02-10-2009 12:34 PM

This is the original code:
PHP Code:

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''test'); // change this depending on your filename 

Can i do this?
PHP Code:

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT'$_SERVER['PHP_SELF']); 


amcd 02-10-2009 05:54 PM

AFAIK, the THIS_SCRIPT constant is used mainly for tracking user activity and who's online. So I guess you can do that.

TNCclubman 02-13-2009 10:51 PM

Please tell me its possible to display 1 users most recent albums in one of these 'powered by' pages. I want to make a intro page with just my albums in it so when people enter the 'menu' page it will show them the most recent pics I've uploaded.

Lynne 02-13-2009 11:35 PM

It is possible to display whatever you want to code. You just need to code it.

TNCclubman 02-14-2009 01:33 AM

I see, Im kind of an amature and was hoping someone knew the code off hand. No worries then, nice code!

(Tried putting 'Todays Events' code from the FORUMHOME template and its not displaying Todays Events. Is it not that easy?)

Lynne 02-14-2009 03:27 AM

No, it's not that easy. You need to grab all the php code that creates all the variables that are called in the template also.

TNCclubman 02-14-2009 03:07 PM

and would that php code go in the php part of your system, or the template part?

Lynne 02-14-2009 03:31 PM

php code goes in the php page. html goes in the templates.

TNCclubman 02-14-2009 10:22 PM

thanks you've been most helpful!!

I'll try to look for the corresponding php probably in the calendar.php file and add it to this test.php and see if it works...

appreciate the help Lynne!

wAnBoA 02-15-2009 05:48 AM

This Article is really useful. Thank dude.

khurtsiya 02-16-2009 10:04 AM

Anyone tested on vBulletin 3.8.1?

ragtek 02-16-2009 10:07 AM

Why it shouldn't work?:D

It's working!

--------------- Added [DATE]1234807628[/DATE] at [TIME]1234807628[/TIME] ---------------

But, i've forgotten, there are some things which changed with the time(because the code seems to be old*g*
1.
PHP Code:

define('NO_REGISTER_GLOBALS'1); 

2. Please use csrf protection on your sites, here's a article/tutorial.

Alien 02-17-2009 10:26 PM

So the "define('CSRF_PROTECTION', true);" code should be added under #1 above, even if the script and related custom template contains NO forms whatsoever?

Lynne 02-18-2009 12:06 AM

Quote:

Originally Posted by Alien (Post 1747342)
So the "define('CSRF_PROTECTION', true);" code should be added under #1 above, even if the script and related custom template contains NO forms whatsoever?

I'm pretty sure it doesn't hurt to have it there if there are no forms.

ragtek 02-18-2009 06:46 AM

Quote:

Originally Posted by Lynne (Post 1747404)
I'm pretty sure it doesn't hurt to have it there if there are no forms.

hmm, for example: if guests or other groups don't have access, they'll see the loginform

Lynne 02-18-2009 03:38 PM

A login is processed by the login.php page, not your page.

ragtek 02-18-2009 03:57 PM

sorry, your right

emocan 02-18-2009 07:01 PM

how can we modify this php page to use it in the admincp with admin permissions? or is there another tutorial?

Thx

ragtek 02-19-2009 08:02 AM

<a href="https://vborg.vbsupport.ru/showthread.php?t=83122&highlight=admincp" target="_blank">https://vborg.vbsupport.ru/showt...hlight=admincp</a>

emocan 02-19-2009 08:37 AM

ragtek thanks for the link

RrCoX22 02-24-2009 05:57 AM

question...

are both those first two codes in the instructions in the same file? my file looks like this: and I placed in under my forum directory and just got a black white page. what am I doing wrong?

Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'stickers'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(
   
);

// pre-cache templates used by all actions
$globaltemplates = array(
    'Norcal 4x4 Forum Dark Side',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Norcal 4x4 Forum Stickers';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('Norcal 4x4 Forum Dark Side') . '");');

?>

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header

$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="tcat">Title</td>
</tr>
<tr>
        <td class="alt1">Text</td>
</tr>
</table>

$footer
</body>
</html>


Lynne 02-24-2009 03:05 PM

I am guessing this line is the problem:
PHP Code:

eval('print_output("' fetch_template('Norcal 4x4 Forum Dark Side') . '");'); 

Do you have a template with that name?

And per the article, the stuff under the ?> is supposed to go into the template you create called "'Norcal 4x4 Forum Dark Side'" (usually we don't use spaces, but use _ instead.)

jayhawk785 02-24-2009 05:00 PM

What would I need to go about to create a template called "header2" (so i can modify the other and not pull everything in) and call it via $header2 in the test template. I created a duplicate header (same code), but it doesn't want to pull and im not sure where it needs to be added to make it work.

thanks :)

Lynne 02-24-2009 05:32 PM

You need to make sure to eval the template. And include it at the top of the file as one of the globaltemplates.

jayhawk785 02-24-2009 05:44 PM

i made another globals file and renamed header and called that through the script... im sure thats the long way, but given im changing the footer template too and im not huge on php, that seemed easy. I'm not sure what you mean by eval the template.

Lynne 02-24-2009 06:33 PM

Quote:

Originally Posted by jayhawk785 (Post 1753525)
i made another globals file and renamed header and called that through the script... im sure thats the long way, but given im changing the footer template too and im not huge on php, that seemed easy. I'm not sure what you mean by eval the template.

I meant to do just like in the first post, only use navbar2 instead:
PHP Code:

eval('$header2 = "' fetch_template('header2') . '";'); 

I've enver tried replacing the header, but I do not you would need to eval it.

RrCoX22 02-24-2009 07:17 PM

Quote:

Originally Posted by Lynne (Post 1753382)
I am guessing this line is the problem:
PHP Code:

eval('print_output("' fetch_template('Norcal 4x4 Forum Dark Side') . '");'); 

Do you have a template with that name?

And per the article, the stuff under the ?> is supposed to go into the template you create called "'Norcal 4x4 Forum Dark Side'" (usually we don't use spaces, but use _ instead.)

ya that's the template name... which basically is the default one but just changed the name.

im really confused? your saying this...

Code:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header

$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="tcat">Title</td>
</tr>
<tr>
        <td class="alt1">Text</td>
</tr>
</table>

$footer
</body>
</html>

goes in my template? like in the additional CSS box? it seems like that stuff would be in the file? or are you saying the first code in the instructions goes in the CSS template box? although the instructions said to put that in the notepad file? so I'm really lost haha. thanks for any help :up:

ragtek 02-24-2009 07:28 PM

Here's a tutorial how to create a template:
http://www.vbulletin.com/docs/html/s...edit_templates

Lynne 02-24-2009 08:04 PM

I don't understand why you are bringing up some CSS box. I don't know where that is coming from.

ZomgStuff 02-24-2009 08:41 PM

Great tutorial, highly useful.

figu120 02-24-2009 09:46 PM

I like that people are not registered or not logueadas can not access

Simply put permissions to different groups ..

RrCoX22 02-25-2009 06:40 PM

i don't understand why I would need to make another template? I though I was simple placing a file in the forums root?


All times are GMT. The time now is 09:21 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03051 seconds
  • Memory Usage 1,831KB
  • 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
  • (3)bbcode_code_printable
  • (6)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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