4images Forum & Community

4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started by: Maniac on May 28, 2005, 05:26:15 AM

Title: Testing templates
Post by: Maniac on May 28, 2005, 05:26:15 AM
Please forgive me if this has been posted elsewhere, but I cannot find it...

I have created a new template group but I want to test it before I make it live. Is there a way for me to preview the template without having to select it in the settings menu of the admin area?

I tried "index.php?template_dir=NewTemp - but that did not work.

Thanks in advance for any informaton
Title: Re: Testing templates
Post by: V@no on May 28, 2005, 06:53:29 AM
u can try do first two steps from this mod:
http://www.4homepages.de/forum/index.php?topic=6220.0

then in step 2 above:
Code: [Select]
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$user_template);insert:
Code: [Select]
if ($user_info['user_level'] >= ADMIN && isset($_GET['tpl']) && !empty($_GET['tpl']) && @is_dir(ROOT_PATH.TEMPLATE_DIR."/".$_GET['tpl']))
{
  $user_template = $_GET['tpl'];
}

Then u should be able test it by adding to the url query: tpl=templatename
like this: index.php?tpl=blah
Ah, almost forgot to say that u must be logged in as admin, or change ADMIN to GUEST or USER
Title: Re: Testing templates
Post by: Maniac on May 28, 2005, 11:54:00 PM
Thank you :)
Title: Re: Testing templates
Post by: Maniac on September 09, 2005, 01:07:00 AM
I've tried the mod and what you suggested a couple of times but keep getting an error.

You basically want me to add the second set of code below the first one, right?

so, find
Code: [Select]
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$user_template);and below it add
Code: [Select]
if ($user_info['user_level'] >= ADMIN && isset($_GET['tpl']) && !empty($_GET['tpl']) && @is_dir(ROOT_PATH.TEMPLATE_DIR."/".$_GET['tpl']))
{
  $user_template = $_GET['tpl'];
}
Title: Re: Testing templates
Post by: Maniac on September 09, 2005, 01:25:46 AM
Please disregard - I got it to work - it was exactly what I needed...

Much appreciated  :D
Title: Re: Testing templates
Post by: impss on September 13, 2005, 01:34:33 AM
when i do this i get

Notice: Undefined index: user_template in C:\CuSStom.com\www\gallery\includes\sessions.php on line 409
Title: Re: Testing templates
Post by: Xyu BAM on September 13, 2005, 03:03:16 AM
when i do this i get

Notice: Undefined index: user_template in C:\CuSStom.com\www\gallery\includes\sessions.php on line 409

pay attention to the instructions ;)

u can try do first two steps from this mod:
http://www.4homepages.de/forum/index.php?topic=6220.0
Title: Re: Testing templates
Post by: impss on September 13, 2005, 03:15:33 AM
For your information, I did used the instructions as written.
thankyou for ASSuming other wise  :evil: :roll:

could it be that i have 1.7.1 :?:
Title: Re: Testing templates
Post by: Maniac on September 13, 2005, 05:01:16 AM
I have 1.71 and it worked for me.

Are you logged in as admin when trying. I know I kept trying it out and it wouldn;t work at first - turned out to be that.

One thing that I do before I paste the code from the forums on my files is make sure there are no "strange" characters sneaking by - that has often given me big headaches before.

I use BBEdit and basically select "view invisible elements" and often find thise strange characters... A simple search and replace fixes it.

Hope this helps. Also, could it be that you have another MOD installed in your pages that is affecting this one?
Title: Re: Testing templates
Post by: Xyu BAM on September 13, 2005, 08:32:48 AM
For your information, I did used the instructions as written.
thankyou for ASSuming other wise  :evil: :roll:

could it be that i have 1.7.1 :?:
if you would followed EXACTLY the instructions, you would not get such error, period. (make sure you didnt mistaken "before" with "after" in step 2)
Title: Re: Testing templates
Post by: mantra on January 22, 2009, 05:13:09 PM
u can try do first two steps from this mod:
http://www.4homepages.de/forum/index.php?topic=6220.0

then in step 2 above:
Code: [Select]
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$user_template);insert:
Code: [Select]
if ($user_info['user_level'] >= ADMIN && isset($_GET['tpl']) && !empty($_GET['tpl']) && @is_dir(ROOT_PATH.TEMPLATE_DIR."/".$_GET['tpl']))

{
  $user_template = $_GET['tpl'];
}

Then u should be able test it by adding to the url query: tpl=templatename
like this: index.php?tpl=blah
Ah, almost forgot to say that u must be logged in as admin, or change ADMIN to GUEST or USER


Hi V@no .. i try this mood in 4images v 1.6.7 [ with change ADMIN to GUEST.... and my question is ..
how to keep the session with the current template they chose ..
cos after they move to another page ... the 4images get the default template again [ from the setting database ] ?
Title: Re: Testing templates
Post by: KurtW on January 22, 2009, 05:25:04 PM
Hi,

i use this small mod to change between different templates in my testgallery
between the sessiontime you can surf on the page in the different style...

http://www.4homepages.de/forum/index.php?topic=1281.msg5463#msg5463
=> only code for global.php is needed... links like index.php?t=new for templatefolder: new


Kurt
Title: Re: Testing templates
Post by: mantra on January 23, 2009, 03:42:00 AM
Hi,

i use this small mod to change between different templates in my testgallery
between the sessiontime you can surf on the page in the different style...

http://www.4homepages.de/forum/index.php?topic=1281.msg5463#msg5463
=> only code for global.php is needed... links like index.php?t=new for templatefolder: new


Kurt

Doesn't work Kurt with 4images 1.7.6
Title: Re: Testing templates
Post by: mantra on January 23, 2009, 06:17:48 AM
Ops sorry .. i'm wrong this mood can work only if register global is on ..in php