Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> WYSIWYG - Raven's RavenNuke(tm) v2.x Distro
Author Message
adriancollins
New Member
New Member



Joined: May 08, 2006
Posts: 8

PostPosted: Thu May 25, 2006 5:10 am Reply with quote

Hi,

The title probably says it all but can anyone help me in regards to integrating the FCKeditor with the latest Nuke Guiki Wiki 1.3.0 please?

What I am trying to do is to have a music Gig list for users to modify themselves, perhaps there is a better method than Nuke Guiki anyway?

I am using the latest RN Distro 2.02.02

Many thanks,
     
    View user's profile Send private message
    jakec
    Site Admin



    Joined: Feb 06, 2006
    Posts: 3048
    Location: United Kingdom

    PostPosted: Thu May 25, 2006 5:43 am Reply with quote

    There are instructions with the distro on how to intergrate the editor into other modules etc.

    kguske is the man to help, but I understand he is very busy at the moment. Have a go and if you don't have any luck post back.

    I'm not familiar with Guiki Wiki, but have you thought about using an Event calender instead. I use Kalender MX and kguske helped me intergrate it with that, so I could send you the amended file.

    I hope this helps


    Jakec
     
    View user's profile Send private message
    adriancollins







    PostPosted: Thu May 25, 2006 5:52 am Reply with quote

    Hi Jakec,

    Thanks for your reply, I have been trying with the info from the instructions with no luck at present. I found your previous post which may have something helpful too.

    I am also using NU Calendar which is pretty good, I've not heard of Kalendar MX though - can you pls let me know your website URL so I can take a peek? thanks.

    I like the idea of an event calendar but also wanted to be able to have a single page with just a few events on (ie this weeks gigs, or whatever)

    Cheers

    A
     
    jakec







    PostPosted: Thu May 25, 2006 12:53 pm Reply with quote

    My site is: [ Only registered users can see links on this board! Get registered or login! ]

    It's still in it's infancy really, a bit of a tester while I work out what Nuke can do.

    Kalender MX is good, but it doesn't support reoccuring events.

    It probably wouldn't be too difficult for someone whos knows about about PHP to knock up a block to display upcoming gigs on a week by week basis, unfortunately I'm not your guy.

    Jakec
     
    kguske
    Site Admin



    Joined: Jun 04, 2004
    Posts: 6432

    PostPosted: Thu May 25, 2006 6:19 pm Reply with quote

    Interesting... I am working on an event calendar at the moment. Of course, it will be integrated with nukeWYSIWYG. No release date, though...still swamped.

    _________________
    I search, therefore I exist...
    nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
     
    View user's profile Send private message
    adriancollins







    PostPosted: Fri May 26, 2006 2:26 am Reply with quote

    Hi Kguske,

    Now that does sound interesting, can I ask what sort of features you are working on, or considering please (The event calendar I'm testing at the moment is NUcalendar which is quite good - for my music gig guide site, I like features like up an coming events etc)

    Cheers

    A
     
    kguske







    PostPosted: Fri May 26, 2006 8:25 pm Reply with quote

    I suppose I'll need to create the feature list at some point, but it definitely has recurring events- and will even allow exceptions.
     
    dirtbag
    Regular
    Regular



    Joined: Nov 09, 2003
    Posts: 73

    PostPosted: Mon Jun 26, 2006 2:35 pm Reply with quote

    yeah i just installed the NukeGuiki 1.3.0 but it comes with the HTMLAREA3 Editor with it... And it works in FireFox But not in IE as there must be some conflict with the FCKEDITOR as i installed it on the Raven Distro 2.002 without the FCKEDITOR and the HTMLAREA3 worked on IE..

    What I need is so that it does not use the HTMLAREA3 and remove it altogether and have it use the FCKEDITOR thats already installed. If anyone interested i am willing to pay you money for the modification. There is not much to the file so i dont think it would be that difficult.. I tried messing and made a little progress but could not figure it out.

    PLEASE PM if your interested in doing this and i send you money paypal..

    you can see it in action on my site as i started adding to it..
    [ Only registered users can see links on this board! Get registered or login! ]

    Quote:
    Release Name: NukeGuiki 1.3.0

    Notes: The supersims project has released Guiki, a simple on-page wiki module for php-nuke. Features include an integrated WYSIWYG editor, all data stored in a database, an index page function. NEW FEATURES - Only users with good karma can edit the wiki. Full history functionality with view and revert to old versions(Thanks to Matt Lankford). Recent changes function.


    it can be downloaded here.. [ Only registered users can see links on this board! Get registered or login! ]

    the directions are vague easy install... but they dont mention you need to get the HTMLAREA3 Editor from the previous version as its not packaged with the 1.3.1
    [ Only registered users can see links on this board! Get registered or login! ]

    contains the HTMLAREA3 editor.


    Last edited by dirtbag on Mon Jun 26, 2006 2:56 pm; edited 1 time in total 
    View user's profile Send private message
    dirtbag







    PostPosted: Mon Jun 26, 2006 2:37 pm Reply with quote

    here is the index file
    Code:
    <?php                     // Licence : GPL 
    
      /**
       * Guiki as PHP-Nuke module
       * A simple php wiki in one-page and a crossplatform WYSIWYG editor
       *
       */
    if (!defined('MODULE_FILE')) {
        die ("You can't access this file directly...");
    }


    require_once("mainfile.php");
    $module_name = basename(dirname(__FILE__));
    $index = 1;
    //get_lang($module_name);             // no languages yet
    $pagetitle = "$module_name";
    global $user, $prefix;
    $prefix_guiki = $prefix."_guiki";

    if(!is_array($user)) {
      $user_get = base64_decode($user);
      $user_get = explode(":", $user_get);
      $user_name = "$user_get[1]";
    } else {
      $user_name = "$user[1]";
    }
     
    include("modules/$module_name/config.php");         // Get user set variables
    $TPLT["EDIT"]   = "$TEMPLATE/edit.html";      // Set edit template


    $TPLT["SHOW"]   = "$TEMPLATE/show.html";      // Set show template
    $TPLT["SEARCH"]   = "$TEMPLATE/show.html";      // Set search template
    $TPLT["INDEX"] = "$TEMPLATE/show.html";         // Set index template
    $TPLT["HISTORY"] = "$TEMPLATE/show.html";

    $CONTENT   = $HTTP_POST_VARS["CONTENT"];      // Get content from edit page
    $SEARCH      = $HTTP_POST_VARS["SEARCH"];      // Get search term
    $MODE      = $HTTP_GET_VARS["MODE"];      // Get mode
    $DOCPOST   = $HTTP_POST_VARS["docpost"];      // Testing out new editor delete me
    $PAGE      = $HTTP_GET_VARS["PAGE"];      // Get page name

    $CONTENT    = preg_replace("/<\?/","",$CONTENT);   // No PHP uploads
    $SEARCH    = checkVars($SEARCH);         // No special chars
    $PAGE       = checkVars($PAGE);         // No special chars
    $MODE       = checkVars($MODE);         // No special chars

    if (! $MODE)   {$MODE = "SHOW";}         // Set default mode
    if (! $PAGE)   {$PAGE = $HOME;}         // Set default page

    # include("header.php");

    function head() {
        global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle;
        include("includes/ipban.php");
        $ThemeSel = get_theme();
        include_once("themes/$ThemeSel/theme.php");
        echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
        echo "<html>\n";
        echo "<head>\n";
        echo "<title>$sitename $pagetitle</title>\n";
        include("includes/meta.php");
        include("includes/javascript.php");

        if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
            echo "<link REL=\"shortcut icon\" HREF=\"themes/$ThemeSel/images/favicon.ico\" TYPE=\"image/x-icon\">\n";
        }
        echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"backend.php\">\n";
        echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
        if (file_exists("includes/custom_files/custom_head.php")) {
              include_once("includes/custom_files/custom_head.php");
        }
        echo "\n\n\n</head>\n\n";
        if (file_exists("includes/custom_files/custom_header.php")) {
              include_once("includes/custom_files/custom_header.php");
        }
       
        echo "\n\n\n</head>\n\n";

        themeheader();
    }


    online();
    head();
    include("includes/counter.php");
    global $user_name, $home;
    if ($home == 1) {
        message_box();
        blocks(Center);
    }
    title("$sitename: $pagetitle - $MODE Page $PAGE");

    if( $CONTENT )                  
       if (validate($user_name))         
          savePage($PAGE,$CONTENT);           

    if( $DOCPOST )                  
       if (validate($user_name))      
          savePage($PAGE,$DOCPOST);       

    if (! page_exists($PAGE))                 
       if ($MODE != "INDEX"&&$MODE != "SEARCH" && $MODE != "HISTORY")
          $MODE = "EDIT";            // Go into edit mode

    if ($MODE == "EDIT"||$MODE == "DELETE")         // If $MODE is edit or delete
       if (! validate($user_name))         // Challenge for user and password
          $MODE = "SHOW";            // Change to show if they dont know login
    if ($MODE == "DELETE"){               // If mode is delete (AUTH done above)
       deletepage($PAGE);            // Delete the page
       $PAGE = "$HOME";            // Set $PAGE to default
       $MODE = "SHOW";               // Set $MODE to show
    }
    if ($MODE == "REVERT") {
            revertpage($PAGE, $DATA);
            $MODE = "HISTORY";
            $DATA = "";
    }
    OpenTable();   

    template($MODE,$PAGE,$DATA,$TPLT[$MODE],$SEARCH);   // Make replacements
       
    CloseTable();   
    include("footer.php");
    //die();

    /*
    **  FUNCTIONS
    */
    function template($MODE,$PAGE,$DATA,$TEMPLATE,$SEARCH){
       $OUTPUT       = implode( "", file($TEMPLATE) );
       if (page_exists($PAGE)){
          $CONTENT        = stripslashes(getpage($PAGE));
          $MODIFIED       = "Last Modified at ".date("H:i:s F d Y",pagemtime($PAGE))." by ".pagemuser($PAGE);
       }
       if ($MODE == "SEARCH")
          $CONTENT   = findPage($SEARCH);
            if ($MODE == "INDEX")
          $CONTENT   = indexPage();
            if ($MODE == "HISTORY")
                    $CONTENT        = historypage($PAGE,$DATA);
       $OUTPUT   = str_replace("<!--MODIFIED-->"   ,$MODIFIED      ,$OUTPUT);
       $OUTPUT   = str_replace("<!--REVERT-->"   ,showRevertLink()   ,$OUTPUT);
       $OUTPUT   = str_replace("<!--CANCEL-->"   ,showCancelLink()   ,$OUTPUT);
       $OUTPUT   = str_replace("<!--EDIT-->"   ,showEditLink($MODE, $PAGE)   ,$OUTPUT);
          $OUTPUT     = str_replace("<!--HISTORY-->"  ,showHistoryLink($PAGE)      ,$OUTPUT);
          $OUTPUT   = str_replace("<!--INDEX-->"   ,showIndexLink($PAGE)      ,$OUTPUT);
       $OUTPUT   = str_replace("<!--DELETE-->"   ,showDeleteLink()   ,$OUTPUT);
       $OUTPUT   = str_replace("<!--PAGE-->"   ,$PAGE         ,$OUTPUT);
       $OUTPUT   = str_replace("<!--CONTENT-->"   ,$CONTENT      ,$OUTPUT);
       $OUTPUT   = str_replace("<!--TEMPLATE-->"   ,dirname($TEMPLATE)   ,$OUTPUT);
       if ($MODE == "SHOW")
          //$OUTPUT = preg_replace("/a href=/i","a target='_blank' href="),$OUTPUT); // now working popup all external links
          $OUTPUT = preg_replace("/\[\[(.*?)\]\]/",writeLink("\\1"),$OUTPUT);
       writeHeaders();
       echo $OUTPUT;
    }
    function checkVars($DATA){
        return preg_replace("/[\`|\.|\\|\/|<\?]/","",$DATA);
    }
    function findPage($SEARCH) {
       $output = "<ul>\n";
       foreach (getDataFiles() as $page) {
          if (!preg_match("/.gif|.jpg|.png/i",$page)){
             $current = getpage($page);
             if (preg_match("/$SEARCH/i",$current) )
                $output .= "<li>".writeLink($page)."</li>\n";
          }
       }
       $output .= "</ul>\n";
       return $output;
    }
    function validate($user){
        global $db, $prefix, $MAX_KARMA, $admin;
        if(is_admin($admin)) return true;
        $result = $db->sql_fetchrow($db->sql_query("SELECT karma FROM ".$prefix."_users WHERE username='$user'"));
        $karma = $result['karma'];
        if ($user != "" && $karma <= $MAX_KARMA) {
       return true;
        } else {
            return false;
        }
    }
    function showCancelLink(){
        global $module_name;
        return "<a href=\"modules.php?name=$module_name&amp;MODE=SHOW&PAGE=<!--PAGE-->\">Cancel</a>";
    }
    function showRevertLink(){
        global $module_name;
        return "<a href=\"modules.php?name=$module_name&amp;MODE=EDIT&PAGE=<!--PAGE-->\">Revert</font>";
    }
    function showDeleteLink(){
        global $module_name;
        return "<a href=\"modules.php?name=$module_name&amp;MODE=DELETE&PAGE=<!--PAGE-->\"><font color='red'>Delete</font></a>";
    }
    function showEditLink($MODE, $PAGE){
        global $module_name, $user_name;
        if ((validate($user_name)) && ( $MODE != "HISTORY" ) && ( $PAGE != "Index" )) {
            return "<a href=\"modules.php?name=$module_name&amp;MODE=EDIT&PAGE=<!--PAGE-->\">Edit</a>";
        }
    }
    function showIndexLink($PAGE){
        global $module_name;
        if ( $PAGE != "Index" )
           return "<a href=\"modules.php?name=$module_name&amp;MODE=INDEX&PAGE=Index\">Index</a>";
    }

    function showHistoryLink($PAGE){
        global $module_name;
        if ( $PAGE != "Index" )
           return "<a href=\"modules.php?name=$module_name&amp;MODE=HISTORY&PAGE=<!--PAGE-->\">History</a>";
        else
           return "<a href=\"modules.php?name=$module_name&amp;MODE=HISTORY&PAGE=<!--PAGE-->\">Recent Changes</a>";
    }

    function savePage($PAGE,$CONTENT) {
        global $db, $prefix_guiki, $user_name;
        if (validate($user_name)) {
        $PAGE = addslashes($PAGE);
        $CONTENT = addslashes($CONTENT);
        if(page_exists($PAGE)){
           // Make a copy
           $query = "INSERT INTO ".$prefix_guiki."_history SELECT * FROM $prefix_guiki WHERE page = '$PAGE'";
           $db->sql_query($query);
        //echo $query;
        //$error = $db->sql_error();
        //echo $error["message"];
           $db->sql_query("UPDATE $prefix_guiki SET content = '$CONTENT' WHERE page = '$PAGE'");
        }else{
           $db->sql_query("INSERT INTO $prefix_guiki VALUES('$PAGE','$CONTENT',0,'')");
       //echo $query;
       //$error = $db->sql_error();
       //echo $error["message"];
        }
        //Update time
        $time=time();
        if($user_name=="")
        {
           $guser_name="Administrator";
        }else
        {
           $guser_name=$user_name;
        }
        $query = "UPDATE $prefix_guiki SET modtime = $time, editedby = '$guser_name' WHERE page = '$PAGE'";
        //echo $query;
        //$error = $db->sql_error();
        //echo $error["message"];
        $db->sql_query($query);
        } else {
          echo "Illegal attempt to change wiki. Admin notified";
        }


    function revertpage($PAGE, $DATA) {
        global $db, $prefix_guiki, $user_name;
        if (validate($user_name)) {
           $PAGE = addslashes($PAGE);
           // Make a copy for history
           $query = "INSERT INTO ".$prefix_guiki."_history SELECT * FROM $prefix_guiki WHERE page = '$PAGE'";
           $db->sql_query($query);
           // Delete current page
           $query = "DELETE FROM $prefix_guiki WHERE page = '$PAGE'";
           $db->sql_query($query);
           // Copy page from history
           $query = "INSERT INTO ".$prefix_guiki." SELECT * FROM ".$prefix_guiki."_history WHERE page = '$PAGE' and modtime = '$DATA'";
           $db->sql_query($query);
           // Update edit time and user
           $time=time();
           $query = "UPDATE $prefix_guiki SET modtime = $time, editedby = '$user_name' WHERE page = '$PAGE'";
           $db->sql_query($query);
        } else {
          echo "Illegal attempt to change wiki. Admin notified";
        }
    }


    function writeHeaders() {
        header ("Expires: Mon, 26 Jul 1990 05:00:00 GMT");
        header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
        header ("Cache-Control: no-cache, must-revalidate");
        header ("Pragma: no-cache");
    }
    function writeLink($PAGE) {
        global $module_name;
        if ( preg_match("/.gif|.jpg|.png/i",$PAGE)){ //not working mat
            return "<img src=\"modules/$module_name/data/$PAGE\">";  //data is hardcoded this is BAD
        } else {
            return "<a href=\"modules.php?name=$module_name&amp;MODE=SHOW&PAGE=$PAGE\">$PAGE</a>";
        }
    }
    function getDataFiles() {
        global $db, $prefix_guiki;
        $pagelist = $db->sql_query("SELECT page FROM $prefix_guiki ORDER BY page");
        //Convert to array
        while( $pagename = $db->sql_fetchrow($pagelist)){
                $allpages[] = $pagename['page'];
        }           
        return $allpages;
    }
    function getpage($PAGE){
       global $db, $prefix_guiki;
       $PAGE = addslashes($PAGE);
       $sqlrow = $db->sql_fetchrow($db->sql_query("SELECT content from $prefix_guiki WHERE page = '$PAGE'"));
       return $sqlrow['content'];
    }


    function page_exists($PAGE){
       global $db, $prefix_guiki;
       $PAGE = addslashes($PAGE);
       return $db->sql_numrows($db->sql_query("SELECT page from $prefix_guiki WHERE page = '$PAGE'"));
    }
    function deletepage($PAGE){
       global $db, $prefix_guiki, $user_name;
            if (validate($user_name)) {
       $PAGE = addslashes($PAGE);
       $db->sql_query("DELETE FROM ".$prefix_guiki."_history WHERE page = '$PAGE'");
       return $db->sql_query("DELETE FROM $prefix_guiki WHERE page = '$PAGE'");
            } else {
              echo "Illegal attempt to delete page. Admins notified";
            }
    }
    function pagemtime($PAGE){
       global $db, $prefix_guiki;
       $PAGE = addslashes($PAGE);
       $sqlrow = $db->sql_fetchrow($db->sql_query("SELECT modtime from $prefix_guiki WHERE page = '$PAGE'"));
       return $sqlrow['modtime'];
    }

    function pagemuser($PAGE){
            global $db, $prefix_guiki;
            $PAGE = addslashes($PAGE);
            $sqlrow = $db->sql_fetchrow($db->sql_query("SELECT editedby from $prefix_guiki WHERE page = '$PAGE'"));
            return $sqlrow['editedby'];
    }


    function indexpage(){
       global $db, $prefix_guiki;
       $output = "<ul>\n";
       foreach(getDataFiles() as $page){
          $output .= "<li>".writeLink($page)."</li>\n";
       }
       $output .= "</ul>\n";
       return $output;
    }

    function historypage($PAGE,$DATA) {
        global $db, $prefix_guiki, $module_name;
        if ($PAGE == "Index"){
            $query = "SELECT page, modtime, editedby FROM ".$prefix_guiki."_history ORDER BY modtime ASC LIMIT 0,10";
         $result = $db->sql_query($query);
            $output = "<table width=75% border=1>";
            $output .= "<tr><th>Date</th><th>Author</th><th>Page</th></tr>";
            while ($row = $db->sql_fetchrow($result))  {
                $output .= "<tr><td>".date("r", $row['modtime'])."</td><td>".$row['editedby']."</td><td>".$row["page"]."</td></tr>";
            }
            $output .= "</table>";
         return $output;
        } else {
            $PAGE = addslashes($PAGE);
            $output = "<br>";
            if ( $DATA != "" ) {
               $output .= "<font color=red>History for $PAGE: ".date("r", $DATA)."</font><br>";
               $query = "SELECT content from ".$prefix_guiki."_history WHERE page = '$PAGE' AND modtime =' $DATA'";
               $sqlrow = $db->sql_fetchrow($db->sql_query($query));
               $output .= stripslashes($sqlrow['content']);
          $output = preg_replace("/\[\[(.*?)\]\]/",writeLink("\\1"),$output);
               $output .= "<br><hr><br>";
            }
            $output .= "<table width=75% border=1>";
            $output .= "<tr><th>Date</th><th>Author</th><th>Action</th></tr>";
            $query = "SELECT * FROM ".$prefix_guiki."_history WHERE page = '$PAGE' ORDER BY modtime DESC";
            $result = $db->sql_query($query);
            while ($row = $db->sql_fetchrow($result))  {
                $output .= "<tr><td>".date("r", $row['modtime'])."</td><td>".$row['editedby']."</td><td><a href=\"modules.php?name=$module_name&amp;MODE=HISTORY&PAGE=$PAGE&DATA=".$row['modtime']."\">view</a> <a href=\"modules.php?name=$module_name&amp;MODE=REVERT&PAGE=$PAGE&DATA=".$row['modtime']."\">revert</a> </td></tr>";
            }
            $output .= "</table>";
            return $output;
       }
    }
     
    ?>


    and there are 2 small .html files and thats it
     
    kguske







    PostPosted: Mon Jun 26, 2006 8:09 pm Reply with quote

    Since there are no textareas in the index file (and HTMLarea replaces the textareas), the answer is in the .html files.

    This appears to use a template approach, so the standard technique for implementing nukeWYSIWYG won't apply. Fortunately, there is an added function specifically for use with template approaches like this.
     
    dirtbag







    PostPosted: Mon Jun 26, 2006 8:18 pm Reply with quote

    yeah i tried messing with the template and i though i was getting somewhere but i failed..... i tried posting the .html files here but it wont allow it...
     
    kguske







    PostPosted: Wed Jun 28, 2006 7:15 am Reply with quote

    I download it and will take a look over the next few weeks.
     
    dirtbag







    PostPosted: Sat Jul 08, 2006 8:50 am Reply with quote

    any news on this...
     
    kguske







    PostPosted: Sat Jul 08, 2006 1:22 pm Reply with quote

    Still on the list...
     
    Display posts from previous:       
    Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> WYSIWYG - Raven's RavenNuke(tm) v2.x Distro

    View next topic
    View previous topic
    You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot vote in polls in this forum
    You can attach files in this forum
    You can download files in this forum


    Powered by phpBB © 2001-2007 phpBB Group
    All times are GMT - 6 Hours
     
    Forums ©