vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   wysiwyg troubles in 3.0.x (https://vborg.vbsupport.ru/showthread.php?t=99298)

AN-net 10-25-2005 06:44 PM

wysiwyg troubles in 3.0.x
 
ok the content of the entry disappears when i submit it>_<
here is the code:
PHP 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$journaltrue);
                    
                    
$url="journal.php?do=showjournal&j=".$journal['journal_id']."";
                    eval(
print_standard_redirect('redirect_journalentryinserted'));
                }
            }
            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:
HTML Code:

$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

HTML Code:

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.


All times are GMT. The time now is 06:29 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01116 seconds
  • Memory Usage 1,797KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete