Enhancement -> copy templates

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
erich_k4
Posts: 160
Joined: Thu 31. Mar 2005, 10:29
Location: Austria

Enhancement -> copy templates

Post by erich_k4 »

[IMPORTEND]

"copy templates" now is included in the latest CVS-Release...

So you don't have to install it manually if you install CVS-Version 1.2.6 -14.12.2005 and up...


----------------------------------------------------------


Hello phpwcms-friends!

Here is my little contribution to this great cms and forum:

With this enhancement it's possible to copy templates in the Backend in a very simple way.

Image

Image

To install this enhancement download

http://www.kmedv.at/phpwcms/admin.templates.tmpl.zip

unzip it and replace the original admin.templates.tmpl.php with the new one.
The admin.templates.tmpl.php is located in "include\inc_tmpl".

Only one thing to change left -> the language files:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#

include\inc_lang\backend\en\lang.inc.php

#
#-----[ FIND ]------------------------------------------
#

// admin.templates.tmpl.php
$BL['be_admin_tmpl_title']              = 'frontend setup: templates';
$BL['be_admin_tmpl_default']            = 'default';
$BL['be_admin_tmpl_add']                = 'add template';
$BL['be_admin_tmpl_edit']               = 'edit template';
$BL['be_admin_tmpl_new']                = 'create new';
$BL['be_admin_tmpl_css']                = 'css file';
$BL['be_admin_tmpl_head']               = 'html head';
$BL['be_admin_tmpl_js']                 = 'js onload';
$BL['be_admin_tmpl_error']              = 'error';
$BL['be_admin_tmpl_button']             = 'save template';
$BL['be_admin_tmpl_name']               = 'name';

#
#-----[ ADD ]------
#

$BL['be_admin_tmpl_copy']               = 'copy template'; 


Repeat the above steps for each preferred language.

Tested with version 1.2.1-DEV, should also work with the newer versions.

Thats all....

Erich
Last edited by erich_k4 on Fri 6. Jan 2006, 12:56, edited 2 times in total.
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

Hi Erich,

just tested it, very nice! Saves a lot of time (instead of copy paste the templates manually...). Works ok in 1.2.1 and 1.2.2 (tested both).
Only thing; when you copy and create the new template it seems you have to set the new template as default or it doesn't create it (but that is not really a "bug" because just by unclicking it after it's ok --> so still does the job)

Really nice little enhancement. Great hack!
Should warn brans to update list of MOD/hacks.
OG, this could be added to next dev version, don't you think?

Cheers
Last edited by Kosse on Thu 9. Jun 2005, 11:25, edited 1 time in total.
brans

Post by brans »

hi erich_k4 would you mind adding your hack to --...--/index.php/board,1.0.html ?

Please keep inline with the template that can be found under
--...--/index.php/topic,4.0.html
User avatar
dbaron
Posts: 74
Joined: Tue 25. Jan 2005, 11:53
Location: France

Post by dbaron »

Hai all

Should have the same for "page layout", no?
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

dbaron wrote:Hai all

Should have the same for "page layout", no?
why?
http://www.studmed.dk Portal for doctors and medical students in Denmark
User avatar
dbaron
Posts: 74
Joined: Tue 25. Jan 2005, 11:53
Location: France

Post by dbaron »

Because I have several page layout
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

dbaron wrote:Because I have several page layout
well you can reuse the same page layout...
http://www.studmed.dk Portal for doctors and medical students in Denmark
User avatar
dbaron
Posts: 74
Joined: Tue 25. Jan 2005, 11:53
Location: France

Post by dbaron »

Right :?
trip
Posts: 657
Joined: Tue 17. Feb 2004, 09:56
Location: Cape Town, South Africa
Contact:

Post by trip »

coool...looks very nice

TriP
Drakaina
Posts: 9
Joined: Thu 5. Jan 2006, 13:58

well very nice but

Post by Drakaina »

Hello board,
I tried the Hack as I was tired of manualy copying but when i try to validate the new template get the following error message
"Fatal error: Call to undefined function: update_cache() in /home/ariockco/public_html/drakainasite/2006/include/inc_tmpl/admin.templates.tmpl.php on line 145"
as i am a beginner to php I have no clue what they mean by undefined fonction :(
now i cannot create anymore templates at all
Can anybody help me make this wonderfull CMs work again?
Thanks in advance
Drakaina
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

Hi, this feature is integrated in dev release 1.2.6
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Drakaina
Posts: 9
Joined: Thu 5. Jan 2006, 13:58

Post by Drakaina »

Hi Cyrano
thanks for the info : i am actually using version 1.1 -RC4 (this is the version offered to download by my webhost)
I guess I need to update version.. But does that mean I wll lose the website stucture I've created so far?
jscholtysik

Post by jscholtysik »

Hi Drakaina,

this enhancement is already included in the latest CVS-Release... :-)

So you don't have to install it manually if you install CVS-Version 1.2.6 -14.12.2005... ;-)


Joachim
Drakaina
Posts: 9
Joined: Thu 5. Jan 2006, 13:58

Post by Drakaina »

Hello Joachim and thanks for your help.
I am a little shy of updating a new version since last time I tried to update another database on with my host (integrahost) it messed up everything and they where unable to help me fix it..
What I need to know is (after downloading the new version to my hard drive and then uploading it with ftp) how do i update the database (all i have done to the website so far is site structure (page layout, templates..) which I do not want to lose when updating new version.. I am really having a hard time understanding how mysql base works therefor I am scared of losing everything when updating to new version :(
Or how do I install the lates CVS release ?
Thank you for your time
Drakaina
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

Hi

for Databes Upgrade use the upgrade.php Script in ../setup/ and do all the SQL-Upgrades Step-by-Step form the Version you had before. Also do the three Upgrades on Top of the Upgrade-Site ( Filestorage, Article-Content etc.)
Before uploading the new Version you should make a Backup of all Files and the Database.
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
Post Reply