Esempio n. 1
0
function help_display($helpname = FALSE)
{
    include_once 'plan_read.php';
    include_once 'markdown.php';
    include_once 'smartypants.php';
    if ($helpname) {
        if (file_exists("{$_SERVER['HELP_ROOT']}/{$helpname}.help")) {
            include_once "{$_SERVER['HELP_ROOT']}/{$helpname}.help";
        } else {
            $filelist = files_list("{$_SERVER['HELP_ROOT']}/", "*{$helpname}*.help");
            if ($filelist) {
                include_once "{$_SERVER['HELP_ROOT']}/{$filelist['0']}";
                $helpname = str_replace('.help', '', $filelist[0]);
            } else {
                return FALSE;
            }
        }
    }
    if (user_is_valid($_SERVER['USERINFO_ARRAY']['username'], $_SERVER['USERINFO_ARRAY']['userpass'])) {
        $editlink = "<a style='font-size: 9pt; font-family: sans-serif; background: #eec; padding: 2px; border: thin solid #eee;' href='{$_SERVER['WEB_ROOT']}/help/edit/{$helpname}'>edit</a>";
    } else {
        $editlink = '';
    }
    $content = Smartypants(Markdown(plan_process_directives(plan_add_user_links(plan_process_smileys("<h1><a href='/help'><img src='{$GLOBALS['helpicon']}' /></a> {$title} {$editlink}</h1>\n\n{$body}")))));
    if ($title || $body) {
        return $content;
    } else {
        return FALSE;
    }
}
Esempio n. 2
0
 private function _get_page($filename) {
     $filename = SITE_PATH . '/pages/' . $filename . '.md';
     if (is_file($filename)) {
         ob_start();
         include $filename;
         $contents = ob_get_contents();
         ob_end_clean();
         if(extension_loaded('discount')) {
             $md = \MarkdownDocument::createFromString($contents);
             $md->compile();
             return $md->getHtml();
         } else {            
             import('3rdparty.markdown');
             import('3rdparty.smartypants');
             return \Smartypants(\Markdown($contents));
         }
     }
     throw new \Core\FileNotFoundError($filename);
 }
Esempio n. 3
0
</id>
		<published><?php 
echo date(DATE_ATOM, $entry->published);
?>
</published>
		<updated><?php 
echo date(DATE_ATOM, $entry->updated);
?>
</updated>
		<author>
				<name>Me</name>
				<email>My Email</email>
        		<uri><?php 
echo $config['base_url'];
?>
</uri>
        </author>
		<summary><?php 
echo Smartypants($entry->summary);
?>
</summary>
		<content type="html" xml:lang="en">
			<![CDATA[
				<?php 
echo Smartypants(Markdown($entry->body));
?>
			]]>
		</content>
	</entry>
	<? endforeach; ?>
</feed>
 public function smartypantsFilter($str)
 {
     $charset = craft()->templates->getTwig()->getCharset();
     $str = Smartypants($str);
     return new \Twig_Markup($str, $charset);
 }
Esempio n. 5
0
echo $config['base_url'];
?>
</h1>
		<? if (isset($entries)) { ?>
		<div id="wrapper">
		<? foreach($entries as $entry):?>
		<div class="entry">
		<h3><a href="<?php 
echo $entry->permalink;
?>
"><?php 
echo Smartypants($entry->title);
?>
</a></h3>
		<?php 
echo Smartypants(Markdown($entry->summary));
?>
		</div><!-- undefined -->
		<? endforeach; ?>
		</div><!-- #wrapper -->
		<? } else { ?><div id="null">NULL</div><? } ?>
		<div id="footer">
		Powered by <a href="http://codeigniter.com">CodeIgniter</a> and <a href="http://code.google.com/p/redis/">Redis</a>.<br />
		<!-- <?php 
echo $views->unique;
?>
 visitor<? if($views->unique > 1) echo "s"; ?> / <?php 
echo $views->total;
?>
 view<? if($views->total > 1) echo "s"; ?> -->
		</div><!-- footer -->
Esempio n. 6
0
 static function smartify($text)
 {
     return Smartypants($text);
 }