Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #1  
Old 06-03-2007, 08:23 PM
Dr.Ozdi's Avatar
Dr.Ozdi Offline
pp regular
 
Join Date: Mar 2007
Location: Czech republic, Europe
Posts: 47
How to put PHP code into "image_template" ?

I would like put into classic "image_template.html" few rows of PHP code. I have idea put there something like <EXTERNAL_PHP_CODE> and code insert in admin part...but I´m not specialist for PHP.

Thanks this addon will be able put into clasic HTML template AdSence, shop offer or whatever.

Thanks for your suggestions
Dr.
Reply With Quote
  #2  
Old 06-04-2007, 01:51 AM
dakwegmo's Avatar
dakwegmo+ Offline
Team Pixelpost
 
Join Date: Jul 2005
Location: West of Between
Posts: 689
The way that PP is designed doesn't allow for inserting PHP code directly into the templates. In order to have something show up in a template, you have to create an addon that produces the output you want, then use tags to replace the PHP output in the template.

PP comes with a sample addon, Current Date Time, that will serve you well in figuring out how to get the code into your site.
__________________
My Photoblog
If you find my help useful please consider feeding the PixelPost Kitty
If you're short on cash just feed my ego
Reply With Quote
  #3  
Old 06-04-2007, 03:40 PM
Dr.Ozdi's Avatar
Dr.Ozdi Offline
pp regular
 
Join Date: Mar 2007
Location: Czech republic, Europe
Posts: 47
Thanks
I had some similar ideas, but PHP is not my cup of tee....HTML or server solutions are not acceptable.

Is here someone who can write/rewrite this addon?

Thanks in advance
Dr.
Reply With Quote
  #4  
Old 03-07-2008, 04:11 PM
Dr.Ozdi's Avatar
Dr.Ozdi Offline
pp regular
 
Join Date: Mar 2007
Location: Czech republic, Europe
Posts: 47
How to put PHP code into "image_template"

I would like ask if here is anybody who can write addon/or somethink I mentioned. I used "Text Addon" but it doesn´t work with PHP code...

Thanks for suggestions in advance
Dr.
__________________
Dr.Ozdi
Dr.Ozdi takes a photos, photoblog
Reply With Quote
  #5  
Old 03-07-2008, 04:30 PM
fredxeric's Avatar
fredxeric Offline
pixelpost guru
 
Join Date: Sep 2006
Location: Montréal, Québec, Canada
Posts: 407
Send a message via AIM to fredxeric Send a message via MSN to fredxeric
just create an addons the name you want and enable it


create files called: external_php_code.php
Code:
<?php
$addon_version = "0.0.1";
$addon_name= "EXTERNAL_PHP_CODE";
$addon_description = '&lt;"EXTERNAL_PHP_CODE&gt;';


$external_php_code = '';

$external_php_code .= 'your code here';


	$tpl = ereg_replace("<EXTERNAL_PHP_CODE>",$external_php_code,$tpl);
?>
Reply With Quote
  #6  
Old 03-07-2008, 08:05 PM
Dr.Ozdi's Avatar
Dr.Ozdi Offline
pp regular
 
Join Date: Mar 2007
Location: Czech republic, Europe
Posts: 47
I used it, it looks great, but in the first row of my page is message from server, file is not in the same place or doesnt have atributs 666. I use long PHP code in the rows, like Adsence, if it´s important.
Thanks for your help
Dr.
__________________
Dr.Ozdi
Dr.Ozdi takes a photos, photoblog
Reply With Quote
  #7  
Old 03-08-2008, 07:31 AM
austriaka's Avatar
austriaka+ Offline
Team Pixelpost
 
Join Date: Nov 2006
Location: Germany
Posts: 1,175
Send a message via ICQ to austriaka Send a message via AIM to austriaka
sounds as if there is a problem in the PHP code you inserted?
__________________
Uh!log Photoblog
My Addons
Reply With Quote
  #8  
Old 03-08-2008, 09:36 AM
Dr.Ozdi's Avatar
Dr.Ozdi Offline
pp regular
 
Join Date: Mar 2007
Location: Czech republic, Europe
Posts: 47
Yes!
It wasn´t message from server, but from my external code, sorry my fault!
But anyway, in the first row of page (above "head" tag) is output of the test "external_php_code.php"...on the left side, below links is "your code here" from fred-eric addon...may be I didn´t understand instruction.
Dr.
__________________
Dr.Ozdi
Dr.Ozdi takes a photos, photoblog
Reply With Quote
  #9  
Old 03-08-2008, 09:59 AM
Dr.Ozdi's Avatar
Dr.Ozdi Offline
pp regular
 
Join Date: Mar 2007
Location: Czech republic, Europe
Posts: 47
I´m sure I do something wrong, can you write instruction step by step, please?
Thanks
Dr.
__________________
Dr.Ozdi
Dr.Ozdi takes a photos, photoblog
Reply With Quote
  #10  
Old 03-08-2008, 12:33 PM
austriaka's Avatar
austriaka+ Offline
Team Pixelpost
 
Join Date: Nov 2006
Location: Germany
Posts: 1,175
Send a message via ICQ to austriaka Send a message via AIM to austriaka
you have to REPLACE "your code here" with your own code, not write it somewhere else!
Since I don't know what kind of code you want to place here it is hard to tell.
If the code produces some Output, set the output into a variable (replace echo if there is echo) and put the variable of the output into "$external_php_code".

If you have not the minimum PHP knowledge this is not so easy, I know.
If everything fails, post the PHP code you want to use
__________________
Uh!log Photoblog
My Addons
Reply With Quote
Post Reply


Thread Tools




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

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