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)
-   -   [RELEASE vB2.0RC1] Copy Templateset (https://vborg.vbsupport.ru/showthread.php?t=15075)

Hotte 04-23-2001 10:00 PM

When using other Templates than the default (ie german templates) than it is usefull to copy this set to a new one before altering them.

File to edit: ./admin/template.php

Around line 235 add the following Code before
Code:

// ###################### Start Modify #######################
if ($action=="modify") {

Code:

// ###################### Start copyset #######################
if ($action=="copyset") {
        $oldset=$DB_site->query_first("SELECT * from templateset where templatesetid=$templateset");
        $DB_site->query("INSERT INTO templateset (templatesetid,title) VALUES (NULL,'Copy of ".$oldset[title]."')");
        $newset=$DB_site->insert_id();
        $sets=$DB_site->query("SELECT * from template where templatesetid=$templateset and title != 'options'");
        while($set=$DB_site->fetch_array($sets)){
                $DB_site->query("INSERT INTO template (templateid,templatesetid,title,template) VALUES (NULL,$newset,'".addslashes($set[title])."','".addslashes($set[template])."')");
        }
       
        echo "<p>copied!</p>";
       
        $action="modify";
}

In action modify around line 357 add

Code:

makelinkcode("copy","template.php?s=$session[sessionhash]&action=copyset&templateset=$templateset[templatesetid]").
between

Code:

makelinkcode("collapse groups","template.php?s=$session[sessionhash]&action=modify&expandset=$templateset[templatesetid]").
"<ul>\n";


Mas*Mind 04-24-2001 08:02 PM

Nice one! Was planning on making this one myself, but won't bother anymore ;)

Another extra cp-feature I had in mind was 'add template to all template sets' which will add your new template to all sets in one click

And I'm working on a template compare utitility which will check two the same template of two different template sets against eachother and lists the differences of the $var variables.

But first I've to release the vbextern hack :D

conan 04-24-2001 11:25 PM

Thanks man that's a great hack, would this work for RC2?

Hotte 04-25-2001 04:04 AM

Quote:

Originally posted by conan
Thanks man that's a great hack, would this work for RC2?
Don?t know
But the chance, that it does, looks great. Don?t think, this part of the skript has changed.

SteveK 04-29-2001 07:25 PM

Yes, this works in RC2. It will also work if you have Kier's alternate template admin hack installed. For this, simply add the code in step 2 of this mod to the ktemplate.php file instead - around line 140 in between:

PHP Code:

    makelinkcode("add new template","template.php?s=$session[sessionhash]&action=add&templatesetid=$templateset[templatesetid]"). 

and

PHP Code:

"<ul>\n"


Remi 05-11-2001 08:06 PM

That is not working in RC3

Any help SteveK :o

Thanks :rolleyes:

SteveK 05-11-2001 11:49 PM

I'll test once I update to RC3 and let you know what I find out.

SteveK 05-13-2001 10:19 PM

I didn't have any problem. You didn't, by chance, change:
PHP Code:

if ($action=="copyset") { 

to:
PHP Code:

if ($HTTP_POST_VARS['action']=="copyset") { 

did you? If so, try changing it back.

Remi 05-13-2001 10:49 PM

Thanks SteveK

It is working now ;)

wajones 05-14-2001 12:35 PM

Hotte or whom ever likes a challenge...

This is a very useful hack for me, love it... Now :D would you be so kind as to create another. Enabling one to make a copy of individual templates. Like a drop down box that would list the template set's then a copy to button or what ever it takes. Sort of like the drop down that move's the template to another set.


All times are GMT. The time now is 05:24 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.02456 seconds
  • Memory Usage 1,744KB
  • 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
  • (4)bbcode_code_printable
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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