|
|
#1 | |
|
Join Date: Oct 2003
Location: Delaware
Posts: 457
![]() |
kl_php is a content mambot which is used to include PHP script in content. This mambot has
4 admin parameters! "ob" ="1" "Use Output Buffering" "entities" ="1" "Decode HTML_entities" "span" ="0" "Set to 1 to Wrap the results in a span" "debug" ="0" "debug" Examples: Code:
{kl_php} include("http://onlinemedicalforum.com/forum/ssi.php?a=active");{/kl_php}
Code:
{kl_php}
$collection ="http://www.mediapanic.com/swanseasucks/random/thoughts.txt";
$thoughts = file("$collection");
$thought = rand(0, count($thoughts)-1);
echo $thoughts[$thought];
{/kl_php}
Code:
{kl_php}
include("local_script_file.php");
{/kl_php}
http://forum.mamboserver.com/showthr...&page=12&pp=10 Quote:
Last edited by konlong : July 15th, 2005 at 03:37. Reason: added small example |
|
|
|
|
|
|
#2 |
![]() Join Date: Jun 2004
Location: San Juan, Argentina
Posts: 767
![]() |
great tips konlong and awesome bot !
__________________
Enrique Becerra Freelance Developer & Mambo Templater MSN: qbecerra @ hotmail.com www.beza.com.ar |
|
|
|
|
|
#3 |
![]() Join Date: Nov 2003
Location: Netherlands
Posts: 1,551
![]() |
yes very usefull bot great script konlong |
|
|
|
|
|
#4 |
![]() Join Date: Apr 2005
Posts: 4
![]() |
Thanks much for your post! I've downloaded your mod_kl_php pack and it works very well.
I am having trouble with the mambot though. It seems as if it doesn't want to recognize {kl_php} as a trigger - even when I use the examples you've posted. Rather than executing the PHP between your trigger tags - it just posts it onto my site as plain text. Being rather new to Mambo - I'm not sure if any of my troubleshooting was worthwhile - but I've tried turning on/off different mambots to see if it would make any difference. Seemed like a logical place to start but it didn't do anything to help. Any ideas on what to do next? *Edit* Might it be because I'm using 4.5.2? |
|
|
|
|
|
#5 |
|
Join Date: Oct 2003
Location: Delaware
Posts: 457
![]() |
I know it gets confusing but mod_kl_evalphp is a module and your php script is stored in a parameter. While kl_php is a mambot and as such the tags {kl_php} and {/kl_php} are entered into Content and they surround the PHP script.
If the text of the mambot isbeing displayed as opposed to being parsed then there are a few possibilities: 1. the mambot has not been published (turned on) 2. you have placed the mambot in a description area of either a section or a category 3. you have placed the mambot in a module John L |
|
|
|
|
|
#6 |
![]() Join Date: Jun 2004
Location: San Juan, Argentina
Posts: 767
![]() |
konlong...
your bot is only for content items, right ? well... any ideas about how to exec some php code inside modules ? lot of people generate php code in phpadsnew and they complain about this... phpadsnew + mambo is becoming very popular... thanks ![]()
__________________
Enrique Becerra Freelance Developer & Mambo Templater MSN: qbecerra @ hotmail.com www.beza.com.ar |
|
|
|
|
|
#7 | |
|
Join Date: Oct 2003
Location: Delaware
Posts: 457
![]() |
Quote:
John L |
|
|
|
|
|
|
#8 |
![]() Join Date: Jun 2004
Location: San Juan, Argentina
Posts: 767
![]() |
thanks John !!
awesome tip ![]()
__________________
Enrique Becerra Freelance Developer & Mambo Templater MSN: qbecerra @ hotmail.com www.beza.com.ar |
|
|
|
|
|
#9 |
![]() Join Date: Apr 2005
Posts: 1
![]() |
I cannot download the mambot although I'm logged in.
Is there any alternative download address? MasterE |
|
|
|
|
|
#10 |
![]() Join Date: Nov 2004
Posts: 43
![]() |
Konlong I am getting this error
Parse error: parse error, unexpected '<' in /home/pakpass/public_html/mambots/content/kl_php.php(65) : eval()'d code on line 1 when I try to execute includes code Any idea why? |
|
|
|
|
|
#11 |
![]() Join Date: Nov 2004
Posts: 43
![]() |
BTW I am trying to execute this code
{kl_php} include(http:///www.pakpassion.net/test/MainPage/WhoAreWe.html);{/kl_php} |
|
|
|
|
|
#12 |
|
Join Date: Oct 2003
Location: Delaware
Posts: 457
![]() |
You simply need to quote the string.
{kl_php} include('http://www.pakpassion.net/test/MainPage/WhoAreWe.html');{/kl_php} John L |
|
|
|
|
|
#13 | |
![]() Join Date: Apr 2005
Posts: 5
![]() |
Quote:
|
|
|
|
|
|
|
#14 |
![]() Join Date: Mar 2005
Location: UK
Posts: 220
![]() |
Hi
I am trying to get this OS API to work in Mambo. http://metaatem.net/words/ I installed the mambot and then dropped the code into a static content page. What happened is that it does not work! I am not sure how this works but what happens is this http://srtcweb.co.uk/index.php?optio...13&Itemi d=28 the php code is appearing in the page along with a the form. it does not work as an API. I used the the source code.. http://metaatem.net/words.phps there is also a javascript wrapper code. http://metaatem.net/spell.phps Tried this but it did not seem to work either. Help would be great! |
|
|
|
|
|
#15 |
|
Join Date: Oct 2003
Location: Delaware
Posts: 457
![]() |
From your link it is apparent that you are missing the opening few lines of his code. Check your file to see that it begins with: <?php
the second line of his code starts with: /* |
|
|
|
|
|
#16 |
![]() Join Date: Jun 2005
Posts: 17
![]() |
Hi... Thanks Konlong, this is a great bot. I only have a question, what about kl_php and mambo 4.5.2? it seems to work ok.... but there is any problem that I´m missing?
.:Guille:. |
|
|
|
|
|
#17 |
|
Join Date: Oct 2003
Location: Delaware
Posts: 457
![]() |
If you are having trouble with the included code it may be that the code is trying to include things which are not available on your system. I would suggest that you contact the original author to see how you might run his application on your system.
|
|
|
|
|
|
#18 | ||
![]() Join Date: Jun 2005
Posts: 4
![]() |
Quote:
Parse error: parse error, unexpected '<' in /home/content/r/m/i/rmirasol/html/ronmambo/mambots/content/kl_php.php(65) : eval()'d code on line 1 this example works, though: Quote:
|
||
|
|
|
|
|
#19 |
|
Join Date: Oct 2003
Location: Delaware
Posts: 457
![]() |
rmirasol: This code works well on my system, perhaps your system is not setup to allow evals of offsite url's.
|
|
|
|
|
|
#20 |
![]() Join Date: Jun 2005
Posts: 4
![]() |
I don't know how to check if my system allows evals of offsite url's (real newbie) but the workaround I used was to put the first code snippet in a php file and then include it using the second code snippet.
thanks for the reply. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I still can't get Mambo to work | digitalninja | Installation Questions | 5 | October 14th, 2007 17:56 |
| Glossary - Grammar and Spell Checked | Yerg | Documentation Suggestions, Modifications and Corrections | 1 | December 20th, 2005 22:20 |
| PHP in content | Zudl | General Questions | 12 | August 16th, 2005 13:26 |
| Admin login problem AGAIN... :) Please bare with me. | spignataro | Installation Questions | 17 | February 23rd, 2005 23:08 |
| linking external php file to main content area ??? | fresh@mambo | General Questions | 1 | October 29th, 2004 05:11 |