Results 1 to 12 of 12

Thread: [RELEASE vB2.0RC1] Copy Templateset

Threaded View

  1. #1
    Member Hotte has disabled reputation
    Join Date
    Apr 2000
    Location
    Germany
    Age
    32
    Posts
    93

    [RELEASE vB2.0RC1] Copy Templateset

    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";
     

  2. #2
    Senior Member Mas*Mind has disabled reputation
    Join Date
    Jun 2000
    Location
    Amsterdam, The Netherlands
    Age
    30
    Posts
    1,450
    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
    Last edited by Mas*Mind; Tue 24th Apr '01 at 6:04pm.
     

  3. #3
    Senior Member conan is on a distinguished road
    Join Date
    Sep 2000
    Posts
    389
    Thanks man that's a great hack, would this work for RC2?
     

  4. #4
    Member Hotte has disabled reputation
    Join Date
    Apr 2000
    Location
    Germany
    Age
    32
    Posts
    93
    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.
     

  5. #5
    Member SteveK is on a distinguished road
    Join Date
    Sep 2000
    Location
    Seattle
    Posts
    31
    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"
     

  6. #6
    Senior Member Remi is on a distinguished road
    Join Date
    May 2001
    Posts
    215
    That is not working in RC3

    Any help SteveK

    Thanks
     

  7. #7
    Member SteveK is on a distinguished road
    Join Date
    Sep 2000
    Location
    Seattle
    Posts
    31
    I'll test once I update to RC3 and let you know what I find out.
     

  8. #8
    Member SteveK is on a distinguished road
    Join Date
    Sep 2000
    Location
    Seattle
    Posts
    31
    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.
     

  9. #9
    Senior Member Remi is on a distinguished road
    Join Date
    May 2001
    Posts
    215
    Thanks SteveK

    It is working now
     

  10. #10
    Senior Member wajones has disabled reputation wajones's Avatar
    Join Date
    Jul 2000
    Location
    Vista, California
    Age
    65
    Posts
    453
    Hotte or whom ever likes a challenge...

    This is a very useful hack for me, love it... Now 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.
     

  11. #11
    Senior Member JoshFink is on a distinguished road JoshFink's Avatar
    Join Date
    Feb 2001
    Posts
    292
    WaJones, just saw this good idea.. Any takers

    Thanks,

    Josh
     

  12. #12
    Senior Member Pie'oh'pah is on a distinguished road Pie'oh'pah's Avatar
    Join Date
    Jul 2001
    Location
    Germany
    Age
    39
    Posts
    157

    up

    Thanx a bunch for this. i was lookin 4 it with the search function here and sooooo glad i found it

    -Pie
    I want to express my deepest compassion to all who have lost their loved ones in the latest terroristic attack

    >> Nuke Bin Laden yourself here <<

    Webmaster NÐE | Webmaster UA Forums | ArtworX ECL | Admin DiGL | Hosted at RWH | Portfolio

    My Stylez
    Red Darkness | Velvet Night | Dreadful Cyan
    Goodiez
    Table bgcolor change on hover | Onlinestatus modifications | German Templates

    *******************************\\\ ///
    ********************************(ô ô)
    -------------------ooO-(_)-Ooo-----------------
     

Similar Threads

  1. Need a copy of VB2.2.0
    By buro9 in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 3
    Last Post: Sat 21st Jun '03, 7:49pm
  2. Copy templateset
    By lordofgun in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 4
    Last Post: Tue 4th Feb '03, 7:02pm
  3. Copy and Past not possible for IE users in VB2.0 final?
    By Black Tiger in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 14
    Last Post: Sat 30th Mar '02, 1:14pm
  4. [Release vb2.0] Receive copy of e-mail you send via the BB
    By bira in forum Releases: Version 2.x
    Replies: 1
    Last Post: Sun 6th May '01, 7:11pm
  5. make a copy of a complet templateset...
    By style-guide! in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 2
    Last Post: Sat 10th Mar '01, 11:57am

Bookmarks

Posting Permissions

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts