![]() |
This is far from being a hack, so I figured I should post it here.
Probably be moved though... :) Anyway, this adds an option to the Edit Template page for returning to the same page or not. If you select yes, then the template will be saved and you will be sent back to the editing page. If you select no (default), then you will be sent to the main template list. I wanted this cuss I sometimes I just edit a template over and over and over again, and loading the list again is quite a pain you-know-where. ;) Hopefully others will also find this helpful. All changes are done to template.php (admin folder)! Find this code: PHP Code:
and right above add this: PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
If you want the default selection to be yes (not recommended - for obvious reasons), change the 0 to 1: Code:
makeyesnocode("Return to this page?","return",0); Please note that this is only and only for edited template. For original templates the option will not show up, because well, it's bit more complex. :p I added a screen shot if you still don't get this. ;) |
i like this one :D
|
Me too. :D Good one!
|
Again another great hack by FireFly :D.
|
Veeery helpful and -although never spoken out ;)- long awaited :D
Pleeeease make it a standard feature, vb folks :) Thanks FireHacker :p -Tom |
Very nice, Firefly! Thank you. :D
|
Very helpful, thanks bunches!
:D |
Heh, didn't think people will really need/like this. :)
Let's have a vote, do you want support for original templates? I think it's useless, cuss if you're gonna be editing a template a lot of times it will only be original when you first edit it. |
Really don't need that support myself. :)
This is great, it's saving me from carpal tunnel! |
i did everything right and selected Yes but it wont return to the same page.
|
i did all as u wrote and didn't work...
when i edited a template i checked "yes" and nothing new hpanned...it moved me to the main templates page... |
Did you add what I said in this block?
PHP Code:
|
Firefly, does this work in 2.2.0? I had it installed in 2.0.3. I've tried adding it twice to the new version. I'm not getting anything. I'm probably just doing something wrong. Please tell me it works so I can send myself to the dumbass room. :)
|
Yup, works great. :)
|
Thanks for this nice & neat hack FireFly ;)
|
I so needed this. lol
|
Quote:
|
This is what mine looks like:
// ###################### Start do update ####################### if ($HTTP_POST_VARS['action']=="doupdate") { So, I cannot move this block... ? |
Why not?
That's exactly what you should have. |
This is what the hack says:
// ###################### Start do update ####################### if ($HTTP_POST_VARS['action']=="doupdate") { // a few lines of code here } ------------------------------------------------- This is mine: // ###################### Start do update ####################### if ($HTTP_POST_VARS['action']=="doupdate") { $DB_site->query("UPDATE template SET templatesetid=$templatesetid,title='".addslashes(" $title")."',template='".addsla shes("$template")."' WHERE templateid=$templateid"); echo "<p>Done!</p>"; if ($return) { $action="edit"; } else { $action="modify"; $expandset=$templatesetid; } } ---------------------------------------------------------- This is correct? |
By this:
Code:
// a few lines of code here So yes, that's correct. |
Firefly,
in 2.2, this code: PHP Code:
the second place is the one you want. Amy |
Working great on v2.2.0 !
Thanks! |
Thanks Amy, I edited the first post (I did it earlier but didn't have the time to reply, sorry). :)
|
love this little hack :D
|
I keep having trouble posting whole edited .php files. I think it's my software to edit them I am using Editplus 2 but it must be adding something to the end of the document because I'll get a Parse error at the last line of the document. Like I keep getting Parse Error like line 713 with this hack. Can anyone help me?
|
Quote:
|
What settings do you use, I'm not sure what exactly it's doing but I get a parse error with any code I edit on the last line, I guess could you explain everything out a bit more. :confused: thanks again ;)
|
This is what the screen looks like, I believe that little thing after the cursor is what causes my trouble. How can I get rid of that?
https://vborg.vbsupport.ru/ |
Got everything working now, great hack as usual thanks again!
|
Quote:
|
Jezz :o lol thought I could get away without anyone asking. I guess I was doing somehting wrong with this hack and another but it must have been my own error :eek: I feel bad but I don't know what i changed if I did Textpad still doesn't work but EditPlus does so I've already installed 5 hacks with 4 more to come, then the customization begins.
My only worry now is that 2.2.0 isn't that last update someone told me it has bugs, so I dunno why I'm adding hacks unless the update is small and doesn't change a lot... If it does change to much then I give up :o |
Quote:
|
Started laughing at this post but when I looked up, I found I was one floor below FWC. Persevered through my ignorance and the third time, I apparently followed the directions and:
What A Great Hack! Thanks for another one, FireFly! :supwink: Quote:
|
Very impressed.
Thanx again old buddy. |
Nice, Chen!
Just something: when I edit twice the same template and save it with the 'return to this...' = on, I get in the body of textarea Array instead of the full template text I just saved. Just seems it looses some brakets value ... Note: new template is actually saved as 'Array', because if I exited and re-edit, this text is the only existing within body (and even into db)... :( I dupe-checked the hack just applied and seems having followed your instructions literally. Thanks a lot. Bye |
Jawelin, that's odd, I've been using this hack for 4 months already and never faced that problem! Do you mind sending me your template.php file by e-mail, so I could have a look and try it out? Thanks. :)
|
It's coming.
Thanks a lot. P.S.: I think made some mistake near 'few rows below' ... ;) |
nice :)
will be installing in a few :) |
Great little hack... Really useful.
Kept trying to make this work over and over again on my testboard without success - until I descovered I was actually editing the file on the live site... that's what you get for hacking at 3.30 in the morning... *sigh* |
All times are GMT. The time now is 04:48 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|