• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_base_href函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_base_href函数的典型用法代码示例。如果您正苦于以下问题:PHP get_base_href函数的具体用法?PHP get_base_href怎么用?PHP get_base_href使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_base_href函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: display_mass_tagger

 public function display_mass_tagger(Page $page, Event $event, $config)
 {
     $data_href = get_base_href();
     $body = "\n\t\t\t<form action='" . make_link("mass_tagger/tag") . "' method='POST'>\n\t\t\t\t<input id='mass_tagger_activate' type='button' onclick='activate_mass_tagger(\"{$data_href}\");' value='Activate'/>\n\t\t\t\t<div id='mass_tagger_controls' style='display: none;'>\n\t\t\t\t\tClick on images to mark them. Use the 'Index Options' in the Board Config to increase the amount of shown images.\n\t\t\t\t\t<br />\n\t\t\t\t\t<input type='hidden' name='ids' id='mass_tagger_ids' />\n\t\t\t\t\tSet instead of add? <input type='checkbox' name='setadd' value='set' />\n\t\t\t\t\t<label>Tags: <input type='text' name='tag' /></label>\n\n\t\t\t\t\t<input type='submit' value='Tag Marked Images' />\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t";
     $block = new Block("Mass Tagger", $body, "left", 50);
     $page->add_block($block);
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:7,代码来源:theme.php


示例2: get_body

 private function get_body()
 {
     // returns just the contents of the body
     global $database;
     global $config;
     $base_href = $config->get_string('base_href');
     $data_href = get_base_href();
     $sitename = $config->get_string('title');
     $contact_link = $config->get_string('contact_link');
     $counter_dir = $config->get_string('home_counter', 'default');
     $total = ceil($database->db->GetOne("SELECT COUNT(*) FROM images"));
     $strtotal = "{$total}";
     $num_comma = number_format($total);
     $counter_text = "";
     for ($n = 0; $n < strlen($strtotal); $n++) {
         $cur = $strtotal[$n];
         $counter_text .= " <img alt='{$cur}' src='{$data_href}/ext/home/counters/{$counter_dir}/{$cur}.gif' />  ";
     }
     // get the homelinks and process them
     $main_links = $config->get_string('home_links');
     $main_links = str_replace('$base', $base_href, $main_links);
     $main_links = str_replace('[', "<a href='", $main_links);
     $main_links = str_replace('|', "'>", $main_links);
     $main_links = str_replace(']', "</a>", $main_links);
     $main_text = $config->get_string('home_text');
     return $this->theme->build_body($sitename, $main_links, $main_text, $contact_link, $num_comma, $counter_text);
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:27,代码来源:main.php


示例3: get_body

 private function get_body()
 {
     // returns just the contents of the body
     global $database;
     global $config;
     $base_href = $config->get_string('base_href');
     $data_href = get_base_href();
     $sitename = $config->get_string('title');
     $contact_link = $config->get_string('contact_link');
     $counter_dir = $config->get_string('home_counter', 'default');
     $total = Image::count_images();
     $strtotal = "{$total}";
     $num_comma = number_format($total);
     $counter_text = "";
     for ($n = 0; $n < strlen($strtotal); $n++) {
         $cur = $strtotal[$n];
         $counter_text .= " <img alt='{$cur}' src='{$data_href}/ext/home/counters/{$counter_dir}/{$cur}.gif' />  ";
     }
     // get the homelinks and process them
     $main_links = $config->get_string('home_links');
     $main_links = str_replace('$base', $base_href, $main_links);
     $main_links = preg_replace('#\\[(.*?)\\|(.*?)\\]#', "<a href='\\1'>\\2</a>", $main_links);
     $main_links = str_replace('//', "/", $main_links);
     $main_text = $config->get_string('home_text');
     return $this->theme->build_body($sitename, $main_links, $main_text, $contact_link, $num_comma, $counter_text);
 }
开发者ID:jackrabbitjoey,项目名称:shimmie2,代码行数:26,代码来源:main.php


示例4: display_image

 public function display_image(Page $page, Image $image)
 {
     $data_href = get_base_href();
     $ilink = $image->get_image_link();
     $html = "\n\t\t\t<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'\n\t\t\t        codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0'\n\t\t\t\t\twidth='400' height='15'>\n\t\t\t\t<param name='movie' value='{$data_href}/ext/handle_mp3/xspf_player_slim.swf?song_url={$ilink}'/>\n\t\t\t\t<param name='quality' value='high' />\n\t\t\t\t<embed src='{$data_href}/ext/handle_mp3/xspf_player_slim.swf?song_url={$ilink}' quality='high'\n\t\t\t\t\tpluginspage='http://www.macromedia.com/go/getflashplayer'\n\t\t\t\t\twidth='400' height='15'\n\t\t\t\t\ttype='application/x-shockwave-flash'></embed>\n\t\t\t</object>\n\t\t\t<p><a href='{$ilink}'>Download</a>";
     $page->add_block(new Block("Music", $html, "main", 0));
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:7,代码来源:theme.php


示例5: get_body

 private function get_body()
 {
     // returns just the contents of the body
     global $config;
     $base_href = get_base_href();
     $sitename = $config->get_string('title');
     $contact_link = $config->get_string('contact_link');
     $counter_dir = $config->get_string('home_counter', 'default');
     $total = Image::count_images();
     $strtotal = "{$total}";
     $num_comma = number_format($total);
     $counter_text = "";
     $length = strlen($strtotal);
     for ($n = 0; $n < $length; $n++) {
         $cur = $strtotal[$n];
         $counter_text .= " <img alt='{$cur}' src='{$base_href}/ext/home/counters/{$counter_dir}/{$cur}.gif' />  ";
     }
     // get the homelinks and process them
     if (strlen($config->get_string('home_links', '')) > 0) {
         $main_links = $config->get_string('home_links');
     } else {
         $main_links = '[url=site://post/list]Posts[/url] [url=site://comment/list]Comments[/url] [url=site://tags]Tags[/url]';
         if (class_exists("Pools")) {
             $main_links .= ' [url=site://pool]Pools[/url]';
         }
         if (class_exists("Wiki")) {
             $main_links .= ' [url=site://wiki]Wiki[/url]';
         }
         $main_links .= ' [url=site://ext_doc]Documentation[/url]';
     }
     $main_links = format_text($main_links);
     $main_text = $config->get_string('home_text');
     return $this->theme->build_body($sitename, $main_links, $main_text, $contact_link, $num_comma, $counter_text);
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:34,代码来源:main.php


示例6: do_rss

 /**
  * @param array $images
  * @param array $search_terms
  * @param int $page_number
  */
 private function do_rss($images, $search_terms, $page_number)
 {
     global $page;
     global $config;
     $page->set_mode("data");
     $page->set_type("application/rss+xml");
     $data = "";
     foreach ($images as $image) {
         $data .= $this->thumb($image);
     }
     $title = $config->get_string('title');
     $base_href = make_http(get_base_href());
     $search = "";
     if (count($search_terms) > 0) {
         $search = url_escape(implode(" ", $search_terms)) . "/";
     }
     if ($page_number > 1) {
         $prev_url = make_link("rss/images/{$search}" . ($page_number - 1));
         $prev_link = "<atom:link rel=\"previous\" href=\"{$prev_url}\" />";
     } else {
         $prev_link = "";
     }
     $next_url = make_link("rss/images/{$search}" . ($page_number + 1));
     $next_link = "<atom:link rel=\"next\" href=\"{$next_url}\" />";
     // no end...
     $version = VERSION;
     $xml = "<" . "?xml version=\"1.0\" encoding=\"utf-8\" ?" . ">\n<rss version=\"2.0\" xmlns:media=\"http://search.yahoo.com/mrss\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n    <channel>\n        <title>{$title}</title>\n        <description>The latest uploads to the image board</description>\n\t\t<link>{$base_href}</link>\n\t\t<generator>Shimmie-{$version}</generator>\n\t\t<copyright>(c) 2007 Shish</copyright>\n\t\t{$prev_link}\n\t\t{$next_link}\n\t\t{$data}\n\t</channel>\n</rss>";
     $page->set_data($xml);
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:34,代码来源:main.php


示例7: __construct

 function __construct($main)
 {
     $matches = array();
     $lines = file($main);
     $number_of_lines = count($lines);
     preg_match("#ext/(.*)/main.php#", $main, $matches);
     $this->ext_name = $matches[1];
     $this->name = $this->ext_name;
     $this->enabled = $this->is_enabled($this->ext_name);
     for ($i = 0; $i < $number_of_lines; $i++) {
         $line = $lines[$i];
         if (preg_match("/Name: (.*)/", $line, $matches)) {
             $this->name = $matches[1];
         }
         if (preg_match("/Visibility: (.*)/", $line, $matches)) {
             $this->visibility = $matches[1];
         }
         if (preg_match("/Link: (.*)/", $line, $matches)) {
             $this->link = $matches[1];
             if ($this->link[0] == "/") {
                 $this->link = make_link(substr($this->link, 1));
             }
         }
         if (preg_match("/Version: (.*)/", $line, $matches)) {
             $this->version = $matches[1];
         }
         if (preg_match("/Author: (.*) [<\\(](.*@.*)[>\\)]/", $line, $matches)) {
             $this->author = $matches[1];
             $this->email = $matches[2];
         } else {
             if (preg_match("/Author: (.*)/", $line, $matches)) {
                 $this->author = $matches[1];
             }
         }
         if (preg_match("/(.*)Description: ?(.*)/", $line, $matches)) {
             $this->description = $matches[2];
             $start = $matches[1] . " ";
             $start_len = strlen($start);
             while (substr($lines[$i + 1], 0, $start_len) == $start) {
                 $this->description .= " " . substr($lines[$i + 1], $start_len);
                 $i++;
             }
         }
         if (preg_match("/(.*)Documentation: ?(.*)/", $line, $matches)) {
             $this->documentation = $matches[2];
             $start = $matches[1] . " ";
             $start_len = strlen($start);
             while (substr($lines[$i + 1], 0, $start_len) == $start) {
                 $this->documentation .= " " . substr($lines[$i + 1], $start_len);
                 $i++;
             }
             $this->documentation = str_replace('$site', make_http(get_base_href()), $this->documentation);
         }
         if (preg_match("/\\*\\//", $line, $matches)) {
             break;
         }
     }
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:58,代码来源:main.php


示例8: build_tagger

 public function build_tagger(Page $page, $event)
 {
     // Initialization code
     $base_href = get_base_href();
     // TODO: AJAX test and fallback.
     $page->add_html_header("<script src='{$base_href}/ext/tagger/webtoolkit.drag.js' type='text/javascript'></script>");
     $page->add_block(new Block(null, "<script type='text/javascript'>\n\t\t\t\t\$( document ).ready(function() {\n\t\t\t\t\tTagger.initialize(" . $event->get_image()->id . ");\n\t\t\t\t});\n\t\t\t</script>", "main", 1000));
     // Tagger block
     $page->add_block(new Block(null, $this->html($event->get_image()), "main"));
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:10,代码来源:theme.php


示例9: onPageRequest

 public function onPageRequest(PageRequestEvent $event)
 {
     global $page, $user;
     // Adds header to enable chatbox
     $root = get_base_href();
     $yPath = make_http($root . "/ext/chatbox/");
     $page->add_html_header("\n\t\t\t\t<script src=\"http://code.jquery.com/jquery-migrate-1.2.1.js\" type=\"text/javascript\"></script>\n\t\t\t\t<script src=\"{$root}/ext/chatbox/js/yshout.js\" type=\"text/javascript\"></script>\n\n\t\t\t\t<link rel=\"stylesheet\" href=\"{$root}/ext/chatbox/css/dark.yshout.css\" />\n\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\tnickname = '{$user->name}';\n\t\t\t\t\tnew YShout({ yPath: '{$yPath}' });\n\t\t\t\t</script>\n\t\t", 500);
     // loads the chatbox at the set location
     $html = "<div id=\"yshout\"></div>";
     $chatblock = new Block("Chatbox", $html, "main", 97);
     $page->add_block($chatblock);
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:12,代码来源:main.php


示例10: get_smarty_instance

/**
 * @return   Smarty  Locally-usable Smarty instance.
 */
function get_smarty_instance()
{
    $s = new Smarty();
    $s->compile_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates', 'cache'));
    $s->cache_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates', 'cache'));
    $s->template_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates'));
    $s->config_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates'));
    $s->assign('domain', get_domain_name());
    $s->assign('base_dir', get_base_dir());
    $s->assign('base_href', get_base_href());
    $s->assign('constants', get_defined_constants());
    $s->assign('request', array('get' => $_GET));
    return $s;
}
开发者ID:RandomEtc,项目名称:apimaps,代码行数:17,代码来源:output.php


示例11: display_holiday

 public function display_holiday($date)
 {
     global $page;
     if ($date) {
         $csssheet = "<link rel='stylesheet' href='" . get_base_href() . "/contrib/holiday/stylesheets/";
         // April Fools
         // Flips the entire page upside down!
         // TODO: Make it possible for the user to turn this off!
         if (date('d/m') == '01/04') {
             $csssheet .= "aprilfools.css";
         }
         $csssheet .= "' type='text/css'>";
         $page->add_html_header("{$csssheet}");
     }
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:15,代码来源:theme.php


示例12: display_message

    /**
     * Display $message and exit
     *
     * @param string $message
     */
    public function display_message($message)
    {
        global $config, $user, $page;
        $theme_name = $config->get_string('theme');
        $data_href = get_base_href();
        $login_link = make_link("user_admin/login");
        $auth = $user->get_auth_html();
        $page->set_mode('data');
        $page->set_code(503);
        $page->set_data(<<<EOD
<html>
\t<head>
\t\t<title>Downtime</title>
\t\t<link rel="stylesheet" href="{$data_href}/themes/{$theme_name}/style.css" type="text/css">
\t</head>
\t<body>
\t\t<div id="downtime">
\t\t\t<section>
\t\t\t\t<h1><center>Down for Maintenance</center></h1>
\t\t\t\t<div id="message" class="blockbody">
\t\t\t\t\t{$message}
\t\t\t\t</div>
\t\t\t</section>
\t\t\t<section>
\t\t\t\t<h3>Admin Login</h3>
\t\t\t\t<div id="login" class="blockbody">
\t\t\t\t\t<form action="{$login_link}" method="POST">
\t\t\t\t\t\t{$auth}
\t\t\t\t\t\t<table id="login_table" summary="Login Form">
\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t<td width="70"><label for="user">Name</label></td>
\t\t\t\t\t\t\t\t<td width="70"><input id="user" type="text" name="user"></td>
\t\t\t\t\t\t\t</tr>
\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t<td><label for="pass">Password</label></td>
\t\t\t\t\t\t\t\t<td><input id="pass" type="password" name="pass"></td>
\t\t\t\t\t\t\t</tr>
\t\t\t\t\t\t\t<tr><td colspan="2"><input type="submit" value="Log In"></td></tr>
\t\t\t\t\t\t</table>
\t\t\t\t\t</form>
\t\t\t\t</div>
\t\t\t</section>
\t\t</div>
\t</body>
</html>
EOD
);
    }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:53,代码来源:theme.php


示例13: get_smarty_instance

/**
 * @return   Smarty  Locally-usable Smarty instance.
 */
function get_smarty_instance()
{
    $s = new Smarty();
    $s->compile_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates', 'cache'));
    $s->cache_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates', 'cache'));
    $s->template_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates'));
    $s->config_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates'));
    $s->register_modifier('url_domain', 'get_url_domain');
    $s->register_modifier('nice_relative_time', 'get_relative_time');
    $s->assign('domain', get_domain_name());
    $s->assign('base_dir', get_base_dir());
    $s->assign('base_href', get_base_href());
    $s->assign('logo', '<img src="' . LOGO . '" />');
    $s->assign('site_title', SITE_TITLE);
    //	    $s->clear_all_cache();
    return $s;
}
开发者ID:quilime,项目名称:mus,代码行数:20,代码来源:output.php


示例14: display_page

 public function display_page()
 {
     global $config, $page;
     $base_href = get_base_href();
     $oekW = $config->get_int("oekaki_width", 400);
     $oekH = $config->get_int("oekaki_height", 400);
     if (isset($_POST['oekW']) && isset($_POST['oekH'])) {
         $oekW = int_escape($_POST['oekW']);
         $oekH = int_escape($_POST['oekH']);
     }
     $html = "\n    <applet archive='{$base_href}/ext/oekaki/chibipaint.jar' code='chibipaint.ChibiPaint.class' width='800' height='600'>\n      <param name='canvasWidth' value='" . $oekW . "' />\n      <param name='canvasHeight' value='" . $oekH . "' />\n      <param name='postUrl' value='" . make_http(make_link("oekaki/upload")) . "' />\n      <param name='exitUrl' value='" . make_http(make_link("oekaki/claim")) . "' />\n      <param name='exitUrlTarget' value='_self' />\n      JAVA NOT INSTALLED :(<!-- alternative content for users who don't have Java installed -->\n    </applet>\n\t\t";
     #      <param name='loadImage' value='http://yourserver/oekaki/pictures/168.png' />
     #      <param name='loadChibiFile' value='http://yourserver/oekaki/pictures/168.chi' />
     // FIXME: prevent oekaki block from collapsing on click in cerctain themes. This causes canvas reset
     $page->set_title("Oekaki");
     $page->set_heading("Oekaki");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Oekaki", $html, "main", 20));
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:19,代码来源:theme.php


示例15: get_info

 /**
  * Collect the information and return it in a keyed array.
  */
 private function get_info()
 {
     global $config, $database;
     global $_event_listeners;
     // yay for using secret globals \o/
     $info = array();
     $info['site_title'] = $config->get_string("title");
     $info['site_theme'] = $config->get_string("theme");
     $info['site_url'] = "http://" . $_SERVER["HTTP_HOST"] . get_base_href();
     $info['sys_shimmie'] = VERSION;
     $info['sys_schema'] = $config->get_string("db_version");
     $info['sys_php'] = phpversion();
     $info['sys_db'] = $database->get_driver_name();
     $info['sys_os'] = php_uname();
     $info['sys_disk'] = to_shorthand_int(disk_total_space("./") - disk_free_space("./")) . " / " . to_shorthand_int(disk_total_space("./"));
     $info['sys_server'] = $_SERVER["SERVER_SOFTWARE"];
     $info['thumb_engine'] = $config->get_string("thumb_engine");
     $info['thumb_quality'] = $config->get_int('thumb_quality');
     $info['thumb_width'] = $config->get_int('thumb_width');
     $info['thumb_height'] = $config->get_int('thumb_height');
     $info['thumb_mem'] = $config->get_int("thumb_mem_limit");
     $info['stat_images'] = $database->get_one("SELECT COUNT(*) FROM images");
     $info['stat_comments'] = $database->get_one("SELECT COUNT(*) FROM comments");
     $info['stat_users'] = $database->get_one("SELECT COUNT(*) FROM users");
     $info['stat_tags'] = $database->get_one("SELECT COUNT(*) FROM tags");
     $info['stat_image_tags'] = $database->get_one("SELECT COUNT(*) FROM image_tags");
     $els = array();
     foreach (get_declared_classes() as $class) {
         $rclass = new ReflectionClass($class);
         if ($rclass->isAbstract()) {
             // don't do anything
         } elseif (is_subclass_of($class, "Extension")) {
             $els[] = $class;
         }
     }
     $info['sys_extensions'] = join(', ', $els);
     //$cfs = array();
     //foreach($database->get_all("SELECT name, value FROM config") as $pair) {
     //	$cfs[] = $pair['name']."=".$pair['value'];
     //}
     //$info[''] = "Config: ".join(", ", $cfs);
     return $info;
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:46,代码来源:main.php


示例16: display_message

    /**
     * Display $message and exit
     */
    public function display_message($message)
    {
        global $config, $user;
        $theme_name = $config->get_string('theme');
        $data_href = get_base_href();
        $login_link = make_link("user_admin/login");
        header("HTTP/1.0 503 Service Temporarily Unavailable");
        $auth = $user->get_auth_html();
        print <<<EOD
<html>
\t<head>
\t\t<title>Downtime</title>
\t\t<link rel="stylesheet" href="{$data_href}/themes/{$theme_name}/style.css" type="text/css">
\t</head>
\t<body>
\t\t<div id="downtime">
\t\t\t<h1>Down for Maintenance</h1>
\t\t\t<div id="message">
\t\t\t\t{$message}
\t\t\t</div>
\t\t\t<h3>Admin Login</h3>
\t\t\t<div id="login">
\t\t\t\t<form action="{$login_link}" method="POST">
\t\t\t\t\t{$auth}
\t\t\t\t\t<table id="login_table" summary="Login Form">
\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t<td width="70"><label for="user">Name</label></td>
\t\t\t\t\t\t\t<td width="70"><input id="user" type="text" name="user"></td>
\t\t\t\t\t\t</tr>
\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t<td><label for="pass">Password</label></td>
\t\t\t\t\t\t\t<td><input id="pass" type="password" name="pass"></td>
\t\t\t\t\t\t</tr>
\t\t\t\t\t\t<tr><td colspan="2"><input type="submit" value="Log In"></td></tr>
\t\t\t\t\t</table>
\t\t\t\t</form>
\t\t\t</div>
\t\t</div>
\t</body>
</html>
EOD;
    }
开发者ID:nsuan,项目名称:shimmie2,代码行数:45,代码来源:theme.php


示例17: display_emotes

 public function display_emotes($list)
 {
     global $page;
     $data_href = get_base_href();
     $html = "<html><head><title>Emoticon list</title></head><body>";
     $html .= "<table><tr>";
     $n = 1;
     foreach ($list as $item) {
         $pathinfo = pathinfo($item);
         $name = $pathinfo["filename"];
         $html .= "<td><img src='{$data_href}/{$item}'> :{$name}:</td>";
         if ($n++ % 3 == 0) {
             $html .= "</tr><tr>";
         }
     }
     $html .= "</tr></table>";
     $html .= "</body></html>";
     $page->set_mode("data");
     $page->set_data($html);
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:20,代码来源:theme.php


示例18: get_smarty_instance

/**
 * @return   Smarty  Locally-usable Smarty instance.
 */
function get_smarty_instance($user)
{
    $s = new Smarty();
    $s->compile_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates', 'cache'));
    $s->cache_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates', 'cache'));
    $s->template_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates'));
    $s->config_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates'));
    $s->assign('domain', get_domain_name());
    $s->assign('base_dir', get_base_dir());
    $s->assign('base_href', get_base_href());
    $s->assign('constants', get_defined_constants());
    $s->assign('providers', get_map_providers());
    $s->assign('request', array('get' => $_GET, 'post' => $_POST, 'uri' => $_SERVER['REQUEST_URI'], 'query' => $_SERVER['QUERY_STRING'], 'authenticated' => isset($user), 'user' => $user));
    $s->register_modifier('nice_placename', 'nice_placename');
    $s->register_modifier('nice_domainname', 'nice_domainname');
    $s->register_modifier('nice_relativetime', 'nice_relativetime');
    $s->register_modifier('nice_datetime', 'nice_datetime');
    $s->register_modifier('nice_degree', 'nice_degree');
    $s->register_modifier('decode_utf8', 'decode_utf8');
    return $s;
}
开发者ID:ndpgroup,项目名称:fp-legacy,代码行数:24,代码来源:output.php


示例19: get_info

 private function get_info()
 {
     global $config, $database;
     global $_event_listeners;
     // yay for using secret globals \o/
     $info = array();
     $info['site_title'] = $config->get_string("title");
     $info['site_theme'] = $config->get_string("theme");
     $info['site_url'] = "http://" . $_SERVER["HTTP_HOST"] . get_base_href();
     $info['sys_shimmie'] = VERSION;
     $info['sys_schema'] = $config->get_string("db_version");
     $info['sys_php'] = phpversion();
     $info['sys_os'] = php_uname();
     $info['sys_disk'] = to_shorthand_int(disk_total_space("./") - disk_free_space("./")) . " / " . to_shorthand_int(disk_total_space("./"));
     $info['sys_server'] = $_SERVER["SERVER_SOFTWARE"];
     include "config.php";
     // more magical hax
     $proto = preg_replace("#(.*)://.*#", "\$1", $database_dsn);
     $db = $database->db->ServerInfo();
     $info['sys_db'] = "{$proto} / {$db['version']}";
     $info['stat_images'] = $database->db->GetOne("SELECT COUNT(*) FROM images");
     $info['stat_comments'] = $database->db->GetOne("SELECT COUNT(*) FROM comments");
     $info['stat_users'] = $database->db->GetOne("SELECT COUNT(*) FROM users");
     $info['stat_tags'] = $database->db->GetOne("SELECT COUNT(*) FROM tags");
     $info['stat_image_tags'] = $database->db->GetOne("SELECT COUNT(*) FROM image_tags");
     $els = array();
     foreach ($_event_listeners as $el) {
         $els[] = get_class($el);
     }
     $info['sys_extensions'] = join(', ', $els);
     //$cfs = array();
     //foreach($database->get_all("SELECT name, value FROM config") as $pair) {
     //	$cfs[] = $pair['name']."=".$pair['value'];
     //}
     //$info[''] = "Config: ".join(", ", $cfs);
     return $info;
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:37,代码来源:main.php


示例20: captcha_get_html

/**
 * @return string
 */
function captcha_get_html()
{
    global $config, $user;
    if (DEBUG && ip_in_range($_SERVER['REMOTE_ADDR'], "127.0.0.0/8")) {
        return "";
    }
    $captcha = "";
    if ($user->is_anonymous() && $config->get_bool("comment_captcha")) {
        $r_publickey = $config->get_string("api_recaptcha_pubkey");
        if (!empty($r_publickey)) {
            $captcha = recaptcha_get_html($r_publickey);
        } else {
            session_start();
            //$securimg = new Securimage();
            $base = get_base_href();
            $captcha = "<br/><img src='{$base}/lib/securimage/securimage_show.php?sid=" . md5(uniqid(time())) . "'>" . "<br/>CAPTCHA: <input type='text' name='code' value='' />";
        }
    }
    return $captcha;
}
开发者ID:JarJak,项目名称:shimmie2,代码行数:23,代码来源:util.inc.php



注:本文中的get_base_href函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_base_url函数代码示例发布时间:2022-05-15
下一篇:
PHP get_banner函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap