WordPress.org

Ready to get started?Download WordPress

Forums

Wiki / Static Pages hack for WordPress (16 posts)

  1. Laughinglizard
    Member
    Posted 10 years ago #

    I modified an Erfurt Wiki script to work with WordPress. The installation is really really simple and the wiki seems to work well for me. You can see it at work here:
    http://mindfulmusings.net/weblog/aboutme.php
    I have created a static about me page with this and plan to use it in the future for "free-for-all" blogging from time to time. I might find other uses for it as well.
    All the instructions and the hack files can be downloaded here:
    http://weblogtoolscollection.com/archives/2004/03/19/wiki-plug-in/
    Please post bugs and suggestions.
    Peace

  2. carthik
    Member
    Posted 10 years ago #

    As always, Good job! I am yet to take a serious look at it, but I sure hope you can take away the function wherein visitors can edit the page.

  3. Laughinglizard
    Member
    Posted 10 years ago #

    Thank you and the edit features can very easily be turned off. Look through the MODIFICATIONS section where the "edit links" can be turned on or off.
    :)

  4. carthik
    Member
    Posted 10 years ago #

    Cool. (more of a bump really) :)

  5. Laughinglizard
    Member
    Posted 10 years ago #

    I have shown you my way of using this page. I would really appreciate examples of how people are using this hack. The community and people wanting to use this could really benefit from that.

  6. Edlef
    Member
    Posted 10 years ago #

    This is a great hack! I've checked it on my testpage and everything seems to work like i expected it 8-)

  7. TechGnome
    Moderator
    Posted 10 years ago #

    Three cheers for LaughingLizard! Hip-hip- Hooray! Hip-hip- Hooray! Hip-hip- Hooray!
    That wiki rocks! I jsut got it installed on my test site at home, and after tweaking it around, it's almost just what I need! Now I just need to tweak it a little more, then upload it and Whahoo!
    TG

  8. TechGnome
    Moderator
    Posted 10 years ago #

    UPDATE: In the off chance that any one wants to implement WP security to the wiki, here's how you go about it.
    In your main wiki php file, right after the line:
    require_once('wp-blog-header.php');
    Add the following:
    get_currentuserinfo();
    Then in the ewkiki.php file, on the second line, add this:
    global $user_level;
    Next, find where "EWIKI_CONTROL_LINE" is DEFINED, roughly, line 51. Change it to read as follows:
    if($user_level>=X) { # X is the minimum level for editing the wiki. This will keep unwanted changes from happening.
    define("EWIKI_CONTROL_LINE", 1); # EditThisPage-link at bottom
    }else{
    define("EWIKI_CONTROL_LINE", 0); # EditThisPage-link at bottom
    }

    Change the X to the minimum user level needed to edit the wiki.
    Save it all. That's it. Now users with a level of X or greater will be able to edit the wiki, and keep the wiki spam down.
    TG

  9. TechGnome
    Moderator
    Posted 10 years ago #

    Ah, screw it... don't use that last hack .... this one is better....

    if(defined("EWIKI_FORCESECURITY")){
    if(EWIKI_FORCESECURITY==1){
    if($user_level>=9) { # 9 is the minimum level for editing the wiki. This will keep unwanted changes from happening.
    define("EWIKI_CONTROL_LINE", 1); # EditThisPage-link at bottom
    }else{
    define("EWIKI_CONTROL_LINE", 0); # No EditThisPage-link at bottom
    }
    }else{
    define("EWIKI_CONTROL_LINE", 1); # EditThisPage-link at bottom
    }
    }else{
    define("EWIKI_CONTROL_LINE", 0); # No EditThisPage-link at bottom
    }

    It's a bit more complicated, but tighter in that if you implement multiple wikis, like I just did, you can control which wiki(s) users get to edit and which ones they don't.
    In your main wiki page (aboutme.php in LL's example), jsut before the
    include("ewiki-about.php"); line, add this:
    define("EWIKI_FORCESECURITY","1"); // Use this inside of ewiki.php to determine if security should be used.
    Set it to 1 to enforce WP user admin security.... Set it to 0 to allow open access to the wiki.... or comment out the line completely to allow no editing of the wiki at all (by any one).
    To see this in action, visit my site and click on the About Me link in the menu. That will take you to a locked wiki. Then click on the "Discussion WhiteBoard" link right below it. That will take you to an open wiki.
    TG

  10. TechGnome
    Moderator
    Posted 10 years ago #

    OK, I found a "bug" in the ewiki.php file.
    Line 3278 reads as follows:
    $sql2 .= $a . "'" . mysql_escape_string($value) . "'";
    It should be
    $sql2 .= $a . "'" . mysql_escape_string(stripslashes($value)) . "'";
    If you get \ in front of all your ' and " when you edit a wiki page, this is the answer to that.
    TG

  11. Anonymous
    Unregistered
    Posted 10 years ago #

    I'm trying to install this wiki thing, but all that I have is a message saying: "table ewiki already exists ewiki error: could not read from directory.
    But since the message don't include the mentioned directory, I can't check if exists or no, or create it manually.
    Can anyone please help me?
    Diego

  12. Laughinglizard
    Member
    Posted 10 years ago #

    That just means that your install is complete. Close your browser window, clear your cache and cookies and try viewing the page again.

  13. Anonymous
    Unregistered
    Posted 10 years ago #

    It's working now! Thanks!!

  14. anatman
    Member
    Posted 10 years ago #

    LL, i tried installing the wiki, but there is a problem i bumped into:
    - the "preview" breaks down WP. you can see it on your aboutme.php, try clicking the preview button: a lot of sql errors appear, from wp-blog-headres.php;
    Do you know how to fix that?
    Thanks,
    Eduardo

  15. Anonymous
    Unregistered
    Posted 9 years ago #

    wow...what was that post about?
    I thought the new version of WP was going to make it easy to create static pages? I installed the latest nightly...not sure I see where or how a static page is created. I'm overlooking something I'm sure?

  16. Mark (podz)
    Support Maven
    Posted 9 years ago #

    [2 huge spams deleted]

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.