The MU forums have moved to WordPress.org

Allow PHP in main blog pages, but not in comments (11 posts)

  1. Bike
    Member
    Posted 16 years ago #

    Hi all, much has been written about kses.php and PHP/HTML-enabling in widgets, but could not find anything related to this:

    I am thinking of converting my old PHP/HTML spaghetticode website into WordpressMU, so use it as a CMS. Basically what I need is for the main blog (ID=1) to be able to execute PHP/HTML that I enter through pages and posts.

    So just for my own pages and posts. I know I can create templates, but creating a different template for every page kinda defeats the purpose of a dynamic CMS :)
    I assume that there must be a way to disable KSES.php for blogID=1, but then likely the comments are exposed as well?

    Any tips or thoughts welcome!
    Cheers, Bike

  2. andrea_r
    Moderator
    Posted 16 years ago #

    What kind of php are you putting in your own pages/posts? I mean, what for? What does it ultimately do?

    I'm thinking it may be easier to plugin-ify it just for your use.

  3. Bike
    Member
    Posted 16 years ago #

    Hi Andrea, I want to Php-include/require other scripts and dynamic pages I use on my website. This includes FAQ scripts I have, other dBase scripts, image galleries per category, (rows of) random images, polls, links, Amazon shops etc.

    Most of them would suffice by allowing php includes, though some will need javascript to be enabled. I assume I can somehow (how?) disable kses.php for blog ID 1, but do not want to leave the comments open for scripts. (or do the comments call kses.php separately?)

    Which plugins were you thinking of?
    Thanks for your time,

    Cheers, Bike

  4. ekusteve
    Member
    Posted 16 years ago #

    Bike,

    This may not be at all what you are looking for, but take a look at this plugin and see if it coud help.

    http://bluesome.net/post/2005/08/18/50/

    Steve

  5. Bike
    Member
    Posted 16 years ago #

    Thanks Ekusteve, I checked and installed it first under mu-plugins, then under plugins, but both do not work (had Rich Editor off as needed).
    Which is probably a good thing ;-)

    (the plugin was also not designed for WPMU is what the author mentions). Not sure if regular WP uses kses.php, but in a MU setup it catches any output this plugin generates.

    I like the idea though..

  6. andrea_r
    Moderator
    Posted 16 years ago #

    Well bike, I was thinking of you were doing the same thing (or a small number of things) in each different page, then you coudl write your own plugins to handle it. But these things:

    "FAQ scripts, image galleries, random images, polls, links, Amazon shops"

    are all things I know can be handled with existing plugins, even if you have to transfer some content over.

    And now that I think of it, it would be better to do something like that than what you want, because that still used your Frankencode ;) and this way, it eventually keeps everything within WP itself.

    dBase? REALLY? :D I don't envy trying to move that stuff. :D

  7. Bike
    Member
    Posted 16 years ago #

    heh, yeah, I am starting to work out again, to prepare the move of the dBase stuff :)

    I like my Frankencode, it is my child! But I might need to take out some stitches..

    I still have found no good image gallery for WPMU. Am using 4images now, which let a row of random images for a particular easily be included on pages.

    About the dreaded dBase stuff. I am using phpMyEdit to display some data, so it can be re-ordered, sorted etc.
    Do you know of any plugins or other ways to make this happen in WP(MU)? I do not want to get stuck with Iframes as I am linking to certain sorts directly.. (besides, somebody once told me that iframes are for pansies).

    Regular phpinclude will not work, as sorting (for example by clicking on headers of the displayed data) will get 404's due to rewrites..

    Cheers, Bike

  8. Bike
    Member
    Posted 16 years ago #

    ps: cannot edit anymore, but here is an example of a phpmyedit code and the resulting urls when sorting:
    http://www.phpmyedit.org/demo/

  9. andrea_r
    Moderator
    Posted 16 years ago #

    Hmmm... now you've got me thinking...

    "About the dreaded dBase stuff. I am using phpMyEdit to display some data, so it can be re-ordered, sorted etc.
    Do you know of any plugins or other ways to make this happen in WP(MU)?"

    Not off the top of my head, no. I bet one could be written though. :D

  10. SteveAtty
    Member
    Posted 16 years ago #

    And I'm quite sure if you did then you'd find interest in it.

    I suppose the real question is - if you do write it then how much time do you spend making it a standalone plug in. I started off writing some stuff which was a plug in which I was going to make available but it sort of morphed into a load of additional, specialised functionality and ended up using extra global tables so I decided that making it a plug in actually no longer made sense

  11. andrea_r
    Moderator
    Posted 16 years ago #

    In this case I'm using the term plugin to get bike's data into WP and without hacking it to pieces.

About this Topic