تحديث آخر نسخة 1.8.37

تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
شرح تركيب هاك الـ WYSIWYG.
#1
السلام عليكم. هاك محرر الـ WYSIWYG لكتابة المواضيع والرسائل الخاصة, وهذا هو شرح لكيفية التركيب فقط بناء على كثرة طلبات الأعضاء لهذا الهاك.. لكنى لا اضمن فى هذا الهاك اى شئ, حيث به الكثير من الأخطاء.
نبدأ بسم الله..
لمن لا يعرف عمل هذا الهاك اختصارا للوقت يمكنك رؤية مثال حى على الهاك. بالضغط هنا

للتحميل

اضغط هنا

نأتى لشرح التركيب.
  1. قم بفك ضغط الملف
  2. ارفع محتويات الملف الذى قمت بفك الضغط عنه, الى مجلد المنتدى الرئيسى.
  3. افتح ملف inc/class_parser.php بأى محرر نصوص لديك.
    • ابحث بداخله عن
      PHP كود :
      $message $plugins->run_hooks("parse_message_end"$message); 
    • اضف بعده التالى
      PHP كود :
      preg_match_all("/\{EDITOR=(.*?)EDITOR\}/si",$message,$matches);
      $get_code $matches[1][0];
      if(
      $get_code !=""){        
          
      $message=str_replace("$get_code","{HOTEDITOR_TMP}",$message);
          
      $get_code=str_replace("&","&",$get_code);
          
      $get_code=str_replace("<","<",$get_code);
          
      $get_code=str_replace(">",">",$get_code);
          
      $get_code=str_replace("[<]","<",$get_code);
          
      $get_code=str_replace("[>]",">",$get_code);    
          
      $get_code=str_replace("[<]","<",$get_code);
          
      $get_code=str_replace("[>]",">",$get_code);
          
      $get_code=str_replace("<br />","",$get_code);
          if(
      $replace_quote=="1") {
              
      $get_code=str_replace(""","\"",$get_code);    
          }
          
      $get_code=str_replace(" "," ",$get_code);    

          
      //Strip All Unwanted HTML Tags (incase user copy (Ctrl-C) and paste (Ctrl-V) stuff to HotEditor
          
      $get_code=strip_tags($get_code,"<p><a><span><div><font><b><i><u><strong><em><ul>
      <ol><li><blockquote><img><strike><sub><sup><hr><pre><tt><br>"
      );
          
          
      // Clear all onClick onMouseOver onMouseOut onMouseDown
       
      onMouseUp onMouseMove onBlur cursor
          
      // position absolute visibility visible z-index


          // Example <span onClick=alert('BOOOO')>Click here</span>

          // will be replaced to <span =alert('BOOOO')>Click here</span>

          // in this way your board won't mess up. Hope this will help.

          
      $match_count preg_match_all("/<(.*?)>/si"$get_code$matches_code);

          for (
      $i 0$i $match_count$i++){
              
      $get_code1 $matches_code[1][$i];
              
      $get_code2 $matches_code[1][$i];
              
      $get_code2 preg_replace("/\sid=/si"""$get_code2);
              
      $get_code2 preg_replace("/\sname=/si"""$get_code2);
              
      $get_code2 preg_replace("/\sonclick=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonmouseover=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonmouseout=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonmousedown=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonmouseup=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonmousemove=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonblur=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sondblclick=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonload=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonsubmit=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonchange=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonfocus=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonselect=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonunload=/si"""$get_code2); 
              
      $get_code2 preg_replace("/\sonkeypress=/si"""$get_code2); 
              
      $get_code2 preg_replace("/position:/si"""$get_code2); 
              
      $get_code =str_replace($get_code1,$get_code2,$get_code);
          }

          
      $get_code=str_replace("\r\n",' ',$get_code);
          
      $get_code=str_replace("\n",' ',$get_code);    

          
      $message=str_replace("{HOTEDITOR_TMP}","$get_code",$message);
          
      $message=str_replace("{EDITOR=","",$message);
          
      $message=str_replace("EDITOR}","",$message);

    • ابحث عن
      PHP كود :
      function cache_mycode()
      {
          global 
      $cache$lang;
          
      $this->mycode_cache = array(); 
    • اضف بعده
      PHP كود :
      //EDITOR
      $standard_mycode['hoteditor_open']['regex'] = "#\[(sub|sup|strike|blockquote|b|i|u)\]#si";
      $standard_mycode['hoteditor_open']['replacement'] = '<$1>';
      $standard_mycode['hoteditor_close']['regex'] = "#\[\/(sub|sup|strike|blockquote|b|i|u)\]#si";
      $standard_mycode['hoteditor_close']['replacement'] = '</$1>';

      $standard_mycode['hoteditor_fontface']['regex'] = "#\[font=(.*?)\]#si";
      $standard_mycode['hoteditor_fontface']['replacement'] = '<font face="$1">';
      $standard_mycode['hoteditor_fontcolor']['regex'] = "#\[color=(.*?)\]#si";
      $standard_mycode['hoteditor_fontcolor']['replacement'] = '<font color="$1">';
      $standard_mycode['hoteditor_fontsize']['regex'] = "#\[size=(.*?)\]#si";
      $standard_mycode['hoteditor_fontsize']['replacement'] = '<font size="$1">';
      $standard_mycode['hoteditor_fontclose']['regex'] = "#\[\/(font|color|size)\]#si";
      $standard_mycode['hoteditor_fontclose']['replacement'] = '</font>';

      $standard_mycode['highlight_open']['regex'] = "#\[highlight=(.*?)\]#si";
      $standard_mycode['highlight_open']['replacement'] = "<font style=\"background-color:$1\">";
      $standard_mycode['highlight_close']['regex'] = "#\[\/highlight\]#si";
      $standard_mycode['highlight_close']['replacement'] = "</font>";

      $standard_mycode['hoteditor_align_open']['regex'] = "#\[(center|right|left|justify)\]#si";
      $standard_mycode['hoteditor_align_open']['replacement'] = '<div align="$1">';
      $standard_mycode['hoteditor_align_close']['regex'] = "#\[\/(center|right|left|justify)\]#si";
      $standard_mycode['hoteditor_align_close']['replacement'] = '</div>';

      $standard_mycode['hoteditor_flash']['regex'] = "#\[FLASH=(.*?),(.*?)\](.*?)\[\/FLASH\]#si";
      $standard_mycode['hoteditor_flash']['replacement'] = '<object width="$1" height="$2"><param name="movie" value="$3">
      </param>
      <param name="wmode" value="transparent"></param>
      <embed src="$3" type="application/x-shockwave-flash" wmode="transparent" width="$1" height="$2"></embed>
      </object>'
      ;
      //EDITOR END 
      اغلق الملف مع حفظ التعديلات
  4. افتح ملف jscripts/thread.js
    • ابحث عن
      PHP كود :
      multiQuotedLoaded: function(request)
      {
          if(
      request.responseText.match(/<error>(.*)<\/error>/))
          {
              
      message request.responseText.match(/<error>(.*)<\/error>/);
              if(!
      message[1])
              {
                  
      message[1] = "An unknown error occurred.";
              }
              
      alert('There was an error fetching the posts.\n\n'+message[1]);
          }
          else if(
      request.responseText)
          {
              var 
      id 'message';
              if(
      typeof clickableEditor != 'undefined')
              {
                  
      id clickableEditor.textarea;
              }
              if($(
      id).value)
              {
                  $(
      id).value += "\n";
              }
              $(
      id).value += request.responseText;
          }
          
      Thread.clearMultiQuoted();
          $(
      'quickreply_multiquote').style.display 'none';
          
      document.input.quoted_ids.value 'all';
          
      this.spinner.destroy();    
          
      this.spinner '';
          $(
      'message').focus();    

    • استبدله بالتالى
      PHP كود :
      multiQuotedLoaded: function(request)
      {
          if(
      request.responseText.match(/<error>(.*)<\/error>/))
          {
              
      message request.responseText.match(/<error>(.*)<\/error>/);
              if(!
      message[1])
              {
                  
      message[1] = "An unknown error occurred.";
              }
              
      alert('There was an error fetching the posts.\n\n'+message[1]);
          }
          else if(
      request.responseText)
          {
              var 
      id 'message';
              
      //EDITOR
              
      var quoteTextReturn=request.responseText;
              
      //Support MOD V.40 
              
      if(quoteTextReturn.indexOf("{EDITOR=")!=-&& quoteTextReturn.indexOf("EDITOR}")!=-1){
                  
      quoteTextReturn=quoteTextReturn.replace(/\{EDITOR=/gi,"");
                  
      quoteTextReturn=quoteTextReturn.replace(/EDITOR\}/gi,"");
                  if(
      editor_type=="0"){//BBCode Editor
                      
      quoteTextReturn=quoteTextReturn.replace(/\&/gi,"&");
                      
      quoteTextReturn=quoteTextReturn.replace(/\</gi,"<");
                      
      quoteTextReturn=quoteTextReturn.replace(/\>/gi,">");
                      
      quoteTextReturn=quoteTextReturn.replace(/\[<\]/gi,"<");
                      
      quoteTextReturn=quoteTextReturn.replace(/\[>\]/gi,">");
                      
      quoteTextReturn=quoteTextReturn.replace(/\[<\]/gi,"<");
                      
      quoteTextReturn=quoteTextReturn.replace(/\[>\]/gi,">");
                      
      quoteTextReturn=quoteTextReturn.replace(/\"/gi,"\"");
                      
      quoteTextReturn=quoteTextReturn.replace(/[\r\n]/gi,"");

                      
      quoteTextReturn=HTMLToBBCode(quoteTextReturn);
                      
      WriteTEXT(quoteTextReturn,"editor");                    
                  }
                  else{
      //WYSIWYG Editor
                      
      WriteHTML(quoteTextReturn,"editor");                    
                  }                
              }
              else{
                  if(
      isSafari && editor_type=="1"){
                      
      alert("Please switch to BBCode Editor then click this link again");
                      return 
      false;
                  }
                  if(
      editor_type=="0"){//BBCode Editor
                      
      WriteTEXT(quoteTextReturn,"editor");    
                  }
                  else{
      //WYSIWYG Editor
                      
      WriteHTML(BBCodeToHTML(quoteTextReturn),"editor");
                  }
              }
          }
          
      Thread.clearMultiQuoted();
          $(
      'quickreply_multiquote').style.display 'none';
          
      document.input.quoted_ids.value 'all';
          
      this.spinner.destroy();    
          
      this.spinner '';

      اغلق الملف مع حفظ التعديلات
  5. افتح ملف jscripts/post.js
    • ابحث عن
      PHP كود :
      multiQuotedLoaded: function(request)
      {
          if(
      request.responseText.match(/<error>(.*)<\/error>/))
          {
              
      message request.responseText.match(/<error>(.*)<\/error>/);
              if(!
      message[1])
              {
                  
      message[1] = "An unknown error occurred.";
              }
              
      alert('There was an error fetching the posts.\n\n'+message[1]);
          }
          else if(
      request.responseText)
          {
              var 
      id 'message';
              if(
      typeof clickableEditor != 'undefined')
              {
                  
      id clickableEditor.textarea;
              }
              if($(
      id).value)
              {
                  $(
      id).value += "\n";
              }
              $(
      id).value += request.responseText;
          }
          $(
      'multiquote_unloaded').style.display 'none';
          
      document.input.quoted_ids.value 'all';
          
      this.spinner.destroy();    
          
      this.spinner '';    

    • استبدله بالتالى
      PHP كود :
      multiQuotedLoaded: function(request)
      {
          if(
      request.responseText.match(/<error>(.*)<\/error>/))
          {
              
      message request.responseText.match(/<error>(.*)<\/error>/);
              if(!
      message[1])
              {
                  
      message[1] = "An unknown error occurred.";
              }
              
      alert('There was an error fetching the posts.\n\n'+message[1]);
          }
          else if(
      request.responseText)
          {
              var 
      id 'message';
              
      //EDITOR
              
      var quoteTextReturn=request.responseText;
              
      //Support user who has MOD V.40 installed months ago
              
      if(quoteTextReturn.indexOf("{EDITOR=")!=-&& quoteTextReturn.indexOf("EDITOR}")!=-1){
                  
      quoteTextReturn=quoteTextReturn.replace(/\{EDITOR=/gi,"");
                  
      quoteTextReturn=quoteTextReturn.replace(/EDITOR\}/gi,"");
                  if(
      editor_type=="0"){//BBCode Editor
                      
      quoteTextReturn=quoteTextReturn.replace(/\&/gi,"&");
                      
      quoteTextReturn=quoteTextReturn.replace(/\</gi,"<");
                      
      quoteTextReturn=quoteTextReturn.replace(/\>/gi,">");
                      
      quoteTextReturn=quoteTextReturn.replace(/\[<\]/gi,"<");
                      
      quoteTextReturn=quoteTextReturn.replace(/\[>\]/gi,">");
                      
      quoteTextReturn=quoteTextReturn.replace(/\[<\]/gi,"<");
                      
      quoteTextReturn=quoteTextReturn.replace(/\[>\]/gi,">");
                      
      quoteTextReturn=quoteTextReturn.replace(/\"/gi,"\"");
                      
      quoteTextReturn=quoteTextReturn.replace(/[\r\n]/gi,"");

                      
      quoteTextReturn=HTMLToBBCode(quoteTextReturn);
                      
      WriteTEXT(quoteTextReturn,"editor");                    
                  }
                  else{
      //WYSIWYG Editor
                      
      WriteHTML(quoteTextReturn,"editor");
                  }
              }
              else{
                  if(
      isSafari && editor_type=="1"){
                      
      alert("Please switch to BBCode Editor then click this link again");
                      return 
      false;
                  }
                  if(
      editor_type=="0"){//BBCode Editor
                      
      WriteTEXT(quoteTextReturn,"editor");    
                  }
                  else{
      //WYSIWYG Editor
                      
      WriteHTML(BBCodeToHTML(quoteTextReturn),"editor");
                  }                
              }            
          }
          $(
      'multiquote_unloaded').style.display 'none';
          
      document.input.quoted_ids.value 'all';
          
      this.spinner.destroy();    
          
      this.spinner '';    

    اغلق واحفظ التغييرات.
  6. ادخل لوحة تحكم المنتدى, وابحث عن مجموعة قوالب Edit Post Templates
    [صورة: sc_mybb_7.gif]
  7. افتح قالب edit post واستبدل محتوه بالكود التالى
    كود :
    <html>
    <head>
    <title>{$mybb->settings['bbname']} - {$lang->edit_post}</title>
    {$headerinclude}
    <script type="text/javascript" src="jscripts/post.js?ver=121"></script>
    </head>
    <body>
    {$header}
    {$preview}
    {$post_errors}
    {$attacherror}
    <form action="editpost.php" method="post" name="editpost">
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td class="thead" colspan="3"><strong>{$lang->delete_post}</strong></td>
    </tr>
    <tr>
    <td class="trow1" style="white-space: nowrap">
    <input type="checkbox" class="checkbox" name="delete" value="yes" tabindex="9" /> <strong>{$lang->delete_q}</strong></td>
    <td class="trow1" width="100%">{$lang->delete_1}<br /><span class="smalltext">{$lang->delete_2}</span></td>
    <td class="trow1"><input type="submit" class="button" name="submit" value="{$lang->delete_now}" tabindex="10" /></td>
    </tr>
    </table>
    <input type="hidden" name="action" value="deletepost" />
    <input type="hidden" name="pid" value="{$pid}" />
    </form>
    <br />
    <!--//EDITOR add code onSubmit="return get_hoteditor_data();"  -->
    <form onSubmit="return get_hoteditor_data();" action="editpost.php" method="post" enctype="multipart/form-data" name="input">
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td class="thead" colspan="2"><strong>{$lang->edit_post}</strong></td>
    </tr>
    {$loginbox}
    <tr>
    <td class="trow2"><strong>{$lang->subject}</strong></td>
    <td class="trow2"><input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
    </tr>
    {$posticons}
    <tr>
    <td class="trow2" valign="top"><strong>{$lang->your_message}:</strong><br /></td>
    <td class="trow2">
    <!-- //EDITOR -->
    <textarea style="visibility:hidden;
    position:absolute;top:-20;left:-20;width:1px;
    height:1px" name="message" id="message" rows="20" cols="70" tabindex="3">
    {$message}</textarea>
    <style type="text/css">@import url(richedit/styles/office2007/style.css);</style>            
    <script language="JavaScript" type="text/javascript" src="richedit/editor.js?version=4.2"></script>                
    <script language="JavaScript" type="text/javascript">
        var getdata =document.getElementById("message").value;
        //Make it work with MOD Hoteditor 4.0
        if(getdata.indexOf("{EDITOR=")!=-1 && getdata.indexOf("EDITOR}")!=-1){
            getdata=getdata.replace(/\&/gi,"&");
            getdata=getdata.replace(/\</gi,"<");
            getdata=getdata.replace(/\>/gi,">");
            getdata=getdata.replace(/\[<\]/gi,"<");
            getdata=getdata.replace(/\[>\]/gi,">");
            getdata=getdata.replace(/\[<\]/gi,"<");
            getdata=getdata.replace(/\[>\]/gi,">");
            getdata=getdata.replace(/\"/gi,"\"");
            getdata=getdata.replace(/[\r\n]/gi,"");
            getdata=getdata.replace(/\{EDITOR=/gi,"");
            getdata=getdata.replace(/EDITOR\}/gi,"");
            
            //Convert to BBCode
            getdata=HTMLToBBCode(getdata);
        }
        Instantiate("max","editor", getdata , "100%", "300px");            
        function get_hoteditor_data(){
            if (HTML_ON == "no"){
                alert ("Please uncheck the HTML checkbox");
                return false;
            }
            setCodeOutput();
            var bbcode_output=document.getElementById("hoteditor_bbcode_ouput_editor").value;//Output to BBCode
            
            //Make it work with MOD Hoteditor 4.0
            bbcode_output=bbcode_output.replace(/\{EDITOR=/gi,"[B]{[/B]EDITOR=");
            bbcode_output=bbcode_output.replace(/EDITOR\}/gi,"EDITOR[B]}[/B]");

            //Output BBCode to message textarea
            document.getElementById("message").value = bbcode_output;
        }
    </script>
    <!-- //EDITOR -->
    </td>
    </tr>
    <tr>
    <td class="trow1" valign="top"><strong>{$lang->post_options}</strong></td>
    <td class="trow1"><span class="smalltext">
    <label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="yes" tabindex="6" {$postoptionschecked['signature']} /> {$lang->options_sig}</label><br />
    <label><input type="checkbox" class="checkbox" name="postoptions[emailnotify]" value="yes" tabindex="7" {$postoptionschecked['emailnotify']} /> {$lang->options_emailnotify}</label>
    {$disablesmilies}</span></td>
    </tr>
    {$attachbox}
    {$pollbox}
    </table>
    <br />
    <div align="center"><input type="submit" class="button" name="submit" value="{$lang->update_post}" tabindex="3" />  <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="4" /></div>
    <input type="hidden" name="action" value="do_editpost" />
    <input type="hidden" name="pid" value="{$pid}" />
    <input type="hidden" name="posthash" value="{$posthash}" />
    <input type="hidden" name="attachmentaid" value="" />
    <input type="hidden" name="attachmentact" value="" />
    </form>
    {$footer}
    </body>
    </html>
  8. افتح قالب newreply واستبدل محتواه بالكود التالى
    كود :
    <html>
    <head>
    <title>{$lang->post_reply_to}</title>
    {$headerinclude}
    <script type="text/javascript" src="jscripts/post.js?ver=121"></script>
    </head>
    <body>
    {$header}
    {$preview}
    {$maximageserror}
    {$attacherror}
    {$reply_errors}
    <!--//EDITOR START HERE add onSubmit="return get_hoteditor_data();"  -->
    <form onSubmit="return get_hoteditor_data();" action="newreply.php" method="post" enctype="multipart/form-data" name="input">
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td class="thead" colspan="2"><strong>{$lang->post_new_reply}</strong></td>
    </tr>
    <tr>
    <td class="tcat" colspan="2"><span class="smalltext"><strong>{$lang->reply_to}</strong></span></td>
    </tr>
    {$loginbox}
    <tr>
    <td class="trow2" width="20%"><strong>{$lang->post_subject}</strong></td>
    <td class="trow2"><input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
    </tr>
    {$posticons}
    <tr>
    <td class="trow2" valign="top"><strong>{$lang->your_message}</strong><br /></td>
    <td class="trow2">
    <!-- //EDITOR -->
    <textarea style="visibility:hidden;position:absolute;top:-20;left:-20;width:1px;height:1px" id="message" name="message" rows="20" cols="70" tabindex="2" >{$message}</textarea>
    <style type="text/css">@import url(richedit/styles/office2007/style.css);</style>            
    <script language="JavaScript" type="text/javascript" src="richedit/editor.js?version=4.2"></script>                
    <script language="JavaScript" type="text/javascript">
        var getdata =document.getElementById("message").value;
        //Make it work with MOD Hoteditor 4.0
        if(getdata.indexOf("{EDITOR=")!=-1 && getdata.indexOf("EDITOR}")!=-1){
            getdata=getdata.replace(/\&/gi,"&");
            getdata=getdata.replace(/\</gi,"<");
            getdata=getdata.replace(/\>/gi,">");
            getdata=getdata.replace(/\[<\]/gi,"<");
            getdata=getdata.replace(/\[>\]/gi,">");
            getdata=getdata.replace(/\[<\]/gi,"<");
            getdata=getdata.replace(/\[>\]/gi,">");
            getdata=getdata.replace(/\"/gi,"\"");
            getdata=getdata.replace(/[\r\n]/gi,"");
            getdata=getdata.replace(/\{EDITOR=/gi,"");
            getdata=getdata.replace(/EDITOR\}/gi,"");
            
            //Convert to BBCode
            getdata=HTMLToBBCode(getdata);
        }
        Instantiate("max","editor", getdata , "100%", "300px");            
        function get_hoteditor_data(){
            if (HTML_ON == "no"){
                alert ("Please uncheck the HTML checkbox");
                return false;
            }
            setCodeOutput();
            var bbcode_output=document.getElementById("hoteditor_bbcode_ouput_editor").value;//Output to BBCode
            
            //Make it work with MOD Hoteditor 4.0
            bbcode_output=bbcode_output.replace(/\{EDITOR=/gi,"[B]{[/B]EDITOR=");
            bbcode_output=bbcode_output.replace(/EDITOR\}/gi,"EDITOR[B]}[/B]");

            //Output BBCode to message textarea
            document.getElementById("message").value = bbcode_output;
        }
    </script>
    <!-- //EDITOR -->
    {$multiquote_external}
    </td>
    </tr>
    <tr>
    <td class="trow1" valign="top"><strong>{$lang->post_options}</strong></td>
    <td class="trow1"><span class="smalltext">
    <label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="yes" tabindex="6" {$postoptionschecked['signature']} /> {$lang->options_sig}</label><br />
    <label><input type="checkbox" class="checkbox" name="postoptions[emailnotify]" value="yes" tabindex="7" {$postoptionschecked['emailnotify']} /> {$lang->options_emailnotify}</label>
    {$disablesmilies}
    </span></td>
    </tr>
    {$attachbox}
    {$modoptions}
    {$captcha}
    </table>
    <br />
    <div align="center"><input type="submit" class="button" name="submit" value="{$lang->post_reply}" tabindex="3" accesskey="s" />
    <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="4" />{$savedraftbutton}</div>
    <input type="hidden" name="action" value="do_newreply" />
    <input type="hidden" name="tid" value="{$tid}" />
    <input type="hidden" name="replyto" value="{$pid}" />
    <input type="hidden" name="posthash" value="{$posthash}" />
    <input type="hidden" name="attachmentaid" value="" />
    <input type="hidden" name="attachmentact" value="" />
    <input type="hidden" name="quoted_ids" value="{$quoted_ids}" />
    {$editdraftpid}
    </form>
    {$forumrules}
    {$threadreview}
    {$footer}
    </body>
    </html>
  9. افتح قالب New Thread واستبدل محتواه بالتالى
    كود :
    <html>
    <head>
    <title>{$lang->newthread_in}</title>
    {$headerinclude}
    <script type="text/javascript" src="jscripts/post.js?ver=121"></script>
    </head>
    <body>
    {$header}
    {$preview}
    {$thread_errors}
    {$attacherror}
    <!--//EDITOR START HERE add onSubmit="return get_hoteditor_data();"  -->
    <form onSubmit="return get_hoteditor_data();" action="newthread.php" method="post" enctype="multipart/form-data" name="input">
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td class="thead" colspan="2"><strong>{$lang->post_new_thread}</strong></td>
    </tr>
    {$loginbox}
    <tr>
    <td class="trow2" width="20%"><strong>{$lang->thread_subject}</strong></td>
    <td class="trow2"><input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
    </tr>
    {$posticons}
    <tr>
    <td class="trow2" valign="top"><strong>{$lang->your_message}</strong><br /></td>
    <td class="trow2">
    <!-- //EDITOR -->
    <textarea style="visibility:hidden;position:absolute;top:-20;left:-20;width:1px;height:1px" name="message" id="message" rows="20" cols="70" tabindex="2">{$message}</textarea>
    <style type="text/css">@import url(richedit/styles/office2007/style.css);</style>            
    <script language="JavaScript" type="text/javascript" src="richedit/editor.js?version=4.2"></script>                
    <script language="JavaScript" type="text/javascript">
        var getdata =document.getElementById("message").value;
        Instantiate("max","editor", getdata , "100%", "300px");            
        function get_hoteditor_data(){
            if (HTML_ON == "no"){
                alert ("Please uncheck the HTML checkbox");
                return false;
            }
            setCodeOutput();
            var bbcode_output=document.getElementById("hoteditor_bbcode_ouput_editor").value;//Output to BBCode

            //Make it work with MOD Hoteditor 4.0
            bbcode_output=bbcode_output.replace(/\{EDITOR=/gi,"[B]{[/B]EDITOR=");
            bbcode_output=bbcode_output.replace(/EDITOR\}/gi,"EDITOR[B]}[/B]");

            document.getElementById("message").value = bbcode_output;
        }
    </script>
    <!-- //EDITOR -->
    </td>
    </tr>
    <tr>
    <td class="trow1" valign="top"><strong>{$lang->post_options}</strong></td>
    <td class="trow1"><span class="smalltext">
    <label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="yes" tabindex="7" {$postoptionschecked['signature']} /> {$lang->options_sig}</label><br />
    <label><input type="checkbox" class="checkbox" name="postoptions[emailnotify]" value="yes" tabindex="8" {$postoptionschecked['emailnotify']} /> {$lang->options_emailnotify}</label>
    {$disablesmilies}</span></td>
    </tr>
    {$modoptions}
    {$attachbox}
    {$pollbox}
    {$captcha}
    </table>
    <br />
    <div style="text-align:center"><input type="submit" class="button" name="submit" value="{$lang->post_thread}" tabindex="4" accesskey="s" />  
    <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="5" />{$savedraftbutton}</div>
    <input type="hidden" name="action" value="do_newthread" />
    <input type="hidden" name="posthash" value="{$posthash}" />
    <input type="hidden" name="fid" value="{$fid}" />
    <input type="hidden" name="attachmentaid" value="" />
    <input type="hidden" name="attachmentact" value="" />
    {$editdraftpid}
    </form>
    {$forumrules}
    {$footer}
    </body>
    </html>
  10. افتح قالب private_send واستبدل محتواه بالتالى.
    كود :
    <html>
    <head>
    <title>{$lang->compose_pm}</title>
    {$headerinclude}
    </head>
    <body>
    {$header}
    <form action="private.php" method="post" name="input">
    <table width="100%" border="0" align="center">
    <tr>
    {$usercpnav}
    <td valign="top">
    {$preview}
    {$send_errors}
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td class="thead" colspan="2"><strong>{$lang->compose_pm}</strong></td>
    </tr>
    <tr>
    <td class="trow1" valign="top"><strong>{$lang->compose_to}</strong></td>
    <td class="trow1"><input type="text" class="textbox" name="to" id="to" size="40" maxlength="{$mybb->settings['maxnamelength']}" value="{$to}" tabindex="1" /></td>
    </tr>
    <tr>
    <td class="trow2"><strong>{$lang->compose_subject}</strong></td>
    <td class="trow2"><input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="2" /></td>
    </tr>
    {$posticons}
    <tr>
    <td class="trow2" valign="top"><strong>{$lang->compose_message}</strong><br/><br/></td>
    <td class="trow2">
    <!-- //EDITOR -->
    <textarea style="visibility:hidden;position:absolute;top:-20;left:-20;width:1px;height:1px" name="message" id="message" rows="20" cols="60" tabindex="3">{$message}
    </textarea>
    <style type="text/css">@import url(richedit/styles/office2007/style.css);</style>            
    <script language="JavaScript" type="text/javascript" src="richedit/editor.js?version=4.2"></script>                
    <script language="JavaScript" type="text/javascript">
        var getdata =document.getElementById("message").value;
        //Make it work with MOD Hoteditor 4.0
        if(getdata.indexOf("{EDITOR=")!=-1 && getdata.indexOf("EDITOR}")!=-1){
            getdata=getdata.replace(/\&/gi,"&");
            getdata=getdata.replace(/\</gi,"<");
            getdata=getdata.replace(/\>/gi,">");
            getdata=getdata.replace(/\[<\]/gi,"<");
            getdata=getdata.replace(/\[>\]/gi,">");
            getdata=getdata.replace(/\[<\]/gi,"<");
            getdata=getdata.replace(/\[>\]/gi,">");
            getdata=getdata.replace(/\"/gi,"\"");
            getdata=getdata.replace(/[\r\n]/gi,"");
            getdata=getdata.replace(/\{EDITOR=/gi,"");
            getdata=getdata.replace(/EDITOR\}/gi,"");
            
            //Convert to BBCode
            getdata=HTMLToBBCode(getdata);
        }
        Instantiate("max","editor", getdata , "100%", "300px");            
        function get_hoteditor_data(){
            if (HTML_ON == "no"){
                alert ("Please uncheck the HTML checkbox");
                return false;
            }
            setCodeOutput();
            var bbcode_output=document.getElementById("hoteditor_bbcode_ouput_editor").value;//Output to BBCode
            
            //Make it work with MOD Hoteditor 4.0
            bbcode_output=bbcode_output.replace(/\{EDITOR=/gi,"[B]{[/B]EDITOR=");
            bbcode_output=bbcode_output.replace(/EDITOR\}/gi,"EDITOR[B]}[/B]");

            //Output BBCode to message textarea
            document.getElementById("message").value = bbcode_output;
        }
    </script>
    <!-- //EDITOR -->
    </tr>
    <tr>
    <td class="trow1" valign="top"><strong>{$lang->compose_options}</strong></td>
    <td class="trow1"><span class="smalltext">
    <label><input type="checkbox" class="checkbox" name="options[signature]" value="yes" tabindex="8" {$optionschecked['signature']} />
    {$lang->options_sig}</label><br />
    <label><input type="checkbox" class="checkbox" name="options[disablesmilies]" value="yes" tabindex="9" {$optionschecked['disablesmilies']} />{$lang->options_disable_smilies}
    </label><br />
    <label><input type="checkbox" class="checkbox" name="options[savecopy]" value="yes" tabindex="10" {$optionschecked['savecopy']} />{$lang->options_save_copy}</label><br />
    <label><input type="checkbox" class="checkbox" name="options[readreceipt]" value="yes" tabindex="11" {$optionschecked['readreceipt']} />{$lang->options_read_receipt}</label><br />
    </span></td>
    </tr>
    </table>
    <br />
    <input type="hidden" name="action" value="do_send" />
    <input type="hidden" name="pmid" value="{$pmid}" />
    <input type="hidden" name="do" value="{$do}" />
    <!--//EDITOR START HERE add onclick="get_hoteditor_data();"  -->
    <div style="text-align:center"><input onClick="get_hoteditor_data();" type="submit" class="button" name="submit" value="{$lang->send_message}" tabindex="4" accesskey="s" />
    <input onClick="get_hoteditor_data();" type="submit" class="button" name="saveasdraft" value="{$lang->save_draft}" tabindex="5" />
      <input onClick="get_hoteditor_data();" type="submit" class="button" name="preview" value="{$lang->preview}" tabindex="6" /></div>
    </td>
    </tr>
    </table>
    </form>
    {$footer}
    {$autocompletejs}
    </body>
    </html>
  11. افتح قالب showthread_quickreply واستبدل محتواه بالتالى.
    كود :
    <br />
    <!--//EDITOR START HERE add onSubmit="return get_hoteditor_data();"  -->
    <form onSubmit="return get_hoteditor_data();" method="post" action="newreply.php" name="input">
    <input type="hidden" name="subject" value="RE: {$thread['subject']}" />
    <input type="hidden" name="action" value="do_newreply" />
    <input type="hidden" name="tid" value="{$tid}" />
    <input type="hidden" name="posthash" value="{$posthash}" />
    <input type="hidden" name="quoted_ids" value="" />
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <thead>
    <tr>
    <td colspan="2" class="thead">
    <div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['quickreply']}.gif" id="quickreply_img" class="expander" alt="[-]"/></div>
    <div><strong>{$lang->quick_reply}</strong></div>
    </td>
    </tr>
    </thead>
    <tbody style="{$collapsed['quickreply_e']}" id="quickreply_e">
    <tr>
    <td class="trow1" valign="top" width="22%">
    <strong>{$lang->message}</strong><br />
    <span class="smalltext">{$lang->message_note}<br /><br />
    <label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="yes" {$postoptionschecked['signature']} /> <strong>{$lang->signature}</strong></label><br />
    <label><input type="checkbox" class="checkbox" name="postoptions[emailnotify]" value="yes" {$postoptionschecked['emailnotify']} /> <strong>{$lang->email_notify}</strong></label><br />
    <label><input type="checkbox" class="checkbox" name="postoptions[disablesmilies]" value="yes" /> <strong>{$lang->disable_smilies}</strong></label>{$closeoption}</span>
    </td>
    <td class="trow1">
        <div>        
            <!-- //EDITOR -->
            <textarea style="visibility:hidden;position:absolute;top:-20;left:-20;width:1px;height:1px" rows="8" cols="80" name="message" id="message" tabindex="1">
            </textarea>
            <style type="text/css">@import url(richedit/styles/office2007/style.css);</style>            
            <script language="JavaScript" type="text/javascript" src="richedit/editor.js?version=4.2"></script>                
            <script language="JavaScript" type="text/javascript">
                var getdata =document.getElementById("message").value;
                Instantiate("min","editor", getdata , "100%", "150px");            
                function get_hoteditor_data(){
                    if (HTML_ON == "no"){
                        alert ("Please uncheck the HTML checkbox");
                        return false;
                    }
                    setCodeOutput();
                    var bbcode_output=document.getElementById("hoteditor_bbcode_ouput_editor").value;//Output to BBCode

                    //Make it work with MOD Hoteditor 4.0
                    bbcode_output=bbcode_output.replace(/\{EDITOR=/gi,"[B]{[/B]EDITOR=");
                    bbcode_output=bbcode_output.replace(/EDITOR\}/gi,"EDITOR[B]}[/B]");

                    document.getElementById("message").value = bbcode_output;
                }            
            </script>
            <!-- //EDITOR -->
        </div>
        <script type="text/javascript">document.write('<div class="editor_control_bar" style="width: 90%;
        padding: 4px; margin-top: 3px; display: none;" id="quickreply_multiquote">
        <span class="smalltext">{$lang->quickreply_multiquote_selected}
        <a href="javascript:Thread.loadMultiQuoted();">{$lang->quickreply_multiquote_now}<\/a> {$lang->or}
        <a href="javascript:Thread.clearMultiQuoted();">{$lang->quickreply_multiquote_deselect}<\/a>.<\/span><\/div>');</script>
    </td>
    </tr>
    <tr>
    <td colspan="2" align="center" class="tfoot"><input type="submit" class="button" value="{$lang->post_reply}" tabindex="2" accesskey="s" />
    <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="3" /></td>
    </tr>
    </tbody>
    </table>
    </form>
  12. افتح قالب usercp_editsig واستبدل محتواه بالتالى.
    كود :
    <html>
    <head>
    <title>{$mybb->settings['bbname']} - {$lang->edit_sig}</title>
    {$headerinclude}
    </head>
    <body>
    {$header}
    <!--//EDITOR add code onSubmit="return get_hoteditor_data();"  -->
    <form onSubmit="return get_hoteditor_data();" action="usercp.php" method="post">
    <table width="100%" border="0" align="center">
    <tr>
    {$usercpnav}
    <td valign="top">
    {$error}
    {$signature}
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td class="thead" colspan="2"><strong>{$lang->edit_sig}</strong></td>
    </tr>
    <tr>
    <td class="trow1" valign="top" width="40%"><span class="smalltext">{$lang->edit_sig_note}<br /><br />{$lang->edit_sig_note2}</span></td>
    <td class="trow1" width="60%">
    <!-- //EDITOR -->
    <textarea style="visibility:hidden;position:absolute;top:-20;left:-20;width:1px;height:1px" rows="5" cols="55" id="signature" name="signature">{$sig}</textarea>
    <style type="text/css">@import url(richedit/styles/office2007/style.css);</style>            
    <script language="JavaScript" type="text/javascript" src="richedit/editor.js?version=4.2"></script>                
    <script language="JavaScript" type="text/javascript">
        var getdata =document.getElementById("signature").value;    
        Instantiate("min","editor", getdata , "100%", "150px");            
        function get_hoteditor_data(){
            if (HTML_ON == "no"){
                alert ("Please uncheck the HTML checkbox");
                return false;
            }
            setCodeOutput();
            var bbcode_output=document.getElementById("hoteditor_bbcode_ouput_editor").value;//Output to BBCode
            
            //Make it work with MOD Hoteditor 4.0
            bbcode_output=bbcode_output.replace(/\{EDITOR=/gi,"[B]{[/B]EDITOR=");
            bbcode_output=bbcode_output.replace(/EDITOR\}/gi,"EDITOR[B]}[/B]");

            //Output BBCode to message textarea
            document.getElementById("signature").value = bbcode_output;
        }
    </script>
    <!-- //EDITOR -->
    <br /><br /><span class="smalltext">
    <label><input type="radio" class="radio" name="updateposts" value="enable" /> {$lang->enable_sig_posts}</label><br />
    <label><input type="radio" class="radio" name="updateposts" value="disable" /> {$lang->disable_sig_posts}</label><br />
    <label><input type="radio" class="radio" name="updateposts" value="no" checked="checked" /> {$lang->leave_sig_settings}</label></span>
    </td>
    </tr>
    </table>
    <br />
    <div align="center">
    <input type="hidden" name="action" value="do_editsig" />
    <input type="submit" class="button" name="submit" value="{$lang->update_sig}" />
    <input type="submit" class="button" name="preview" value="{$lang->preview}" />
    </div>
    </td>
    </tr>
    </table>
    </form>
    {$footer}
    </body>
    </html>
  13. افتح قالب xmlhttp_inline_post_editor واستبدل محتواه بالتالى
    كود :
    <br />
            <div style="clear: both;">
                <iframe name=hotframe_{$post['pid']} frameborder=0 width=100% height=490px src="hoteditor_quickedit.php?id={$post['pid']}" scrolling=no target="_top">
                </iframe>
                <div>
                    <textarea style="visibility:hidden;" id="quickedit_{$post['pid']}" />{$post['message']}</textarea>
                </div>            
            </div>
  14. افتح قالب post_attachments_attachment_postinsert واستبدل محتواه بالتالى.
    كود :
    <input type="button" name="insert" value="{$lang->insert_attachment_post}" onclick="if(editor_type=='0'){
    WriteTEXT('[attachment='+{$attachment['aid']}+']','editor');}
    else{WriteHTML('[attachment='+{$attachment['aid']}+']','editor');}" />
هذا هو كل ماورد فى ملف شرح تركيب الهاك باللغة الأنجليزية.
السلام عليكم ورحمة الله وبركاته
شكر من طرف :


الردود في هذا الموضوع
شرح تركيب هاك الـ WYSIWYG. - بواسطة Pepo - 2007-05-25, 02:53 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة almsre - 2007-05-25, 08:39 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Pepo - 2007-05-26, 05:28 AM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة almsre - 2007-05-26, 07:13 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Pepo - 2007-05-27, 06:57 AM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة almsre - 2007-05-30, 12:51 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Pepo - 2007-05-30, 02:14 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة S_CaReCRo_W - 2007-06-04, 09:25 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة almsre - 2007-06-04, 10:14 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Pepo - 2007-06-04, 10:24 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة almsre - 2007-06-05, 09:27 AM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة S_CaReCRo_W - 2007-06-06, 09:13 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة tassnim - 2007-06-15, 01:57 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة S_CaReCRo_W - 2007-06-17, 11:20 AM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة tassnim - 2007-06-17, 01:47 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Pepo - 2007-06-18, 04:00 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة tassnim - 2007-06-18, 04:20 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة tassnim - 2007-06-19, 02:27 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Mr-Faris - 2007-09-17, 04:38 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Pepo - 2007-09-17, 07:11 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Mr-Faris - 2007-09-17, 07:49 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Pepo - 2007-09-17, 08:04 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Mr-Faris - 2007-09-18, 08:35 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Pepo - 2007-09-19, 01:27 AM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Mr-Faris - 2007-09-19, 03:25 AM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Pepo - 2007-09-19, 05:46 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Mr-Faris - 2007-09-19, 11:30 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Pepo - 2007-09-19, 11:36 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة Mr-Faris - 2007-09-19, 11:59 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة tassnim - 2007-10-10, 05:21 PM
Re: شرح تركيب هاك الـ WYSIWYG. - بواسطة Toscana - 2007-12-08, 09:12 PM
Re: شرح تركيب هاك الـ WYSIWYG. - بواسطة Pepo - 2007-12-08, 10:33 PM
Re: شرح تركيب هاك الـ WYSIWYG. - بواسطة be3besha3 - 2008-02-02, 12:22 AM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة tassnim - 2008-06-07, 12:53 PM
Re: شرح تركيب هاك الـ WYSIWYG. - بواسطة Techno-Man - 2008-06-02, 06:03 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة tassnim - 2008-06-07, 12:57 PM
Re: شرح تركيب هاك الـ WYSIWYG. - بواسطة Lamees - 2008-06-05, 05:00 PM
RE: شرح تركيب هاك الـ WYSIWYG. - بواسطة tassnim - 2008-06-07, 01:00 PM
Re: شرح تركيب هاك الـ WYSIWYG. - بواسطة wahda4ever - 2008-06-30, 10:59 AM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم