当前位置: 首页>>代码示例>>PHP>>正文


PHP GeSHi::set_footer_content_style方法代码示例

本文整理汇总了PHP中GeSHi::set_footer_content_style方法的典型用法代码示例。如果您正苦于以下问题:PHP GeSHi::set_footer_content_style方法的具体用法?PHP GeSHi::set_footer_content_style怎么用?PHP GeSHi::set_footer_content_style使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GeSHi的用法示例。


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

示例1:

    // ...
    // </ol></pre>
    $geshi->set_line_style('color: #003030;', 'font-weight: bold; color: #006060;', true);
    $geshi->set_code_style('color: #000020;', true);
    // Styles for hyperlinks in the code. GESHI_LINK for default styles, GESHI_HOVER for hover style etc...
    // note that classes must be enabled for this to work.
    $geshi->set_link_styles(GESHI_LINK, 'color: #000060;');
    $geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;');
    // Use the header/footer functionality. This puts a div with content within the PRE element, so it is
    // affected by the styles set by set_overall_style. So if the PRE has a border then the header/footer will
    // appear inside it.
    $geshi->set_header_content('<SPEED> <TIME> GeSHi &copy; 2004-2007, Nigel McNie, 2007-2008 Benny Baumann. View source of example.php for example of using GeSHi');
    $geshi->set_header_content_style('font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;');
    // You can use <TIME> and <VERSION> as placeholders
    $geshi->set_footer_content('Parsed in <TIME> seconds at <SPEED>, using GeSHi <VERSION>');
    $geshi->set_footer_content_style('font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-top: 1px solid #d0d0d0; padding: 2px;');
} else {
    // make sure we don't preselect any language
    $_POST['language'] = null;
}
?>
<!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>
<title>GeSHi examples</title>
<style type="text/css">
<!--
<?php 
if (isset($_POST['submit'])) {
    // Output the stylesheet. Note it doesn't output the <style> tag
开发者ID:CarlosOVillanueva,项目名称:BIFROST,代码行数:31,代码来源:example.php

示例2: explode

for ($i = 0; $i < count($matches[1]); $i++) {
    $lines = explode("\n", $matches[2][$i]);
    if (count($lines) < 200) {
        $input = str_replace('<br>', '', str_replace('<br  />', '', str_replace('<br />', '', stripslashes($matches[2][$i]))));
        //replace problematic characters
        $search = array("\\", "&quot;", "&#39;", "&#92;", "&quot;", "&#39;", "&lt;", "&gt;", "&amp;");
        $replace = array("\\\\", "\"", "'", "\\", "\"", "\\'", "<", ">", "&");
        $input = str_replace($search, $replace, $input);
        $geshi = new GeSHi($input, $matches[1][$i]);
        $geshi->set_header_type(GESHI_HEADER_PRE);
        $geshi->set_overall_style('font-family:\'Courier New\', Courier; font-size:12px;');
        $geshi->set_link_styles(GESHI_LINK, 'font-weight:bold;');
        $geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;');
        $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10);
        $geshi->set_footer_content($locale['bb_geshi_info']);
        $geshi->set_footer_content_style('font-family:Verdana,Arial,sans-serif;color:#808080;font-size:9px;font-weight:bold;background-color:#f0f0ff;border-top: 1px solid #d0d0d0;padding:2px;width:400px');
        if (preg_match("/\\/forum\\//i", FUSION_REQUEST) && isset($data['post_id'])) {
            $geshi_save = "<a href='" . INCLUDES . "bbcodes/geshi_bbcode_save.php?thread_id=" . $_GET['thread_id'] . "&amp;post_id=" . $data['post_id'] . "&amp;code_id=" . $i . "'><img src='" . INCLUDES . "bbcodes/images/geshi_save.png' alt='" . $locale['bb_geshi_save'] . "' title='" . $locale['bb_geshi_save'] . "' style='border:none' /></a>&nbsp;&nbsp;";
        } else {
            $geshi_save = "";
        }
        $text = preg_replace("#\\[geshi=(.*?)\\](.*?)\\[/geshi\\]#si", '$2', $text);
        $text = str_replace($matches[2][$i], "<div class='tbl-border tbl2' style='width:400px'>" . $geshi_save . "<strong>GeSHi: " . $geshi->get_language_name() . "</strong></div><div class='tbl-border tbl1' style='width:400px;height:auto;white-space:nowrap;overflow:auto;background-color:#ffffff;'><code style='white-space:nowrap'>" . $geshi->parse_code() . "</code></div>", $text);
    } else {
        $ccount = substr_count($text, "[geshi=");
        for ($i = 0; $i < $ccount; $i++) {
            if (preg_match("/\\/forum\\//i", FUSION_REQUEST) && isset($data['post_id'])) {
                $geshi_save = "<a href=\\'" . INCLUDES . "bbcodes/geshi_bbcode_save.php?thread_id=" . $_GET['thread_id'] . "&amp;post_id=" . $data['post_id'] . "&amp;code_id=" . $i . "\\'><img src=\\'" . INCLUDES . "bbcodes/images/geshi_save.png\\' alt=\\'" . $locale['bb_geshi_save'] . "\\' title=\\'" . $locale['bb_geshi_save'] . "\\' style=\\'border:none\\' /></a>&nbsp;&nbsp;";
            } else {
                $geshi_save = "";
            }
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:geshi_bbcode_include.php

示例3: substr

$geshi->set_highlight_lines_extra_style('background:#FFFF88;');
$geshi->enable_keyword_links(false);
//geshi line numbers
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
$geshi->set_header_type(GESHI_HEADER_DIV);
//geshi styling for syntax box
$geshi->set_overall_style('color: #000066; border: 1px solid #d0d0d0; background-color: #fdfdf6; line-height:1.3em;', true);
$geshi->set_line_style('font: normal normal \'Courier New\', Courier, monospace; color: #003030;', 'font-weight: bold; color: #006060; padding-right: 5px;', true);
$geshi->set_code_style('color: #000020;', 'color: #000020;');
if ($drop['editable'] == 1) {
    if (!isset($_GET['passkey'])) {
        $editable = ' You may <a href="' . $DROP_CONF_siteURL . '/' . $drop['id'] . '/edit">edit this</a> drop.';
    } else {
        $editable = ' You may <a href="' . substr($_SERVER['REQUEST_URI'], 0, -30) . '/edit?pkey=' . $_GET['passkey'] . '">edit this</a> drop.';
    }
} else {
    if ($drop['editable'] == 0) {
        $editable = '';
    } else {
        die("WOAH! WE HAVE AN ERROR IN THE HOUSE!!! CONTACT THE AUTHORITIES!");
    }
}
$geshi->set_header_content('You are viewing Drop #' . $drop['id'] . ' and it is being highlighted with the ' . $drop['lang'] . ' syntax.' . $editable);
$geshi->set_header_content_style('font-family: Verdana, Arial, sans-serif; color: #414141; background-color: #d2d2c8; border-bottom: 1px solid #d0d0d0; padding: 2px;');
if (!isset($drops[1])) {
    $geshi->set_footer_content('Parsed in <TIME> seconds');
}
$geshi->set_footer_content_style('font-family: Verdana, Arial, sans-serif; color: #414141; background-color: #d2d2c8; border-top: 1px solid #d0d0d0; padding: 2px;');
//geshi results
echo $geshi->parse_code();
//echo $drop['text'];
开发者ID:jakedahn,项目名称:dropbin,代码行数:31,代码来源:highlighting.php


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