[MOD] Quick Title Edition

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

Moderator: mindphp

ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

[MOD] Quick Title Edition

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

16-6-2557 10-42-30.png
16-6-2557 10-42-30.png (73.51 KiB) Viewed 4566 times
รายละเอียด :: MOD ที่ช่วยให้การเพิ่มแท็กหรือคำนำหน้าของโพสต์ เช่น [แก้ไข] เพื่อชื่อให้กับหัวข้อ โดยสามารถกำหนดได้ว่า ใครสามารถที่จะเพิ่มได้ เเละยังมีเเท็บเครื่องมือช่วยในการค้นหา เเละ ยกเลิกการเพิ่มเเท็ก หรือคำนำหน้าได้
พัฒนาโดย :: ABDev
Version ::1.2.5
ดาวน์โหลดได้ที่ :: https://www.mindphp.com/download/files/9 ... 5-zip.html
ไฟล์ที่ใช้ในการติดตั้งเเละวิธีการติดตั้ง
เปิดไฟล์ -> adm/style/acp_forums.html,
ค้นหา ::

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

		<fieldset>
			<legend>{L_FORUM_PRUNE_SETTINGS}</legend>
เติมก่อน ::

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

		<!-- INCLUDE acp_attributes_forums.html -->
เปิดไฟล์ -> adm/style/admin.css,
ค้นหา ::

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

.phpinfo td, .phpinfo th, .phpinfo h2, .phpinfo h1 {
	text-align: left;
}
ต่อท้าย::

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

/* Class for Quick Title Edition
---------------------------------------- */
#acp_attributes option:disabled {
	color: #808080;
	font-style: italic;
}
เปิดไฟล์ -> includes/acp/acp_forums.php,
ค้นหา ::

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

		$user->add_lang('acp/forums');
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
		global $qte;
//-- fin mod : quick title edition ---------------------------------------------
ค้นหา ::

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

				// No break here
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
					$forum_data += array(
						'default_attr' => request_var('default_attr', 0),
						'hide_attr' => request_var('hide_attr', array(0)),
					);
//-- fin mod : quick title edition ---------------------------------------------
ค้นหา ::

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

					// On add, add empty forum_options... else do not consider it (not updating it)
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
					$forum_data += array('force_attr' => request_var('force_attr', false));
//-- fin mod : quick title edition ---------------------------------------------
ค้นหา ::

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

						$message = ($action == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED'];
ต่อท้าย ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
						$from_attr = request_var('from_attr', 0);
						if ( $action == 'add' && $from_attr )
						{
							foreach ( $qte->attr as $attr )
							{
								if ( $attr['attr_auths'] )
								{
									$attr['attr_auths'] = json_decode($attr['attr_auths'], true);
									if ( !empty($attr['attr_auths'][0]['forums_ids']) && in_array($from_attr, $attr['attr_auths'][0]['forums_ids']) )
									{
										$attr['attr_auths'][0]['forums_ids'][] = $forum_data['forum_id'];
										$sql_ary = array('attr_auths' => json_encode($attr['attr_auths']));

										$sql = 'UPDATE ' . TOPICS_ATTR_TABLE . '
											SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
											WHERE attr_id = ' . (int) $attr['attr_id'];
										$db->sql_query($sql);
									}
								}
							}
							$cache->destroy('_attr');
						}
//-- fin mod : quick title edition ---------------------------------------------
ค้นหา ::

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

					$forum_data['forum_password_confirm'] = $forum_data['forum_password'];
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
					$forum_data += array('default_attr' => 0, 'hide_attr' => array());
//-- fin mod : quick title edition ---------------------------------------------
ค้นหา ::

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

					}
				}

				$forum_rules_data = array(
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
						$forum_data += array('force_attr' => false);
//-- fin mod : quick title edition ---------------------------------------------
ค้นหา ::

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

				return;

			break;

			case 'delete':
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
				// init ary
				$tpl_fields = array();

				if ( $action == 'edit' )
				{
					$qte->attr_default($forum_id, $forum_data['default_attr']);

					$group_ids = unserialize(trim($forum_data['hide_attr']));
					if ( $group_ids === false )
					{
						$group_ids = array();
					}

					$tpl_fields += array('S_GROUPS_HIDE_ATTR' => $qte->qte_group_select($group_ids));
				}

				$tpl_fields += array('S_FORCE_ATTR' => $forum_data['force_attr'] ? true : false);

				// send to template
				$template->assign_vars($tpl_fields);
//-- fin mod : quick title edition ---------------------------------------------
ค้นหา ::

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

        validate_range($range_test_ary, $errors); 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( !empty($forum_data['hide_attr']) )
        {
            $forum_data['hide_attr'] = serialize($forum_data['hide_attr']);
        }
        else
        {
            $forum_data['hide_attr'] = '';
        }
//-- fin mod : quick title edition ---------------------------------------------         
เปิดไฟล์ -> includes/acp/acp_logs.php,
ค้นหา ::

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

        // Set up general vars         
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        $user->add_lang('mods/info_mcp_attributes');
//-- fin mod : quick title edition ---------------------------------------------         
เปิดไฟล์ -> includes/acp/acp_styles.php,
ค้นหา ::

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

        // Execute overall actions         
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( !isset($this->imageset_keys['custom']) )
        {
            $this->imageset_keys['custom'] = array();
        }
        $this->imageset_keys['custom'] += array_merge($this->imageset_keys['custom'], array('icon_topic_solved', 'icon_topic_cancel'));
//-- fin mod : quick title edition ---------------------------------------------         
เปิดไฟล์ -> includes/mcp/mcp_forum.php,
ค้นหา ::

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

    $user->add_lang(array('viewtopic', 'viewforum'));

    include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx); 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    global $qte;
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

    $to_topic_id        = request_var('to_topic_id', 0); 
ต่อท้าย ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    $attr_id = request_var('attr_id', 0);
    if ( $attr_id && !$merge_select )
    {
        $qte->mcp_attr_apply($attr_id, $topic_id_list);
    }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

    // Grab icons         
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    $forum_info['hide_attr'] = unserialize(trim($forum_info['hide_attr']));
    if ( $forum_info['hide_attr'] === false )
    {
        $forum_info['hide_attr'] = array();
    }

    $qte->attr_select($forum_id, $user->data['user_id'], '', $forum_info['hide_attr']);
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

    foreach ($topic_list as $topic_id) 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    $qte->get_users_by_topic_id($topic_list);
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        $template->assign_block_vars('topicrow', $topic_row); 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( !empty($row['topic_attr_id']) )
        {
            $topic_row += array(
                'S_TOPIC_ATTR'    => true,
                'TOPIC_ATTRIBUTE' => $qte->attr_display($row['topic_attr_id'], $row['topic_attr_user'], $row['topic_attr_time']),
            );
        }
//-- fin mod : quick title edition ---------------------------------------------         
เปิดไฟล์ -> includes/mcp/mcp_main.php,
ค้นหา ::

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

                $db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow));

                // Shadow topics only count on new "topics" and not posts... a shadow topic alone has 0 posts         
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
                $shadow += array(
                    'topic_attr_id' => (int) $row['topic_attr_id'],
                    'topic_attr_user' => (int) $row['topic_attr_user'],
                    'topic_attr_time' => (int) $row['topic_attr_time'],
                );
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

            $db->sql_query('INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
            $new_topic_id = $db->sql_nextid(); 
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
            $sql_ary += array(
                'topic_attr_id' => (int) $topic_row['topic_attr_id'],
                'topic_attr_user' => (int) $topic_row['topic_attr_user'],
                'topic_attr_time' => (int) $topic_row['topic_attr_time'],
            );
//-- fin mod : quick title edition ---------------------------------------------         
เปิดไฟล์ -> includes/mcp/mcp_queue.php,
ค้นหา ::

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

        include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        global $qte;
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

            break;

            case 'unapproved_topics':
            case 'unapproved_posts': 
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
                if ( ($post_info['topic_first_post_id'] == $post_info['post_id']) && !empty($post_info['topic_attr_id']) )
                {
                    $qte->get_users_by_topic_id(array($post_info['topic_id']));
                    $template->assign_vars(array(
                        'S_TOPIC_ATTR' => true,
                        'TOPIC_ATTRIBUTE' => $qte->attr_display($post_info['topic_attr_id']
, $post_info['topic_attr_user'], $post_info['topic_attr_time']),
                    ));
                }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

                    $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);

                    $rowset = array(); 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
                    $sql = str_replace(', t.topic_title AS post_subject', ', t.topic_title AS post_subject
, t.topic_attr_id AS post_attr_id
, t.topic_attr_user AS post_attr_user, t.topic_attr_time AS post_attr_time', $sql);
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

                foreach ($rowset as $row) 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
                $topic_list = array();
                foreach( $rowset as $row )
                {
                    $topic_list[] = (int) $row['topic_id'];
                }
                $qte->get_users_by_topic_id($topic_list);
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

                }
                unset($rowset, $forum_names);

                // Now display the page         
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
                    if ( !empty($row['post_attr_id']) && ($mode == 'unapproved_topics') )
                    {
                        $template->alter_block_array('postrow', array(
                            'S_TOPIC_ATTR' => true,
                            'TOPIC_ATTRIBUTE' => $qte->attr_display($row['post_attr_id'], $row['post_attr_user'], $row['post_attr_time']),
                        ), true, 'change');
                    }
//-- fin mod : quick title edition ---------------------------------------------         
เปิดไฟล์ -> includes/mcp/mcp_topic.php,
ค้นหา ::

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

    $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url()); 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    global $qte;
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

    foreach ($rowset as $i => $row) 
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    $topic_list = array();
    foreach( $rowset as $row )
    {
        $topic_list[] = (int) $row['topic_id'];
    }
    $qte->get_users_by_topic_id($topic_list);
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        // Display not already displayed Attachments for this post, we already parsed them. ;)         
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( !empty($topic_info['topic_attr_id']) && !$i )
        {
            $template->alter_block_array('postrow', array(
                'S_TOPIC_ATTR' => true,
                'TOPIC_ATTRIBUTE' => $qte->attr_display($topic_info['topic_attr_id'], $topic_info['topic_attr_user']
, $topic_info['topic_attr_time']),
            ), true, 'change');
        }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

    $s_hidden_fields = build_hidden_fields(array(
        'st_old'    => $sort_days,
        'post_ids'    => $post_id_list,
    )); 
ต่อท้าย ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    if ( $action == 'split' )
    {
        $topic_info['hide_attr'] = unserialize(trim($topic_info['hide_attr']));
        if ( $topic_info['hide_attr'] === false )
        {
            $topic_info['hide_attr'] = array();
        }

        $qte->attr_select($topic_info['forum_id'], $user->data['user_id'], '', $topic_info['hide_attr']);
    }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

    $success_msg = $return_link = ''; 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    $s_hidden_fields .= build_hidden_fields(array('attr_id' => request_var('attr_id', 0)));
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        $sql = 'INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
        $db->sql_query($sql);

        $to_topic_id = $db->sql_nextid(); 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        $attr_id = request_var('attr_id', 0);
        if ( $attr_id == -1 )
        {
            $sql_ary += array('topic_attr_id' => 0, 'topic_attr_user' => 0, 'topic_attr_time' => 0);
        }
        else
        {
            $sql_ary += array(
                'topic_attr_id' => $attr_id,
                'topic_attr_user' => (int) $user->data['user_id'],
                'topic_attr_time' => time(),
            );
        }
//-- fin mod : quick title edition ---------------------------------------------         
เปิดไฟล์ -> includes/search/fulltext_mysql.php,
ค้นหา ::

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

        // generate a search_key from all the options to identify the results         
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
// add
        $attribute_id = 0;
        if ( array_key_exists('attr_id', $id_ary) )
        {
            $attribute_id = (int) $id_ary['attr_id'];
            unset($id_ary['attr_id']);
        }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        $sql_where_options .= (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( $attribute_id )
        {
            $sql_where_options .= ' AND t.topic_attr_id = ' . (int) $attribute_id;
        }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        // generate a search_key from all the options to identify the results         
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
// add
        $attribute_id = 0;
        if ( array_key_exists('attr_id', $id_ary) )
        {
            $attribute_id = (int) $id_ary['attr_id'];
            unset($id_ary['attr_id']);
        }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        $sql_fora        = (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( $attribute_id )
        {
            $sql_author .= ' AND t.topic_attr_id = ' . (int) $attribute_id;

            $firstpost_only = true;
        }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

            break;

            case 't': 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
                if ( $attribute_id )
                {
                    $sql_sort_join .= ' AND t.topic_attr_id = ' . (int) $attribute_id;
                }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

            break;

            case 'f': 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
                if ( $attribute_id )
                {
                    $sql_sort_join .= ' AND t.topic_attr_id = ' . (int) $attribute_id;
                }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

    /**
    * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated.
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    function attribute_search($sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, &$id_ary, $start, $per_page)
    {
        global $config, $db;

        $attribute_id = 0;
        if ( array_key_exists('attr_id', $id_ary) )
        {
            $attribute_id = (int) $id_ary['attr_id'];
            unset($id_ary['attr_id']);
        }
        else
        {
            return 0;
        }

        // init var and ary
        $total_results = 0;
        $id_ary = array();

        // create some display specific sql strings
        $sql_attribute = 't.topic_attr_id = ' . (int) $attribute_id;
        $sql_fora = sizeof($ex_fid_ary) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
        $sql_time = $sort_days ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';

        // build sql strings for sorting
        $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
        $sql_sort_table = $sql_sort_join = '';
        switch ( $sql_sort[0] )
        {
            case 'u':
                $sql_sort_table = USERS_TABLE . ' u, ';
                $sql_sort_join = ' AND u.user_id = p.poster_id ';
            break;

            case 'f':
                $sql_sort_table = FORUMS_TABLE . ' f, ';
                $sql_sort_join = ' AND f.forum_id = p.forum_id ';
            break;
        }

        if ( !sizeof($m_approve_fid_ary) )
        {
            $m_approve_fid_sql = ' AND p.post_approved = 1';
        }
        else if ( $m_approve_fid_ary == array(-1) )
        {
            $m_approve_fid_sql = '';
        }
        else
        {
            $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
        }

        // if the cache was completely empty count the results
        $calc_results = $total_results ? '' : 'SQL_CALC_FOUND_ROWS ';

        $sql = "SELECT {$calc_results}t.topic_id
            FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
            WHERE $sql_attribute
                $m_approve_fid_sql
                $sql_fora
                AND t.topic_id = p.topic_id
                $sql_sort_join
                $sql_time
            GROUP BY t.topic_id
            ORDER BY $sql_sort";

        // only read one block of posts from the db and then cache it
        $result = $db->sql_query_limit($sql, $config['search_block_size'], $start);
        while ( $row = $db->sql_fetchrow($result) )
        {
            $id_ary[] = (int) $row['topic_id'];
        }
        $db->sql_freeresult($result);

        if ( !$total_results )
        {
            $sql = 'SELECT FOUND_ROWS() as total_results';
            $result = $db->sql_query($sql);
            $total_results = (int) $db->sql_fetchfield('total_results');
            $db->sql_freeresult($result);

            if ( !$total_results )
            {
                return false;
            }
        }

        if ( sizeof($id_ary) )
        {
            $id_ary = array_slice($id_ary, 0, $per_page);

            return $total_results;
        }

        return false;
    }
//-- fin mod : quick title edition ---------------------------------------------         
เปิดไฟล์ -> includes/search/fulltext_native.php,
ค้นหา ::

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

        // generate a search_key from all the options to identify the results         
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
// add
        $attribute_id = 0;
        if ( array_key_exists('attr_id', $id_ary) )
        {
            $attribute_id = (int) $id_ary['attr_id'];
            unset($id_ary['attr_id']);
        }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        if ($type == 'topics') 
ค้นหา :: เปิดไฟล์ -> includes/ucp/ucp_main.php,
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( $attribute_id )
        {
            $sql_where[] = 't.topic_attr_id = ' . (int) $attribute_id;
        }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        // generate a search_key from all the options to identify the results         
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
// add
        $attribute_id = 0;
        if ( array_key_exists('attr_id', $id_ary) )
        {
            $attribute_id = (int) $id_ary['attr_id'];
            unset($id_ary['attr_id']);
        }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        $sql_fora        = (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( $attribute_id )
        {
            $sql_author .= ' AND t.topic_attr_id = ' . (int) $attribute_id;

            $firstpost_only = true;
        }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

            break;

            case 'f': 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
                if ( $attribute_id )
                {
                    $sql_sort_join .= ' AND t.topic_attr_id = ' . (int) $attribute_id;
                }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

    /**
    * Split a text into words of a given length
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    function attribute_search($sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, &$id_ary, $start, $per_page)
    {
        global $config, $db;

        $attribute_id = 0;
        if ( array_key_exists('attr_id', $id_ary) )
        {
            $attribute_id = (int) $id_ary['attr_id'];
            unset($id_ary['attr_id']);
        }
        else
        {
            return 0;
        }

        // init var and ary
        $total_results = 0;
        $id_ary = array();

        // create some display specific sql strings
        $sql_attribute = 't.topic_attr_id = ' . (int) $attribute_id;
        $sql_fora = sizeof($ex_fid_ary) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
        $sql_time = $sort_days ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';

        // build sql strings for sorting
        $sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
        $sql_sort_table = $sql_sort_join = '';
        switch ( $sql_sort[0] )
        {
            case 'u':
                $sql_sort_table = USERS_TABLE . ' u, ';
                $sql_sort_join = ' AND u.user_id = p.poster_id ';
            break;

            case 'f':
                $sql_sort_table = FORUMS_TABLE . ' f, ';
                $sql_sort_join = ' AND f.forum_id = p.forum_id ';
            break;
        }

        if ( !sizeof($m_approve_fid_ary) )
        {
            $m_approve_fid_sql = ' AND p.post_approved = 1';
        }
        else if ( $m_approve_fid_ary == array(-1) )
        {
            $m_approve_fid_sql = '';
        }
        else
        {
            $m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
        }

        $is_mysql = false;

        // if the cache was completely empty count the results
        if ( !$total_results )
        {
            switch ( $db->sql_layer )
            {
                case 'mysql4':
                case 'mysqli':
                    $is_mysql = true;
                break;

                default:

                    if ( $db->sql_layer == 'sqlite' )
                    {
                        $sql = 'SELECT COUNT(topic_id) as total_results
                            FROM (SELECT DISTINCT t.topic_id';
                    }
                    else
                    {
                        $sql = 'SELECT COUNT(DISTINCT t.topic_id) as total_results';
                    }

                    $sql .= ' FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
                        WHERE $sql_attribute
                            $m_approve_fid_sql
                            $sql_fora
                            AND t.topic_id = p.topic_id
                            $sql_time" . (($db->sql_layer == 'sqlite') ? ')' : '');
                    $result = $db->sql_query($sql);

                    $total_results = (int) $db->sql_fetchfield('total_results');
                    $db->sql_freeresult($result);

                    if ( !$total_results )
                    {
                        return false;
                    }

                break;
            }
        }

        $sql = "SELECT t.topic_id
            FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
            WHERE $sql_attribute
                $m_approve_fid_sql
                $sql_fora
                AND t.topic_id = p.topic_id
                $sql_sort_join
                $sql_time
            GROUP BY t.topic_id, " . $sort_by_sql[$sort_key] . '
            ORDER BY ' . $sql_sort;

        // only read one block of posts from the db and then cache it
        $result = $db->sql_query_limit($sql, $config['search_block_size'], $start);
        while ( $row = $db->sql_fetchrow($result) )
        {
            $id_ary[] = (int) $row['topic_id'];
        }
        $db->sql_freeresult($result);

        if ( !$total_results && $is_mysql )
        {
            // count rows for the executed queries
            $sql = str_replace('SELECT t.topic_id', 'SELECT DISTINCT SQL_CALC_FOUND_ROWS p.post_id', $sql);
            $db->sql_query($sql);
            $db->sql_freeresult($result);

            $sql = 'SELECT FOUND_ROWS() as total_results';
            $result = $db->sql_query($sql);
            $total_results = (int) $db->sql_fetchfield('total_results');
            $db->sql_freeresult($result);

            if ( !$total_results )
            {
                return false;
            }
        }

        if ( sizeof($id_ary) )
        {
            $id_ary = array_slice($id_ary, 0, $per_page);

            return $total_results;
        }

        return false;
    }
//-- fin mod : quick title edition ---------------------------------------------         
เปิดไฟล์ -> includes/ucp/ucp_main.php,
ค้นหา ::

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

        switch ($mode) 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        global $qte;
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

    foreach ($topic_list as $topic_id) 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
                $qte->get_users_by_topic_id($topic_list);
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

                }

                if ($config['load_user_activity']) 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
                    if ( !empty($row['topic_attr_id']) )
                    {
                        $template->alter_block_array('topicrow', array(
                            'S_TOPIC_ATTR' => true,
                            'TOPIC_ATTRIBUTE' => $qte->attr_display($row['topic_attr_id'], $row['topic_attr_user'], $row['topic_attr_time']),
                        ), true, 'change');
                    }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        $table = ($mode == 'subscribed') ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE; 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        global $qte;
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        }
    }
}

 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
            if ( !empty($row['topic_attr_id']) )
            {
                $template->alter_block_array('topicrow', array(
                    'S_TOPIC_ATTR' => true,
                    'TOPIC_ATTRIBUTE' => $qte->attr_display($row['topic_attr_id'], $row['topic_attr_user'], $row['topic_attr_time']),
                ), true, 'change');
            }
//-- fin mod : quick title edition ---------------------------------------------         
เปิดไฟล์ -> includes/constants.php,
ค้นหา ::

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

// Additional tables         
ต่อท้าย ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
define('TOPICS_ATTR_TABLE', $table_prefix . 'topics_attr');
//-- fin mod : quick title edition ---------------------------------------------         
เปิดไฟล์ -> includes/functions_display.php,
ค้นหา ::

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

        $result = $db->sql_query($sql);
        $active_t_row['topic_title'] = (string) $db->sql_fetchfield('topic_title'); 
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- delete
/*-MOD
ต่อท้าย ::

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

MOD-*/
//-- add
        $sql = str_replace('SELECT ', 'SELECT topic_attr_id, topic_attr_user, topic_attr_time, ', $sql);
        $result = $db->sql_query_limit($sql, 1);
        $active_t_row += $db->sql_fetchrow($result);
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        'S_SHOW_ACTIVITY'        => true)
    ); 
ต่อท้าย ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    if ( !empty($active_t_row['topic_attr_id']) )
    {
        global $qte;

        $qte->get_users_by_topic_id(array($active_t_id));
        $template->assign_vars(array(
            'S_TOPIC_ATTR' => true,
            'TOPIC_ATTRIBUTE' => $qte->attr_display($active_t_row['topic_attr_id'], $active_t_row['topic_attr_user']
, $active_t_row['topic_attr_time']),
        ));
    }
//-- fin mod : quick title edition ---------------------------------------------         
เปิดไฟล์ -> includes/functions_posting.php,
ค้นหา ::

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

    // We do not handle erasing posts here         
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    global $qte;
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

        $result = $db->sql_query($sql);
        $topic_row = $db->sql_fetchrow($result); 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( defined('IN_STK') )
        {
            $sql = str_replace(', t.topic_approved', ', t.topic_approved, t.topic_attr_id, t.topic_attr_user, t.topic_attr_time', $sql);
        }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

    }

    // This variable indicates if the user is able to post or put into the queue - it is used later for all code decisions regarding approval         
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( defined('IN_STK') )
        {
            if ( !empty($topic_row['topic_attr_id']) )
            {
                $data['attr_id'] = $topic_row['topic_attr_id'];
                $data['attr_user'] = $topic_row['topic_attr_user'];
                $data['attr_time'] = $topic_row['topic_attr_time'];
            }
        }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

            if ($update_message)
            {
                $sql_data[POSTS_TABLE]['sql']['post_text'] = $data['message'];
            } 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
            if ( defined('IN_STK') )
            {
                if ( !isset($sql_data[TOPICS_TABLE]['sql']) )
                {
                    $sql_data[TOPICS_TABLE]['sql'] = array();
                }

                $data['attr_id'] = isset($data['attr_id']) ? $data['attr_id'] : -1;
                if ( $data['attr_id'] == -1 )
                {
                    $sql_data[TOPICS_TABLE]['sql'] += array('topic_attr_id' => 0, 'topic_attr_user' => 0, 'topic_attr_time' => 0);
                }
                else
                {
                    $sql_data[TOPICS_TABLE]['sql'] += array(
                        'topic_attr_id' => $data['attr_id'],
                        'topic_attr_user' => $data['attr_user'],
                        'topic_attr_time' => $data['attr_time'],
                    );
                }
            }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

            if (isset($poll['poll_options']) && !empty($poll['poll_options'])) 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
            // generic fix for mods, which use that function ...
            $data['attr_id'] = isset($data['attr_id']) ? $data['attr_id'] : -1;

            if ( $data['attr_id'] != -2 )
            {
                if ( $data['attr_id'] == -1 )
                {
                    $sql_data[TOPICS_TABLE]['sql'] += array('topic_attr_id' => 0, 'topic_attr_user' => 0, 'topic_attr_time' => 0);
                }
                else
                {
                    $sql_data[TOPICS_TABLE]['sql'] += array(
                        'topic_attr_id' => $data['attr_id'],
                        'topic_attr_user' => (int) $user->data['user_id'],
                        'topic_attr_time' => $current_time,
                    );
                }
            }
//-- fin mod : quick title edition ---------------------------------------------         
ค้นหา ::

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

            // Correctly set back the topic replies and forum posts... only if the topic was approved before and now gets disapproved         
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
            // ditto ...
            $data['attr_id'] = isset($data['attr_id']) ? $data['attr_id'] : -1;

            if ( $data['attr_id'] != -2 )
            {
                if ( $data['attr_id'] == -1 )
                {
                    $sql_data[TOPICS_TABLE]['sql'] += array('topic_attr_id' => 0, 'topic_attr_user' => 0, 'topic_attr_time' => 0);
                }
                else
                {
                    $sql_data[TOPICS_TABLE]['sql'] += array(
                        'topic_attr_id' => $data['attr_id'],
                        'topic_attr_user' => (int) $user->data['user_id'],
                        'topic_attr_time' => $current_time,
                    );
                }
            }
//-- fin mod : quick title edition ---------------------------------------------         
แก้ไขล่าสุดโดย thatsawan เมื่อ 16/06/2014 3:57 pm, แก้ไขไปแล้ว 2 ครั้ง.
ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

Re: [MOD] Quick Title Edition

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

การติดตั้ง (ต่อ)
เปิดไฟล์ -> includes/functions_user.php,
ค้นหา ::

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

                // Since we change every post by this author, we need to count this amount towards the anonymous user       
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
                $sql = 'UPDATE ' . TOPICS_TABLE . '
                    SET topic_attr_user = ' . ANONYMOUS . '
                    WHERE topic_attr_user = ' . (int) $user_id;
                $db->sql_query($sql);
//-- fin mod : quick title edition ---------------------------------------------       
เปิดไฟล์ -> styles/prosilver/imageset/imageset.cfg,
ค้นหา ::

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

img_icon_user_warn = icon_user_warn.gif*20*20
เติมท้าย ::

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

img_icon_topic_cancel = icon_topic_cancel.gif*16*16
img_icon_topic_solved = icon_topic_solved.gif*16*16
เปิดไฟล์ -> styles/prosilver/template/mcp_forum.html,
ค้นหา ::

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

                    <a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> 
เติมก่อน ::

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

                    <!-- IF topicrow.S_TOPIC_ATTR -->{topicrow.TOPIC_ATTRIBUTE} <!-- ENDIF --> 
ค้นหา ::

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

<fieldset class="display-actions"> 
เติมก่อน ::

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

<!-- INCLUDE attributes.html --> 
เปิดไฟล์ -> styles/prosilver/template/mcp_post.html,
ค้นหา ::

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

        <h3><a href="{U_VIEW_POST}">{POST_SUBJECT}</a></h3> 
ในบรรทัดค้นหา :: ต่อท้ายในบรรทัดค้นหา ::

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

<!-- IF S_TOPIC_ATTR -->{TOPIC_ATTRIBUTE} <!-- ENDIF --> 
เปิดไฟล์ -> styles/prosilver/template/mcp_queue.html,
ค้นหา ::

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

                    <a href="{postrow.U_VIEW_DETAILS}" class="topictitle">{postrow.POST_SUBJECT}</a> <br /> 
ในบรรทัดค้นหา ::

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

<a href="{postrow.U_VIEW_DETAILS}" class="topictitle"> 
เติมก่อนในบรรทัดค้นหา ::

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

<!-- IF postrow.S_TOPIC_ATTR -->{postrow.TOPIC_ATTRIBUTE} <!-- ENDIF --> 
เปิดไฟล์ -> styles/prosilver/template/mcp_topic.html,
ค้นหา ::

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

    <dl>
        <dt><label>{L_SPLIT_FORUM}:</label></dt> 
เติมก่อน ::

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

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

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

                <h3><a href="{postrow.U_POST_DETAILS}">{postrow.POST_SUBJECT}</a></h3> 
ในบรรทัดค้นหา :: เติมท้ายในบรรทัดค้นหา ::

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

<!-- IF postrow.S_TOPIC_ATTR -->{postrow.TOPIC_ATTRIBUTE} <!-- ENDIF --> 
เปิดไฟล์ -> styles/prosilver/template/posting_editor.html,
ค้นหา ::

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

    <!-- INCLUDE posting_buttons.html --> 
