Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #1  
Old 05-23-2007, 09:11 PM
tomyeah's Avatar
tomyeah Offline
pp veteran
 
Join Date: Aug 2006
Posts: 74
Send a message via ICQ to tomyeah
template switcher for template developers

i made a few templates now and i was sick of creating new domains and pixelpost installations for every template to give people a live showcase ...

so i made this little addon for template developers.

get this file (, extract it) and place it in the "/includes" folder of your pixelpost base directory.
template_switcher.zip

look for these lines in the index.php of your pixelpost base directory:

around line: 85
Code:
$upload_dir = $cfgrow['imagepath'];
around line: 239
Code:
$tpl = file_get_contents("templates/".$cfgrow['template']."/".$_GET['x']."_template.html");
around line: 260
Code:
$tpl = file_get_contents("templates/".$cfgrow['template']."/image_template.html");
right after these 3 lines you place this line:
Code:
require("includes/template_switcher.php");
you can see a demo of this addon here.


if you want to insert special instructions for individual templates you can do this in the template_switcher.php . i'Ve inserted a little example:

Code:
if($cfgrow['template'] == "macstyle"){
	$cfgrow['thumbnumber'] = 22;
}
that means, if the template "macstyle" is loaded than it should display 22 thumbnails for the <IMAGE_THUMBNAIL_ROW> .

regards, tom.
Reply With Quote
  #2  
Old 05-24-2007, 01:19 AM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
Nice work Tom but hopefully the new Pixelpost website (when it's completed) will include a template preview system but this is nice for those who want to let their viewers choose which template they like to view your site with.
Reply With Quote
  #3  
Old 05-24-2007, 06:51 AM
tomyeah's Avatar
tomyeah Offline
pp veteran
 
Join Date: Aug 2006
Posts: 74
Send a message via ICQ to tomyeah
@dwilkinsjr: oh, any details or even a preview about the new website ?
Reply With Quote
  #4  
Old 05-25-2007, 03:26 AM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
Quote:
Originally Posted by tomyeah View Post
@dwilkinsjr: oh, any details or even a preview about the new website ?
No, it's being worked on slowly but there is no public preview or anything.
Reply With Quote
  #5  
Old 11-29-2007, 04:45 AM
EcoSee Offline
pp veteran
 
Join Date: Nov 2007
Posts: 63
Yeah Baby... nice feature. I am in the process of porting about 25 templates and it was driving me nuts. Nice job and thank you!!!
Reply With Quote
  #6  
Old 02-10-2008, 01:44 PM
Scarabaeus's Avatar
Scarabaeus Offline
pixelpost guru
 
Join Date: Dec 2007
Location: England
Posts: 139
I've just added this to my site. Very good and works well. Also I changed so when you select the option from the drop down it changes without having to click submit.
__________________

Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 01:43 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs