PDA

View Full Version : Easy Template Update


Andreas
12-06-2005, 10:00 PM
Easy Template Update

Description
This Hack helps you to update your templates, by allowing you to semi-automatically merge changes into your templates.

Details
1 Product XML (5 Phrases)

This Hack is unsupported! All support requests except proved Bugs will be ignored.

D|ver
12-07-2005, 12:18 PM
sounds great, thanks :)

michaelbenson
12-07-2005, 12:22 PM
So, this hack allows templates to merge into one another?
Sorry i dont quite understand the description.

AshokForums.com
12-07-2005, 01:43 PM
Nice!! Thanks a lot.. I hope this solves my problem..

Jenta
12-07-2005, 02:12 PM
Since your a developer now, I hope to see this as standard soon. ;)
I always thought to myself while using comparision utilities that vb should mimic the merging function. Great to see you pulled it off. My only dissappointment is that you would mainly use this when upgrading and that's when your php files are stock...no fault of yours ofcourse.
Good job!

Andreas
12-07-2005, 02:31 PM
I could have done it as a separate file, but that would have required duplicated a bunch of code.

Princeton
12-07-2005, 02:35 PM
great idea!

thank you

SuperFly
12-07-2005, 03:27 PM
When i click save template it takes me to template.php with bg of admincp but blank.

Mastar
12-07-2005, 04:09 PM
I'm glad I read this before I actually started cause I am about to update them. Hope this makes it easier because I have 49 templates to update.

1 Question, how do I use it?

Guest190829
12-07-2005, 04:10 PM
I will definitely try this out, I still have 2 out of 5 upgrades to do...and this seems like the answer to all that tedious work. :)

Mastar
12-07-2005, 04:27 PM
will I have to edit my templates for the hacks that are already installed on my forum?

do I click in the merge boxes to update?

:Judge:
12-07-2005, 09:35 PM
Installed but I do not see any change? What exactly should I be looking for?

I can see that this is unsupported, however, if I install it and have no obvious change I have to ask. Could anyone maybe shed some light on this for me please.

ImportPassion
12-08-2005, 01:43 AM
ok, i was starting to install this when I noticed the last step.

the last step would end up looking like this...


// ################################################## ###########################
// insert queries and cache rebuilt for template insertion
if ($_POST['do'] == 'inserttemplate')
{

if ($_POST['do'] == 'merge')
{ ...more code here ...


how can "do" be both of those at the same time? Or am I reading it wrong?

I believe it should say "ABOVE" not "BELOW"
D

DS MrSinister
12-08-2005, 01:48 AM
sweet thanks m8!

ImportPassion
12-08-2005, 01:53 AM
Installed but I do not see any change? What exactly should I be looking for?

I can see that this is unsupported, however, if I install it and have no obvious change I have to ask. Could anyone maybe shed some light on this for me please.

I agree. Are we supposed to upload the new changed style and compare with our current style templates? :ermm:

ImportPassion
12-08-2005, 02:19 AM
Think i figured it out...

go to

Find Updated Templates > View History and compare the versions

C_P
12-08-2005, 02:31 AM
Think i figured it out...

go to

Find Updated Templates > View History and compare the versions
I did this, I selected merge, each button disapeared after selecting. I then selected to save merged and it then went to a blank screen. I then went back and the same navbar in the style I was merging (because it still shows the same amount of styles to be reverted) was still there and showed I could merge again and again and again....
I am wondering if maybe after the merge, we need to copy the code, then revert the stlyle section then paste the merged code over the reverted section of style?

ImportPassion
12-08-2005, 02:37 AM
I did this, I selected merge, each button disapeared after selecting. I then selected to save merged and it then went to a blank screen. I then went back and the same navbar in the style I was merging (because it still shows the same amount of styles to be reverted) was still there and showed I could merge again and again and again....
I am wondering if maybe after the merge, we need to copy the code, then revert the stlyle section then paste the merged code over the reverted section of style?

u need to do the fix in my post here https://vborg.vbsupport.ru/showpost.php?p=843356&postcount=13

Mastar
12-08-2005, 03:16 AM
ok, i was starting to install this when I noticed the last step.

the last step would end up looking like this...


// ################################################## ###########################
// insert queries and cache rebuilt for template insertion
if ($_POST['do'] == 'inserttemplate')
{

if ($_POST['do'] == 'merge')
{ ...more code here ...


how can "do" be both of those at the same time? Or am I reading it wrong?

I believe it should say "ABOVE" not "BELOW"
D

1.Can you show how it suppose to look like? 7thgenCivic.

2. And will I have to edit my templates for the hacks to work or the merge will instert the coding for the hacks? I got 49 templates that it says to be updated.

ImportPassion
12-08-2005, 03:22 AM
I don't want to post too much code, but it should say this..




FIND
------------------------------------------------------------
// ################################################## ###########################
// insert queries and cache rebuilt for template insertion
if ($_POST['do'] == 'inserttemplate')
{
------------------------------------------------------------

ABOVE that ADD
------------------------------------------------------------
if ($_POST['do'] == 'merge')
{
--snip--

C_P
12-08-2005, 01:19 PM
u need to do the fix in my post here https://vborg.vbsupport.ru/showpost.php?p=843356&postcount=13
Thank you for reply! I did your edit but after selecting all the merge buttons and saving merge, it takes me to next page stating:
Please Complete All Required Fields
I have confirmed ALL buttons were checked so what am I missing?
Ooops wait... I may have missed something...

*Update, yup, I only pasted partial code you put rather than the entire code Andrea did and it works!!!!
Thank you!

C_P
12-08-2005, 01:42 PM
Not sure why, but it looks like this is almost acting like a revert as I am losing template modifications that were done like thank you posts mod after doing the merge...

Mastar
12-08-2005, 02:17 PM
Thank you for reply! I did your edit but after selecting all the merge buttons and saving merge, it takes me to next page stating:
Please Complete All Required Fields
I have confirmed ALL buttons were checked so what am I missing?
Ooops wait... I may have missed something...

*Update, yup, I only pasted partial code you put rather than the entire code Andrea did and it works!!!!
Thank you!

Same thing here!

Mastar
12-08-2005, 02:18 PM
Not sure why, but it looks like this is almost acting like a revert as I am losing template modifications that were done like thank you posts mod after doing the merge...

That is exactly what I don't want happen. I got too many hack on my board.

Mastar
12-08-2005, 06:05 PM
Are you checking the checkboxes to the right of the comparison/history page, and making sure the "new" templates looks right before you save merged?

I've used this now, and it's brilliant.

:D

Did you loose any of your hacks or had to edit the hacks back in your templates?

DID YOU DO THE EDIT ABOVE?

Mastar
12-08-2005, 06:08 PM
Nope, I think you just have to be careful what you do and don't decide to "merge".

So how did you did your's?

C_P
12-08-2005, 06:13 PM
Are you checking the checkboxes to the right of the comparison/history page, and making sure the "new" templates looks right before you save merged?

I've used this now, and it's brilliant.

:D I did but I am not a coder to know what should or should not be merged. I was "assuming" the merge process would merge your sections of old code to the new so there was no need to re-add this code to new section of styles changed... obviously I was mistaken and will not use this now. Oh well.

Mastar
12-08-2005, 06:26 PM
I found where I went wrong,

I placed:
$_POST['do'] = 'merge';
}

above this:

// ################################################## ###########################
// generate a diff between two templates (current or historical versions)
if ($_REQUEST['do'] == 'viewversion')

Instead of this:
// ################################################## ###########################
// generate a diff between two templates (current or historical versions)
if ($_POST['do'] == 'docompare')
{

So now it looks like this:

if ($_POST['do'] == 'docompare' AND !empty($_POST['domerge']))
{
$_POST['do'] = 'merge';
}
// ################################################## ###########################
// generate a diff between two templates (current or historical versions)
if ($_POST['do'] == 'docompare')
{
$vbulletin->input->clean_array_gpc('p', array(
'left_template' => TYPE_STR,
'right_template' => TYPE_STR,
'wrap' => TYPE_BOOL
));



So it works!

Can someone verify what I wrote?

C_P
12-08-2005, 06:35 PM
and with the template merging I had to switch the radio buttons from my tempate being 'new to 'old' and then merge.Now, that is an interesting statement. What you are saying is you should change the default new old option when you look at history making 3.5.2 the new and (in my case) 3.5.1 the old?

Mastar
12-09-2005, 08:09 AM
Now, that is an interesting statement. What you are saying is you should change the default new old option when you look at history making 3.5.2 the new and (in my case) 3.5.1 the old?

Sorry don't change the radio buttons and basically merge the peach and yellow codes and leave the green.

It works and its easy!

k40tic
12-09-2005, 02:02 PM
This worked great for me. No trouble at all and the skin updates were super fast.

divided_by_fear
12-10-2005, 06:52 AM
i like the mod dont get me wrong but what would be nice to see is a check box next to each difference it found this way you can select which merges you want to install and which you dont... this way you can test each hack out as you merge it and so on... and it would also i think be more user friendly that way

ImportPassion
12-10-2005, 12:55 PM
i like the mod dont get me wrong but what would be nice to see is a check box next to each difference it found


ummm....that's exactly what it does.

klaush
12-10-2005, 01:48 PM
Thanks, a helpful tool!

divided_by_fear
12-10-2005, 02:07 PM
opps i posted it under the wrong one... cause there is already a hack like this https://vborg.vbsupport.ru/showthread.php?t=91038 which has alot more options just missing that

Xplorer4x4
12-11-2005, 01:19 AM
opps i posted it under the wrong one... cause there is already a hack like this https://vborg.vbsupport.ru/showthread.php?t=91038 which has alot more options just missing that

Actually its nothing like this. That bassicly just coppies all the indidual templates of one style to every or select styles. Using that means you would not be adding the apropriate template changes form the update.

This comapres the old template with the new template and merges the non-standard lines of code and html to the new templates that have the up date tmeplate fixes. ;)

divided_by_fear
12-11-2005, 05:35 AM
nah you can compare the old to the new it just dont have the check box next to the changes... it really has alot more featurtes in that one... but i aint saying which is better im just saying i put it in the wrong spot

MrNase
12-12-2005, 12:19 PM
I made the update from vB3.5.1 to 3.5.2 and I wanted to use this modification to ease my work a bit..

I have the old one to the left and the new template to the right and I want to copy the changes from left to right but the new template (updated to have my old changes) is still listed as 'old' :(

waza
12-12-2005, 02:21 PM
Andreas, thx for this wonderful hack, it's not big, but it spares me big work!

@mrnase: You should be able to choose old/new template...

Mastar
12-12-2005, 03:00 PM
I made the update from vB3.5.1 to 3.5.2 and I wanted to use this modification to ease my work a bit..

I have the old one to the left and the new template to the right and I want to copy the changes from left to right but the new template (updated to have my old changes) is still listed as 'old' :(

Don't merge everything, not the ones in green!

jj
12-12-2005, 04:23 PM
Thx for this... saved me some work and worked without errors.

FROGGYJ
01-09-2006, 09:03 PM
Question for anyone that can help as I know this isn't supported. Great mod btw. Anyways I only had a few templates needed updating so good testing...I selected the old one and the new one and did the compare and then merged the changes and saved. Now there were 7 in total and I did every one. Now it still shows 7 template changes are required....they look something like this now.

"MEMBERINFO
Default Template Updated in 3.5.1 by Template Merge System
Your Custom Template Last Edited in 3.5.0 by Paypal Donations"

However if you compare them, there is nothing different. Is this normal?

Antivirus
01-18-2006, 05:54 PM
Has anyone used this when upgrading to 3.5.3 yet?

Billspaintball
01-26-2006, 04:52 AM
Just used it (sorta) in my upgrade to 3.5.3

Great hack.......
In Theory.....

A few instructions to save any confusion would have been nice. :disappointed:

nitro
03-03-2006, 06:07 PM
Seems to work ok in 3.5.4. :)

What I dont get as it seems backardws imo is why Jelsoft have the new version templates are listed as the old and the and the old customised templates are listed as the new ? And if your used to reversing the radio buttons prior to comparing which would seem to be a normal way to veiw the compare window this mod will apply changes but doesnt remove it from the templates require attention listing.

I also think this should be added as standard to vb its a great addon. ;)

Edit:

Actually it does not work properly, if you leave the old/new radio buttons as per default it will just delete your custom code not merge it, if you switch the radio buttons to what would seem to be normal (new = latest default template version/ old = old template version with custom code) it will merge the custom code with the new template but it doesnt update the templates status meaning it still shows as requiring reverting. I dont think its the hack that is the issue but how Jelsoft is labeling whats old whats new

Edit 2:

And hopefully the final edit.

Dont reverse the radio buttons you may well stiff your Default style and perhaps the master style, fortunately easy to fix. ;)

Leave radio buttons as is:
Treat the one saying new as your new custom target

Green blocks will mostly be on the right and often contain the custom code you want to keep, checking these will drop that code into one of the magical bit bins of nowhere :D

Your really interested in the red blocks on the left and yellow blocks that span both sides. Check wether the red block is new code needed before checking those items, yellow will need a closer look to ensure your not going to kill a bit of custom code with an updated line, if its not, fine check it else you will need to edit this block of code manually. Save your merger and cross your fingers. ;)

I do wonder now wether its should be left as is and not dropped in to vb as standard, could cause considerable supoort posts for newcomers who use it. ;)

FROGGYJ
03-15-2006, 12:35 AM
weird ever since upgrading to 3.5.4 I don't have the merge column anymore. I even reinstalled the product and allowed overwrite......nadda. I can view the changes no problem, but there is no merge function. Anyone else have this problem? I'm going from 3.5.1 to 3.5.4 if that makes a difference.

k40tic
03-16-2006, 04:28 PM
weird ever since upgrading to 3.5.4 I don't have the merge column anymore. I even reinstalled the product and allowed overwrite......nadda. I can view the changes no problem, but there is no merge function. Anyone else have this problem? I'm going from 3.5.1 to 3.5.4 if that makes a difference.

Mine done this also because I uploaded all the new files and overwrote template.php. Once I applied the changes to this file again then everything worked for me.

Antivirus
03-21-2006, 08:11 PM
I would ddo the pee pee dance if this were fully supported feature in a future release of vb.... god i hate updating my templates when upgrading.

I had this installed for the last 2-3 upgrades, however i found it rather complicated to utilize and it just seems that it is easier to revert the templates and do the template edits manually (for me).

(Antivirus wishes that Andreas brings this to dev team in next dev meeting and it becomes implemented in future versions...)

:)

FROGGYJ
03-21-2006, 10:03 PM
Mine done this also because I uploaded all the new files and overwrote template.php. Once I applied the changes to this file again then everything worked for me.

lol I guess if I re-read the instructions I might get a clue, sorry.

So before I go ahead....leave the radio buttons alone? Even though it says the current default is 3.5.3 (old) and the current version is 3.5.1 (new). Ignore that even though it seems backwards?

FROGGYJ
03-25-2006, 04:51 PM
bump anyone? just want to make sure I merged them properly.

FROGGYJ
03-30-2006, 11:32 PM
bump

Smiry Kin's
03-31-2006, 03:42 AM
very easy to install. yet to try

Yorixz
06-24-2006, 07:45 PM
It's a shame I found this after I finished upgrading all my templates to vB3.6 (expecting it'd work there as well).

Great addon though!

FROGGYJ
06-24-2006, 08:24 PM
ya but I wish someone would confirm the procedure before I try it and mess everything up.

nitro
07-21-2006, 02:04 AM
I would like to know if this is working in in 3.6 or is there changes needed ?

Stoebi
01-15-2009, 06:54 PM
Hi Andreas,

any chance for an update to work with 3.8.x, please?

Regards,

Stoebi

Andreas
01-17-2009, 04:53 PM
Nah, I ditched that since I use TMS :-)