เติมก่อน ::

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

    <!-- INCLUDE attributes.html --> 
เปิดไฟล์ -> styles/prosilver/template/posting_layout.html,
ค้นหา ::

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

    <h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2> 
ในบรรทัดค้นหา ::

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

<a href="{U_VIEW_TOPIC}"> 
เติมก่อนบรรทัดค้นหา ::

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

<!-- IF S_TOPIC_ATTR -->{TOPIC_ATTRIBUTE} <!-- ENDIF --> 
เปิดไฟล์ -> styles/prosilver/template/posting_preview.html,
ค้นหา ::

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

        <h3>{L_PREVIEW}: {PREVIEW_SUBJECT}</h3> 
ในบรรทัดค้นหา ::

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

{PREVIEW_SUBJECT} 
เติมก่อนในบรรทัดค้นหา ::

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

<!-- IF S_TOPIC_ATTR -->{TOPIC_ATTRIBUTE} <!-- ENDIF --> 
เปิดไฟล์ -> styles/prosilver/template/search_body.html,
ค้นหา ::

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

    </fieldset>
    <span class="corners-bottom"><span></span></span></div> 
เติมก่อน::

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

    <!-- INCLUDE attributes.html --> 
เปิดไฟล์ -> styles/prosilver/template/search_results.html,
ค้นหา ::

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

                        <a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a> {searchresults.ATTACH_ICON_IMG} 
เติมก่อน::

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

                        <!-- IF searchresults.S_TOPIC_ATTR -->{searchresults.TOPIC_ATTRIBUTE} <!-- ENDIF --> 
ค้นหา ::

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

            <h3><a href="{searchresults.U_VIEW_POST}">{searchresults.POST_SUBJECT}</a></h3> 
ในบรรทัดค้นหา :: เติมท้ายในค้นหา ::

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

<!-- IF searchresults.S_TOPIC_ATTR -->{searchresults.TOPIC_ATTRIBUTE} <!-- ENDIF --> 
เปิดไฟล์ -> styles/prosilver/template/ucp_main_bookmarks.html,
ค้นหา ::

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

                    <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> 
ในบรรทัดค้นหา ::

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

<!-- ENDIF --> 
เติมท้ายในบรรทัดค้นหา ::

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

<!-- IF topicrow.S_TOPIC_ATTR -->{topicrow.TOPIC_ATTRIBUTE} <!-- ENDIF --> 
เปิดไฟล์ -> styles/prosilver/template/ucp_main_front.html,
ค้นหา ::

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

                    <!-- IF topicrow.S_UNREAD --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->
<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a><br /> 
ในบรรทัดค้นหา ::

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

<!-- ENDIF --> 
เติมท้ายในบรรทัดค้นหา ::

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

<!-- IF topicrow.S_TOPIC_ATTR -->{topicrow.TOPIC_ATTRIBUTE} <!-- ENDIF --> 
ค้นหา ::

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

<strong><a href="{U_ACTIVE_TOPIC}"> 
ในบรรทัดค้นหา ::

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

<strong><a href="{U_ACTIVE_TOPIC}"> 
เติมก่อนในบรรทัดค้นหา ::

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

<!-- IF S_TOPIC_ATTR -->{TOPIC_ATTRIBUTE} <!-- ENDIF --> 
เปิดไฟล์ -> styles/prosilver/template/ucp_main_subscribed.html,
ค้นหา ::

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

                    <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> 
ในบรรทัดค้นหา ::

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

<!-- ENDIF --> 
เติมท้ายในบรรทัดค้นหา ::

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

<!-- IF topicrow.S_TOPIC_ATTR -->{topicrow.TOPIC_ATTRIBUTE} <!-- ENDIF --> 
เปิดไฟล์ -> styles/prosilver/template/viewforum_body.html,
ค้นหา ::

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

                <dt<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> 
ในบรรทัดค้นหา ::

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

<!-- IF topicrow.S_UNREAD_TOPIC --> 
เติมก่อนในบรรทัดค้นหา::

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

<!-- IF topicrow.S_TOPIC_ATTR -->{topicrow.TOPIC_ATTRIBUTE} <!-- ENDIF --> 
ค้นหา ::

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

            <label>{L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS}</label> 
เติมก่อน ::

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

            <!-- INCLUDE attributes.html --> 
เปิดไฟล์ -> styles/prosilver/template/viewtopic_body.html,
ค้นหา ::

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

<h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2> 
ในบรรทัดค้นหา :: ต่อท้ายในบรรทัดค้นหา::

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

<!-- IF S_TOPIC_ATTR -->{TOPIC_ATTRIBUTE} <!-- ENDIF --> 
ค้นหา ::

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

            <h3 <!-- IF postrow.S_FIRST_ROW -->class="first"<!-- ENDIF -->><!-- IF postrow.POST_ICON_IMG --><img src="{T_ICONS_PATH}{postrow.POST_ICON_IMG}" width="{postrow.POST_ICON_IMG_WIDTH}" height="{postrow.POST_ICON_IMG_HEIGHT}" alt="" /> <!-- ENDIF --><a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a></h3> 
ในบรรทัดค้นหา ::

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

<a href="#p{postrow.POST_ID}"> 
เติมก่อนในบรรทัดค้นหา::

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

<!-- IF postrow.S_TOPIC_ATTR && ON_PAGE eq 1 && postrow.S_FIRST_ROW -->{postrow.TOPIC_ATTRIBUTE} <!-- ENDIF --> 
ค้นหา ::

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

<!-- INCLUDE jumpbox.html --> 
เติมก่อน::

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

<!-- INCLUDE attributes.html --> 
เปิดไฟล์ -> styles/prosilver/theme/stylesheet.css,
ค้นหา ::

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

@import url("colours.css"); 
เติมท้าย ::

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

@import url("qte.css"); 
เปิดไฟล์ -> common.php,
ค้นหา :: เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
require $phpbb_root_path . 'includes/functions_attributes.' . $phpEx;

