Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
stclem
Regular
Regular



Joined: Oct 18, 2008
Posts: 52

PostPosted: Wed Nov 26, 2008 5:13 pm Reply with quote

Someone who know how touse the FCK editor when i write a match report in Nuke League?
 
View user's profile Send private message
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Wed Nov 26, 2008 10:21 pm Reply with quote

There are instructions on modifying modules to use FCKeditor in the download (or in extra files folder with RN). It's not that hard, especially since you're using RN.

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







PostPosted: Tue Dec 02, 2008 2:10 am Reply with quote

i cant find it. if someone can tell me where to look. thanks
 
kguske







PostPosted: Tue Dec 02, 2008 10:33 pm Reply with quote

Sorry...from the readme file included with the nukeWYSIWYG download:
Code:
INSTALLATION

...
If you have addons / modules that do not already use nukeWYSIWYG, you can complete the following:

6. For the standard "display-as-you-go" approach, replace textarea HTML tags in
   modules and admin scripts with a PHP call to function wysiwyg_textarea with 5
   arguments: textarea name, textarea value, the toolbar set name, textarea
   columns and textarea rows.  For example, in modules/Submit_News/index.php:

   echo "<br><br>"
        ."<b>"._STORYTEXT.":</b> ("._HTMLISFINE.")<br>
        ."<textarea cols=\"50\" rows=\"12\" name=\"story\"></textarea><br>";

   becomes:
   
   echo "<br><br>"
        ."<b>"._STORYTEXT.":</b> ("._HTMLISFINE.")<br>";
#   ."<textarea cols=\"50\" rows=\"12\" name=\"story\"></textarea><br>"
   wysiwyg_textarea("story", "", "NukeUser", "50", "12");

   If there is a value between the <textarea> and </textarea>, tags, that should
   be specified as the second argument in the wysiwyg_textarea function call.
   
   The 3rd argument defines the toolbar set, which controls which functions are
   available to the user.  Since these functions can present security risks,
   this should be chosen carefully.  By default, the most limited toolset bar
   will be chosen.  In admin functions, you may choose to use PHPNukeAdmin which
   loads all FCKeditor functions.  The NukeUser toolbar set is more limited,
   more secure and loads faster.

   The textarea columns and rows are used in the event the WYSIWYG editor is
   turned off.  Rows are used to control the height of the text editor when the
   WYSIWYG editor is on.

   NOTE:  The name of the first argument cannot contain reserved HTML tags, e.g.
          description contains SCRIPT.  This requires that the fields be renamed.
   
7. For a template / "build, then display" approach, replace the textarea HTML
   with a similar PHP function call, wysiwyg_textarea_html.  For example, from
   My_eGallery:

      $out .=
      '<center><p align="center"><form action="'.$baseurl.'" method="POST">'
      .'<input type="hidden" name="do" value="Post">'
      .'<font class="'.$font['title'].'">'._GALNAME.'</font>&nbsp;<b>'.$userdata[1].'</b>'
             .'<input type="hidden" name="gname" value="'.$userdata[1].'">'
             .'<input type="hidden" name="member" value="1"><br>'
      .'<font class="'.$font['title'].'">'._GALCOMMENT.'</font><br>'
      . '<textarea wrap="virtual" cols="40" rows="8" name="comment" type="text" maxlength="70"></textarea><br>'
       $out .= '<input class="textbox" type="hidden" name="pid" value="'.$pid.'">&nbsp;'
        .'<input type="submit" value="Envoyer">'
      .'</form>'
      .'<font class="option">'._GALNOTE.'</font></p></center>';

   becomes:
      $out .=
      '<center><p align="center"><form action="'.$baseurl.'" method="POST">'
      .'<input type="hidden" name="do" value="Post">'
      .'<font class="'.$font['title'].'">'._GALNAME.'</font>&nbsp;<b>'.$userdata[1].'</b>'
             .'<input type="hidden" name="gname" value="'.$userdata[1].'">'
             .'<input type="hidden" name="member" value="1"><br>'
      .'<font class="'.$font['title'].'">'._GALCOMMENT.'</font><br>';
      $out .= wysiwyg_textarea_html("comment", "", "NukeUser", "40", "8");
#      . '<textarea wrap="virtual" cols="40" rows="8" name="comment" type="text" maxlength="70"></textarea><br>'
       $out .= '<input class="textbox" type="hidden" name="pid" value="'.$pid.'">&nbsp;'
        .'<input type="submit" value="Envoyer">'
      .'</form>'
      .'<font class="option">'._GALNOTE.'</font></p></center>';

Most Nuke modules use the first approach (6). If you have trouble, let me know, and I can help (it doesn't take long for most modules).
 
stclem







PostPosted: Wed Dec 03, 2008 3:41 am Reply with quote

I have tried to do nr 6. but nr 7. i cant find. cant see any templates.

Posting the league/news.php script so you can se if i done right. Made changes two times.

Code:
<?php


/* $Id: news.php,v 1.28 2007/05/12 21:27:09 luca_negrini Exp $ */
/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2006-2007 by Luca Negrini                              */
/* Copyright (c) 2003-2005 by Joubert Berger                            */
/* Copyright (c) 2002 by Francisco Burzi                                */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* This file was taken from the Submit_News module and modified by      */
/* Joubert Berger for Nuke-League.                                      */
/************************************************************************/

if (!eregi("modules.php", $PHP_SELF)) {
    die ("You can't access this file directly...");
}
require_once("mainfile.php");
require_once("modules/League/util.php");
get_lang("League");
$pagetitle = "- "._SUBMITNEWS."";

function defaultDisplay($schid, $lid, $sid, $tid) {
    global $AllowableHTML, $prefix, $user, $cookie, $anonymous,
           $currentlang, $multilingual, $db;

    include ('header.php');

    $prefs = getLeaguePrefs($lid);

    $result = $db->sql_query("select tid1, tid2 from " . $prefix . "_league_schedule where id = $schid");
    list($tid1, $tid2) = $db->sql_fetchrow($result);

    if ($prefs[matchreport] == 0)
       return;

    OpenTable();
    echo "<center><font class=\"title\"><b>"._SUBMITNEWS."</b></font><br>";
    echo getTeamName($tid1) . " " . _VS . " " . getTeamName($tid2) . "<br><br>";
    echo "<font class=\"content\"><i>"._SUBMITADVICE."</i></font></center><br>";
    CloseTable();
    echo "<br>";
    OpenTable();
    if (is_user($user)) getusrinfo($user);
    echo "<p><form action=\"modules.php?name=League&amp;file=news\" method=\"post\">"
   ."<b>"._YOURNAME.":</b> ";
    if (is_user($user)) {
   cookiedecode($user);
   echo "<a href=\"account.html\">$cookie[1]</a> <font class=\"content\">[ <a href=\"modules.php?name=Your_Account&amp;op=logout\">"._LOGOUT."</a> ]</font>";
    } else {
       echo "$anonymous <font class=\"content\">[ <a href=\"account.html\">"._NEWUSER."</a> ]</font>";
    }
    echo "<br><br>"
        ."<b>"._SUBTITLE."</b> "
        ."("._BEDESCRIPTIVE.")<br>"
        ."<input type=\"text\" name=\"subject\" size=\"50\" maxlength=\"80\"><br><font class=\"content\">("._BADTITLES.")</font>";

    if ($prefs[topicid] == 0) {
        echo "<br><br>";
        echo "<b>"._TOPIC.":</b> <select name=\"topic\">";
        $toplist = $db->sql_query("select topicid, topictext from ".$prefix."_topics order by topictext");
        echo "<option value=\"\">"._SELECTTOPIC."</option>\n";
        while(list($topicid, $topics) = $db->sql_fetchrow($toplist)) {
            if ($topicid==$prefs[topicid]) {
                $sel = "selected ";
            }
            echo "<option $sel value=\"$topicid\">$topics</option>\n";
            $sel = "";
        }
        echo "</select>";
    }
    echo "<input type=\"hidden\" name=\"alanguage\" value=\"$language\">";
    echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\">";
    echo "<input type=\"hidden\" name=\"schid\" value=\"$schid\">";
    echo "<input type=\"hidden\" name=\"sid\" value=\"$sid\">";
    echo "<input type=\"hidden\" name=\"tid\" value=\"$tid\">";

  //  echo "<br><br>"
  //      ."<b>"._STORYTEXT.":</b> ("._HTMLISFINE.")<br>"
//   ."<textarea cols=\"50\" rows=\"12\" name=\"story\"></textarea><br>"
   
      echo "<br><br>"
        ."<b>"._STORYTEXT.":</b> ("._HTMLISFINE.")<br>";
#   ."<textarea cols=\"50\" rows=\"12\" name=\"story\"></textarea><br>"
   wysiwyg_textarea("story", "", "NukeUser", "50", "12");

        ."<br><br><b>"._EXTENDEDTEXT.":</b><br>"
   ."<textarea cols=\"50\" rows=\"12\" name=\"storyext\"></textarea><br>"
   ."("._AREYOUSURE.")</font><br><br>"
        ."<font class=\"content\">"._ALLOWEDHTML."<br>";
    while (list($key,) = each($AllowableHTML)) echo " &lt;".$key."&gt;";
    echo "<br><br><input type=\"submit\" name=\"op\" value=\""._PREVIEW."\">&nbsp;&nbsp;"
   ."<select name=\"posttype\">\n"
   ."<option value=\"exttrans\">"._EXTRANS."</option>\n"
   ."<option value=\"html\" >"._HTMLFORMATED."</option>\n"
   ."<option value=\"plaintext\" selected>"._PLAINTEXT."</option>\n"
   ."</select>"
   ."<br>("._SUBPREVIEW.")</form>";
    CloseTable();
    include ('footer.php');
}

function PreviewStory($name, $address, $subject, $story, $storyext, $topic,
                      $alanguage, $posttype, $schid, $lid, $sid, $tid) {
    global $user, $cookie, $bgcolor1, $bgcolor2, $anonymous, $prefix, $multilingual, $AllowableHTML, $db;
    include ('header.php');
    $subject = stripslashes($subject);
    $story = stripslashes($story);
    $storyext = stripslashes($storyext);
    if ($posttype=="exttrans") {
        $f_story = nl2br(htmlspecialchars($story));
   $f_storyext = nl2br(htmlspecialchars($storyext));
    } elseif ($posttype=="plaintext") {
        $f_story = nl2br($story);
   $f_storyext = nl2br($storyext);
    } else {
   $f_story = $story;
   $f_storyext = $storyext;
    }
    $story2 = "$f_story<br><br>$f_storyext";
    OpenTable();
    echo "<center><font class=\"title\"><b>"._NEWSUBPREVIEW."</b></font>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<center><i>"._STORYLOOK."</i></center><br><br>";
    echo "<table width=\"70%\" bgcolor=\"$bgcolor2\" cellpadding=\"0\" cellspacing=\"1\" border=\"0\"align=\"center\"><tr><td>"
   ."<table width=\"100%\" bgcolor=\"$bgcolor1\" cellpadding=\"8\" cellspacing=\"1\" border=\"0\"><tr><td>";
    if ($topic=="") {
        $topicimage="AllTopics.gif";
        $warning = "<center><blink><b>"._SELECTTOPIC."</b></blink></center>";
    } else {
        $warning = "";
        $result = $db->sql_query("select topicimage from ".$prefix."_topics where topicid='$topic'");
        list($topicimage) = $db->sql_fetchrow($result);
    }
    echo "<img src=\"images/topics/$topicimage\" border=\"0\" align=\"right\">";
    themepreview($subject, $story2);
    echo "$warning"
   ."</td></tr></table></td></tr></table>"
   ."<br><br><center><font class=\"tiny\">"._CHECKSTORY."</font></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<p><form action=\"modules.php?name=League&amp;file=news\" method=\"post\">"
   ."<b>"._YOURNAME.":</b> ";
    if (is_user($user)) {
       cookiedecode($user);
   echo "<a href=\"account.html\">$cookie[1]</a> <font class=\"content\">[ <a href=\"modules.php?name=Your_Account&amp;op=logout\">"._LOGOUT."</a> ]</font>";
    } else {
   echo "$anonymous";
    }
    echo "<br><br><b>"._SUBTITLE.":</b><br>"
   ."<input type=\"text\" name=\"subject\" size=\"50\" maxlength=\"80\" value=\"$subject\">";
   if ($topic=="") {
        echo "<br><br>";
      echo "<b>"._TOPIC.":</b> <select name=\"topic\">";
        $toplist = $db->sql_query("select topicid, topictext from ".$prefix."_topics order by topictext");
        echo "<option value=\"\">"._SELECTTOPIC."</option>\n";
        while(list($topicid, $topics) = $db->sql_fetchrow($toplist)) {
            if ($topicid==$prefs[topicid]) {
                $sel = "selected ";
            }
            echo "<option $sel value=\"$topicid\">$topics</option>\n";
            $sel = "";
        }
        echo "</select>";
    }
 //   echo "<br><br><b>"._STORYTEXT.":</b> ("._HTMLISFINE.")<br>"
 //       ."<textarea cols=\"50\" rows=\"12\" name=\"story\">$story</textarea><br>"
    echo "<br><br>"
        ."<b>"._STORYTEXT.":</b> ("._HTMLISFINE.")<br>";
#   ."<textarea cols=\"50\" rows=\"12\" name=\"story\"></textarea><br>"
   wysiwyg_textarea("story", "", "NukeUser", "50", "12");

   ."<br><b>"._EXTENDEDTEXT.":</b><br>"
   ."<textarea cols=\"50\" rows=\"12\" name=\"storyext\">$storyext</textarea><br>"
   ."<font class=\"content\">("._AREYOUSURE.")</font><br><br>"
   .""._ALLOWEDHTML."<br>";
    while (list($key,) = each($AllowableHTML)) echo " &lt;".$key."&gt;";
    echo "<br><br>"
        ."<input type=\"submit\" name=\"op\" value=\""._PREVIEW."\">&nbsp;&nbsp;"
   ."<input type=\"submit\" name=\"op\" value=\""._OK."\">&nbsp;&nbsp;"
   ."<select name=\"posttype\"><option value=\"exttrans\"";
    if ($posttype=="exttrans") {
        echo " selected";
    }
    echo ">"._EXTRANS."</option>\n"
   ."<OPTION value=\"html\"";;
    if ($posttype=="html") {
        echo " selected";
    }
    echo ">"._HTMLFORMATED."</option>\n"
   ."<OPTION value=\"plaintext\"";
    if (($posttype!="exttrans") && ($posttype!="html")) {
        echo " selected";
    }
    echo ">"._PLAINTEXT."</option></select>"
       . "<input type=\"hidden\" name=\"lid\" value=\"$lid\">"
       . "<input type=\"hidden\" name=\"schid\" value=\"$schid\">"
       . "<input type=\"hidden\" name=\"sid\" value=\"$sid\">"
       . "<input type=\"hidden\" name=\"tid\" value=\"$tid\">"
       . "</form>";
    CloseTable();
    include ('footer.php');
}

function SubmitStory($name, $address, $subject, $story, $storyext, $topic,
                     $alanguage, $posttype, $schid, $lid, $sid, $tid) {
    global $user, $EditedMessage, $cookie, $anonymous, $notify, $notify_email,
           $notify_subject, $notify_message, $notify_from, $prefix, $db,
           $aid, $Version_Num;

    if (is_user($user)) {
       cookiedecode($user);
   $uid = $cookie[0];
   $name = $cookie[1];
    } else {
       $uid = 1;
   $name = "$anonymous";
    }

    $prefs = getLeaguePrefs($lid);

    if ($uid == 1)
       $author="";

    if ($prefs[matchreport] == 0)
       Header("Locations: modules.php?name=League&file=game&op=update_game&schid=$schid&lid=$lid&sid=$sid");

    $subject = ereg_replace("\"", "''", $subject);
    $subject = FixQuotes(filter_text($subject, "nohtml"));
    if($posttype=="exttrans") {
       $story = FixQuotes(nl2br(htmlspecialchars(check_words($story))));
   $storyext = FixQuotes(nl2br(htmlspecialchars(check_words($storyext))));
    } elseif($posttype=="plaintext") {
       $story = FixQuotes(nl2br(filter_text($story)));
   $storyext = FixQuotes(nl2br(filter_text($storyext)));
    } else {
   $story = FixQuotes(filter_text($story));
   $storyext = FixQuotes(filter_text($storyext));
    }

    if ($prefs[autopost] == 0) {
       $sql = "insert into ".$prefix."_queue ( qid, uid, uname, subject, story, storyext, timestamp, topic, alanguage) values (NULL, '$uid', '$name', '$subject', '$story', '$storyext', now(), '$prefs[topicid]', '$alanguage')";
echo $sql; exit();
       $result = $db->sql_query($sql);
       if(!$result) {
             echo ""._ERROR."<br>";
      exit();
       }
       if($notify) {
         $notify_message = "$notify_message\n\n\n========================================================\n$subject\n\n\n$story\n\n$storyext\n\n$name";
          mail($notify_email, $notify_subject, $notify_message, "From: $notify_from\nX-Mailer: PHP/" . phpversion());
       }
    }
    else {
       $haspoll = 0;
       $id = 0;
       $catid = getStoriesCat($tid);
       if ($story == $storyext) $storyext = "";

       $sql ="insert into ".$prefix."_stories (sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, ihome, alanguage, acomm, haspoll, pollID, score, ratings, associated) values (NULL, '$catid', '$name', '$subject', now(), '$story', '$storyext', '0', '0', '$prefs[topicid]', '$name', '$notes', '$prefs[publish]', '$alanguage', '0', '$haspoll', '$id',   '0', '0', '')";

       $result = $db->sql_query($sql);
       if (!$result) {
           Header("Locations: modules.php?name=League&file=game&op=update_game&schid=$schid&lid=$lid&sid=$sid");
       }
       
       $result = $db->sql_query("select tid1, tid2 from " . $prefix . "_league_schedule where id = $schid");
       list($tid1, $tid2) = $db->sql_fetchrow($result);

       if ($tid == $tid1)
          $mr = "matchreport1";
       else if ($tid == $tid2)
          $mr = "matchreport2";
       else
          $mr = "";

       if ($mr != "")
          $db->sql_query("update " . $prefix . "_league_schedule set $mr = last_insert_id() where id = $schid");

       if ($uid == 1) {
       } else {
          $db->sql_query("update ".$prefix."_users set counter=counter+1 where uid='$uid'");
       }
       if ($aid != "")
          $db->sql_query("update ".$prefix."_authors set counter=counter+1 where aid='$aid'");
    }

    Header("Location: modules.php?name=League&file=game&op=update_game&schid=$schid&lid=$lid&sid=$sid");

}

function removeStory($sid, $schid, $lid, $ssid, $ok=0) {
    global $aid, $prefix, $db;

    $result2 = $db->sql_query("select aid from ".$prefix."_stories where sid='$sid'");
    list($aaid) = $db->sql_fetchrow($result2);
    if($ok) {
       $counter--;
       $db->sql_query("DELETE FROM ".$prefix."_stories where sid=$sid");
       $db->sql_query("DELETE FROM ".$prefix."_comments where sid=$sid");
       $db->sql_query("update ".$prefix."_poll_desc set artid='0' where artid='$sid'");
       $result = $db->sql_query("update ".$prefix."_authors set counter=counter-1' where aid='$aid'");
       $db->sql_query("update " . $prefix . "_league_schedule set matchreport1 = NULL where id = $schid and matchreport1 = $sid");
       $db->sql_query("update " . $prefix . "_league_schedule set matchreport2 = NULL where id = $schid and matchreport2 = $sid");
        Header("Location: modules.php?name=League&file=game&op=update_game&schid=$schid&lid=$lid&sid=$ssid");
     }
     else {
        include("header.php");
     
        OpenTable();
        echo "<center><font class=\"title\"><b>"._ARTICLEADMIN."</b></font></center>";
        CloseTable();
        echo "<br>";
        OpenTable();
        echo "<center>"._REMOVESTORY." $sid "._ANDCOMMENTS."";
        echo "<br><br>[ <a href=\"admin.php\">"._NO."</a> | <a href=\"modules.php?name=League&amp;file=news&amp;op=RemoveStory&amp;sid=$sid&amp;schid=$schid&amp;lid=$lid&amp;ssid=$ssid&amp;ok=1\">"._YES."</a> ]</center>";
        CloseTable();
        include("footer.php");
     }
}

switch($op) {

    case ""._PREVIEW."":
   PreviewStory($name, $address, $subject, $story, $storyext, $topic, $alanguage, $posttype, $schid, $lid, $sid, $tid);
   break;

    case ""._OK."":
   SubmitStory($name, $address, $subject, $story, $storyext, $topic, $alanguage, $posttype, $schid, $lid, $sid, $tid);
   break;

    case "RemoveStory":
       removeStory($sid, $schid, $lid, $ssid, $ok);
       break;

    default:
   defaultDisplay($schid, $lid, $sid, $tid);
   break;

}

?>
 
kguske







PostPosted: Sat Dec 06, 2008 8:06 am Reply with quote

You'll get a PHP error on line 92. Just change that to:
Code:
   echo "<br><br><b>"._EXTENDEDTEXT.":</b><br>"


Same thing on line 181:
Code:
   echo "<br><b>"._EXTENDEDTEXT.":</b><br>"


Other than that, I think it should work.
 
stclem







PostPosted: Mon Dec 08, 2008 10:20 am Reply with quote

thanks.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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 ©