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)
-   -   Return to Edit Template page after saving (https://vborg.vbsupport.ru/showthread.php?t=28625)

Admin 09-21-2001 10:00 PM

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:

  makehiddencode("group""$group"); 

(second time it appears, not first time!)
and right above add this:
PHP Code:

  makeyesnocode("Return to this page?","return",0); 

Now replace this:
PHP Code:

  echo "<p>Done!</p>";
  
$action="modify";
  
$expandset=$templatesetid

with
PHP Code:

  echo "<p>Done!</p>";
  if (
$return) {
    
$action="edit";
  } else {
    
$action="modify";
    
$expandset=$templatesetid;
  } 

And last but not least move this block:
PHP Code:

// ###################### Start do update #######################
if ($HTTP_POST_VARS['action']=="doupdate") {
  
// a few lines of code here


a few lines up, namely right before this:
PHP Code:

// ###################### Start edit #######################
if ($action=="edit") { 

And that's it.
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);
That's it, hope you enjoy this. :)

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. ;)

eva2000 09-22-2001 12:02 PM

i like this one :D

Mike Gaidin 09-22-2001 12:10 PM

Me too. :D Good one!

Goldfinger 09-22-2001 12:12 PM

Again another great hack by FireFly :D.

Thomas P 09-22-2001 03:29 PM

Veeery helpful and -although never spoken out ;)- long awaited :D
Pleeeease make it a standard feature, vb folks :)
Thanks FireHacker :p
-Tom

FWC 09-22-2001 06:55 PM

Very nice, Firefly! Thank you. :D

Alien 09-23-2001 07:56 AM

Very helpful, thanks bunches!

:D

Admin 09-23-2001 09:09 AM

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.

Alien 09-23-2001 11:00 AM

Really don't need that support myself. :)

This is great, it's saving me from carpal tunnel!

holev 09-23-2001 12:43 PM

i did everything right and selected Yes but it wont return to the same page.


All times are GMT. The time now is 02:07 AM.

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.01174 seconds
  • Memory Usage 1,737KB
  • 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
  • (1)bbcode_code_printable
  • (6)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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