vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   trying to use templates for something else (https://vborg.vbsupport.ru/showthread.php?t=35951)

Mutt 03-10-2002 03:03 PM

trying to use templates for something else
 
A little while back I posted a hack for grouping custom templates. I wanted to make an easy way to add new groups and thought that would be real easy.

I used phpmyadmin to insert a a new template called templategroups with a templateset id of -2

then I set the template field to

$only['links'] = 'Links';
$only['eventcalendar'] = 'Event Calendar';
$only['activetopics'] = 'Active Topics';

then I wanted to grab that template info and stick it in template.php right after

$only['vbcode'] = 'vB Code';
$only['whosonline'] = 'Who\'s Online';
$only['showgroup'] = 'Show Groups';

that way I could edit the template to add new groups without having to edit template.php again.

i tried several variations of like these

eval (gettemplate("templategroups"));
gettemplate("templategroups");
gettemplate("templategroups",0);

but nothing worked. could I get a little help here people?

Admin 03-10-2002 04:34 PM

Because the templatesetid is -2 gettemplate() won't grab it, you need to use your own query:
Code:

$gettemplate = $DB_site->query_first("SELECT template FROM template WHERE title='templategroups' AND templatesetid=-2");
eval($gettemplate['template']);


Mutt 03-10-2002 05:02 PM

THAT DID IT!!

Thanks so much. I'll go write up some directions.

Admin 03-11-2002 11:10 AM

:)


All times are GMT. The time now is 08:52 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.01008 seconds
  • Memory Usage 1,710KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete