PHP-Scripts MOD

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
wingover
Posts: 58
Joined: Wed 13. Apr 2005, 13:18
Contact:

PHP-Scripts MOD

Post 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
Last edited by wingover on Tue 5. Dec 2006, 20:50, edited 3 times in total.
---------------------------------------------------
Vol Libre - der Traum vom freien Fliegen
http://www.gleitschirm-taxi.de
Faszination Berge
http://www.mountain-panorama.com
---------------------------------------------------
wingover
Posts: 58
Joined: Wed 13. Apr 2005, 13:18
Contact:

Post 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
---------------------------------------------------
Vol Libre - der Traum vom freien Fliegen
http://www.gleitschirm-taxi.de
Faszination Berge
http://www.mountain-panorama.com
---------------------------------------------------
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post 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.
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
wingover
Posts: 58
Joined: Wed 13. Apr 2005, 13:18
Contact:

Post 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
---------------------------------------------------
Vol Libre - der Traum vom freien Fliegen
http://www.gleitschirm-taxi.de
Faszination Berge
http://www.mountain-panorama.com
---------------------------------------------------
wingover
Posts: 58
Joined: Wed 13. Apr 2005, 13:18
Contact:

Post 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
---------------------------------------------------
Vol Libre - der Traum vom freien Fliegen
http://www.gleitschirm-taxi.de
Faszination Berge
http://www.mountain-panorama.com
---------------------------------------------------
wingover
Posts: 58
Joined: Wed 13. Apr 2005, 13:18
Contact:

Post by wingover »

Hi,

I made some small changes on 12.11.2006.
---------------------------------------------------
Vol Libre - der Traum vom freien Fliegen
http://www.gleitschirm-taxi.de
Faszination Berge
http://www.mountain-panorama.com
---------------------------------------------------
Post Reply