PDA

View Full Version : wysiwyg troubles in 3.0.x


AN-net
10-25-2005, 06:44 PM
ok the content of the entry disappears when i submit it>_<
here is the code:

if($_POST['do'] == "insertentry")
{
globalize($_POST, array(
'journalid' => INT,
'title' => STR_NOHTML,
'message' => STR,
'private' => INT,
'wcv' => STR_NOHTML,
'mood' => INT,
'allowbudds' => INT
));

$vbjverify= new verify();
if($vbjverify->verify_journal('journalist_compare', $journalid) AND $bbuserinfo['userid']!=0)
{
if($_POST['preview'] == "Preview Entry")
{
$show['entrypreview']= true;
$preview= array();
if(isset($_POST['WYSIWYG_HTML']))
{
echo "This is WYSIWYG!";
require_once('./includes/functions_wysiwyg.php');
$message = trim(convert_wysiwyg_html_to_bbcode($_POST['WYSIWYG_HTML'], 0));
}
require_once('./includes/functions_newpost.php');
$preview['message_parsed']= convert_url_to_bbcode($message);
require_once('./includes/functions_bbcodeparse.php');
$preview['message_parsed']= parse_bbcode2($preview['message_parsed'], 0, $setting['allow_imgcode'], $setting['allow_smilies'], $setting['allow_bbcode']);
$preview['message']= htmlspecialchars_uni($message);
$preview['title']= $title;
$preview['private']= $private;
$preview['allowbuddies']= $allowbudds;
$preview['whocanview']= $wcv;
if($mood != 0)
{
$getmood= $DB_site->query_first("SELECT mood_name, mood_image FROM " . TABLE_PREFIX . "journal_moods WHERE mood_id=" . $mood . "");
$preview['moodname']= $getmood['mood_name'];
$preview['moodimg']= $getmood['mood_image'];
$preview['mood']= $mood;
$preview['showmood']= true;
}
eval('$entrypreview = "' . fetch_template('journal_entrypreview')."\";");
$_REQUEST['do']= "addentry";
}
else
{
$journal= array();
$journal['journal_id']= $journalid;

$entry= array();
$entry['title']= $title;
if (isset($_POST['WYSIWYG_HTML']))
{
require_once('./includes/functions_wysiwyg.php');
$entry['message'] = trim(convert_wysiwyg_html_to_bbcode($_POST['WYSIWYG_HTML'], 0));
}
else
{
$entry['message'] = trim($message);
}
$entry['private']= $private;
$entry['whocanview']= trim($wcv);
$entry['mood']= $mood;
$entry['allowbuddies']= $allowbudds;

$vbjcreate= new create();
$vbjcreate->build_new_entry($entry, $journal, true);

$url="journal.php?do=showjournal&j=".$journal['journal_id']."";
eval(print_standard_redirect('redirect_journalentr yinserted'));
}
}
else
{
print_no_permission();
}
}

deathemperor
10-26-2005, 03:04 AM
the same problem happens to me, I can neither get the value in WYSIWYG in 3.0 nor 3.5.

thinking of someone have experiences and share.

AN-net
10-26-2005, 06:34 PM
anyone know of a solution???

AN-net
10-29-2005, 01:07 AM
please someone help!!!!

AN-net
10-31-2005, 07:18 PM
i still seek an answer>_>

AN-net
11-02-2005, 11:13 PM
i beg that someone please answer my question!!!!

AN-net
11-04-2005, 11:06 PM
someone answer my question PLEASE!

AN-net
11-07-2005, 01:11 PM
Please I Need Help!!
edit: here is the template:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - vB Journal: Add New Entry</title>
<script type="text/javascript">
function validate()
{
form=document.vbform
entrytitle=form.title.value
entrytext=form.message.value
submitOK="true"
if(entrytitle.length<5)
{
alert("Your title for this entry must be at least 5 characters.")
submitOK="false"
}
if(entrytext.length<10)
{
alert("Your message for your journal entry must be at least 10 characters.")
submitOK="false"
}
if(submitOK=="false")
{
return false
}
}
</script>
$headinclude
</head>
<body$onload>
$header
$navbar
<br />
<if condition="$show[entrypreview]">
$entrypreview
<br />
</if>
<form action="journal.php" method="post" name="vbform" onsubmit="return validate()">
<input type="hidden" name="journalid" value="$j" />
<input type="hidden" name="do" value="insertentry" />
<table class="tborder" width="100%" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" align="center">
<tr>
<td class="tcat">Add Entry:</td>
</tr>
<tr>
<td class="thead">General Journal Entry Information(Required):</td>
</tr>
<tr>
<td class="alt1">Entry Title: <input type="text" name="title" value="$preview[title]" maxlength="80" size="65" /></td>
</tr>
<tr>
<td class="alt2"><fieldset><legend>Entry Message:</legend>$messagearea</fieldset></td>
</tr>
<tr>
<td class="alt1">Mood: <select name="mood"><optgroup label="Moods">
<option value="0">None</option>
$moodbits</optgroup>
</select>
</td>
</tr>
<tr>
<td class="thead">Journal Entry Privacy(Optional):</td>
</tr>
<tr>
<td class="alt1">Would you like this entry to be private?<input type="checkbox" name="private" value="1" <if condition="$preview['private']==1">checked="checked" </if>/><br />
Allow Your Journal Buddies to View This Entry?<input type="checkbox" name="allowbudds" value="1" <if condition="$preview[allowbuddies]==1">checked="checked" </if>/><br />
If so, who can view?<input type="text" name="wcv" value="$preview[whocanview]" maxlength="150" size="100" /><div class="smallfont">(Type in the userids of the people who you wish to view this entry;remember to put a comma(,) inbetween each userid)</div></td>
</tr>
<tr>
<td class="thead" align="center"><input type="submit" name="submit" value="Submit Entry" class="button" />&nbsp;<input type="submit" name="preview" value="Preview Entry" class="button" /></td>
</tr>
</table>
</form>
<br />
<div align="center" class="smallfont">$setting[copyright]</div>
<br />
$footer
</body>
</html>

AN-net
11-08-2005, 01:17 PM
In order for the WYSIWYG editor to function properly you must have


onsubmit="return validatePost(this, this.subject.value, $vboptions[postminchars], $vboptions[postmaxchars]);"


in the form tag so that $_POST['WYSIWYG_HTML'] is filled.

This is only for 3.0.x though

deathemperor
02-16-2006, 04:55 AM
thanks An-net, this is really helpful.