/** * css编辑预览 */ public function preview() { define('HTML', true); if (!$_GET['specialid']) showmessage(L('illegal_action'), HTTP_REFERER); $info = $this->db->get_one(array('id'=>$_GET['specialid'], 'disabled'=>'0', 'siteid'=>$this->get_siteid())); if (!$info['id']) showmessage(L('illegal_parameters'), HTTP_REFERER); $css = get_css($_POST['info']); $template = $info['index_template'] ? $info['index_template'] : 'index'; include template('special', $template); }
function a2b_add_header() { global $post; if (!isset($post)) { return; } echo "<!-- start adblock-to-bitcoin -->"; echo get_css(); echo "<!-- end adblock-to-bitcoin -->"; }
/** * 专题分类 */ public function type() { $typeid = intval($_GET['typeid']); $specialid = intval($_GET['specialid']); if (!$specialid || !$typeid) showmessage(L('illegal_action')); $info = $this->db->get_one(array('id'=>$specialid, 'disabled'=>0)); if(!$info) showmessage(L('special_not_exist'), 'back'); $page = max(intval($_GET['page']), 1); extract($info); $css = get_css(unserialize($css)); if(!$typeid) showmessage(L('illegal_action')); $type_db = pc_base::load_model('type_model'); $info = $type_db->get_one(array('typeid'=>$typeid)); $SEO = seo($siteid, '', $info['typename'], ''); $template = $list_template ? $list_template : 'list'; include template('special', $template); }
public static function vue($chemin, $vue = "normal") { if ($vue == "normal") { $ret = ''; $ret .= '<div class="prochain-evenement">'; $ret .= '<h2>Prochain évènement</h2>'; if (Permissions::vérifier_permission($chemin, "set_prop", Authentification::get_utilisateur())) { $ret .= '<form method="post" action="' . $chemin->get_url() . '">'; $ret .= formulaire_édition_texte_enrichi(Stockage::get_prop($chemin, "prochain_evenement"), "prochain_evenement"); $ret .= '<p><input type="submit" value="appliquer" /></p>'; $ret .= '</form>'; } else { $ret .= Stockage::get_prop($chemin, "prochain_evenement"); } $ret .= '</div>'; $ret .= '<div class="description-site">'; if (Permissions::vérifier_permission($chemin, "set_prop", Authentification::get_utilisateur())) { $ret .= '<form class="nom_site infos" method="post" action="' . $chemin->get_url() . '">'; $ret .= '<h2><input type="text" name="nom_site" value="' . Stockage::get_prop($chemin, "nom_site") . '" /></h2>'; $ret .= '<p><input type="submit" value="appliquer" /></p>'; $ret .= '</form>'; } else { $ret .= "<h2>" . Stockage::get_prop($chemin, "nom_site") . "</h2>"; } if (Permissions::vérifier_permission($chemin, "set_prop", Authentification::get_utilisateur())) { $ret .= '<form method="post" action="' . $chemin->get_url() . '">'; $ret .= formulaire_édition_texte_enrichi(Stockage::get_prop($chemin, "description"), "description"); $ret .= '<p><input type="submit" value="appliquer" /></p>'; $ret .= '</form>'; } else { $ret .= Stockage::get_prop($chemin, "description"); } $ret .= '</div>'; return new Page($ret, Stockage::get_prop($chemin, "nom_site")); } else { if ($vue == "css") { return new Page(get_css(), "text/css", "raw"); } } return new Page('', ''); // TODO : devrait renvoyer une page d'erreur ! }
/** * 生成专题首页 * * @param intval $specialid * 专题ID * @param intval $pagesize * 每页个数 * @param intval $pages_num * 最大更新页数 * @return boolen/intval 成功返回生成文件的大小 */ public function _index($specialid = 0, $pagesize = 20, $pages_num = 0) { Loader::helper('special:global'); $specialid = intval($specialid); if (!$specialid) { return false; } $r = $this->db->getby_id($specialid); if (!$r['ishtml'] || $r['disabled'] != 0) { return true; } if (!$specialid) { showmessage(L('illegal_action')); } $info = $this->db->getby_id($specialid); if (!$info) { showmessage(L('special_not_exist'), 'back'); } extract($info); if ($pics) { $pic_data = get_pic_content($pics); unset($pics); } if ($voteid) { $vote_info = explode('|', $voteid); $voteid = $vote_info[1]; } $commentid = id_encode('special', $id); $file = $this->html_root . '/special/' . $filename . '/index.html'; if (!$ispage) { $type_db = Loader::model('type_model'); $types = $type_db->where(array('application' => 'special', 'parentid' => $specialid))->order('listorder ASC, typeid ASC')->key('listorder')->select(); } $css = get_css(unserialize($css)); $template = $index_template ? $index_template : 'index'; $SEO = seo('', $title, $description); if ($ispage) { $total = $this->c_db->where(array('specialid' => $specialid))->count(); $times = ceil($total / $pagesize); if ($pages_num) { $pages_num = min($times, $pages_num); } else { $pages_num = $times; } for ($i = 1; $i <= $pages_num; $i++) { if ($i == 1) { $file_root = $file; } else { $file_root = str_replace('index', 'index-' . $i, $file); } $file_root = BASE_PATH . $file_root; ob_start(); include template('special', $template); $this->create_html($file_root); } return true; } else { $file = BASE_PATH . $file; ob_start(); include template('special', $template, $style); return $this->create_html($file); } }
<!-- CORE CSS --> <link href="<?php echo base_url('assets/plugins/bootstrap/css/bootstrap.min.css'); ?> " rel="stylesheet" type="text/css" /> <link href="<?php echo base_url('assets/css/font-awesome.css'); ?> " rel="stylesheet" type="text/css" /> <link href="<?php echo base_url('assets/css/style.css'); ?> " rel="stylesheet" type="text/css" /> <?php get_css(); ?> </head> <body> <div class="container"> <div class="header"> <img clas="img-responsive" src="<?php echo base_url('assets/images/header.png'); ?> " alt="header.png" /> </div> <!-- NOTIFICACIONS --> <?php
?> "; // 3/15/11 parent.frames["upper"].$("logged_in_txt").style.color = "<?php print get_css('titlebar_text', $day_night); ?> "; // 3/15/11 parent.frames["upper"].$("perms_txt").style.color = "<?php print get_css('titlebar_text', $day_night); ?> "; // 3/15/11 parent.frames["upper"].$("modules_txt").style.color = "<?php print get_css('titlebar_text', $day_night); ?> "; // 3/15/11 parent.frames["upper"].$("time_txt").style.color = "<?php print get_css('titlebar_text', $day_night); ?> "; // 3/15/11 parent.frames["upper"].$("term").innerHTML = "<?php print $term_str; ?> "; // responder or 'Mobile' name - 3/19/11 } catch(e) { } var frame_rows; // frame parent.upper.show_butts(); // 1/21/09 parent.upper.light_butt('term'); // light it up parent.frames["upper"].document.getElementById("gout").style.display = "inline";
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Welcome to TITAN</title> <link rel="stylesheet" href="<?php echo get_css('style.css'); ?> "> <link rel="shortcut icon" type="image/x-icon" href="<?php echo get_image('favicon.ico'); ?> " /> </head> <body> <div id="logo"> <img src="<?php echo get_image('titan.png'); ?> " width="90" /> </div> <div id="container"> <h3>Welcome to <span class="error_code">TITAN</span></h3> <p>This is backend dashboard page.</p> </div> <div id="footer"> <span class="copyright">Developed by <a href="http://www.turankaratug.com" target="_blank">Turan Karatuğ</a></span> <span class="version">Version <?php echo VERSION; ?> </span>
if (strlen($cloud) > 0 && $cloud == "zcloud") { echo "on ZCloud"; } else { echo "on EC2"; } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <title>zPerfmon: Instance Utilization Report</title> <style type="text/css"> <?php echo get_css(); ?> </style> </head> <script language="javascript" type="text/javascript"> <!-- function show_ungrouped() { wndw = window.open('','name','height=500,width=250'); var doc = wndw.document; doc.write('<html><head><title>Unclassified Instances</title>'); doc.write('</head><body><table>'); <?php
public function edit_role($id = "") { $this->form_validation->set_rules($this->_validation_rules_message()); if ($this->form_validation->run()) { $this->ins_data['role'] = $this->input->post('role'); $this->ins_data['id'] = $this->input->post('id'); $this->load->model('admin/role_model'); $this->role_model->edit_role($this->ins_data); $this->service_message->set_flash_message("record_insert_success"); redirect("admin/role/manage_role"); } $this->load->model('admin/role_model'); $this->result = $this->role_model->get_role_details($id); $this->data['css'] = get_css('user_add'); $this->data['js'] = get_js('user_add'); $this->layout->view("admin/role/edit_role", $this->result); }
; background: <?php print get_css("page_background", $day_night); ?> ; border-top: 4px outset #CECECE; border-left: 4px outset #CECECE; border-bottom: 4px outset #CECECE; z-index: 3; } .right_menu_lit { text-align: center; padding: 2px; color: <?php print get_css("label_text", $day_night); ?> ; background: #00FFFF; border-top: 4px outset #CECECE; border-left: 4px outset #CECECE; border-bottom: 4px outset #CECECE; z-index: 3; } .right_menu_container { padding-top: 5px; padding-bottom: 5px; z-index: 3; }
function generate_tpl($W_H) { $W = $W_H['W']; $H = $W_H['H']; $baner_sizes = $W_H['baners']; unset($W_H); $sellspasing = rand(5, 40); //зазоры м/у ячейками $sellpadding = rand(1, 20); // отступы от границ ячеек $dopusk = 20; //допустимое расхождение размера банера и ячейки $min_main_w = 350; $max_main_w = 780; $min_main_h = 600; $max_main_h = 900; //максимальная высота шаблона без учета хидера, футера, и текста. т.е. габарит рядов банеров $main_w = Ceil(mt_rand($min_main_w, $max_main_w)); $main_h = Ceil(mt_rand($min_main_h, $max_main_h)); $w_ost = $main_w - $sellspasing; //остаток места под колонки //echo "w_ost= ".$w_ost."<br>"; //echo "sellspasing= ".$sellspasing."<br>"; //echo "sellpadding= ".$sellpadding."<br>"; //print_r($W); $min_w = min($W); //print_r($min_w); //echo "min_w= ".$min_w."<br>"; //$min_w = min($W) + $sellpadding + $sellpadding; //Размечаем колонки $w_cols = array(); $w_col = 0; while ($w_ost > $min_w) { $key = array_rand($W); $w_col = $W[$key] + $sellpadding + $sellpadding; //ширина колонки с учетом отступов от края ячейки //echo "w_col= ".$w_col."<br>"; $w_ost = $w_ost - $w_col - $sellspasing; //уменьшаем остаток на ширину колонки и зазора //echo "w_ost= ".$w_ost."<br>"; if ($w_ost > 0) { $w_cols[] = $w_col; //массив ширин кололонок } } //Корректируем ширину шаблона $main_w = $main_w - $w_ost - $sellspasing; $h_ost = $main_h - $sellspasing; //остаток места под колонки $min_h = min($H) + 2 * $sellpadding; //Размечаем ряды while ($h_ost > $min_h) { $key = array_rand($H); $h_row = $H[$key] + 2 * $sellpadding; //высота ряда с учетом отступов от края ячейки $h_rows[] = $h_row; //массив высот рядов $h_ost = $h_ost - $h_row - $sellspasing; //уменьшаем остаток на высоту ряда и зазора } //Корректируем высоту шаблона $main_h = $main_h - $h_ost - $sellspasing; //Отбираем кандидатов для каждой колонки $kandidats = array(); foreach ($w_cols as $n_col => $w_col) { $w_b_max = $w_col - 2 * $sellpadding; //максим ширина банера в текущей колонке $w_b_min = $w_b_max - $dopusk; //минимально допустимая ширина банера в текущей колонке foreach ($baner_sizes as $baner_size => $baner_count) { $baner_size_arr = explode('_', $baner_size); $baner_w = $baner_size_arr[0]; if ($baner_w <= $w_b_max && $baner_w >= $w_b_min) { $kandidats[$n_col][] = $baner_size . '|' . $baner_count; //подходящий размер } } } //Расставляем кандидатов по колонкам $H_col = array(); $baners = array(); foreach ($w_cols as $n_col => $w_col) { $col_kandidats = array(); $h_col = $sellpadding; if (isset($kandidats[$n_col])) { $col_kandidats = $kandidats[$n_col]; //кандидаты в текущую колонку } else { continue; } while ((list($key, $val) = each($col_kandidats)) && $h_col <= $main_h) { //пока не заполнится колонка $b_key = array_rand($col_kandidats); //случайный банер (ключ массива) $b_str = $col_kandidats[$b_key]; //количество банеров с таким размером $b_arr = explode('|', $b_str); $b_size = $b_arr[0]; $b_count = $b_arr[1]; if ($b_count > 0) { $b_size_arr = explode('_', $b_size); $b_w = $b_size_arr[0]; //ширина и высота текущего банера $b_h = $b_size_arr[1]; $new_value = $b_count - 1; $col_kandidats[$b_key] = $b_size . '|' . $new_value; //уменьшили число доступных банеров $h_col = $h_col + $b_h + $sellpadding; //увеличили высоту колонки if ($h_col <= $main_h) { $baners[$n_col][] = $b_size; //отобрали для обязательного размещения в шаблоне } } } $H_col[$n_col] = $h_col; } $col_count = count($w_cols); $css = get_css(); $tbl_border_thin = 0; //Начало генерации шаблона $content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>[BKEYWORD]</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="SearchTitle" content="[BKEYWORD]"> <meta name="SearchDescription" content="[KEYWORD]"> <meta name="generator" content="WordPress/MU" /> <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://[DOMEN]/rss.xml" mce_href="http://[DOMEN]/rss.xml" />' . "\n"; $content .= "<style type='text/css'>\n"; $content .= $css . "\n"; $content .= "</style>\n"; $content .= "<script src=[SCRIPTNAME]></script>\n\n</head>\n"; $content .= "<body>\n"; $content .= "<table border='{$tbl_border_thin}" . "px' width='{$main_w}" . "px' cellspacing='{$sellspasing}" . "px' cellpadding='{$sellpadding}" . "px' align='center'>\n"; $content .= "<tr><td class='h' colspan='{$col_count}'><h1>[BKEYWORD]</h1></td></tr>\n"; $content .= "<tr><td class='but' colspan='{$col_count}'>[BUTTON]</td></tr>\n"; $content .= "<tr>"; foreach ($w_cols as $n_col => $w_col) { $content .= "<td width='{$w_col}" . "px' class='b'>\n"; if (!isset($baners[$n_col])) { $content .= ' '; continue; } else { $col_baners = $baners[$n_col]; //массив банеров текущей колонки foreach ($col_baners as $W_H_str) { //print_r($col_baners); $W_H = explode('_', $W_H_str); $W = $W_H[0]; $H = $W_H[1]; $content .= "[BANER-{$W}-{$H}] <br />\n"; } } $content .= "</td>\n"; } $content .= "</tr>\n"; $content .= "<tr><td class='but' colspan='{$col_count}'>[BUTTON]</td></tr>\n"; $content .= "<tr><td class='t' colspan='{$col_count}'>[TEXT] <br /> \n [LINKS-TO-MAP]</td></tr>\n"; $content .= "<tr><td class='m' colspan='{$col_count}'>[MAP] <br /> \n Copyright [HOME] 2006. All right reserved.</td></tr>\n"; $content .= "<tr><td class='c' colspan='{$col_count}'>[COUNTER]</td></tr>\n"; $content .= "</table>\n</body>\n</html>"; $tpl['content'] = $content; $tpl['css'] = $css; return $tpl; exit; }
<?php // template: http://blog.ijasoneverett.com/2013/02/rest-api-a-simple-php-tutorial/ function get_css($url) { $css_result = array(array("input" => $url, "result" => "test JSON")); return $css_result; } $value = "An error has occurred"; if (isset($_GET["url"])) { $url = $_GET["url"]; $value = get_css($url); } //return JSON array exit(json_encode($value));
?> "; $("logged_in_txt").style.color = "<?php print get_css('titlebar_text', 'Day'); ?> "; $("perms_txt").style.color = "<?php print get_css('titlebar_text', 'Day'); ?> "; $("modules_txt").style.color = "<?php print get_css('titlebar_text', 'Day'); ?> "; $("time_txt").style.color = "<?php print get_css('titlebar_text', 'Day'); ?> "; try { $('manual').style.display = 'none'; // hide the manual link - possibly absent } catch(e) { } } function show_butts() { // 10/27/08 $("buttons").style.visibility = "visible"; $("daynight").style.display = "inline"; } // ============== module window openers ===========================================
} return array_unique($file); } # Returns an array of CSS files that are in the input mechanisms function get_css($entry) { $include = check_file_exists(explode('+', $entry)); return !empty($include) ? $include : default_css(); } # If there is a cookie and no parameter $_GET, we set a cookie with your own content if (isset($_COOKIE['css_stylesheet']) && !isset($_GET['style'])) { $include = get_css($_COOKIE['css_stylesheet']); } else { # If there is a parameter, we set the cookie with the style of the parameter, # if no cookie and no parameter, we set the cookie with a default style $include = isset($_GET['style']) ? get_css($_GET['style']) : default_css(); } setcookie('css_stylesheet', implode('+', $include)); # If last page visited can’t be found (HTTP_REFERER) will redirect back to index of the site. header('Content-type: text/css'); if (isset($_GET['style'])) { isset($_SERVER['HTTP_REFERER']) ? header("Location:" . $_SERVER['HTTP_REFERER']) : header("Location:http://" . $_SERVER['SERVER_NAME']); } # Includes CSS files in the header if (!empty($include)) { foreach ($include as $value) { include $value; } } else { die(".css NOT FOUND"); }
public function get_file($file_name, $file_type) { $file = ""; switch ($file_type) { case 'js': $js = $this->js; $file = isset($js[$file_name]) ? $js[$file_name] : 'not-found'; break; case 'css': $css = get_css(array($file_name)); $file = $css[0]; break; default: break; } return $file; }
/** * 生成专题首页 * @param intval $specialid 专题ID * @param intval $pagesize 每页个数 * @param intval $pages_num 最大更新页数 * @return boolen/intval 成功返回生成文件的大小 */ public function _index($specialid = 0, $pagesize = 20, $pages_num = 0) { pc_base::load_app_func('global', 'special'); $specialid = intval($specialid); if (!$specialid) { return false; } $r = $this->db->get_one(array('id' => $specialid, 'siteid' => get_siteid())); if (!$r['ishtml'] || $r['disabled'] != 0) { return true; } if (!$specialid) { showmessage(L('illegal_action')); } $info = $this->db->get_one(array('id' => $specialid)); if (!$info) { showmessage(L('special_not_exist'), 'back'); } extract($info); if ($pics) { $pic_data = get_pic_content($pics); unset($pics); } if ($voteid) { $vote_info = explode('|', $voteid); $voteid = $vote_info[1]; } $commentid = id_encode('special', $id, $siteid); //分站时计算路径 if ($siteid > 1) { $site_info = $this->site->get_by_id($siteid); $file = pc_base::load_config('system', 'html_root') . '/' . $site_info['dirname'] . '/special/' . $filename . '/index.html'; } else { $file = pc_base::load_config('system', 'html_root') . '/special/' . $filename . '/index.html'; } if (!$ispage) { $type_db = pc_base::load_model('type_model'); $types = $type_db->select(array('module' => 'special', 'parentid' => $specialid), '*', '', '`listorder` ASC, `typeid` ASC', '', 'listorder'); } $css = get_css(unserialize($css)); $template = $index_template ? $index_template : 'index'; $SEO = seo($siteid, '', $title, $description); if ($ispage) { $re = $this->c_db->get_one(array('specialid' => $specialid), 'COUNT(`id`) AS num'); $total = $re['num']; $times = ceil($total / $pagesize); if ($pages_num) { $pages_num = min($times, $pages_num); } else { $pages_num = $times; } for ($i = 1; $i <= $pages_num; $i++) { if ($i == 1) { $file_root = $file; } else { $file_root = str_replace('index', 'index-' . $i, $file); } $this->queue->add_queue('add', $file_root, $siteid); //添加至信息队列 $file_root = PHPCMS_PATH . $file_root; ob_start(); include template('special', $template); $this->create_html($file_root); } return true; } else { $this->queue->add_queue('add', $file, $siteid); //添加至信息队列 $file = PHPCMS_PATH . $file; ob_start(); include template('special', $template, $style); return $this->create_html($file); } }
/** * This function generates dynamic styles */ function cc_dysplay_dynamic_css() { global $cap; ob_start(); ?> <style type="text/css" title="here they are"> div{ } <?php get_css(); if ($cap->overwrite_css) { echo stripslashes($cap->overwrite_css); } ?> </style> <?php $dynamic_styles = ob_get_contents(); ob_end_clean(); echo compress($dynamic_styles); }