$replace[] = number_format($item['visited']); $replace[] = number_format($item['comments']); if (!empty($item['picture']) && is_file(DATA_PATH . "document/{$item['picture']}")) { $replace[] = DATA_URL . "document/{$item['picture']}"; } elseif (!empty($index['icon']) && is_file(DATA_PATH . "document/{$index['icon']}")) { $replace[] = DATA_URL . "document/{$index['icon']}"; } else { $replace[] = WEB_URL . "/{$index['default_icon']}"; } if ($item['create_date'] > $valid_date && $item['comment_date'] == 0) { $replace[] = ' new'; } elseif ($item['last_update'] > $valid_date || $item['comment_date'] > $valid_date) { $replace[] = ' update'; } else { $replace[] = ''; } $list[] = preg_replace($patt, $replace, $listitem); } // URL สำหรับ แบ่งหน้า และ canonical $c = $cat_count > 0 ? "&cat={$cat}" : ''; if (empty($tag)) { $url = '<a href="' . gcms::getURL($index['module'], '', 0, 0, "page=%d{$c}") . '">%d</a>'; $canonical = gcms::getURL($index['module'], '', 0, 0, "page={$page}{$c}"); } else { $url = '<a href="' . gcms::getURL('tag', $tag, 0, 0, "page=%d{$c}") . '">%d</a>'; $canonical = gcms::getURL('tag', $tag, 0, 0, "page={$page}{$c}"); } // แบ่งหน้า $splitpage = gcms::pagination($totalpage, $page, $url); } }
$tr .= '<td headers="r' . $id . ' c4" class=menu><a href="{URLQUERY?id=' . $id . '&module=countrywrite&src=country&spage=' . $page . '}" title="{LNG_MEMBER_EDIT_TITLE}" class=icon-edit></a></td>'; $tr .= '</tr>'; $content[] = $tr; } $content[] = '</tbody>'; $content[] = '<tfoot>'; $content[] = '<tr>'; $content[] = '<td headers=c0> </td>'; $content[] = '<td headers=c1 class=check-column><a class="checkall icon-uncheck"></a></td>'; $content[] = '<td headers=c2 colspan=3></td>'; $content[] = '</tr>'; $content[] = '</tfoot>'; $content[] = '</table>'; // แบ่งหน้า $url = '<a href="{URLQUERY?module=country&page=%d}" title="{LNG_DISPLAY_PAGE} %d">%d</a>'; $content[] = '<div class=splitpage>' . gcms::pagination($totalpage, $page, $url) . '</div>'; $content[] = '<div class=table_nav>'; $content[] = '<fieldset>'; // sel action $sel = array(); $sel[] = '<select id=sel_action>'; // delete $sel[] = '<option value=delete_country>{LNG_DELETE}</option>'; // country zone $sel[] = '<option value=zone_0>{LNG_COUNTRY_NO_ZONE}</option>'; if (isset($lng['COUNTRIES_ZONE'])) { foreach ($lng['COUNTRIES_ZONE'] as $i => $item) { $sel[] = '<option value=zone_' . $i . '>' . $item . '</option>'; } } $sel[] = '</select>';
$replace[] = $item['detail']; $replace[] = $item['count']; $replace[] = $item['visited']; $items[] = gcms::pregReplace($patt, $replace, $skin); } // URL สำหรับแบ่งหน้า $qs[] = 'page=%d'; $url = '<a href="' . gcms::getURL($index['module'], '', 0, 0, implode('&', $qs)) . '">%d</a>'; // แสดงผล list รายการ $patt = array('/{BREADCRUMS}/', '/{TOPIC}/', '/{DETAIL}/', '/{LIST}/', '/{SPLITPAGE}/', '/{COLS}/'); $replace = array(); $replace[] = implode("\n", $breadcrumbs); $replace[] = $index['topic']; $replace[] = nl2br($index['detail']); $replace[] = implode("\n", $items); $replace[] = gcms::pagination($totalpage, $page, $url); $replace[] = $config['gallery_cols']; $content = preg_replace($patt, $replace, gcms::loadtemplate($index['module'], 'gallery', 'album')); } // title,keywords,description $title = $index['topic']; $keywords = $index['keywords']; $description = $index['description']; // เลือกเมนู $menu = $install_modules[$index['module']]['alias']; $menu = $menu == '' ? $index['module'] : $menu; } else { $title = $lng['LNG_DATA_NOT_FOUND']; $content = '<div class=error>' . $title . '</div>'; } }