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)

Adrian Schneider 07-23-2005 04:56 PM

global.php
Find
PHP Code:

define('STYLEID'$style['styleid']); 

Above it, add
PHP Code:

if (THIS_SCRIPT == 'yourscriptname')
{
    
$styleid X


Make sure you have yourscriptname defined in your custom page.

derekivey 07-24-2005 12:47 AM

Thanks :)

Didn't work :(

MRGTB 07-26-2005 04:11 PM

I have a question, how can you create the template so it uses it own custom folder to store the template in, so the option is there to restore the template to original state.

Just like all the other vb templates use there own folders. Like FORUMHOME stores all the forumhome templates for example, if you understand what I mean to tidy things up much better in the admin template section.

MRGTB 08-02-2005 02:12 PM

I hate to reply to myself - but anybody got an answer to the above question? :surprised:

attroll 08-02-2005 04:17 PM

Quote:

Originally Posted by Gary Bolton
I have a question, how can you create the template so it uses it own custom folder to store the template in, so the option is there to restore the template to original state.

Just like all the other vb templates use there own folders. Like FORUMHOME stores all the forumhome templates for example, if you understand what I mean to tidy things up much better in the admin template section.

I know you can create a folder so that it is stored in its own folder but I don't know any way to have the template have a default code.

Adrian Schneider 08-02-2005 04:24 PM

To create the categories to store them in edit adminfunctions_template.php, at the very end add to the array.
PHP Code:

'prefix' => 'Text'

remember that for it to work, the template name must be "prefix" or contain "prefix_", and the text "Templates" is automatically added.

To be able to revert it, you must add it into the MASTER STYLE {requires being in debug mode}.

m0nde 08-02-2005 06:30 PM

Quote:

Originally Posted by SVTBlackLight01
OK. To answer my own question, on line 32, I replaced

Code:

require_once('./global.php');
with this

Code:

chdir('/home/site/public_html/testvb/');
require('./global.php');

;)

How can that work? Wouldn't you have to put the whole path to global.php once you change the directory?

- Sid

MRGTB 08-02-2005 07:05 PM

Quote:

Originally Posted by TheSpecialist
To create the categories to store them in edit adminfunctions_template.php, at the very end add to the array.
PHP Code:

'prefix' => 'Text'

remember that for it to work, the template name must be "prefix" or contain "prefix_", and the text "Templates" is automatically added.

To be able to revert it, you must add it into the MASTER STYLE {requires being in debug mode}.

Can you please be a little more clear in laymans terms. I really don't understand what your saying for me to do :disappointed:

Adrian Schneider 08-02-2005 07:12 PM

Okay, in /includes/adminfunctions_template.php there is an array at the very end of the file:
PHP Code:

// template groups
$only = array
(
    
// phrased groups
    
'buddylist' => $vbphrase['group_buddy_list'],
    
'calendar' => $vbphrase['group_calendar'],
    
'faq' => $vbphrase['group_faq'],
 ... 

Each of these creates a 'folder' into the template manager to oraganize your templates. You can add your own in using the above format (left part is the prefix, right part is the 'folder' Name (which automatically adds Templates to the end).

Example:
PHP Code:

    'attachmentlist' => $vbphrase['group_attachment_list'],
    
'subscription' => $vbphrase['group_paid_subscriptions'],
        
'league' => 'League'// I added this one 
    
'aaa' => 'AAA Old Backup' 


MRGTB 08-02-2005 11:41 PM

Quote:

Originally Posted by TheSpecialist
Okay, in /includes/adminfunctions_template.php there is an array at the very end of the file:
PHP Code:

// template groups
$only = array
(
    
// phrased groups
    
'buddylist' => $vbphrase['group_buddy_list'],
    
'calendar' => $vbphrase['group_calendar'],
    
'faq' => $vbphrase['group_faq'],
 ... 

Each of these creates a 'folder' into the template manager to oraganize your templates. You can add your own in using the above format (left part is the prefix, right part is the 'folder' Name (which automatically adds Templates to the end).

Example:
PHP Code:

    'attachmentlist' => $vbphrase['group_attachment_list'],
    
'subscription' => $vbphrase['group_paid_subscriptions'],
        
'league' => 'League'// I added this one 
    
'aaa' => 'AAA Old Backup' 


Your a star, that works great and I created a new line called:
'vbindex' => 'vBindex',

And it moved all my loose vbindex templates into the folder so everything is nice and neat now. I have one other question though that I also hope you can help me with the finish it off.

By default when you go into a templates folder and view a template there, there is an option to view the default template code in-case you mess up. So you can copy and paste that code back intoi the box and save.

I noticed even though I now have all my vbindex templates in there own folder under default template, the option to view default template just shows me a blank white box with no code in it. Is it possible to make that show the default code for all my vbindex templates when clicked for each one?


All times are GMT. The time now is 01:04 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.03658 seconds
  • Memory Usage 1,761KB
  • 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
  • (2)bbcode_code_printable
  • (8)bbcode_php_printable
  • (4)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