eMosbat TinyMCE Integration เปลี่ยนแปลง BBCODE ให้มีความสวยงามและทันสมัย

แนะนำ Mod ต่างๆ ของ PHPBB3 แนะนำความสามารถ ของ mod การติดตั้ง การเข้ากันได้กับเวอร์ชั่น

Moderator: mindphp

ภาพประจำตัวสมาชิก
M004
PHP VIP Members
PHP VIP Members
โพสต์: 1323
ลงทะเบียนเมื่อ: 01/01/1970 7:00 am

eMosbat TinyMCE Integration เปลี่ยนแปลง BBCODE ให้มีความสวยงามและทันสมัย

โพสต์ที่ยังไม่ได้อ่าน โดย M004 »

รายละเอียดเกี่ยวกับ eMosbat TinyMCE Integration
เปลี่ยนแปลงฟังชั่นการ "ตอบด่วน" ให้สวนงามและมีเครื่องให้ใช้งานเพิ่มขึ้น และ สำหรับการสร้างกระทู้ก็ เปลี่ยนแปลง BBCODE ให้มีความสวยงามและทันสมัยมากขึ้น
พัฒนาโดย : eMosbat
Version : 1.5.9
phpBB Version(s) : 3.0.11
ดาวน์โหลดได้ที่ : https://www.phpbb.com/community/viewtop ... &t=2160273
1.jpg
1.jpg (41.75 KiB) Viewed 860 times
2.jpg
2.jpg (27.08 KiB) Viewed 860 times
3.jpg
3.jpg (45.43 KiB) Viewed 860 times
ขั้นตอนการติดตั้ง
เปิดไฟล์ posting.php
ค้นหา

โค้ด: เลือกทั้งหมด

$quote_status    = true; 
เติมหลังคำที่หา

โค้ด: เลือกทั้งหมด

// eMosbat TinyMCE

if(!class_exists('Mobile_Detect'))
{
    include($phpbb_root_path . 'includes/Mobile_Detect.' . $phpEx);
}

$mobile_detect = new Mobile_Detect();
$is_mobile = ($mobile_detect->isMobile() ? 1 : 0);
$use_mobile = (isset($config['emotinymce_mobile']) ? ($config['emotinymce_mobile'] ? 1 : 0) : 0);
// eMosbat TinyMCE
 
ค้นหา

โค้ด: เลือกทั้งหมด

'S_BBCODE_ALLOWED'            => ($bbcode_status) ? 1 : 0, 
เติมหลังคำที่หา

โค้ด: เลือกทั้งหมด

    // eMosbat TinyMCE
    'EMOTINYMCE_ENABLE'            => (isset($config['emotinymce_enable']) ? (($config['emotinymce_enable'] && ($user->data['user_emotinyeditor']==1) || ($config['emotinymce_allowuser']==0)) ? ($is_mobile ? $use_mobile : 1) : 0) : 0),
    'EMOTINYMCE_RTL'            => (isset($config['emotinymce_enable']) ? (($config['emotinymce_rtl']) ? 1 : 0) : 0),
    'EMOTINYMCE_WIDTH'            => (isset($config['emotinymce_enable']) ? ($config['emotinymce_width']) : 0),
    'EMOTINYMCE_HEIGHT'            => (isset($config['emotinymce_enable']) ? ($config['emotinymce_height']) : 0),
    'EMOTINYMCE_SKIN'            => (isset($config['emotinymce_enable']) ? ($config['emotinymce_skin'] != "" ? current(explode("@",$config['emotinymce_skin'])) : "") : ""),
    'EMOTINYMCE_SKIN_VAR'        => (isset($config['emotinymce_enable']) ? ($config['emotinymce_skin'] != "" ? end(explode("@",$config['emotinymce_skin'])) : "") : ""),
    'EMOTINYMCE_SPELLCHECKER'    => (isset($config['emotinymce_enable']) ? (($config['emotinymce_spellchecker']) ? 1 : 0) : 0),
    'EMOTINYMCE_CAPTION'        => (isset($config['emotinymce_enable']) ? (($config['emotinymce_caption']) ? 1 : 0) : 0),
    'EMOTINYMCE_TIP'            => (isset($config['emotinymce_enable']) ? (($config['emotinymce_tip']) ? 1 : 0) : 0),
    'EMOTINYMCE_LANG'            => (isset($config['emotinymce_enable']) ? ($config['emotinymce_lang']) : 0),
    // eMosbat TinyMCE

 
เปืดไฟล์ includes/functions_posting.php
ค้นหา

โค้ด: เลือกทั้งหมด

        $template->set_filenames(array(
            'body' => 'posting_smilies.html')
        ); 
เติมก่อนคำทีหา

โค้ด: เลือกทั้งหมด

        // eMosbat TinyMCE
        if(!class_exists('Mobile_Detect'))
        {
        include($phpbb_root_path . 'includes/Mobile_Detect.' . $phpEx);
        }
        
        $mobile_detect = new Mobile_Detect();
        $is_mobile = ($mobile_detect->isMobile() ? 1 : 0);
        $use_mobile = (isset($config['emotinymce_mobile']) ? ($config['emotinymce_mobile'] ? 1 : 0) : 0);
        
        $template->assign_var('EMOTINYMCE_ENABLE', (isset($config['emotinymce_enable']) ? (($config['emotinymce_enable'] && ($user->data['user_emotinyeditor']==1) || ($config['emotinymce_allowuser']==0)) ? ($is_mobile ? $use_mobile : 1) : 0) : 0)
        );
        // eMosbat TinyMCE

 
ค้นหา

โค้ด: เลือกทั้งหมด

        if ($row = $db->sql_fetchrow($result))
        {
            $display_link = true;
        }
        $db->sql_freeresult($result);
 
เติมก่อนคำที่ค้นหา

โค้ด: เลือกทั้งหมด

        // eMosbat TinyMCE
        $sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height, MIN(smiley_order) AS min_smiley_order
            FROM ' . SMILIES_TABLE . '
            GROUP BY smiley_url, smiley_width, smiley_height
            ORDER BY min_smiley_order';
        $result = $db->sql_query($sql, 3600);

    $smilies = array();
    while ($row = $db->sql_fetchrow($result))
    {
        if (empty($smilies[$row['smiley_url']]))
        {
            $smilies[$row['smiley_url']] = $row;
        }
    }
    $db->sql_freeresult($result);


    if (sizeof($smilies))
    {
        $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;

        foreach ($smilies as $row)
        {
            $template->assign_block_vars('smileyall', array(
                'SMILEY_CODE'    => $row['code'],
                'A_SMILEY_CODE'    => addslashes($row['code']),
                'SMILEY_IMG'    => $root_path . (isset($config['smilies_path']) ? $config['smilies_path'] : '') . '/' . $row['smiley_url'],
                'SMILEY_WIDTH'    => $row['smiley_width'],
                'SMILEY_HEIGHT'    => $row['smiley_height'],
                'SMILEY_DESC'    => $row['emotion'])
            );
        }
    }

    unset($smilies);
    unset($row);
    
        // eMosbat TinyMCE

 
เปิดไฟล์ includes/ucp/ucp_pm_compose.php
ค้นหา

โค้ด: เลือกทั้งหมด

$url_status        = ($config['allow_post_links']) ? true : false; 
เติมก่อนคำที่หา

โค้ด: เลือกทั้งหมด

    
    // eMosbat TinyMCE
    if(!class_exists('Mobile_Detect'))
    {
        include($phpbb_root_path . 'includes/Mobile_Detect.' . $phpEx);
    }
    
    $mobile_detect = new Mobile_Detect();
    $is_mobile = ($mobile_detect->isMobile() ? 1 : 0);
    $use_mobile = (isset($config['emotinymce_mobile']) ? ($config['emotinymce_mobile'] ? 1 : 0) : 0);
    // eMosbat TinyMCE
    
 
ค้นหา

โค้ด: เลือกทั้งหมด

'S_BBCODE_ALLOWED'        => ($bbcode_status) ? 1 : 0, 
เติมหลังคำที่หา

โค้ด: เลือกทั้งหมด

// eMosbat TinyMCE
    'EMOTINYMCE_ENABLE'            => (isset($config['emotinymce_enable']) ? (($config['emotinymce_enable'] && ($user->data['user_emotinyeditor']==1) || ($config['emotinymce_allowuser']==0)) ? ($is_mobile ? $use_mobile : 1) : 0) : 0),
    'EMOTINYMCE_RTL'            => (isset($config['emotinymce_enable']) ? (($config['emotinymce_rtl']) ? 1 : 0) : 0),
    'EMOTINYMCE_WIDTH'            => (isset($config['emotinymce_enable']) ? ($config['emotinymce_qwidth']) : 0),
    'EMOTINYMCE_HEIGHT'            => (isset($config['emotinymce_enable']) ? ($config['emotinymce_qheight']) : 0),
    'EMOTINYMCE_SKIN'            => (isset($config['emotinymce_enable']) ? ($config['emotinymce_skin'] != "" ? current(explode("@",$config['emotinymce_skin'])) : "") : ""),
    'EMOTINYMCE_SKIN_VAR'        => (isset($config['emotinymce_enable']) ? ($config['emotinymce_skin'] != "" ? end(explode("@",$config['emotinymce_skin'])) : "") : ""),
    'EMOTINYMCE_SPELLCHECKER'    => (isset($config['emotinymce_enable']) ? (($config['emotinymce_spellchecker']) ? 1 : 0) : 0),
    'EMOTINYMCE_CAPTION'        => (isset($config['emotinymce_enable']) ? (($config['emotinymce_caption']) ? 1 : 0) : 0),
    'EMOTINYMCE_TIP'            => (isset($config['emotinymce_enable']) ? (($config['emotinymce_tip']) ? 1 : 0) : 0),
    'EMOTINYMCE_LANG'            => (isset($config['emotinymce_enable']) ? (($config['emotinymce_lang'])) : ''),
    'S_SMILIES_ALLOWED'        => $smilies_status,
    'S_BBCODE_IMG'            => $img_status,
    'S_BBCODE_URL'            => $url_status,
    'S_BBCODE_FLASH'        => $flash_status,
    'S_BBCODE_QUOTE'        => true,
// eMosbat TinyMCE
 
เปิดไฟล์ includes/ucp/ucp_prefs.php
ค้นหา

โค้ด: เลือกทั้งหมด

'tz'            => request_var('tz', (float) $user->data['user_timezone']),
 
เติมหลังคำที่หา

โค้ด: เลือกทั้งหมด

                    // emosbat TinyMCE
                    'emotinyeditor'    => request_var('emotinyeditor', (int) $user->data['user_emotinyeditor']),
                    // emosbat TinyMCE
 
ค้นหา

โค้ด: เลือกทั้งหมด

'user_style'            => $data['style'], 
เติมหลังคำที่ค้นหา

โค้ด: เลือกทั้งหมด

                            // emosbat TinyMCE
                            'user_emotinyeditor'    => (isset($config['emotinymce_enable']) ? (($config['emotinymce_allowuser'] ? $data['emotinyeditor'] : $config['emotinymce_enable'])) : 0),
                            // emosbat TinyMCE
 
ค้นหา

โค้ด: เลือกทั้งหมด

'S_STYLE_OPTIONS'        => ($config['override_user_style']) ? '' : style_select($data['style']), 
เติมหลังคำที่หา

โค้ด: เลือกทั้งหมด

                    // emosbat TinyMCE
                    'S_EMOTINYEDITOR'        => $data['emotinyeditor'],
                    'EMOTINYMCE_ALLOWUSER' => (isset($config['emotinymce_allowuser']) ? $config['emotinymce_allowuser'] : 0),
                    // emosbat TinyMCE
 
เปืดไฟล์ includes/ucp/ucp_profile.php
ค้นหา

โค้ด: เลือกทั้งหมด

$enable_urls    = ($config['allow_sig_links']) ? (bool) $user->optionget('sig_links') : false; 
เติมหลังคำที่หา

โค้ด: เลือกทั้งหมด

                
                // eMosbat TinyMCE
                if(!class_exists('Mobile_Detect'))
                {
                    include($phpbb_root_path . 'includes/Mobile_Detect.' . $phpEx);
                }
                
                $mobile_detect = new Mobile_Detect();
                $is_mobile = ($mobile_detect->isMobile() ? 1 : 0);
                $use_mobile = (isset($config['emotinymce_mobile']) ?  ($config['emotinymce_mobile'] ? 1 : 0) : 0);
                // eMosbat TinyMCE
                
 
ค้นหา

โค้ด: เลือกทั้งหมด

                    'SIGNATURE_PREVIEW'    => $signature_preview, 
เติมหลังคำที่หา

โค้ด: เลือกทั้งหมด

// eMosbat TinyMCE
    'EMOTINYMCE_ENABLE'            => (isset($config['emotinymce_enable']) ? (($config['emotinymce_enable'] && ($user->data['user_emotinyeditor']==1) || ($config['emotinymce_allowuser']==0)) ? ($is_mobile ? $use_mobile : 1) : 0) : 0),
    'EMOTINYMCE_RTL'            => (isset($config['emotinymce_enable']) ? (($config['emotinymce_rtl']) ? 1 : 0) : 0),
    'EMOTINYMCE_WIDTH'            => (isset($config['emotinymce_enable']) ? ($config['emotinymce_qwidth']) : 0),
    'EMOTINYMCE_HEIGHT'            => (isset($config['emotinymce_enable']) ? ($config['emotinymce_qheight']) : 0),
    'EMOTINYMCE_SKIN'            => (isset($config['emotinymce_enable']) ? ($config['emotinymce_skin'] != "" ? current(explode("@",$config['emotinymce_skin'])) : "") : ""),
    'EMOTINYMCE_SKIN_VAR'        => (isset($config['emotinymce_enable']) ? ($config['emotinymce_skin'] != "" ? end(explode("@",$config['emotinymce_skin'])) : "") : ""),
    'EMOTINYMCE_SPELLCHECKER'    => (isset($config['emotinymce_enable']) ? (($config['emotinymce_spellchecker']) ? 1 : 0) : 0),
    'EMOTINYMCE_CAPTION'        => (isset($config['emotinymce_enable']) ? (($config['emotinymce_caption']) ? 1 : 0) : 0),
    'EMOTINYMCE_TIP'            => (isset($config['emotinymce_enable']) ? (($config['emotinymce_tip']) ? 1 : 0) : 0),
    'EMOTINYMCE_LANG'            => (isset($config['emotinymce_enable']) ? (($config['emotinymce_lang'])) : ''),
    'S_SMILIES_ALLOWED'        => $enable_smilies,
    'S_BBCODE_IMG'            => ($config['allow_sig_img'] ? 1 : 0),
    'S_BBCODE_URL'            => $enable_urls,
    'S_BBCODE_FLASH'        => ($config['allow_sig_flash'] ? 1 : 0),
    'S_BBCODE_QUOTE'        => true,
