nukeSEO.com - PHPNuke SEO Search engine optimization, professional tools including nukeSEO, nukeSPAM, nukeFEED, nukePIE, nukeWYSIWYG and more

 

. Welcome to nukeSEO.com  ! 
.
.
.

Tag This



.
nukeSEO.com: Forums


 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

help please
 
 
Post new topic   Reply to topic    nukeSEO.com Forum Index -> nukeWYSIWYG (tm)
View previous topic :: View next topic  
Author Message
orgis
webmaster


Joined: Mar 08, 2007
Posts: 6
Location: Scotland

PostPosted: Fri Mar 09, 2007 11:35 am    Post subject: help please Reply with quote

i installed the wysiwyg editor and managed to get it to work with submit news but i want it for admin only and to work with the content , blocks and messages im a noob and not quite sure how to go about it
any help much appreciated
thanks
_________________
Only registered users can see links on this board! Get registered or login!
  
Back to top
View user's profile Send private message Visit poster's website
kguske
Site Admin
Site Admin


Joined: May 12, 2005
Posts: 875

PostPosted: Fri Mar 09, 2007 11:52 am    Post subject: Re: help please Reply with quote

You can use the admin function to create new stories, and turn off the wysiwyg editor in the submit news module (or disable the submit news module altogether, depending on your requirements).

It can be integrated with content and with blocks and messages administration (I think we had examples in the first version).
_________________
  
Back to top
View user's profile Send private message Visit poster's website
orgis
PostPosted: Fri Mar 09, 2007 11:55 am    Post subject: Re: help please Reply with quote

submit news is disabled for users on my site so thats not a problem.

how can i integrate with content and with blocks and messages administration?

im not sure what files to edit and where exactly to edit them

for messages would i change this
Code:
   ."<b>" . _MESSAGECONTENT . ":</b><br>"

   ."<textarea name=\"add_content\" rows=\"15\" wrap=\"virtual\" cols=\"60\"></textarea><br><br>";


to this
Code:
   ."<b>" . _MESSAGECONTENT . ":</b><br>"

   ."<textarea name=\"add_content\" rows=\"15\" wrap=\"virtual\" cols=\"60\"></textarea><br><br>";
   wysiwyg_textarea("content", "", "NukeUser", "50", "12");


would i change "NukeUser" to "PHPNukeAdmin"?

or am i way off?

ok i went for the lets go do it mode lol and got this as a result

Image
  
Back to top
kguske
PostPosted: Tue Mar 13, 2007 7:16 am    Post subject: Re: help please Reply with quote

Looks good. The toolbar defines what functions are available. Using the PHPNukeAdmin toolbar allows the ability to upload files, so it's appropriate for admin use on the content, blocks and messages administration pages.
  
Back to top
orgis
PostPosted: Tue Mar 13, 2007 7:26 pm    Post subject: Re: help please Reply with quote

no its not good! it doesnt work it has created an extra box with the editor if you look closer, and it posts a blank message, dont know where i have gone wrong
  
Back to top
kguske
PostPosted: Tue Mar 13, 2007 8:33 pm    Post subject: Re: help please Reply with quote

OK. Why not send (or post a text version) of the file so I can take a look?
  
Back to top
orgis
PostPosted: Sun Mar 18, 2007 2:56 pm    Post subject: Re: help please Reply with quote

here is my admin\modules\messages.php

Code:


    echo "<center><font class=\"title\"><b>" . _ADDMSG . "</b></font></center><br>";
    echo "<form action=\"".$admin_file.".php\" method=\"post\">"
   ."<br><b>" . _MESSAGETITLE . ":</b><br>"
   ."<input type=\"text\" name=\"add_title\" value=\"\" size=\"50\" maxlength=\"100\"><br><br>"
   ."<b>" . _MESSAGECONTENT . ":</b><br>"
   ."<textarea name=\"add_content\" rows=\"15\" wrap=\"virtual\" cols=\"60\"></textarea><br><br>";
   wysiwyg_textarea("content", "", "NukeUser", "50", "12");
.
.
.

function editmsg($mid) {
.
.
.
    echo "<form action=\"".$admin_file.".php\" method=\"post\">"
   ."<br><b>" . _MESSAGETITLE . ":</b><br>"
   ."<input type=\"text\" name=\"title\" value=\"$title\" size=\"50\" maxlength=\"100\"><br><br>"
   ."<b>" . _MESSAGECONTENT . ":</b><br>"
   ."<textarea name=\"content\" rows=\"15\" wrap=\"virtual\" cols=\"60\">$content</textarea><br><br>";
.
.
.


thanks for looking.
  
Back to top
kguske
PostPosted: Sun Mar 18, 2007 4:47 pm    Post subject: Re: help please Reply with quote

You added the WYSIWYG, but did not remove the original textarea.

Change it like this:
Code:
   ."<b>" . _MESSAGECONTENT . ":</b><br>";

#   ."<textarea name=\"add_content\" rows=\"15\" wrap=\"virtual\" cols=\"60\"></textarea><br><br>";
   wysiwyg_textarea("add_content", "", "PHPNukeAdmin", "50", "12");
   echo "<br><br>";

and this:
Code:
   ."<b>" . _MESSAGECONTENT . ":</b><br>";

#   ."<textarea name=\"content\" rows=\"15\" wrap=\"virtual\" cols=\"60\">$content</textarea><br><br>";
   wysiwyg_textarea("content", "$content", "PHPNukeAdmin", "60", "15");
   echo "<br><br>";
  
Back to top
orgis
PostPosted: Mon Mar 19, 2007 8:09 am    Post subject: Re: help please Reply with quote

ok here is what i done but now the title message box is missing.
what have i done now lol

Image

Code:
<?php


/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* 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.       */
/************************************************************************/

if ( !defined('ADMIN_FILE') )
{
   die ("Access Denied");
}
global $prefix, $db, $admin_file;
$aid = substr("$aid", 0,25);
$row = $db->sql_fetchrow($db->sql_query("SELECT radminsuper FROM " . $prefix . "_authors WHERE aid='$aid'"));
if ($row['radminsuper'] == 1) {

/*********************************************************/
/* Messages Functions                                    */
/*********************************************************/

function MsgDeactive($mid) {
    global $prefix, $db, $admin_file;
    $mid = intval($mid);
    $db->sql_query("update " . $prefix . "_message set active='0' WHERE mid='$mid'");
    Header("Location: ".$admin_file.".php?op=messages");
}

function messages() {
    global $admin, $admlanguage, $language, $bgcolor1, $bgcolor2, $prefix, $db, $multilingual, $admin_file;
    include("header.php");
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _MESSAGESADMIN . "</b></font></center>";
    CloseTable();
    echo "<br>";
    if (empty($admlanguage)) {
       $admlanguage = $language; /* This to make sure some language is pre-selected */
    }
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _ALLMESSAGES . "</b></font><br><br><table border=\"1\" width=\"100%\" bgcolor=\"$bgcolor1\">"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>" . _ID . "</b></td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>" . _TITLE . "</b></td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\">&nbsp;<b>" . _LANGUAGE . "</b>&nbsp;</td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\" nowrap>&nbsp;<b>" . _VIEW . "</b>&nbsp;</td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\">&nbsp;<b>" . _ACTIVE . "</b>&nbsp;</td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\">&nbsp;<b>" . _FUNCTIONS . "</b>&nbsp;</td></tr>";
    $result = $db->sql_query("SELECT mid, title, content, date, expire, active, view, mlanguage from " . $prefix . "_message");
    while ($row = $db->sql_fetchrow($result)) {
    $mid = intval($row['mid']);
    $title = check_html($row['title'], "nohtml");
    $content = check_html($row['content'], "");
    $mdate = $row['date'];
    $expire = intval($row['expire']);
    $active = intval($row['active']);
    $view = intval($row['view']);
    $mlanguage = $row['mlanguage'];
    if ($active == 1) {
   $mactive = "" . _YES . "";
    } elseif ($active == 0) {
   $mactive = "" . _NO . "";
    }
    if ($view == 1) {
   $mview = "" . _MVALL . "";
    } elseif ($view == 2) {
   $mview = "" . _MVANON . "";
    } elseif ($view == 3) {
   $mview = "" . _MVUSERS . "";
    } elseif ($view == 4) {
   $mview = "" . _MVADMIN . "";
    } elseif ($view == 5) {
   $mview = ""._SUBUSERS."";
    }
   if (empty($mlanguage)) {
   $mlanguage = "" . _ALL . "";
   }
   echo "<tr><td align=\"right\"><b>$mid</b>"
       ."</td><td align=\"left\" width=\"100%\"><b>$title</b>"
       ."</td><td align=\"center\">$mlanguage"
       ."</td><td align=\"center\" nowrap>$mview"
       ."</td><td align=\"center\">$mactive"
       ."</td><td align=\"right\" nowrap>(<a href=\"".$admin_file.".php?op=editmsg&mid=$mid\">" . _EDIT . "</a>-<a href=\"".$admin_file.".php?op=deletemsg&mid=$mid\">" . _DELETE . "</a>)"
       ."</td></tr>";

    }
    echo "</table></center><br>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _ADDMSG . "</b></font></center><br>";
    echo "<form action=\"".$admin_file.".php\" method=\"post\">"
   ."<br><b>" . _MESSAGETITLE . ":</b><br>"
   ."<input type=\"text\" name=\"add_title\" value=\"\" size=\"50\" maxlength=\"100\"><br><br>"
   ."<b>" . _MESSAGECONTENT . ":</b><br>"
   ."<textarea name=\"add_content\" rows=\"15\" wrap=\"virtual\" cols=\"60\"></textarea><br><br>";
   wysiwyg_textarea("content", "", "NukeUser", "50", "12");
    if ($multilingual == 1) {
   echo "<b>" . _LANGUAGE . ": </b>"
       ."<select name=\"add_mlanguage\">";
   $handle=opendir('language');
   $languageslist = "";
   while ($file = readdir($handle)) {
       if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
           $langFound = $matches[1];
           $languageslist .= "$langFound ";
       }
   }
   closedir($handle);
   $languageslist = explode(" ", $languageslist);
   sort($languageslist);
   for ($i=0; $i < sizeof($languageslist); $i++) {
       if($languageslist[$i]!="") {
      echo "<option value=\"$languageslist[$i]\" ";
      if($languageslist[$i]==$language) echo "selected";
      echo ">".ucfirst($languageslist[$i])."</option>\n";
       }
   }
   echo "<option value=\"\">" . _ALL . "</option></select><br><br>";
    } else {
   echo "<input type=\"hidden\" name=\"add_mlanguage\" value=\"\">";
    }
    $now = time();
    echo "<b>" . _EXPIRATION . ":</b> <select name=\"add_expire\">"
   ."<option value=\"86400\" >1 " . _DAY . "</option>"
   ."<option value=\"172800\" >2 " . _DAYS . "</option>"
   ."<option value=\"432000\" >5 " . _DAYS . "</option>"
   ."<option value=\"1296000\" >15 " . _DAYS . "</option>"
   ."<option value=\"2592000\" >30 " . _DAYS . "</option>"
   ."<option value=\"0\" >" . _UNLIMITED . "</option>"
   ."</select><br><br>"
   ."<b>Active?</b> <input type=\"radio\" name=\"add_active\" value=\"1\" checked>" . _YES . " "
   ."<input type=\"radio\" name=\"add_active\" value=\"0\" >" . _NO . "";
    echo "<br><br><b>" . _VIEWPRIV . "</b> <select name=\"add_view\">"
   ."<option value=\"1\" >" . _MVALL . "</option>"
   ."<option value=\"2\" >" . _MVANON . "</option>"
   ."<option value=\"3\" >" . _MVUSERS . "</option>"
   ."<option value=\"4\" >" . _MVADMIN . "</option>"
   ."<option value=\"5\" >" . _SUBUSERS . "</option>"
   ."</select><br><br>"
   ."<input type=\"hidden\" name=\"op\" value=\"addmsg\">"
   ."<input type=\"hidden\" name=\"add_mdate\" value=\"$now\">"
   ."<input type=\"submit\" value=\"" . _ADDMSG . "\">"
   ."</form>";
    CloseTable();
    include("footer.php");
}

function editmsg($mid) {
    global $admin, $prefix, $db, $multilingual, $admin_file;
    include("header.php");
    $mid = intval($mid);
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _MESSAGESADMIN . "</b></font></center>";
    CloseTable();
    echo "<br>";
    $row = $db->sql_fetchrow($db->sql_query("SELECT title, content, date, expire, active, view, mlanguage from " . $prefix . "_message WHERE mid='$mid'"));
    $title = check_html($row['title'], "nohtml");
    $content = stripslashes(check_html($row['content'], ""));
    $mdate = $row['date'];
    $expire = intval($row['expire']);
    $active = intval($row['active']);
    $view = intval($row['view']);
    $mlanguage = $row['mlanguage'];
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _EDITMSG . "</b></font></center>";
    if ($active == 1) {
   $asel1 = "checked";
   $asel2 = "";
    } elseif ($active == 0) {
   $asel1 = "";
   $asel2 = "checked";
    }
    $sel1 = $sel2 = $sel3 = $sel4 = $sel5 = "";
    if ($view == 1) {
   $sel1 = "selected";
    } elseif ($view == 2) {
   $sel2 = "selected";
    } elseif ($view == 3) {
   $sel3 = "selected";
    } elseif ($view == 4) {
   $sel4 = "selected";
    } elseif ($view == 5) {
   $sel5 = "selected";
    }
    $esel1 = $esel2 = $esel3 = $esel4 = $esel5 = $esel6 = "";
    if ($expire == 86400) {
   $esel1 = "selected";
    } elseif ($expire == 172800) {
   $esel2 = "selected";
    } elseif ($expire == 432000) {
   $esel3 = "selected";
    } elseif ($expire == 1296000) {
   $esel4 = "selected";
    } elseif ($expire == 2592000) {
   $esel5 = "selected";
    } elseif ($expire == 0) {
   $esel6 = "selected";
    }
    echo "<form action=\"".$admin_file.".php\" method=\"post\">"
   ."<br><b>" . _MESSAGETITLE . ":</b><br>"
   ."<input type=\"text\" name=\"title\" value=\"$title\" size=\"50\" maxlength=\"100\"><br><br>"
   ."<b>" . _MESSAGECONTENT . ":</b><br>";
#   ."<textarea name=\"content\" rows=\"15\" wrap=\"virtual\" cols=\"60\">$content</textarea><br><br>";
   wysiwyg_textarea("content", "$content", "PHPNukeAdmin", "60", "15");
   echo "<br><br>";
    if ($multilingual == 1) {
   echo "<b>" . _LANGUAGE . ": </b>"
       ."<select name=\"mlanguage\">";
   $handle=opendir('language');
   $languageslist = "";
   while ($file = readdir($handle)) {
       if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
           $langFound = $matches[1];
           $languageslist .= "$langFound ";
       }
   }
   closedir($handle);
   $languageslist = explode(" ", $languageslist);
   sort($languageslist);
   for ($i=0; $i < sizeof($languageslist); $i++) {
       if(!empty($languageslist[$i])) {
      echo "<option value=\"$languageslist[$i]\" ";
      if($languageslist[$i]==$mlanguage) echo "selected";
      echo ">".ucfirst($languageslist[$i])."</option>\n";
       }
   }
   if (empty($mlanguage)) {
       $sellang = "selected";
   } else {
           $sellang = "";
   }
   echo "<option value=\"\" $sellang>" . _ALL . "</option></select><br><br>";
    } else {
   echo "<input type=\"hidden\" name=\"mlanguage\" value=\"\">";
    }
    echo "<b>" . _EXPIRATION . ":</b> <select name=\"expire\">"
   ."<option name=\"expire\" value=\"86400\" $esel1>1 " . _DAY . "</option>"
   ."<option name=\"expire\" value=\"172800\" $esel2>2 " . _DAYS . "</option>"
   ."<option name=\"expire\" value=\"432000\" $esel3>5 " . _DAYS . "</option>"
   ."<option name=\"expire\" value=\"1296000\" $esel4>15 " . _DAYS . "</option>"
   ."<option name=\"expire\" value=\"2592000\" $esel5>30 " . _DAYS . "</option>"
   ."<option name=\"expire\" value=\"0\" $esel6>" . _UNLIMITED . "</option>"
   ."</select><br><br>"
   ."<b>Active?</b> <input type=\"radio\" name=\"active\" value=\"1\" $asel1>" . _YES . " "
   ."<input type=\"radio\" name=\"active\" value=\"0\" $asel2>" . _NO . "";
    if ($active == 1) {
   echo "<br><br><b>" . _CHANGEDATE . "</b>"
       ."<input type=\"radio\" name=\"chng_date\" value=\"1\">" . _YES . " "
       ."<input type=\"radio\" name=\"chng_date\" value=\"0\" checked>" . _NO . "<br><br>";
    } elseif ($active == 0) {
   echo "<br><font class=\"tiny\">" . _IFYOUACTIVE . "</font><br><br>"
       ."<input type=\"hidden\" name=\"chng_date\" value=\"1\">";
    }
    echo "<b>" . _VIEWPRIV . "</b> <select name=\"view\">"
   ."<option name=\"view\" value=\"1\" $sel1>" . _MVALL . "</option>"
   ."<option name=\"view\" value=\"2\" $sel2>" . _MVANON . "</option>"
   ."<option name=\"view\" value=\"3\" $sel3>" . _MVUSERS . "</option>"
   ."<option name=\"view\" value=\"4\" $sel4>" . _MVADMIN . "</option>"
   ."<option name=\"view\" value=\"5\" $sel5>" . _SUBUSERS . "</option>"
   ."</select><br><br>"
   ."<input type=\"hidden\" name=\"mdate\" value=\"$mdate\">"
   ."<input type=\"hidden\" name=\"mid\" value=\"$mid\">"
   ."<input type=\"hidden\" name=\"op\" value=\"savemsg\">"
   ."<input type=\"submit\" value=\"" . _SAVECHANGES . "\">"
   ."</form>";
    CloseTable();
    include("footer.php");
}