// instantiate the class now !
if ( !empty($config['qte_version']) )
{
    $qte = new qte();
}
//-- fin mod : quick title edition ---------------------------------------------       
เปิดไฟล์ -> posting.php,
ค้นหา ::

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

// User own some drafts?       
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
if ( in_array($mode, array('edit', 'post')) )
{
    $post_data['attr_id'] = request_var('attr_id', 0);
}
//-- fin mod : quick title edition ---------------------------------------------       
ค้นหา ::

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

            foreach ($hidden_fields as $name => $default) 
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
            $hidden_fields += array('attr_id' => 0);
//-- fin mod : quick title edition ---------------------------------------------       
ค้นหา ::

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

    $post_data['enable_bbcode']        = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true; 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    $post_data['attr_id'] = request_var('attr_id', 0);
    if ( $post_data['attr_id'] != -2 )
    {
        if ( !empty($post_data['topic_attr_id']) )
        {
            if ( empty($post_data['attr_id']) )
            {
                $post_data['attr_id'] = $post_data['topic_attr_id'];
            }
        }
    }
//-- fin mod : quick title edition ---------------------------------------------       
ค้นหา ::

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

        $error[] = $user->lang['EMPTY_SUBJECT'];
    } 
ต่อท้าย ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    if ( $post_data['force_attr'] )
    {
        if ( !$preview && !$refresh && ($post_data['attr_id'] == -1) && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id)) )
        {
            $user->add_lang('mods/attributes');

            $error[] = $user->lang['QTE_ATTRIBUTE_UNSELECTED'];

            // init the value
            $post_data['attr_id'] = 0;
        }
    }
//-- fin mod : quick title edition ---------------------------------------------       
ค้นหา ::

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

            // The last parameter tells submit_post if search indexer has to be run       
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
            $post_data['attr_id'] = (($mode == 'post') && !empty($post_data['default_attr'])) ? $post_data['default_attr'] : $post_data['attr_id'];
            $data += array('attr_id' => (int) $post_data['attr_id']);
//-- fin mod : quick title edition ---------------------------------------------       
ค้นหา ::

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

    }
}

// Decode text for message display       
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( !empty($post_data['attr_id']) && ($post_data['attr_id'] != -1) )
        {
            $qte->get_users_by_user_id($user->data['user_id']);
            $template->assign_vars(array(
                'S_TOPIC_ATTR' => true,
                'TOPIC_ATTRIBUTE' => $qte->attr_display($post_data['attr_id'], $user->data['user_id'], $current_time),
            ));
        }
//-- fin mod : quick title edition ---------------------------------------------       
ค้นหา ::

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

    $s_topic_icons = posting_gen_topic_icons($mode, $post_data['icon_id']);
} 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
if ( $mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id']) )
{
    $topic_attribute = 0;
    if ( !$preview )
    {
        if ( !empty($post_data['topic_attr_id']) )
        {
            $topic_attribute = $post_data['topic_attr_id'];
        }
        else if ( $post_data['attr_id'] )
        {
            $topic_attribute = $post_data['attr_id'];
        }
    }
    else
    {
        $topic_attribute = $post_data['attr_id'];
    }

    $post_data['hide_attr'] = unserialize(trim($post_data['hide_attr']));
    if ( $post_data['hide_attr'] === false )
    {
        $post_data['hide_attr'] = array();
    }

    $qte->attr_select($forum_id, $user->data['user_id'], (int) $topic_attribute, $post_data['hide_attr']);

    $template->assign_vars(array(
        'S_POSTING' => true,
        'IS_AUTHOR' => ($post_data['poster_id'] == $user->data['user_id']),
    ));
}
//-- fin mod : quick title edition ---------------------------------------------       
ค้นหา ::

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

// Build custom bbcodes array       
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
if ( ($mode == 'edit') && isset($topic_attribute) && ($post_id == $post_data['topic_first_post_id']) )
{
    if ( $preview )
    {
        if ( $topic_attribute != $post_data['topic_attr_id'] )
        {
            $post_data['topic_attr_id'] = (int) $topic_attribute;
            $post_data['topic_attr_user'] = (int) $user->data['user_id'];
            $post_data['topic_attr_time'] = (string) $current_time;
        }
    }

    if ( $post_data['topic_attr_id'] != -1 )
    {
        $qte->get_users_by_topic_id(array($post_data['topic_id']));
        $template->assign_vars(array(
            'S_TOPIC_ATTR' => true,
            'TOPIC_ATTRIBUTE' => $qte->attr_display($post_data['topic_attr_id'], $post_data['topic_attr_user'], $post_data['topic_attr_time']),
        ));
    }
}
//-- fin mod : quick title edition ---------------------------------------------       
เปิดไฟล์ -> search.php,
ค้นหา ::

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

// We put login boxes for the case if search_id is newposts, egosearch or unreadposts     
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
$attr_id = request_var('attr_id', 0);
$show_results = $attr_id ? 'topics' : $show_results;
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

gen_sort_selects( 
เติมท้าย ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
$submit |= $attr_id;
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

    sort($author_id_ary); 
เติมท้าย::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    $id_ary += array('attr_id' => $attr_id);
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

        $total_match_count = $search->author_search(
    } 
เติมท้าย::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    else if ( empty($search_id) && $attr_id )
    {
        $total_match_count = $search->attribute_search($sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $id_ary, $start, $per_page);
    }
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

        $sql_where .= $db->sql_in_set(($show_results == 'posts') ? 'p.post_id' : 't.topic_id', $id_ary); 
เติมท้าย::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( $attr_id )
        {
            $sql_where .= (!empty($sql_where) ? ' AND ' : '') . 't.topic_attr_id = ' . (int) $attr_id;
        }
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

    $u_search .= ($return_chars != 300) ? '&ch=' . $return_chars : ''; 
เติมท้าย ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    if ( $attr_id )
    {
        $u_search .= '&attr_id=' . $attr_id;
    }
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

        foreach ($rowset as $row) 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        $topic_list = array();
        foreach ( $rowset as $row )
        {
            $topic_list[] = (int) $row['topic_id'];
        }
        $qte->get_users_by_topic_id($topic_list);
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

            $template->assign_block_vars('searchresults', array_merge($tpl_ary, array( 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
            if ( !empty($row['topic_attr_id']) )
            {
                $tpl_ary += array(
                    'S_TOPIC_ATTR' => isset($row['post_id']) ? (($row['topic_first_post_id'] == $row['post_id']) ? true : false) : true,
                    'TOPIC_ATTRIBUTE' => $qte->attr_display($row['topic_attr_id'], $row['topic_attr_user'], $row['topic_attr_time']),
                );
            }
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

// only show recent searches to search administrators     
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
$qte->attr_search();
//-- fin mod : quick title edition ---------------------------------------------     
เปิดไฟล์ -> viewforum.php,
ค้นหา ::

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

// Limit topics to certain time frame, obtain correct topic count     
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
$sort_attr = request_var('attr_id', 0);
$qte->attr_sort($forum_id, $sort_attr);
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

    $result = $db->sql_query($sql);
    $topics_count = (int) $db->sql_fetchfield('num_topics'); 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    if ( $sort_attr )
    {
        $sql .= 'AND topic_attr_id = ' . (int) $sort_attr;
    }
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

    // Make sure we have information about day selection ready
    $template->assign_var('S_SORT_DAYS', true);
} 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
else if ( $sort_attr )
{
    $sql = 'SELECT COUNT(topic_id) AS num_topics
        FROM ' . TOPICS_TABLE . '
        WHERE forum_id = ' . (int) $forum_id . '
            AND ((topic_type <> ' . POST_GLOBAL . ' AND topic_attr_id = ' . (int) $sort_attr . ')
                OR topic_type = ' . POST_ANNOUNCE . ')';
    if ( !$auth->acl_get('m_approve', $forum_id) )
    {
        $sql .= 'AND topic_approved = 1';
    }
    $result = $db->sql_query($sql);
    $topics_count = (int) $db->sql_fetchfield('num_topics');
    $db->sql_freeresult($result);

    if ( isset($_POST['sort']) )
    {
        $start = 0;
    }

    $sql_limit_time = '';
}
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

$result = $db->sql_query_limit($sql, $sql_limit, $sql_start); 
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
if ( $sort_attr )
{
    $sql = str_replace($sql_where, $sql_where . ' AND t.topic_attr_id = ' . (int) $sort_attr, $sql);
}
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

// We need to readd the local announcements to the forums total topic count, otherwise the number is different from the one on the forum list
$total_topic_count = $topics_count + sizeof($announcement_list) - sizeof($global_announce_list); 
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
if ( $sort_attr )
{
    $u_sort_param .= (strlen($u_sort_param) ? '&' : '') . 'attr_id=' . $sort_attr;
}
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

    $s_type_switch = 0; 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    $qte->get_users_by_topic_id($topic_list);
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

        $s_type_switch = ($row['topic_type'] == POST_ANNOUNCE 
|| $row['topic_type'] == POST_GLOBAL) ? 1 : 0; 
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
        if ( !empty($row['topic_attr_id']) )
        {
            $template->alter_block_array('topicrow', array(
                'S_TOPIC_ATTR' => true,
                'TOPIC_ATTRIBUTE' => $qte->attr_display($row['topic_attr_id'], $row['topic_attr_user'], $row['topic_attr_time']),
            ), true, 'change');
        }
//-- fin mod : quick title edition ---------------------------------------------     
เปิดไฟล์ -> viewtopic.php
ค้นหา ::

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

// Does this topic contain a poll?     
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
// did the user apply an attribute ? so, let's save it !
$attr_id = request_var('attr_id', 0);
if ( $attr_id )
{
    $qte->attr_apply($attr_id, $topic_id, $forum_id, $topic_data['topic_attr_id']);
}

// show the selector
$topic_data['hide_attr'] = unserialize(trim($topic_data['hide_attr']));
if ( $topic_data['hide_attr'] === false )
{
    $topic_data['hide_attr'] = array();
}

$qte->attr_select($forum_id, $topic_data['topic_poster'], $topic_data['topic_attr_id'], $topic_data['hide_attr']);

$tpl_ary = array('S_QTE_FORM' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 
"f=$forum_id&t=$topic_id"));
if ( !empty($topic_data['topic_attr_id']) )
{
    $qte->get_users_by_topic_id(array($topic_data['topic_id']));
    $tpl_ary += array(
        'S_TOPIC_ATTR' => true,
        'TOPIC_ATTRIBUTE' => $qte->attr_display($topic_data['topic_attr_id'], $topic_data['topic_attr_user']
, $topic_data['topic_attr_time']),);
}
$template->assign_vars($tpl_ary);
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

    // Dump vars into template     
เติมก่อน::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
    if ( !empty($topic_data['topic_attr_id']) )
    {
        $postrow += array(
            'S_TOPIC_ATTR' => true,
            'TOPIC_ATTRIBUTE' => $qte->attr_display($topic_data['topic_attr_id'], $topic_data['topic_attr_user']
, $topic_data['topic_attr_time']),
        );
    }
//-- fin mod : quick title edition ---------------------------------------------     
ค้นหา ::

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

// Output the page     
เติมก่อน ::

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

//-- mod : quick title edition -------------------------------------------------
//-- add
$attribute_title = $qte->attr_title($topic_data['topic_attr_id']
, $topic_data['topic_attr_user'], $topic_data['topic_attr_time']);
$topic_data['topic_title'] = $attribute_title . ' ' . $topic_data['topic_title'];
//-- fin mod : quick title edition ---------------------------------------------     
***จากนั้นให้ทำการ คัดลอกไฟล์ทั้งหมดที่มี ในโฟลเดอร์ root ไปวาง เเล้วทำการ เปิด Browser ::/db_update.php***
การแสดงผลการติดตั้ง
16-6-2557 15-57-51.png
16-6-2557 15-57-51.png (49.67 KiB) Viewed 4566 times
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

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

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