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 css_links($row) { $html = ''; foreach ($row as $href) { $html .= css_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); }
protected function init_admin() { $this->layout['css'] .= css_link(base_url('css/layout/2col.css')); include 'application/libraries/Admin.php'; $username = my_session('username', ''); $password = my_session('password', ''); if ($username and $password) { $data['username'] = $this->cipher->decrypt($username); $data['password'] = $this->cipher->decrypt($password); if ($rows = $this->Admin_model->get_where_case_sensitivity($data)) { $this->me = new Admin($rows[0]); } else { redirect('login/index/index'); } } else { redirect('login/index/index'); } $this->layout['sidebar_first'] = $this->load->view('sidebar_first', array('me' => $this->me), true); }
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; }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Tonynews.com | template</title> <meta http-equiv="Content-Language" content="English" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script type="text/javascript" src="<?php echo base_url(); ?> public/client_2/js/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="<?php echo base_url(); ?> public/client_2/js/client_2.js"></script> <link rel="stylesheet" type="text/css" href="<?php echo css_link('style.css'); ?> " media="screen" /> <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss-articles/" /> </head> <body> <div id="wrap"> <div id="top"> </div> <div id="header"> <h1><a href="#">Tonynews.com</a></h1> <h2>Tonytran's First Website Template</h2> </div>
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; } }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title><?php echo isset($area_title) ? $area_title . ' : ' : ''; echo isset($site_title) ? $site_title : ''; ?> </title> <?php echo css_link('base'); ?> <meta name="author" content="<?php echo $this->config->item('author_meta'); ?> " /> <meta name="description" content="<?php echo $this->config->item('desc_meta'); ?> " /> <meta name="keywords" content="<?php echo $this->config->item('keywords_meta'); ?> " /> <link rel="shortcut icon" href="<?php echo base_url(); ?> favicon.ico" /> <script src="/mint/?js" type="text/javascript"></script>
function sort($sort = '') { /* Load Textile */ $this->load->plugin('textile'); /* Load Javascripts */ $head[] = js_tags('prototype'); $head[] = js_tags('scriptaculous.js?load=effects'); $head[] = js_tags('lightbox'); $head[] = css_link('lightbox'); /* Add the sort options to the content area. */ $content[] = $this->load->view('partials/portfolio/sort_options', array('sort_nav' => $sort), TRUE); /* Get all portfolio entries. */ switch ($sort) { case 'sites': $entries = $this->portfolio_model->get_type('1'); break; case 'apps': $entries = $this->portfolio_model->get_type('2'); break; case 'logos': $entries = $this->portfolio_model->get_type('3'); break; case 'all': $entries = $this->portfolio_model->get_alpha(); break; default: $entries = $this->portfolio_model->get_recent(); } if ($entries->num_rows() > 0) { /* Loop through them. Get some additional data, build the content view. */ foreach ($entries->result() as $item) { $temp_types = array(); $image_list = array(); $item->snippet = ''; /* Get portfolio images. */ $images = $this->portfolio_model->get_images($item->id); /* We need at least one item in the list & one snippet. */ if ($images->num_rows() >= 2) { /* Start the list. */ $image_list[] = '<ul>'; $num = 0; $snippet_link = ''; $snippet_title = ''; /* Loop through the images. */ foreach ($images->result() as $image) { /* If it's a snippet we set the snippet property. */ if ($image->type != 'snippet') { /* Add item to the list array. */ $image_list[] = '<li><a href="' . $image->src . '" rel="lightbox[' . $item->id . ']" title="' . (!empty($image->title) ? $image->title : 'Additional Screenshot') . '">' . (!empty($image->title) ? $image->title : 'Additional Screenshot') . '</a></li>'; if ($num == 0) { $snippet_link = $image->src; $snippet_title = $image->title; } $num++; } } foreach ($images->result() as $image) { if ($image->type == 'snippet' && $snippet_link != '') { /* Set snippet. */ $item->snippet = '<a href="' . $snippet_link . '" rel="lightbox[' . $item->id . ']" title="' . (!empty($snippet_title) ? $snippet_title : 'Additional Screenshot') . '"><img src="' . $image->src . '" /></a>'; } } /* Close the list. */ $image_list[] = '</ul>'; } /* Build final image list. */ $item->image_list = implode("\n", $image_list); /* Get item types. */ $types = $this->portfolio_model->get_types($item->id); /* Loop through the types and get only the names. */ foreach ($types->result() as $type) { $temp_types[] = $type->name; } /* Create Pipe Separated List of Types */ $item->types = implode(' | ', $temp_types); /* Link to the site if applicable. */ $item->anchor = !empty($item->uri) ? '<p><a href="' . $item->uri . '" target="new">Visit Site</a></p>' : ''; /* TEXTILE */ $textile = new Textile(); $item->blurb = $textile->process($item->blurb); /* View Content */ $entry = array('item' => $item); /* Load view. */ $content[] = $this->load->view('partials/portfolio/item', $entry, TRUE); } } /* Frame Data */ $frame = array('site_title' => $this->config->item('title'), 'head' => implode('', $head), 'area_title' => 'Portfolio', 'body_id' => 'portfolio', 'content' => implode("\n", $content)); /* Load the Frame View */ $this->load->view('frames/public', $frame); }
$ret .= meta('name', 'category', $_SESSION['frm']); $ret .= meta('name', 'generator', 'philum_' . $_SESSION['philum']); //needed $ret .= meta('name', 'hub', $_SESSION['qb']); //$ret.=meta('name','copyright','GNU/GPLv3'); $ret .= meta('name', 'viewport', 'user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1, width=device-width'); //prmb(4) $ret .= meta('name', 'google-site-verification', prms('goog')); $ret .= css_link('/css/_global.css' . $cst); //css $ret .= css_link('/css/_pictos.css' . $cst); //icons 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";
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; }
/** * Add extra head content to WP Admin head * * @return nothing * */ function friendfeed_comments_head() { echo "\n<!-- WP FF Comments JS -->\n"; echo css_link('friendfeed_comments'); // Different WP versions make problem with jquery // wp_enqueue_script('wp_ff_admin', '/wp-content/plugins/wordpress-friendfeed-comments/js/wp_ff_admin.js'); // wp_print_scripts(); }
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); }