[SOLVED] Warning: Template "NAME" does not exist!

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-17-2008, 06:23 PM
cmstheme's Avatar
Donor/Coder
Pligg Version: 9.9
Pligg Template: Squaretle
 
Join Date: Jan 2007
Location: Philippines
Posts: 531
Pligg Beta 9.9.5 cannot switch template using settemplate.php. When you type in your browser: http://domain.com/settemplate.php?template=yget or whatever template you will used it will show an error:
Quote:
Warning: Template "TEMPLATE_NAME" does not exist!
even though the template really exists in the /templates folder.
Reply With Quote
  #2 (permalink)  
Old 08-17-2008, 07:52 PM
chuckroast's Avatar
Pligg Developer/Coder/Designer
Pligg Version: SVN
Pligg Template: Social Pro Kit
 
Join Date: Jun 2006
Posts: 5,448
Hi cmstheme

Are you sure that the template_details.php is correct? I'm using 9.9.5 and have no problem switching in between templates.
Reply With Quote
  #3 (permalink)  
Old 08-17-2008, 09:36 PM
cmstheme's Avatar
Donor/Coder
Pligg Version: 9.9
Pligg Template: Squaretle
 
Join Date: Jan 2007
Location: Philippines
Posts: 531
My default template is a custom one. Then when I switched to "yget" I got the error. Here's the unmodified template_details.php of yget:
PHP Code:
<?php
    $template_info
['name'] = 'yGet'// do not use the _ character. use - instead
    
$template_info['desc'] = 'yGet';
    
$template_info['author'] = 'Pligg Team';
    
$template_info['support'] = 'http://forums.pligg.com/yget/';
    
$template_info['version'] = 0.995;
    
$template_info['designed_for_pligg_version'] = '9.9.5';
?>
Here's also another thread that encountered the error: http://forums.pligg.com/customizatio...l-shows.html#3 - please look at number 4 of his reply.

My Pligg 9.9.5 is a fresh install.
Reply With Quote
  #4 (permalink)  
Old 08-17-2008, 09:46 PM
chuckroast's Avatar
Pligg Developer/Coder/Designer
Pligg Version: SVN
Pligg Template: Social Pro Kit
 
Join Date: Jun 2006
Posts: 5,448
I still can't recreate this.. So can you give us some more details so I can see if I can't recreate this and see whats going on. Are you using the template management module to switch, or are you switching by the standard admin>config> template> method? Are you able to switch by using the settemplate.php?template=templatename method?

Thanks
Reply With Quote
  #5 (permalink)  
Old 08-17-2008, 09:48 PM
cmstheme's Avatar
Donor/Coder
Pligg Version: 9.9
Pligg Template: Squaretle
 
Join Date: Jan 2007
Location: Philippines
Posts: 531
The error is when you change template by cookie only: http://domain.com/settemplate.php?template=yget

I can switch template and there's no problem if I use admin>config> template> method

I have never tried template management module.
Reply With Quote
  #6 (permalink)  
Old 08-17-2008, 09:49 PM
cmstheme's Avatar
Donor/Coder
Pligg Version: 9.9
Pligg Template: Squaretle
 
Join Date: Jan 2007
Location: Philippines
Posts: 531
I also copied the old settempalte.php file from 9.9.0 and still the problem occured.
Reply With Quote
  #7 (permalink)  
Old 08-17-2008, 09:56 PM
chuckroast's Avatar
Pligg Developer/Coder/Designer
Pligg Version: SVN
Pligg Template: Social Pro Kit
 
Join Date: Jun 2006
Posts: 5,448
It sounds like something could be corrupting the cookie.
Try this and see if you get a different result.

Go to line 37 of settemplate.php and look for

Code:
$main_smarty->assign('message', 'Warning: Template <b>"' . sanitize($_GET['template'],1) . '"</b> does not exist!');
Replace with
Code:
$main_smarty->assign('message', 'Warning: Template <b>"' . $_GET['template'] . '"</b> does not exist!');
Reply With Quote
  #8 (permalink)  
Old 08-17-2008, 10:07 PM
cmstheme's Avatar
Donor/Coder
Pligg Version: 9.9
Pligg Template: Squaretle
 
Join Date: Jan 2007
Location: Philippines
Posts: 531
In 9.9.0 and 9.9.5 this line:
PHP Code:
$main_smarty->assign('message''Warning: Template <b>"' $_GET['template'] . '"</b> does not exist!'); 
is the default one.

So I replace it with:
PHP Code:
$main_smarty->assign('message''Warning: Template <b>"' sanitize($_GET['template'],1) . '"</b> does not exist!'); 
There's no error that comes out, but still I cannot switch the template.
Reply With Quote
  #9 (permalink)  
Old 08-17-2008, 10:11 PM
chuckroast's Avatar
Pligg Developer/Coder/Designer
Pligg Version: SVN
Pligg Template: Social Pro Kit
 
Join Date: Jun 2006
Posts: 5,448
This is probably a dumb question but did you delete templates_c?
Reply With Quote
  #10 (permalink)  
Old 08-17-2008, 10:16 PM
cmstheme's Avatar
Donor/Coder
Pligg Version: 9.9
Pligg Template: Squaretle
 
Join Date: Jan 2007
Location: Philippines
Posts: 531
Yes, I have deleted the contents of templates_c.

When I compare the settemplate.php file of 9.9.0 and 9.9.5, the only difference is this:

9.9.0:
PHP Code:
if(file_exists("./templates/".$_GET['template']."/link_summary.tpl")){ 
9.9.5:
PHP Code:
if(file_exists("./templates/".$_GET['template']."/link_summary.tpl") && strpos('.'$_GET['template']) === 0){ 
I have also tried to use the settemplate.php from 9.9.0 and there's still the error.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Index.php won't open to install nigelnix Questions and Comments 8 04-15-2010 06:19 PM
cann't vote in pligg (buliding 802) haxhax Questions and Comments 27 03-10-2007 07:53 AM
Internal Server Error wagthis Questions and Comments 12 01-16-2007 06:20 PM
ERROR: my_base_url is not set. Please correct this using the admin panel. Then refres search Questions and Comments 7 11-14-2006 11:35 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development