Not signed in ( Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorPerindu
    • CommentTimeJul 18th 2008
     permalink
    inline php

    as i promised before inline php

    its allowed you to exec php in post and static pages

    *notes*
    - im not write this plugin ( i port it to fp to make me easy implement php in post even what i want is to put php in plugin )
    - i take no credits as the original writer doing it good ( i cant find the original writer i hope he not angry i port its to fp without permission :( )
    - i test it on php 5.26 and apache 2.063
    - i take this as is.. its work for me but im not sure if its work with u ;)
    simple how to use

    [exec]
    your php code
    [/exec]

    i hope u enjoy ;)
    •  
      CommentAuthorsneakatron
    • CommentTimeJul 21st 2008
     permalink
    Wow, it works. Thanks
    •  
      CommentAuthorZoLToR
    • CommentTimeAug 6th 2008
     permalink
    Thank you! Very useful plugin! =)
    •  
      CommentAuthorPerindu
    • CommentTimeSep 19th 2008
     permalink
    :) welcome hope u happy with it
    •  
      CommentAuthorStanley
    • CommentTimeMar 6th 2010
     permalink
    Does anyone have a copy of this please? The link is broken now.

    Thanks.
    •  
      CommentAuthorChrisBlank
    • CommentTimeMar 27th 2010
     permalink
    Need this file too.
    Can somebody reup it please.

    Thanks
    •  
      CommentAuthorStanley
    • CommentTimeMar 29th 2010
     permalink
    Posted By: ChrisBlankNeed this file too.


    Hey Chris,

    I dug around after my original post and I "think" this is the WordPress plugin it stemmed from - not sure how good you are with this kind of stuff but it looks like being a DIY job. I have it on my list of (far too many) things to look at, but I thought I'd point you to it in case you're interested.
    •  
      CommentAuthorChrisBlank
    • CommentTimeMar 30th 2010 edited
     permalink
    Thanks! Works fine.
    •  
      CommentAuthorChrisBlank
    • CommentTimeMar 30th 2010
     permalink
    I've build a compatible Plugin:
    Entry in FlattPress-Wiki
    •  
      CommentAuthorStanley
    • CommentTimeMar 30th 2010
     permalink
    Posted By: ChrisBlankI've build a compatible Plugin


    Great - I'll give it a try.

    Thanks!
    •  
      CommentAuthorjpneok
    • CommentTimeApr 8th 2010 edited
     permalink
    I don't pretend to know exactly how it works or who came up with the original code or ported it from Wordpress or whatever, but I do know ChrisBlank did the plugin version and I commend him a thousand percent!!! It dropped in without a hitch and works like a robot on caffeine pills!

    It should be a basic part of Flatpress or at least a "deluxe" Flatpress release or something, or one of those "official unofficial" packages of common mods.

    A giant thank you to Chris, I was happy when I found out you could do inline HTML in FP, now I'm really happy you can do PHP, I do a lot of silly little scripts like this - this is terrific! And again, to NoWhereMan and all the other developers, coders and testers and users!

    Here's some examples from my FlatPress:

    http://www.zanysite.com/main/?page=descriptivegen
    http://www.zanysite.com/main/index.php/magicitemgen/

    For anyone who wants a quick example to use on their own FP, use this script and make a file called randomwords.txt in the same folder as FP (or change the $dir) and put in about 20 random words each on a new line. Make sure you have the "inlinephp" folder inside the fp plugins folder and the three files are inside it and you've enabled InlinePHP in the Plugins section in FP first.

    [exec]
    $dir=".";
    $descriptors = file("$dir/randomwords.txt");

    $arrtot1=count($descriptors);
    $maxroll1=$arrtot1-1;
    echo "
    <center>
    Descriptors: $arrtot1 (0 - $maxroll1)<br>
    Click your browser's Refresh button to generate a new list. =)
    </center><br><br><ol>";

    for($i=0; $i<10; $i++)
    {
    $n1=rand(0,$maxroll1);
    $n2=rand(0,$maxroll1);
    $n3=rand(0,$maxroll1);
    $n4=rand(0,$maxroll1);

    $item =
    substr($descriptors[$n1], 0, strlen($descriptors[$n1])-2).
    substr($descriptors[$n2], 0, strlen($descriptors[$n2])-2)." ".
    substr($descriptors[$n3], 0, strlen($descriptors[$n3])-2).
    substr($descriptors[$n4], 0, strlen($descriptors[$n4])-2);

    echo "<li>$item";
    }
    [/exec]


    EDIT: Sorry to belabor the point, but I thought I was having trouble because of this plugin, and it kinda is, but it's because I had a LOT of bad errors in my code, and it caused my WHOLE site to not load, for some reason, even though it wasn't on the page that was loading, so if you DO use this Plugin, make sure your script is working FIRST - it is NOT the place to be doing debugging - do that elsewhere first and put the finished product in FP.
    •  
      CommentAuthorjpneok
    • CommentTimeApr 8th 2010 edited
     permalink
    -- didn't know I could edit other post --
    •  
      CommentAuthorChrisBlank
    • CommentTimeApr 8th 2010 edited
     permalink
    At my site Flatpress generate no errors (only warnings and notices). But some plugins mainly fpstats are error-prone.
    Maybe you should analyse the messages and post in a new discussion.
    •  
      CommentAuthorjpneok
    • CommentTimeApr 9th 2010
     permalink
    Well, as I said, it was my fault, the problems I was having, not the script or your plugin. As long as the code you're working with is clean and operational, everything worked fine. Flatpress didn't "generate errors", I just had mixed up my loop iteration variables (started one variable increment, then changed the name so the loop never completed etc), but once I figured out MY problems, it worked fine. Great work!
    •  
      CommentAuthorskatebored
    • CommentTimeMay 12th 2010
     permalink
    kinda stucked down here, need help.

    Parse error: syntax error, unexpected '<' in /home/sk8bored/public_html/fp-plugins/inlinephp/exec_php.php5(4) : eval()'d code on line 2

    thanks before...
    •  
      CommentAuthorChrisBlank
    • CommentTimeMay 13th 2010
     permalink
    I can not find a problem in my files. Perhaps it is indeed in your code. Have you tested it already? You can send me your code then I can see if I can find an error.