public function view($data = '') { $this->init(); //if(true){ //$json['auth'] = "9e965808ba6bd38dc883a2806e27763e"; //$json['aid'] = "2"; //$data = $this->encode($json); //} if ($data = $this->decode($data)) { $auth = trim(get_std($data, 'auth', '')); $kid = intval(get_std($data, 'kid', 0)); if (is_alpha_numeric($auth) and $kid != 0) { $where['auth'] = $auth; if (!($rows = $this->User_model->get_where_case_sensitivity($where))) { } else { if (!$rows[0]['vip']) { } else { $sql = "SELECT * FROM `knowledge` WHERE `kid` = {$kid}"; if ($rows = $this->Knowledge_model->query($sql)) { //前端. $js[] = site_url('config'); $js[] = base_url('js/jquery-2.1.0.min.js'); $this->layout['js'] = js_links($js); $this->layout['js'] .= js_link(base_url('js/jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.js')); $this->layout['css'] = css_link(base_url('js/jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.css')); $this->layout['title'] = $rows[0]['title']; $this->layout['content'] = $this->load->view('main_index', array('title' => $rows[0]['title'], 'content' => $rows[0]['knowledge']), true); $this->load->view('layout/mobile', $this->layout); } } } } } }
function js_links($row) { $html = ''; foreach ($row as $href) { $html .= js_link($href); } return $html; }
public function index($data = '') { $this->init(); //前端. $js[] = site_url('config'); $js[] = base_url('js/jquery-2.1.0.min.js'); $this->layout['js'] = js_links($js); $this->layout['js'] .= js_link(base_url('js/jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.js')); $this->layout['css'] = css_link(base_url('js/jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.css')); $this->layout['css'] .= css_link(base_url('css/q_and_a_index.css')); $this->layout['title'] = '問與答'; $this->layout['content'] = $this->load->view('q_and_a_index', array(), true); $this->load->view('layout/mobile', $this->layout); }
public function index() { $this->init(); $this->load->helper('captcha'); $this->layout['js'] .= js_link(base_url('js/login.js')); /* Form Data. */ $captcha = get_captcha(); $this->session->set_userdata('captcha', $captcha['word']); $data['captcha_image'] = $captcha['image']; $otp = $this->psl['auth/otp']; $data['otp_key'] = $otp->generate('login', $this->session->userdata('session_id')); $data['error_message'] = $this->session->flashdata('error_message'); /* 顯示. */ $this->layout['title'] = ''; $this->layout['content'] = $this->load->view('login_index_index', $data, true); $this->load->view('layout/blank', $this->layout); }
function upload_sav($d, $p) { req('sav'); $id = ses('read'); if ($id) { req('pop'); } $ret = css_link('/css/_global.css') . js_link('/prog/ajx.js') . js_link('/prog/utils.js'); $_POST["imnot"] = 1; list($er, $url) = save_img(); $t = $er ? $er : 'saved'; //foreach($_GET as $k=>$v)if($k=='opdir' or $k=='mode' or $k=='read')$lk.='&'.$k.'='.$v; //$tb=$t?strrchr_b($t,'/'):'empty'; $ret .= up_form($_GET['go'], $_GET['chk']); if ($_GET['chk']) { $ret .= up_back(urlread($id)); } //if($_GET['mode']=="banim")$ret.=up_back('/?admin=banner'); return $ret; }
function load_js($file, $init = '') { global $head_content, $urlAppend, $theme, $theme_settings, $language; static $loaded; if (isset($loaded[$file])) { return; } else { $loaded[$file] = true; } // Load file only if not provided by template if (!(isset($theme_settings['js_loaded']) and in_array($file, $theme_settings['js_loaded']))) { if ($file == 'jstree') { $head_content .= js_link('jstree/jquery.cookie.min.js'); $file = 'jstree/jquery.jstree.min.js'; } elseif ($file == 'jstree3') { $head_content .= css_link('jstree3/themes/proton/style.min.css'); $file = 'jstree3/jstree.min.js'; } elseif ($file == 'jstree3d') { $head_content .= css_link('jstree3/themes/default/style.min.css'); $file = 'jstree3/jstree.min.js'; } elseif ($file == 'shadowbox') { $head_content .= css_link('shadowbox/shadowbox.css'); $file = 'shadowbox/shadowbox.js'; } elseif ($file == 'fancybox2') { $head_content .= css_link('fancybox2/jquery.fancybox.css'); $file = 'fancybox2/jquery.fancybox.pack.js'; } elseif ($file == 'colorbox') { $head_content .= css_link('colorbox/colorbox.css'); $file = 'colorbox/jquery.colorbox.min.js'; } elseif ($file == 'flot') { $head_content .= css_link('flot/flot.css') . "<!--[if lte IE 8]><script language='javascript' type='text/javascript' src='{$urlAppend}js/flot/excanvas.min.js'></script><![endif]-->\n" . js_link('jquery-migrate-1.2.1.min.js') . js_link('flot/jquery.flot.min.js'); $file = 'flot/jquery.flot.categories.min.js'; } elseif ($file == 'slick') { $head_content .= css_link('slick-master/slick/slick.css'); $file = 'slick-master/slick/slick.min.js'; } elseif ($file == 'datatables') { $head_content .= css_link('datatables/media/css/jquery.dataTables.css'); $file = 'datatables/media/js/jquery.dataTables.min.js'; } elseif ($file == 'datatables_bootstrap') { $head_content .= css_link('datatables/media/css/dataTables.bootstrap.css'); $file = 'datatables/media/js/dataTables.bootstrap.js'; } elseif ($file == 'datatables_filtering_delay') { $file = 'datatables/media/js/jquery.dataTables_delay.js'; } elseif ($file == 'RateIt') { $file = 'jquery.rateit.min.js'; } elseif ($file == 'select2') { $head_content .= css_link('select2-3.5.1/select2.css') . css_link('select2-3.5.1/select2-bootstrap.css') . js_link('select2-3.5.1/select2.min.js'); $file = "select2-3.5.1/select2_locale_{$language}.js"; } elseif ($file == 'bootstrap-datetimepicker') { $head_content .= css_link('bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css') . js_link('bootstrap-datetimepicker/js/bootstrap-datetimepicker.js'); $file = "bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.{$language}.js"; } elseif ($file == 'bootstrap-timepicker') { $head_content .= css_link('bootstrap-timepicker/css/bootstrap-timepicker.min.css'); $file = 'bootstrap-timepicker/js/bootstrap-timepicker.min.js'; } elseif ($file == 'bootstrap-datepicker') { $head_content .= css_link('bootstrap-datepicker/css/datepicker3.css') . js_link('bootstrap-datepicker/js/bootstrap-datepicker.js'); $file = "bootstrap-datepicker/js/locales/bootstrap-datepicker.{$language}.js"; } elseif ($file == 'bootstrap-validator') { $file = "bootstrap-validator/validator.js"; } elseif ($file == 'bootstrap-slider') { $head_content .= css_link('bootstrap-slider/css/bootstrap-slider.min.css'); $file = 'bootstrap-slider/js/bootstrap-slider.min.js'; } elseif ($file == 'bootstrap-colorpicker') { $head_content .= css_link('bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css'); $file = 'bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js'; } elseif ($file == 'spectrum') { $head_content .= css_link('spectrum/spectrum.css'); $file = 'spectrum/spectrum.js'; } elseif ($file == 'sortable') { $file = "sortable/Sortable.min.js"; } elseif ($file == 'filetree') { $head_content .= css_link('jquery_filetree/jqueryFileTree.css'); $file = 'jquery_filetree/jqueryFileTree.js'; } elseif ($file == 'trunk8') { $head_content .= "\n<script>\n \$(function () { \$('.trunk8').trunk8({\n lines: 3,\n fill: '… <a class=\"read-more\" href=\"#\">" . js_escape($GLOBALS['showall']) . "</a>',\n });\n\n \$(document).on('click', '.read-more', function (event) {\n \$(this).parent().trunk8('revert').append(' <a class=\"read-less\" href=\"#\">" . js_escape($GLOBALS['shownone']) . "</a>');\n event.preventDefault();\n });\n\n \$(document).on('click', '.read-less', function (event) {\nconsole.log('aaa');\n \$(this).parent().trunk8();\n event.preventDefault();\n });\n\n});\n</script>"; $file = 'trunk8.js'; } $head_content .= js_link($file); } if (strlen($init) > 0) { $head_content .= $init; } }
if ($_GET['admin'] or $_GET['msql']) { $ret .= css_link('/css/_admin.css'); } else { $ret .= css_link('/css/' . $meta["css"] . '.css' . $cst); } $ret .= js_code('cutat=' . $_SESSION['jbuffer'] . '; fixpop="' . $_SESSION['mobile'] . '"; fulpop="1"; read="' . $read . '"; flow="' . $flow . '";'); $ret .= js_link('/prog' . $g . '/ajx.js'); //ajax $ret .= js_link('/prog' . $g . '/utils.js'); //js if (rstr(100)) { $ret .= js_link('http://code.jquery.com/jquery-1.9.1.min.js'); } if ($_SESSION['desgn']) { $ret .= js_link('/js/live.js#css'); } $ret .= Head::get(); $ret .= '</head>' . "\n"; if ($_GET['admin']) { $sp = ' spellcheck="false"'; } $ret .= '<body' . atb('onload', $onload) . ' onclick="clpop(event)" onmousemove="popslide(event)"' . $sp . '>' . "\n"; // $ret .= divd('clbub', '') . "\n"; $ret .= $madmin; $ret .= divd('desktop', '') . "\n"; $ret .= '<div id="page">' . "\n"; if ($out) { $ret .= implode('', $out); }
public function index($data = '') { $this->init(); if (true) { //$json['auth'] = "85ace4027df3c500fd9a6099a625f111"; //$data = $this->encode($json); } if ($data = $this->decode($data)) { $auth = trim(get_std($data, 'auth', '')); if (is_alpha_numeric($auth)) { $where['auth'] = $auth; if (!($rows = $this->User_model->get_where_case_sensitivity($where))) { } else { if ($rows[0]['vip']) { $date = date('Y-m-d', time()); } else { $N = date('N', time()); if ($N >= 4) { $date = date('Y-m-d', time() - ($N - 4) * 86400); } else { $date = date('Y-m-d', time() - ($N - 1) * 86400); } } if ($rows = $this->Knowledge_model->get_where_order(array('date' => $date, 'switch' => 1))) { //前端. $js[] = site_url('config'); $js[] = base_url('js/jquery-2.1.0.min.js'); $this->layout['js'] = js_links($js); $this->layout['js'] .= js_link(base_url('js/jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.js')); $this->layout['css'] = css_link(base_url('js/jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.css')); $this->layout['title'] = $rows[0]['title']; $this->layout['content'] = $this->load->view('main_index', array('title' => $rows[0]['title'], 'content' => $rows[0]['knowledge']), true); $this->load->view('layout/mobile', $this->layout); } } } } }
function header_tags($r) { $ret = ''; if ($r) { foreach ($r as $k => $v) { if (is_array($v)) { $va = current($v); } switch (key($v)) { case 'code': $ret .= $va . "\n"; break; case 'csslink': $ret .= css_link($va); break; case 'jslink': $ret .= js_link($va); break; case 'csscode': $ret .= css_code($va); break; case 'jscode': $ret .= js_code($va); break; case 'rel': $ret .= '<link rel="' . $v['rel'][0] . '" href="' . $v['rel'][1] . '">' . "\n"; break; case 'meta': $ret .= meta($va[0], $va[1], $va[2]); break; case 'name': $ret .= meta('name', $va[0], $va[1]); break; case 'tag': $ret .= bal($va[0], $va[1]); break; default: $ret .= meta(key($v), $va[0], $va[1]); break; } } } return $ret; }
public function index() { $this->init(); $this->init_admin(); $this->layout['js'] .= js_link(base_url('js/jquery-ui-1.8.18.custom.xuelunlu/js/jquery-ui-1.8.18.custom.min.js')); $this->layout['js'] .= js_link(base_url() . 'js/jquery-ui-1.8.18.custom.xuelunlu/development-bundle/ui/i18n/jquery.ui.datepicker-zh-TW.js'); $this->layout['css'] .= css_link(base_url('js/jquery-ui-1.8.18.custom.xuelunlu/css/ui-lightness/jquery-ui-1.8.18.custom.css')); $this->layout['js'] .= js_link(base_url('js/ckeditor_4.5.5_full/ckeditor/ckeditor.js')); $this->layout['js'] .= js_link(base_url('js/ckfinder_php_2.4.2/ckfinder/ckfinder.js')); $this->layout['js'] .= js_link(base_url('js/admin_knowledge_index.js')); if ($max_date = $this->Knowledge_model->get_max_date()) { $date = date('Y-m-d', strtotime($max_date) + 24 * 60 * 60); } else { $date = ''; } /* 表單資料. */ $data['title'] = my_flashdata('title', ''); $data['date'] = my_flashdata('date', $date); $data['url'] = my_flashdata('url', ''); $data['knowledge'] = my_flashdata('knowledge', ''); $data['selected_switch'] = my_flashdata('selected_switch', 1); $data['switch'] = $this->config->item('switch'); $data['success_message'] = $this->session->flashdata('success_message'); $data['error_message'] = $this->session->flashdata('error_message'); /* 顯示. */ $this->layout['title'] = ''; $this->layout['content'] = $this->load->view('admin_knowledge_index', $data, true); $this->load->view('layout/2col', $this->layout); }