Page 1 of 1

PHP-Scripts MOD

Posted: Wed 12. Jul 2006, 22:33
by wingover
Update: 05.15.2006
- now you can add parameters to you scripts
- sample: {SCRIPT:my_script.php:param_a,param_b}

Update: 12.11.2006
- Some small changes
- Tested with phpwcms 1.2.8, Firefox 1.5, Internet Explorer 6

I think, most people don`t know for what this MOD is good.
You can easy add small php-scripts to you content and change the scripts from the admin-area.
My gallery-script for example:
- add the script to a content {SCRIPT:gallery.php}
- open the script in the edit-area of the MOD
- change the gallery-parameters to you needs
- upload some images in you desired folder
- example: http://www.surfclub-bernau.de/surfclubc ... hp?galerie
I use this MOD very often for all the little 'php-scripts' I need on my sites



Hi,

I made a small MOD to add and edit your own php-scripts.
You can insert the php-code with a replacement-tag in your templates or content.
Testet with phpwcms 1.2.6 on some servers.
If you find errors, please write it here.

PHP Scripts v.1.0

The MOD ID is 778, but it`s easy to change.
Copy the directory "mod_php_scripts" into this directory "include/inc_module" and read the instructions for installation in install.txt.
The replacement-tag is: {SCRIPT:script-name}
There are only some lines of code to add in the following files:
- phpwcms.php
- include/inc_front/content.func.inc.php

Download it here: mod_php_scripts.zip

Here is a screenshots:

Image

Posted: Fri 14. Jul 2006, 11:21
by wingover
Hi,

has anybody a solution for that:

- add a new script with the php-scripts mod (for example: breadcrumb.php)

Code: Select all

<?php

if(something...)
{
     echo '<div class="breadcrumb-green">{BREADCRUMB}</div>';
}
else
{
     echo '<div class="breadcrumb-red">{BREADCRUMB}</div>';
}

?>
- place the rep-tag in the template: {SCRIPT:breadcrumb.php}
- only {BREADCRUMB} is shown and not the the real breadcrumb-menu
- the problem is the order, the replacement-tags are rendered
- the script can not be included with {SCRIPT:breadcrumb.php}, only with [PHP]include/inc_module/mod_php_scripts/data/breadcrumb.php[/PHP]

Does anybody has a solution, that all rep-tags are rendered after that or again...?


Thanks - Andi

Posted: Fri 14. Jul 2006, 12:58
by pico
Hi

try to insert this Line

Code: Select all

// PHP-Scripts MOD //
require_once ('include/inc_module/mod_php_scripts/inc_front/scripts.func.inc.php');
before

Code: Select all

// include external PHP script (also normal HTML snippets) or return PHP var value
if( ! ( strpos($content["all"],'PHP')===false ) ) {
	$content["all"] = render_PHPcode($content["all"]);
}
in content.func.inc.php - so it will be 'loaded' earlier and the Content can be rendered correct.

Haven't install your Mod yet, but think this is the way.

Posted: Fri 14. Jul 2006, 14:29
by wingover
Hi Pico,

thank you - now the replacement-tags in the php-script are rendered.
I testet it with {BREADCRUMB} and it`s working.


Grüzli - Andi

Posted: Fri 20. Oct 2006, 11:58
by wingover
Hi, I made some small changes:

- a javascript confirm-box ask you now, before you edit or delete

The download-link is the same...

Grüzli - Andi

Posted: Sun 12. Nov 2006, 15:45
by wingover
Hi,

I made some small changes on 12.11.2006.