|
#1
|
||||
|
||||
|
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. |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
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. |
|
#4
|
||||
|
||||
|
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. |
|
#5
|
||||
|
||||
|
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 = '<"EXTERNAL_PHP_CODE>';
$external_php_code = '';
$external_php_code .= 'your code here';
$tpl = ereg_replace("<EXTERNAL_PHP_CODE>",$external_php_code,$tpl);
?>
|
|
#6
|
||||
|
||||
|
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. |
|
#7
|
||||
|
||||
|
sounds as if there is a problem in the PHP code you inserted?
|
|
#8
|
||||
|
||||
|
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. |
|
#9
|
||||
|
||||
|
I´m sure I do something wrong, can you write instruction step by step, please?
Thanks Dr. |
|
#10
|
||||
|
||||
|
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 |
| Post Reply |
| Thread Tools | |
|
|