basicset(); $style = $basicset['template']; $source = ES_TEMPLATE_PATH . $style . '/' . $name . '.html'; if (!(is_file($source))) { $source = ES_TEMPLATE_PATH . ES_STYLE . '/' . $name . '.html'; } if (!(is_file($source))) { trigger_error('Template ' . $name . ' Not Found!'); exit(); } $compile = IA_ROOT . '/data/tpl/web/ewei_shop_web/' . ES_STYLE . '/' . $name . '.tpl.php'; if (DEVELOPMENT || !(is_file($compile)) || (filemtime($compile) < filemtime($source))) { template_compile($source, $compile, true); } return $compile; } public function basicset() { global $_W; $basicset = pdo_fetch('select * from ' . tablename('ewei_shop_system_site') . ' where `type`=:type', array(':type' => 'set')); $data = iunserializer($basicset['content'], true); return $data; } public function pagination($total, $pageIndex, $pageSize = 15, $url = '', $context = array('before' => 5, 'after' => 4, 'ajaxcallback' => '', 'callbackfuncname' => '')) { global $_W; $pdata = array('tcount' => 0, 'tpage' => 0, 'cindex' => 0, 'findex' => 0, 'pindex' => 0, 'nindex' => 0, 'lindex' => 0, 'options' => ''); if ($context['ajaxcallback']) { $context['isajax'] = true; } $pdata['tcount'] = $total; $pdata['tpage'] = ceil($total / $pageSize); if ($pdata['tpage'] <= 1) { return ''; } $cindex = $pageIndex; $cindex = min($cindex, $pdata['tpage']); $cindex = max($cindex, 1); $pdata['cindex'] = $cindex; $pdata['findex'] = 1; $pdata['pindex'] = ((1 < $cindex ? $cindex - 1 : 1)); $pdata['nindex'] = (($cindex < $pdata['tpage'] ? $cindex + 1 : $pdata['tpage'])); $pdata['lindex'] = $pdata['tpage']; if ($context['isajax']) { if (!($url)) { $url = $_W['script_name'] . '?' . http_build_query($_GET); } $pdata['faa'] = 'href="javascript:;" page="' . $pdata['findex'] . '" ' . (($callbackfunc ? 'onclick="' . $callbackfunc . '(\'' . $_W['script_name'] . $url . '\', \'' . $pdata['findex'] . '\', this);return false;"' : '')); $pdata['paa'] = 'href="javascript:;" page="' . $pdata['pindex'] . '" ' . (($callbackfunc ? 'onclick="' . $callbackfunc . '(\'' . $_W['script_name'] . $url . '\', \'' . $pdata['pindex'] . '\', this);return false;"' : '')); $pdata['naa'] = 'href="javascript:;" page="' . $pdata['nindex'] . '" ' . (($callbackfunc ? 'onclick="' . $callbackfunc . '(\'' . $_W['script_name'] . $url . '\', \'' . $pdata['nindex'] . '\', this);return false;"' : '')); $pdata['laa'] = 'href="javascript:;" page="' . $pdata['lindex'] . '" ' . (($callbackfunc ? 'onclick="' . $callbackfunc . '(\'' . $_W['script_name'] . $url . '\', \'' . $pdata['lindex'] . '\', this);return false;"' : '')); } else if ($url) { $pdata['faa'] = 'href="?' . str_replace('*', $pdata['findex'], $url) . '"'; $pdata['paa'] = 'href="?' . str_replace('*', $pdata['pindex'], $url) . '"'; $pdata['naa'] = 'href="?' . str_replace('*', $pdata['nindex'], $url) . '"'; $pdata['laa'] = 'href="?' . str_replace('*', $pdata['lindex'], $url) . '"'; } else { $_GET['page'] = $pdata['findex']; $pdata['faa'] = 'href="' . $_W['script_name'] . '?' . http_build_query($_GET) . '"'; $_GET['page'] = $pdata['pindex']; $pdata['paa'] = 'href="' . $_W['script_name'] . '?' . http_build_query($_GET) . '"'; $_GET['page'] = $pdata['nindex']; $pdata['naa'] = 'href="' . $_W['script_name'] . '?' . http_build_query($_GET) . '"'; $_GET['page'] = $pdata['lindex']; $pdata['laa'] = 'href="' . $_W['script_name'] . '?' . http_build_query($_GET) . '"'; } $html = '