// eMosbat TinyMCE
 
เปิดไฟล์ language/en/posting.php
ค้นหา

โค้ด: เลือกทั้งหมด

$lang = array_merge($lang, array( 
เติมหลังคำที่หา

โค้ด: เลือกทั้งหมด

    // emosbat TinyMCE
    'EMOTINYMCE_CHANGED_TEXT'    => 'Changes you made in the editor will be lost.',
    // emosbat TinyMCE
 
เปิดไฟล์ language/en/ucp.php
ค้นหา

โค้ด: เลือกทั้งหมด

$lang = array_merge($lang, array(
 
เติมหลังคำที่หา

โค้ด: เลือกทั้งหมด

    // emosbat TinyMCE
    'USE_EMOTINYEDITOR'            => 'Use Enhanced Editor',
    // emosbat TinyMCE
 
เปิดไฟล์ styles/prosilver/template/posting_editor.html
ค้นหา

โค้ด: เลือกทั้งหมด

</script>
เติมหลังคำที่หา

โค้ด: เลือกทั้งหมด

<!-- INCLUDE emotinymce_editor.html -->
 
ค้นหา

โค้ด: เลือกทั้งหมด

<!-- INCLUDE posting_buttons.html --> 
เติมแทนคำที่หา

โค้ด: เลือกทั้งหมด

<!-- IF not EMOTINYMCE_ENABLE -->
<!-- INCLUDE posting_buttons.html -->
<!-- ENDIF -->
 
ค้นหา

โค้ด: เลือกทั้งหมด

<textarea <!-- IF S_UCP_ACTION and not S_PRIVMSGS and not S_EDIT_DRAFT -->name="signature" id="signature" style="height: 9em;"<!-- ELSE -->name="message" id="message"<!-- ENDIF --> rows="15" cols="76" tabindex="4" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" class="inputbox">{MESSAGE}{DRAFT_MESSAGE}{SIGNATURE}</textarea> 
หาคำในบรรทัด

โค้ด: เลือกทั้งหมด

name="signature" id="signature"
เติมแทนคำที่หา

โค้ด: เลือกทั้งหมด

name="signature" id="message"
เปิดไฟล์ styles/prosilver/template/posting_smilies.html
ค้นหา

โค้ด: เลือกทั้งหมด

<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/editor.js"></script>
เติมหลังคำที่หา

โค้ด: เลือกทั้งหมด

<!-- IF EMOTINYMCE_ENABLE -->
<script type="text/javascript" src="{T_TEMPLATE_PATH}/emo_tinymce.js"></script>
<!-- ENDIF -->
เปิดไฟล์ styles/prosilver/template/ucp_prefs_personal.html
ค้นหา

โค้ด: เลือกทั้งหมด

</fieldset>
เติมก่อนคำที่หา

โค้ด: เลือกทั้งหมด

	<!-- IF EMOTINYMCE_ALLOWUSER -->
	<dl>
		<dt><label for="emotinyeditor0">{L_USE_EMOTINYEDITOR}:</label></dt>
		<dd>
			<label for="emotinyeditor1"><input type="radio" name="emotinyeditor" id="emotinyeditor1" value="1"<!-- IF S_EMOTINYEDITOR --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> 
			<label for="emotinyeditor0"><input type="radio" name="emotinyeditor" id="emotinyeditor0" value="0"<!-- IF not S_EMOTINYEDITOR --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
		</dd>
	</dl>
	<!-- ENDIF -->
ติดตั้งไฟล์

โค้ด: เลือกทั้งหมด

emotinymce_install.php

ลบไฟล์ หลังติดตั้งเสร็จ

โค้ด: เลือกทั้งหมด

emotinymce_install.php
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 57