function savemsg($mid, $title, $content, $mdate, $expire, $active, $view, $chng_date, $mlanguage) {
    global $prefix, $db, $admin_file;
    $mid = intval($mid);
    $title = addslashes(check_words(check_html($title, "nohtml")));
    $content = addslashes(check_words(check_html($content, "")));
    if ($chng_date == 1) {
   $newdate = time();
    } elseif ($chng_date == 0) {
   $newdate = intval($mdate);
    }
    $result = $db->sql_query("update " . $prefix . "_message set title='$title', content='$content', date='$newdate', expire='".intval($expire)."', active='".intval($active)."', view='".intval($view)."', mlanguage='".addslashes($mlanguage)."' WHERE mid='$mid'");
    Header("Location: ".$admin_file.".php?op=messages");
}

function addmsg($add_title, $add_content, $add_mdate, $add_expire, $add_active, $add_view, $add_mlanguage) {
    global $prefix, $db, $admin_file;
    $add_title = addslashes(check_words(check_html($add_title, "nohtml")));
    $add_content = addslashes(check_words(check_html($add_content, "")));
    $result = $db->sql_query("insert into " . $prefix . "_message values (NULL, '$add_title', '$add_content', '".intval($add_mdate)."', '".intval($add_expire)."', '".intval($add_active)."', '".intval($add_view)."', '".addslashes($add_mlanguage)."')");
    if (!$result) {
   exit();
    }
    Header("Location: ".$admin_file.".php?op=messages");
}

function deletemsg($mid, $ok=0) {
    global $prefix, $db, $admin_file;
    $mid = intval($mid);
    if($ok) {
   $result = $db->sql_query("delete from " . $prefix . "_message where mid='$mid'");
       if (!$result) {
       return;
       }
   Header("Location: ".$admin_file.".php?op=messages");
    } else {
   include("header.php");
   GraphicAdmin();
   OpenTable();
   echo "<center><font size=\"4\"><b>" . _MESSAGESADMIN . "</b></font></center>";
   CloseTable();
   echo "<br>";
   OpenTable();
   echo "<center>" . _REMOVEMSG . "";
   echo "<br><br>[ <a href=\"".$admin_file.".php?op=messages\">" . _NO . "</a> | <a href=\"".$admin_file.".php?op=deletemsg&amp;mid=$mid&amp;ok=1\">" . _YES . "</a> ]</center>";
       CloseTable();
   include("footer.php");
    }
}
if (!isset($title)) { $title = ""; }
if (!isset($content)) { $content = ""; }
if (!isset($mdate)) { $mdate = ""; }
if (!isset($expire)) { $expire = ""; }
if (!isset($active)) { $active = ""; }
if (!isset($view)) { $view = ""; }
if (!isset($chng_date)) { $chng_date = ""; }
if (!isset($mlanguage)) { $mlanguage = ""; }
if (!isset($ok)) { $ok = ""; }

switch ($op){

    case "messages":
    messages();
    break;

    case "editmsg":
    editmsg($mid, $title, $content, $mdate, $expire, $active, $view, $chng_date, $mlanguage);
    break;

    case "addmsg":
    addmsg($add_title, $add_content, $add_mdate, $add_expire, $add_active, $add_view, $add_mlanguage);
    break;

    case "deletemsg":
    deletemsg($mid, $ok);
    break;

    case "savemsg":
    savemsg($mid, $title, $content, $mdate, $expire, $active, $view, $chng_date, $mlanguage);
    break;

}

} else {
    echo "Access Denied";
}

?>


when i add a message it doesnt show i have to go into edit then i get the ""Title" box then it works have i edited the wrong bits or something?
Thanks for the help mate
  
Back to top
kguske
PostPosted: Mon Mar 19, 2007 11:23 am    Post subject: Re: help please Reply with quote

Not sure how you removed the title, but I updated your code in the last post to put it back. The change is in the
Code:
function messages()

The section where you create messages should look like this:
Code:
    echo "<center><font class=\"title\"><b>" . _ADDMSG . "</b></font></center><br>";

    echo "<form action=\"".$admin_file.".php\" method=\"post\">"
   ."<br><b>" . _MESSAGETITLE . ":</b><br>"
   ."<input type=\"text\" name=\"add_title\" value=\"\" size=\"50\" maxlength=\"100\"><br><br>"
   ."<b>" . _MESSAGECONTENT . ":</b><br>"
   ."<textarea name=\"add_content\" rows=\"15\" wrap=\"virtual\" cols=\"60\"></textarea><br><br>";
   wysiwyg_textarea("content", "", "NukeUser", "50", "12");
  
Back to top
orgis
PostPosted: Mon Mar 19, 2007 2:29 pm    Post subject: Re: help please Reply with quote

well after many a headche its now working, i must of made more mistakes so i got the original file and started again with your previous code and hey presto success!
sorry to be a pain and thanks for the great support and speedy replies!
thankyou
regards
orgis
  
Back to top
Display posts from previous:       
Post new topic   Reply to topic    nukeSEO.com Forum Index -> nukeWYSIWYG (tm) All times are GMT - 5 Hours
 
 Page 1 of 1

 

Jump to:   
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 cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group


Page Generation: 0.18 Seconds