by M034 » 24/05/2016 4:25 pm
โค๊ดค่ะ ไม่เข้าใจโค๊ดในส่วนของโฟล์เดอร์ event ค่ะ
Code: Select all
public function posting_modify_template_vars1($event) {
global $db, $config, $table_prefix;
if ($config['classified_config'] == 1) {
$page_data = $event['page_data'];
$mode = $event['mode'];
$draft_id = request_var('d', 0);
$sql = 'SELECT * from ' . DRAFTS_TABLE . ' where draft_id = ' . $draft_id;
$query = $db->sql_query($sql);
$fetch = $db->sql_fetchrow($query);
if (!empty($fetch) && ($draft_id != 0)) {
foreach ($this->user->lang['classified_con_type'] as $key => $value) {
$SELECTED = false;
$value = trim($value);
$fetch['classified_condition_type'] = trim($fetch['classified_condition_type']);
if (($fetch['classified_condition_type'] == $value)) {
$SELECTED = true;
}
$this->template->assign_block_vars('classified_con_type', array(
'KEY_TYPE' => $key,
'VALUE_TYPE' => $value,
'SELECTED_C' => $SELECTED,
));
}
โค๊ดค่ะ ไม่เข้าใจโค๊ดในส่วนของโฟล์เดอร์ event ค่ะ
[code]public function posting_modify_template_vars1($event) {
global $db, $config, $table_prefix;
if ($config['classified_config'] == 1) {
$page_data = $event['page_data'];
$mode = $event['mode'];
$draft_id = request_var('d', 0);
$sql = 'SELECT * from ' . DRAFTS_TABLE . ' where draft_id = ' . $draft_id;
$query = $db->sql_query($sql);
$fetch = $db->sql_fetchrow($query);
if (!empty($fetch) && ($draft_id != 0)) {
foreach ($this->user->lang['classified_con_type'] as $key => $value) {
$SELECTED = false;
$value = trim($value);
$fetch['classified_condition_type'] = trim($fetch['classified_condition_type']);
if (($fetch['classified_condition_type'] == $value)) {
$SELECTED = true;
}
$this->template->assign_block_vars('classified_con_type', array(
'KEY_TYPE' => $key,
'VALUE_TYPE' => $value,
'SELECTED_C' => $SELECTED,
));
}[/code]