public function test_pull_675() { $strings = array('<br />www.google.com' => '<br /><a href="http://www.google.com">www.google.com</a>'); foreach ($strings as $in => $out) { $this->assertEquals($out, auto_link($in, 'url')); } }
function _generate_email_markup($contents) { $return = ''; foreach ($contents as $content) { if (isset($content['tag'])) { $return .= '<' . $content['tag']; } if (isset($content['css'])) { $return .= ' style="' . htmlentities($content['css']) . '"'; } if (isset($content['tag'])) { $return .= '>'; } foreach ($content as $i => $c) { if ($i != 'tag' && $i != 'css') { if (is_array($c)) { $return .= _generate_email_markup($c); } else { $return .= auto_link(html_entities($c)); } } } if (isset($content['tag'])) { $return .= '</' . $content['tag'] . '>'; } } return $return; }
/** * Smarty {url} function plugin * * Type: function * Name: url * @author: Trimo * @mail: trimo.1992[at]gmail[dot]com */ function smarty_function_url($params, &$smarty) { if (!function_exists('current_url')) { if (!function_exists('get_instance')) { $smarty->trigger_error("url: Cannot load CodeIgniter"); return; } $CI =& get_instance(); $CI->load->helper('url'); } if ($params['type'] == 'string') { return uri_string(); } elseif ($params['type'] == 'anchor' && isset($params['url'])) { return anchor($params['url'], $params['text'], $params['attr']); } elseif ($params['type'] == 'safemail' && isset($params['url'])) { return safe_mailto($params['url'], $params['text'], $params['attr']); } elseif ($params['type'] == 'mail' && isset($params['url'])) { return mailto($params['url'], $params['text'], $params['attr']); } elseif ($params['type'] == 'autolink' && isset($params['url'])) { return auto_link($params['url'], isset($params['mode']) ? $params['mode'] : 'both', $params['new'] == 1 ? TRUE : FALSE); } elseif ($params['type'] == 'urltitle' && isset($params['title'])) { return url_title($params['title'], isset($params['mode']) ? $params['mode'] : 'dash', $params['lower'] == 1 ? TRUE : FALSE); } elseif ($params['type'] == 'prep' && isset($params['url'])) { return prep_url($params['url']); } elseif ($params['type'] == 'current') { return current_url(); } elseif ($params['type'] == 'site') { return site_url($params['url']); } else { return base_url(); } }
function _process($items, $return_single = FALSE) { $this->load->helper('url'); if ($items) { foreach ($items as $key => $value) { $new_item = new Sweetcron_item(); //item feed components $new_item->feed_id = $items[$key]->feed_id; $new_item->feed_title = $items[$key]->feed_title; $new_item->feed_icon = $items[$key]->feed_icon; $new_item->feed_url = $items[$key]->feed_url; $new_item->feed_data = $items[$key]->feed_data; $new_item->feed_status = $items[$key]->feed_status; $new_item->feed_domain = $items[$key]->feed_domain; //standard item components $new_item->ID = $items[$key]->ID; $new_item->item_date = $items[$key]->item_date; //autolinks $new_item->item_content = auto_link($items[$key]->item_content); $new_item->item_content = markdown($new_item->item_content); $new_item->item_title = auto_link($items[$key]->item_title); $new_item->item_original_permalink = $items[$key]->item_permalink; $new_item->item_permalink = $this->config->item('base_url') . 'items/view/' . $new_item->ID; $new_item->item_status = $items[$key]->item_status; $new_item->item_name = $items[$key]->item_name; $new_item->item_data = unserialize($items[$key]->item_data); $new_item->item_tags = $this->get_tags($items[$key]->ID); //make adjustments if blog post if (!$items[$key]->feed_id) { $new_item->feed_icon = '/favicon.ico'; $url = parse_url($this->config->item('base_url')); if (substr($url['host'], 0, 4) == 'www.') { $new_item->feed_domain = substr($url['host'], 4); } else { $new_item->feed_domain = $url['host']; } } $new_item->feed_class = str_replace('.', '_', $new_item->feed_domain); //extended item components if ($new_item->feed_id) { $new_item = $this->sweetcron->extend('pre_display', $new_item->feed_domain, $new_item); } //custom item components $new_item->nice_date = timespan($items[$key]->item_date); if ($new_item->item_date < strtotime('1 day ago')) { $new_item->human_date = date('F j Y, g:ia', $items[$key]->item_date); } else { $new_item->human_date = $new_item->nice_date . ' ago'; } $items[$key] = $new_item; } if ($return_single) { return $items[0]; } else { return $items; } } else { return false; } }
/** * parse_bbcode * * Converts BBCode style tags into basic HTML * * @access public * @param string unparsed string * @param int max image width * @return string */ function bbcode($str = '', $max_images = 0) { // convert to html entities $str = htmlentities($str); $str = auto_link($str); // Max image size eh? Better shrink that pic! if ($max_images > 0) { $str_max = "style=\"max-width:" . $max_images . "px; width: [removed]this.width > " . $max_images . " ? " . $max_images . ": true);\""; } $find = array("'\n'i", "'\\[b\\](.*?)\\[/b\\]'is", "'\\[i\\](.*?)\\[/i\\]'is", "'\\[u\\](.*?)\\[/u\\]'is", "'\\[s\\](.*?)\\[/s\\]'is", "'\\[img\\](.*?)\\[/img\\]'i", "'\\[url\\](.*?)\\[/url\\]'i", "'\\[url=(.*?)\\](.*?)\\[/url\\]'i", "'\\[link\\](.*?)\\[/link\\]'i", "'\\[link=(.*?)\\](.*?)\\[/link\\]'i", "'\\[size=small\\](.*?)\\[/size\\]'is", "'\\[size=normal\\](.*?)\\[/size\\]'is", "'\\[size=medium\\](.*?)\\[/size\\]'is", "'\\[size=big\\](.*?)\\[/size\\]'is", "'\\[quote\\](.*?)\\[/quote\\]'is", "'\\[code\\](.*?)\\[/code\\]'is", "'\\[color\\=(.*?)\\](.*?)\\[\\/color\\]'is", "'\\:\\-\\)'is", "'\\:\\-\\('", "'\\:\\-\\D'", "'\\:lol'", "'\\;\\-\\)'", "'\\:dry'", "'\\:hal-is-awesome'", "'\\:read-the-rules'", "'\\:spam'"); $replace = array('<br />', '<strong>\\1</strong>', '<em>\\1</em>', '<u>\\1</u>', '<s>\\1</s>', '<img src="\\1" alt="" />', '<a href="\\1">\\1</a>', '<a href="\\1">\\2</a>', '<a href="\\1">\\1</a>', '<a href="\\1">\\2</a>', '<span style="font-size:0.9em;">\\1</span>', '<span style="font-size:1em;">\\1</span>', '<span style="font-size:1.2em;">\\1</span>', '<span style="font-size:1.4em;">\\1</span>', '</p><blockquote>\\1</blockquote><p>', '<pre><code>\\1</pre></code>', '<span style="color: \\1;">\\2</span>', '<img src="' . site_url() . 'static/images/smileys/smiley-face-smile.gif" alt="smile" />', '<img src="' . site_url() . 'static/images/smileys/smiley-face-sad.gif" alt="sad-face" />', '<img src="' . site_url() . 'static/images/smileys/smiley-face-biggrin.gif" alt="biggrin" />', '<img src="' . site_url() . 'static/images/smileys/smiley-face-laugh.gif" alt="lol" />', '<img src="' . site_url() . 'static/images/smileys/smiley-face-wink.gif" alt="wink" />', '<img src="' . site_url() . 'static/images/smileys/smiley-face-dry.gif" alt="Dry" />', '<img src="' . site_url() . 'static/images/smileys/smiley-hal-is-awsome.gif" alt="Halogy Is Awesome" />', '<img src="' . site_url() . 'static/images/smileys/smiley-read-the-rules.gif" alt="Read The Rules" />', '<img src="' . site_url() . 'static/images/smileys/smiley-spam!!!.gif" alt="Spam" />'); $str = preg_replace($find, $replace, $str); return '<p>' . $str . '</p>'; }
/** * parse_bbcode * * Converts BBCode style tags into basic HTML * * @access public * @param string unparsed string * @param int max image width * @return string */ function bbcode($str = '', $max_images = 0) { // convert to html entities $str = htmlentities($str); $str = auto_link($str); // Max image size eh? Better shrink that pic! if ($max_images > 0) { $str_max = "style=\"max-width:" . $max_images . "px; width: [removed]this.width > " . $max_images . " ? " . $max_images . ": true);\""; } $find = array("'\n'i", "'\\[b\\](.*?)\\[/b\\]'is", "'\\[i\\](.*?)\\[/i\\]'is", "'\\[u\\](.*?)\\[/u\\]'is", "'\\[s\\](.*?)\\[/s\\]'is", "'\\[img\\](.*?)\\[/img\\]'i", "'\\[url\\](.*?)\\[/url\\]'i", "'\\[url=(.*?)\\](.*?)\\[/url\\]'i", "'\\[link\\](.*?)\\[/link\\]'i", "'\\[link=(.*?)\\](.*?)\\[/link\\]'i", "'\\[size=small\\](.*?)\\[/size\\]'is", "'\\[size=normal\\](.*?)\\[/size\\]'is", "'\\[size=medium\\](.*?)\\[/size\\]'is", "'\\[size=big\\](.*?)\\[/size\\]'is", "'\\[quote\\](.*?)\\[/quote\\]'is", "'\\[code\\](.*?)\\[/code\\]'is"); $replace = array('<br />', '<strong>\\1</strong>', '<em>\\1</em>', '<u>\\1</u>', '<s>\\1</s>', '<img src="\\1" alt="" />', '<a href="\\1">\\1</a>', '<a href="\\1">\\2</a>', '<a href="\\1">\\1</a>', '<a href="\\1">\\2</a>', '<span style="font-size:0.9em;">\\1</span>', '<span style="font-size:1em;">\\1</span>', '<span style="font-size:1.2em;">\\1</span>', '<span style="font-size:1.4em;">\\1</span>', '</p><blockquote>\\1</blockquote><p>', '<pre><code>\\1</pre></code>'); $str = preg_replace($find, $replace, $str); return '<p>' . $str . '</p>'; }
public function parse_string($template, $data = array(), $return = FALSE, $config = array()) { if (!is_array($config)) { $config = array(); } $config = array_merge($this->config, $config); $ci = $this->ci; $is_mx = false; if (!$return) { list($ci, $is_mx) = $this->detect_mx(); } $template = auto_link($template, $config['type'], $config['attributes']); return $this->output($template, $return, $ci, $is_mx); }
/** * Index * * Display's the sponsors * * @access public * @return void */ function index() { // Retrieve sponsors $sponsors = $this->sponsors->get_sponsors(); // Check if sponsors exist if ($sponsors) { // Sponsors exist, loop through each sponsor foreach ($sponsors as $sponsor) { // Format html, create links & assign sponsor description $sponsor->sponsor_description = auto_link($this->typography->auto_typography($this->bbcode->to_html($sponsor->sponsor_description)), 'url'); } } // Create a reference to sponsors $this->data->sponsors =& $sponsors; // Load the sponsors view $this->load->view(THEME . 'sponsors', $this->data); }
function add() { $this->load->library('typography'); $task_id = trim(strip_tags($this->input->post('task_id'))); $content = trim(strip_tags($this->input->post('content'))); if ($this->input->post('submitclose')) { $this->tasks->close($task_id); $content = "-- TASK CLOSED --\n\n" . $content; } else { if ($this->input->post('submitopen')) { $this->tasks->reopen($task_id); $content = "-- TASK REOPENED --\n\n" . $content; } } if ($content != "") { $this->comments->add($task_id, $content); $data['comment'] = $this->comments->get_by_id($this->db->insert_id()); $data['comment']->content = $this->typography->auto_typography(auto_link($data['comment']->content)); $this->load->view('comments/single', $data); } }
public static function init_absolute_urls(&$pages, $lang) { foreach ($pages as &$page) { // Set the page complete URL $page['absolute_url'] = ''; // Link if ($page['link_type'] != '') { // External if ($page['link_type'] == 'external') { $page['absolute_url'] = $page['link']; } else { if ($page['link_type'] == 'email') { $page['absolute_url'] = auto_link($page['link'], 'both', TRUE); } else { // Article if ($page['link_type'] == 'article') { // Get the article to which this page links $rel = explode('.', $page['link_id']); $target_article = self::$ci->article_model->get_context($rel[1], $rel[0], $lang); // Of course, only if not empty... if (!empty($target_article)) { // Get the article's parent page $page['absolute_url'] = ''; foreach ($pages as $p) { if ($p['id_page'] == $target_article['id_page']) { $page['absolute_url'] = $p['url'] . '/' . $target_article['url']; } } } } else { // Get the page to which the page links // $target_page = array_values(array_filter($con->globals->pages, create_function('$row','return $row["id_page"] == "'. $page['link_id'] .'";'))); // if ( ! empty($target_page)) // { // $page['absolute_url'] = $target_page[0]['url']; // } $page['absolute_url'] = ''; foreach ($pages as $p) { if ($p['id_page'] == $page['link_id']) { $page['absolute_url'] = $p['url']; } } } if (count(Settings::get_online_languages()) > 1 or Settings::get('force_lang_urls') == '1') { $page['absolute_url'] = $lang . '/' . $page['absolute_url']; } $page['absolute_url'] = base_url() . $page['absolute_url']; } } } else { if (count(Settings::get_online_languages()) > 1 or Settings::get('force_lang_urls') == '1') { // Home page : doesn't contains the page URL if ($page['home'] == 1) { // Default language : No language code in the URL for the home page // Other language : The home page has the lang code in URL if (Settings::get_lang('default') != $lang) { $page['absolute_url'] = $lang; } } else { // If page URL if already set because of a link, don't replace it. $page['absolute_url'] = $page['absolute_url'] != '' ? $lang . '/' . $page['absolute_url'] : $lang . '/' . $page['url']; } $page['absolute_url'] = base_url() . $page['absolute_url']; // Set the lang code depending URL (used by language subtag) $page['absolute_urls'] = array(); foreach (Settings::get_online_languages() as $language) { if ($page['home'] == 1) { // Default language : No language code in the URL for the home page if (Settings::get_lang('default') == $language['lang']) { $page['absolute_urls'][$language['lang']] = base_url(); } else { $page['absolute_urls'][$language['lang']] = base_url() . $language['lang']; } } else { $page['absolute_urls'][$language['lang']] = base_url() . $language['lang'] . '/' . $page['urls'][$language['lang']]; } } } else { if ($page['home'] == 1) { $page['absolute_url'] = base_url(); } else { $page['absolute_url'] = base_url() . $page['url']; } // Set the lang code depending URL (used by language subtag) $page['absolute_urls'][$lang] = $page['absolute_url']; } } } }
/** * Gets a tranlation value from a key * Callback function linked to the tag <ion:translation /> * * @param FTL_Binding The binded tag to parse * */ public static function tag_translation($tag) { // Kind of article : Get only the article linked to the given view $term = isset($tag->attr['item']) ? $tag->attr['item'] : FALSE; if ($term === FALSE) { $term = isset($tag->attr['term']) ? $tag->attr['term'] : FALSE; } if ($term !== FALSE) { // Return the auto-linked translation value if (array_key_exists($term, self::$ci->lang->language) && self::$ci->lang->language[$term] != '') { return auto_link(self::$ci->lang->language[$term], 'both', true); } else { return '#' . $term; } } return; }
public function test1() { $this->load->helper('url'); //site_url()参数为字符串 echo '1:site_url()参数为字符串<br/> ' . site_url('helpers_test/Helper_url_test/test'); echo '<br/>'; //site_url()参数为数组 $segments = array('helpers_test', 'Helper_url_test', 'test'); echo '2:site_url()参数为数组<br/> ' . site_url($segments); echo '<br/>'; //base_url()和site_url()相同,只是不会加上index.php echo '3:base_url()和site_url()相同,只是不会加上index.php<br/> ' . base_url("helpers_test/Helper_url_test/test"); echo '<br/>'; echo '4:base_url()和site_url()相同,只是不会加上index.php<br/> ' . base_url($segments); echo '<br/>'; //current_url()返回当前正在浏览的页面的完整 URL (包括分段) echo '5:current_url()返回当前正在浏览的页面的完整 URL (包括分段)<br/> ' . current_url(); echo '<br/>'; //uri_string() echo '6:uri_string返回包含该函数的页面的 URI 分段<br/>' . uri_string() . '<br/>'; //返回你在配置文件中配置的 index_page 参数 echo '7:返回你在配置文件中配置的 index_page 参数<br/>' . index_page() . '<br/>'; //anchor()根据你提供的 URL 生成一个标准的 HTML 链接 echo '8:根据你提供的 URL 生成一个标准的 HTML 链接<br/>' . anchor('news/local/123', 'My News', 'title="News title"'); echo '<br/>'; echo anchor('news/local/123', 'My News', array('title' => 'The best news!')); echo '<br/>'; echo anchor('', 'Click here'); echo '<br/>'; //anchor_popup()它生成的 URL 将会在新窗口被打开 $atts = array('width' => 800, 'height' => 600, 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => 0, 'screeny' => 0, 'window_name' => '_blank'); //anchor_popup()它生成的 URL 将会在新窗口被打开 echo '9:anchor_popup()它生成的 URL 将会在新窗口被打开<br/>' . anchor_popup('news/local/123', 'Click Me!', $atts); echo '<br/>'; echo anchor_popup('news/local/123', 'Click Me!', array()); echo '<br/>'; //mailto()创建一个标准的 HTML e-mail 链接(发邮件) echo '10.mailto()创建一个标准的 HTML e-mail 链接<br/>' . mailto('*****@*****.**', 'Click Here to Contact Me'); echo '<br/>'; $attributes = array('title' => 'Mail me'); echo mailto('*****@*****.**', 'Contact Me', $attributes); echo '<br/>'; //和mailto函数一样safe_mailto()它的 mailto 标签使用了一个混淆的写法, 可以防止你的 e-mail 地址被垃圾邮件机器人爬到 echo '11.和mailto函数一样safe_mailto()它的 mailto 标签使用了一个混淆的写法,可以防止你的 e-mail 地址被垃圾邮件机器人爬到<br/>' . mailto('*****@*****.**', 'Click Here to Contact Me'); echo '<br/>'; //auto_link()将一个字符串中的 URL 和 e-mail 地址自动转换为链接 //$string = auto_link($string, 'url'); //$string = auto_link($string, 'email'); //$string = auto_link($string, 'both', TRUE); //auto_link()将一个字符串中的 URL 和 e-mail 地址自动转换为链接 echo '12:auto_link()将一个字符串中的 URL 和 e-mail 地址自动转换为链接<br/>' . auto_link('http://cyy.com/ci_chm/helpers/url_helper.html#id2', 'url'); echo '<br/>'; //url_title()将字符串转换为对人类友好的 URL 字符串格式 $title = "What's wrong with CSS?"; echo '13:url_title()将字符串转换为对人类友好的 URL 字符串格式<br/>' . url_title($title); echo '<br/>'; echo url_title($title, 'underscore'); echo '<br/>'; //$url = prep_url('example.com'); $url = prep_url('example.com'); echo '14:prep_url(\'example.com\'):<br/>' . $url; }
<div class="span10"> <article> <h1><?php echo $topic->title; ?> </h1> <div> <div><?php echo kdate($topic->created); ?> </div> <?php echo auto_link($topic->description); ?> </div> </article> <div> <form action="/index.php/topic/delete" method="post"> <input type="hidden" name="topic_id" value="<?php echo $topic->id; ?> " /> <a href="/index.php/topic/add" class="btn">추가</a> <input type="submit" class="btn" value="삭제" /> </form> </div> </div>
} echo $row->country; } ?> <?php if ($row->postal_code != '') { echo ' ' . $row->postal_code; } ?> <?php if ($row->city != '' || $row->province != '' || $row->country != '' || $row->postal_code != '') { echo '<br />'; } ?> <?php echo auto_link(prep_url($row->website)); ?> <?php if ($row->tax_code != '') { echo '<br />' . $this->lang->line('settings_tax_code') . ': ' . $row->tax_code; } ?> </p> <h4><?php echo $this->lang->line('invoice_work_description'); ?> </h4> <table class="invoice_items stripe"> <tr>
</div> <div id="contact_us"> <?php echo $BLOCKS['contact_us']; ?> </div> <div id="latest_tweets"> <h3>Latest Tweets</h3> <?php $counter = 0; foreach ($TWEETS as $tweet) { $counter++; ?> <p><?php echo auto_link($tweet->text, 'url', true); ?> </p> <?php if ($counter != count($TWEETS)) { ?> <div class="hr_dotted"></div> <?php } ?> <?php } ?> </div>
?> </span> people</strong> <?php echo time() <= $event_detail->event_end ? ' attending so far' : ' said they attended'; ?> . <a href="javascript:void(0);" id="toggle-attendees" class="show">Show »</a></span> </p> </div> <div class="clear"></div> </div> <div class="clear"></div> </div> <div class="desc"> <?php echo auto_p(auto_link(escape($event_detail->event_desc))); ?> <hr/> <b>Your host(s):</b><br/> <table cellpadding="5" cellspacing="0" border="0"> <tr> <?php foreach ($admins as $admin_user) { echo '<td style="padding-right:5px;font-size:11px">'; echo '<a href="/user/view/' . $admin_user->ID . '">' . $admin_user->full_name . '</a></td>'; } ?> </tr> </table>
function update($id = 0) { if ($id == 0) { redirect('/tasks'); } $this->load->library('typography'); // If the Title was edited... if ($this->input->post('id') == 'title') { $content = strip_tags(trim($this->input->post('value'))); $this->tasks->change_title($id, $content); $data['content'] = $content; // If the description was edited... } else { if ($this->input->post('id') == 'description') { $content = strip_tags(trim($this->input->post('value'))); $this->tasks->change_description($id, $content); $data['content'] = $this->typography->auto_typography(auto_link($content)); // If the tags were edited... } else { if ($this->input->post('id') == 'tags') { $content = strip_tags(trim($this->input->post('value'))); if (!empty($content)) { $this->tasks->change_tags($id, $content); $tags = $this->tags->get_by_task_id($id); $content = ""; foreach ($tags as $tag) { $content .= "<span class='tag'>" . $tag->name . "</span> "; } } else { $this->tags->remove_task_tags($id); $content = '<span class="small">(no tags)</span>'; } $data['content'] = $content; } } } $this->load->view('utility/content', $data); }
</th> </tr> <?php foreach ($clients as $client) { ?> <tr class="hoverall"> <td class="first"><?php echo $client->client_id; ?> </td> <td nowrap="nowrap"><?php echo $client->client_name; ?> </td> <td><?php echo auto_link($client->client_email_address) . ' '; ?> </td> <td><?php echo $client->client_phone_number . ' '; ?> </td> <td class="col_amount"><?php echo display_currency($client->client_credit_amount); ?> </td> <td class="col_amount"><?php echo display_currency($client->client_total_balance); ?> </td> <td><?php
function arrangeThread($PTE, $tree, $tree_cut, $posts, $hiddenReply, $resno = 0, $arr_kill, $arr_old, $kill_sensor, $old_sensor, $showquotelink = true, $adminMode = false) { $PIO = PMCLibrary::getPIOInstance(); $FileIO = PMCLibrary::getFileIOInstance(); $PMS = PMCLibrary::getPMSInstance(); $thdat = ''; // 討論串輸出碼 $posts_count = count($posts); // 迴圈次數 if (gettype($tree_cut) == 'array') { $tree_cut = array_flip($tree_cut); } // array_flip + isset 搜尋法 if (gettype($tree) == 'array') { $tree_clone = array_flip($tree); } // $i = 0 (首篇), $i = 1~n (回應) for ($i = 0; $i < $posts_count; $i++) { $imgsrc = $img_thumb = $imgwh_bar = ''; $IMG_BAR = $REPLYBTN = $QUOTEBTN = $WARN_OLD = $WARN_BEKILL = $WARN_ENDREPLY = $WARN_HIDEPOST = ''; extract($posts[$i]); // 取出討論串文章內容設定變數 // 設定欄位值 $name = str_replace('&' . _T('trip_pre'), '&' . _T('trip_pre'), $name); // 避免 &#xxxx; 後面被視為 Trip 留下 & 造成解析錯誤 if (CLEAR_SAGE) { $email = preg_replace('/^sage( *)/i', '', trim($email)); } // 清除E-mail中的「sage」關鍵字 if (ALLOW_NONAME == 2) { // 強制砍名 $name = preg_match('/(\\' . _T('trip_pre') . '.{10})/', $name, $matches) ? '<span class="nor">' . $matches[1] . '</span>' : ''; if ($email) { $now = "<a href=\"mailto:{$email}\">{$now}</a>"; } } else { $name = preg_replace('/(\\' . _T('trip_pre') . '.{10})/', '<span class="nor">$1</span>', $name); // Trip取消粗體 if ($email) { $name = "<a href=\"mailto:{$email}\">{$name}</a>"; } } if (AUTO_LINK) { $com = auto_link($com); } $com = quoteLight($com); if (USE_QUOTESYSTEM && $i) { // 啟用引用瀏覽系統 if (preg_match_all('/((?:>|>)+)(?:No\\.)?(\\d+)/i', $com, $matches, PREG_SET_ORDER)) { // 找尋>>No.xxx $matches_unique = array(); foreach ($matches as $val) { if (!in_array($val, $matches_unique)) { array_push($matches_unique, $val); } } foreach ($matches_unique as $val) { if (isset($tree_clone[$val[2]])) { $r_page = $tree_clone[$val[2]]; // 引用回應在整體討論串中的位置 // 在此頁顯示區間內,輸出錨點即可 if (isset($tree_cut[$val[2]])) { $com = str_replace($val[0], '<a class="qlink" href="#r' . $val[2] . '" onclick="replyhl(' . $val[2] . ');">' . $val[0] . '</a>', $com); } else { $com = str_replace($val[0], '<a class="qlink" href="' . PHP_SELF . '?res=' . $tree[0] . (RE_PAGE_DEF ? '&page_num=' . floor(($r_page - 1) / RE_PAGE_DEF) : '') . '#r' . $val[2] . '">' . $val[0] . '</a>', $com); } } } } } // 設定附加圖檔顯示 if ($ext && $FileIO->imageExists($tim . $ext)) { $imageURL = $FileIO->getImageURL($tim . $ext); // image URL $thumbName = $FileIO->resolveThumbName($tim); // thumb Name $imgsrc = '<a href="' . $imageURL . '" target="_blank" rel="nofollow"><img src="nothumb.gif" class="img" alt="' . $imgsize . '" title="' . $imgsize . '" /></a>'; // 預設顯示圖樣式 (無預覽圖時) if ($tw && $th) { if ($thumbName != false) { // 有預覽圖 $thumbURL = $FileIO->getImageURL($thumbName); // thumb URL $img_thumb = '<small>' . _T('img_sample') . '</small>'; $imgsrc = '<a href="' . $imageURL . '" target="_blank" rel="nofollow"><img src="' . $thumbURL . '" style="width: ' . $tw . 'px; height: ' . $th . 'px;" class="img" alt="' . $imgsize . '" title="' . $imgsize . '" /></a>'; } elseif ($ext == '.swf') { $imgsrc = ''; } // swf檔案不需預覽圖 } if (SHOW_IMGWH) { $imgwh_bar = ', ' . $imgw . 'x' . $imgh; } // 顯示附加圖檔之原檔長寬尺寸 $IMG_BAR = _T('img_filename') . '<a href="' . $imageURL . '" target="_blank" rel="nofollow">' . $tim . $ext . '</a>-(' . $imgsize . $imgwh_bar . ') ' . $img_thumb; } // 設定回應 / 引用連結 if ($resno) { // 回應模式 if ($showquotelink) { $QUOTEBTN = '<a href="javascript:quote(' . $no . ');" class="qlink">No.' . $no . '</a>'; } else { $QUOTEBTN = '<a href="' . PHP_SELF . '?res=' . $tree . '&page_num=all#r' . $no . '" class="qlink">No.' . $no . '</a>'; } } else { if (!$i) { $REPLYBTN = '[<a href="' . PHP_SELF . '?res=' . $no . '">' . _T('reply_btn') . '</a>]'; } // 首篇 $QUOTEBTN = '<a href="' . PHP_SELF . '?res=' . $tree[0] . '#q' . $no . '" class="qlink">No.' . $no . '</a>'; } if ($adminMode) { // 前端管理模式 $modFunc = ''; $PMS->useModuleMethods('AdminList', array(&$modFunc, $posts[$i], $resto)); // "AdminList" Hook Point $QUOTEBTN .= $modFunc; } // 設定討論串屬性 if (STORAGE_LIMIT && $kill_sensor) { if (isset($arr_kill[$no])) { $WARN_BEKILL = '<span class="warn_txt">' . _T('warn_sizelimit') . '</span><br />' . "\n"; } } // 預測刪除過大檔 if (!$i) { // 首篇 Only if ($old_sensor) { if (isset($arr_old[$no])) { $WARN_OLD = '<span class="warn_txt">' . _T('warn_oldthread') . '</span><br />' . "\n"; } } // 快要被刪除的提示 $flgh = $PIO->getPostStatus($status); if ($flgh->exists('TS')) { $WARN_ENDREPLY = '<span class="warn_txt">' . _T('warn_locked') . '</span><br />' . "\n"; } // 被標記為禁止回應 if ($hiddenReply) { $WARN_HIDEPOST = '<span class="warn_txt2">' . _T('notice_omitted', $hiddenReply) . '</span><br />' . "\n"; } // 有隱藏的回應 } // 對類別標籤作自動連結 if (USE_CATEGORY) { $ary_category = explode(',', str_replace(',', ',', $category)); $ary_category = array_map('trim', $ary_category); $ary_category_count = count($ary_category); $ary_category2 = array(); for ($p = 0; $p < $ary_category_count; $p++) { if ($c = $ary_category[$p]) { $ary_category2[] = '<a href="' . PHP_SELF . '?mode=category&c=' . urlencode($c) . '">' . $c . '</a>'; } } $category = implode(', ', $ary_category2); } else { $category = ''; } // 最終輸出處 if ($i) { // 回應 $arrLabels = array('{$NO}' => $no, '{$SUB}' => $sub, '{$NAME}' => $name, '{$NOW}' => $now, '{$CATEGORY}' => $category, '{$QUOTEBTN}' => $QUOTEBTN, '{$IMG_BAR}' => $IMG_BAR, '{$IMG_SRC}' => $imgsrc, '{$WARN_BEKILL}' => $WARN_BEKILL, '{$NAME_TEXT}' => _T('post_name'), '{$CATEGORY_TEXT}' => _T('post_category'), '{$SELF}' => PHP_SELF, '{$COM}' => $com); if ($resno) { $arrLabels['{$RESTO}'] = $resno; } $PMS->useModuleMethods('ThreadReply', array(&$arrLabels, $posts[$i], $resno)); // "ThreadReply" Hook Point $thdat .= $PTE->ParseBlock('REPLY', $arrLabels); } else { // 首篇 $arrLabels = array('{$NO}' => $no, '{$SUB}' => $sub, '{$NAME}' => $name, '{$NOW}' => $now, '{$CATEGORY}' => $category, '{$QUOTEBTN}' => $QUOTEBTN, '{$REPLYBTN}' => $REPLYBTN, '{$IMG_BAR}' => $IMG_BAR, '{$IMG_SRC}' => $imgsrc, '{$WARN_OLD}' => $WARN_OLD, '{$WARN_BEKILL}' => $WARN_BEKILL, '{$WARN_ENDREPLY}' => $WARN_ENDREPLY, '{$WARN_HIDEPOST}' => $WARN_HIDEPOST, '{$NAME_TEXT}' => _T('post_name'), '{$CATEGORY_TEXT}' => _T('post_category'), '{$SELF}' => PHP_SELF, '{$COM}' => $com); if ($resno) { $arrLabels['{$RESTO}'] = $resno; } $PMS->useModuleMethods('ThreadPost', array(&$arrLabels, $posts[$i], $resno)); // "ThreadPost" Hook Point $thdat .= $PTE->ParseBlock('THREAD', $arrLabels); } } $thdat .= $PTE->ParseBlock('THREADSEPARATE', $resno ? array('{$RESTO}' => $resno) : array()); return $thdat; }
<ul class="contact-list"> <?php if (trim($user_about['user_website']) != '') { ?> <li><strong>Website URL:</strong><?php print auto_link($user_about['user_website']); ?> </li> <?php } ?> <?php if (trim($user_about['user_blog']) != '') { ?> <li><strong>Blog:</strong><?php print auto_link($user_about['user_blog']); ?> </li> <?php } ?> <?php if (trim($user_about['email']) != '') { ?> <li><strong>Email:</strong><?php echo safe_mailto($user_about['email'], $user_about['email']); ?> </li> <?php } ?>
/** * Gets a translation value from a key * Callback function linked to the tag <ion:translation /> * * @param FTL_Binding * * @return string * */ public static function tag_lang(FTL_Binding $tag) { // Kind of article : Get only the article linked to the given view $key = $tag->getAttribute('key'); if (is_null($key)) { $key = $tag->getAttribute('term'); } if (is_null($key)) { $key = $tag->getAttribute('item'); } $swap = $tag->getAttribute('swap'); if (!is_null($swap)) { $swap = self::get_lang_swap($tag, $swap); } if (!is_null($key)) { $random = $tag->getAttribute('random'); if (!is_null($random)) { $keys = explode(',', $key); $index = rand(0, sizeof($keys) - 1); $key = trim($keys[$index]); } $autolink = $tag->getAttribute('autolink', TRUE); $line = lang($key, $swap); if (!$autolink) { return self::wrap($tag, $line); } return self::wrap($tag, auto_link($line, 'both', TRUE)); } return ''; }
function read() { // get partials $output = $this->partials; // get post based on uri $year = $this->uri->segment(2); $month = $this->uri->segment(3); $uri = $this->uri->segment(4); if ($post = $this->blog->get_post($year, $month, $uri)) { // add comment if (count($_POST)) { // required $this->core->required = array('fullName' => 'Full name', 'comment' => 'Comment'); // check for spam preg_match_all('/http:\\/\\//i', $this->input->post('comment'), $urlMatches); preg_match_all('/viagra|levitra|cialis/i', $this->input->post('comment'), $spamMatches); if (count($urlMatches[0]) > 2 || count($urlMatches[0]) > 0 && count($spamMatches[0]) > 0) { $this->form_validation->set_error('Sorry but your comment looks like spam. Please remove links and try again.'); } elseif (isset($_POST['captcha']) && !$this->_captcha_check()) { $this->form_validation->set_error('Sorry you didn\'t pass the spam check. Please contact us to post a comment.'); } else { // set date $this->core->set['dateCreated'] = date("Y-m-d H:i:s"); $this->core->set['postID'] = $post['postID']; // awaiting moderation if ($this->session->userdata('session_admin')) { $this->core->set['active'] = 1; } else { $this->core->set['active'] = 0; } // update if ($this->core->update('blog_comments')) { // get insertID $commentID = $this->db->insert_id(); // get details on post poster $user = $this->blog->get_user($post['userID']); // construct URL $url = '/blog/' . $year . '/' . $month . '/' . $uri . '/'; if ($user['notifications'] && !$this->session->userdata('session_admin')) { // set header and footer $emailHeader = str_replace('{name}', $user['firstName'] . ' ' . $user['lastName'], $this->site->config['emailHeader']); $emailHeader = str_replace('{email}', $user['email'], $emailHeader); $emailFooter = str_replace('{name}', $user['firstName'] . ' ' . $user['lastName'], $this->site->config['emailFooter']); $emailFooter = str_replace('{email}', $user['email'], $emailFooter); // send email $this->load->library('email'); $this->email->from($this->site->config['siteEmail'], $this->site->config['siteName']); $this->email->to($user['email']); $this->email->subject('New Blog Comment on ' . $this->site->config['siteName']); $this->email->message($emailHeader . "\n\nSomeone has just commented on your blog post titled \"" . $post['postTitle'] . "\".\n\nYou can either approve or delete this comment by clicking on the following URL:\n\n" . site_url('/admin/blog/comments') . "\n\nThey said:\n\"" . $this->input->post('comment') . "\"\n\n" . $emailFooter); $this->email->send(); } // output message $output['message'] = 'Thank you, your comment has been posted and is awaiting moderation.'; // disable form $post['allowComments'] = 0; } } } // set page title $output['page:title'] = $post['postTitle'] . ($this->site->config['siteName'] ? ' - ' . $this->site->config['siteName'] : ''); // set meta description if ($post['excerpt']) { $output['page:description'] = $post['excerpt']; } // get author details $author = $this->blog->lookup_user($post['userID']); // populate template $output['post:title'] = $post['postTitle']; $output['post:link'] = site_url('blog/' . dateFmt($post['dateCreated'], 'Y/m') . '/' . $post['uri']); $output['post:date'] = dateFmt($post['dateCreated'], $this->site->config['dateOrder'] == 'MD' ? 'M jS Y' : 'jS M Y'); $output['post:day'] = dateFmt($post['dateCreated'], 'd'); $output['post:month'] = dateFmt($post['dateCreated'], 'M'); $output['post:year'] = dateFmt($post['dateCreated'], 'y'); $output['post:body'] = $this->template->parse_body($post['body']); $output['post:excerpt'] = $this->template->parse_body($post['excerpt']); $output['post:comments-count'] = $post['numComments']; $output['post:author'] = $author['displayName'] ? $author['displayName'] : $author['firstName'] . ' ' . $author['lastName']; $output['post:author-id'] = $author['userID']; $output['post:author-email'] = $author['email']; $output['post:author-avatar'] = anchor('/users/profile/' . $author['userID'], display_image($this->blog->get_user_avatar($author['avatar']), 'User Avatar', 100, 'class="bordered"', site_url() . $this->config->item('staticPath') . '/images/noavatar.gif')); $output['post:author-gravatar'] = 'http://www.gravatar.com/avatar.php?gravatar_id=' . md5(trim($author['email'])) . '&default=' . urlencode(site_url('/static/uploads/avatars/noavatar.gif')); $output['post:author-bio'] = empty($author['bio']) ? 'This Author has no bio set yet.' : $author['bio']; $output['post:allow-comments'] = $post['allowComments'] ? TRUE : FALSE; $output['form:name'] = set_value('fullName', $this->session->userdata('firstName') . ' ' . $this->session->userdata('lastName')); $output['form:email'] = set_value('email', $this->session->userdata('email')); $output['form:website'] = $this->input->post('website'); $output['form:comment'] = $this->input->post('comment'); // get cats if ($cats = $this->blog->get_cats_for_post($post['postID'])) { $i = 0; foreach ($cats as $cat) { $output['post:categories'][$i]['category:link'] = site_url('blog/' . url_title(strtolower(trim($cat)))); $output['post:categories'][$i]['category'] = $cat; $i++; } } // get tags if ($post['tags']) { $tags = explode(',', $post['tags']); $i = 0; foreach ($tags as $tag) { $output['post:tags'][$i]['tag:link'] = site_url('blog/tag/' . $this->tags->make_safe_tag($tag)); $output['post:tags'][$i]['tag'] = $tag; $i++; } } // get comments if ($comments = $this->blog->get_comments($post['postID'])) { $i = 0; foreach ($comments as $comment) { $output['post:comments'][$i]['comment:class'] = $i % 2 ? ' alt ' : ''; $output['post:comments'][$i]['comment:id'] = $comment['commentID']; $output['post:comments'][$i]['comment:gravatar'] = 'http://www.gravatar.com/avatar.php?gravatar_id=' . md5(trim($comment['email'])) . '&default=' . urlencode(site_url('/static/uploads/avatars/noavatar.gif')); $output['post:comments'][$i]['comment:author'] = !empty($comment['website']) ? anchor(prep_url($comment['website']), $comment['fullName']) : $comment['fullName']; $output['post:comments'][$i]['comment:date'] = dateFmt($comment['dateCreated'], $this->site->config['dateOrder'] == 'MD' ? 'M jS Y' : 'jS M Y'); $output['post:comments'][$i]['comment:body'] = nl2br(auto_link(strip_tags($comment['comment']))); $i++; } } // load errors $output['errors'] = validation_errors() ? validation_errors() : FALSE; // add view $this->blog->add_view($post['postID']); // output post ID for CMS $output['postID'] = $post['postID']; // display with cms layer $this->pages->view('blog_single', $output, TRUE); } else { show_404(); } }
/** * Returns the URL of the article, based or not on the lang * If only one language is online, this tag will return the URL without the lang code * To returns the lag code if you have only one language, set the "lang" attribute to TRUE * If the link or the article is set, this tag will return the link instead of the URL to the article. * */ public static function tag_article_url($tag) { $url = ''; // If lang attribute is set to TRUE, force the lang code to be in the URL // Usefull only if the website has only one language $lang_url = isset($tag->attr['lang']) && $tag->attr['lang'] == 'TRUE' ? TRUE : FALSE; // If link, return the link if ($tag->locals->article['link_type'] != '') { // External link if ($tag->locals->article['link_type'] == 'external') { return $tag->locals->article['link']; } // Mail link : TODO if ($tag->locals->article['link_type'] == 'email') { return auto_link($tag->locals->article['link'], 'both', TRUE); } // If link to one article, get the page to build the complete link if ($tag->locals->article['link_type'] == 'article') { // Get the article to which this article links $rel = explode('.', $tag->locals->article['link_id']); $target_article = self::$ci->article_model->get_context($rel[1], $rel[0], Settings::get_lang('current')); // If more than one parent, links to to first found // Normally, target link articles should not be duplicated in the tree // $parent_page = array_values(array_filter($tag->globals->pages, create_function('$row','return $row["id_page"] == "'. $target_article['id_page'] .'";'))); // $url = ( ! empty($parent_page[0])) ? $parent_page[0]['url'] . '/' . $target_article['url'] : ''; $url = ''; if (!empty($target_article)) { foreach ($tag->globals->pages as $p) { if ($p['id_page'] == $target_article['id_page']) { $url = $p['url'] . '/' . $target_article['url']; } } if (count(Settings::get_online_languages()) > 1 or Settings::get('force_lang_urls') == '1') { $url = Settings::get_lang('current') . '/' . $url; } return base_url() . $url; } } else { // Get the page to which the article links // $page = array_values(array_filter($tag->globals->pages, create_function('$row','return $row["id_page"] == "'. $tag->locals->article['link_id'] .'";'))); // if ( ! empty($page[0])) // { // $page = $page[0]; // return $page['absolute_url']; // } foreach ($tag->globals->pages as $p) { if ($p['id_page'] == $tag->locals->article['link_id']) { return $p['absolute_url']; } } } } $url = $tag->locals->article['url']; // Adds the suffix if defined in /application/config.php if (config_item('url_suffix') != '') { $url .= config_item('url_suffix'); } return $url; }
?> "> <?php } ?> <?php if ($quote->quote_status_id != 1) { ?> <p class="padded"> <?php echo lang('guest_url'); ?> : <?php echo auto_link(site_url('guest/view/quote/' . $quote->quote_url_key)); ?> </p> <?php } ?> </div> <script> // Get the template HTML and remove it from the document var previewNode = document.querySelector("#template"); previewNode.id = ""; var previewTemplate = previewNode.parentNode.innerHTML; previewNode.parentNode.removeChild(previewNode); var myDropzone = new Dropzone(document.body, { // Make the whole body a dropzone url: "<?php echo site_url('upload/upload_file/' . $quote->client_id . '/' . $quote->quote_url_key);
if (isset($posts) && count($posts) > 0) { ?> <?php foreach ($posts as $k => $v) { ?> <div class="row row-blog"> <h2 class="h3"><a href="/blog/view/<?php echo $v->ID; ?> "><?php echo $v->title; ?> </a></h2> <div class="desc"> <?php echo auto_p(auto_link($v->content)); ?> </div> <p class="opts"> <a href="/blog/view/<?php echo $v->ID; ?> #comments"><?php echo $v->comment_count; ?> comment<?php echo $v->comment_count == 1 ? '' : 's'; ?> </a> | Written <strong><?php echo date('d.M.Y', $v->date_posted);
echo $data['formName']; ?> <?php } ?> </p> </div> <div id="tpl-2col"> <div class="col1"> <h2 class="underline">Body</h2> <p><?php echo nl2br(auto_link($data['body'])); ?> </p> </div> <div class="col2"> <h2 class="underline">User Details</h2> <p><strong>Full name:</strong> <?php echo $data['fullName']; ?> </p> <p><strong>Email:</strong> <a href="mailto:<?php echo $data['email']; ?>
if ($provider != '') { ?> <p class="a-break"> <?php echo auto_link($path, 'both', true); ?> </p> <?php } else { ?> <p class="a-break"> <?php echo auto_link(base_url() . $path, 'both', true); ?> </p> <?php if (file_exists(DOCPATH . $path)) { ?> <?php echo sprintf('%01.2f', filesize(DOCPATH . $path) / 1024); ?> ko <?php if ($type === 'picture') { ?> -
<p><strong><?php echo $custom_field->custom_field_label; ?> </strong></p> <input type="text" name="custom[<?php echo $custom_field->custom_field_column; ?> ]" id="<?php echo $custom_field->custom_field_column; ?> " value="<?php echo form_prep($this->mdl_invoices->form_value('custom[' . $custom_field->custom_field_column . ']')); ?> "> <?php } ?> <p class="padded"><?php echo lang('guest_url'); ?> : <?php echo auto_link(site_url('guest/view/invoice/' . $invoice->invoice_url_key)); ?> </p> </div> </form> </div>
/** * Returns the comment description. You can pass it an array of formatting parameters which include: <ul> <li><strong>markdown:</strong> applies the <a href="[user_guide_url]helpers/markdown_helper">markdown</a> function </li> <li><strong>short:</strong> filters just the first paragraphs of the description if multiple paragraphs </li> <li><strong>long:</strong> returns the entire description</li> <li><strong>one_line:</strong> filters the description to appear on one line by removing returns</li> <li><strong>entities:</strong> converts html entities</li> <li><strong>eval:</strong> evaluates php code</li> <li><strong>periods:</strong> adds periods at the end of lines that don't have them</li> <li><strong>ucfirst:</strong> uppercases the first word</li> </ul> * * @access public * @param int The index (order) of the parameter to retrieve * @param string The part of the parameter to retrieve. Options are 'type' and 'comment' * @return boolean */ public function description($format = FALSE) { if (!isset($this->_description)) { preg_match('#/\\*\\*\\s*(.+ )(@|\\*\\/)#Ums', $this->_text, $matches); if (isset($matches[1])) { $this->_description = $matches[1]; // removing preceding * and tabs $this->_description = preg_replace('#\\* *#m', "", $matches[1]); $this->_description = preg_replace("#^ +#m", "", $this->_description); // remove code examples since they are handled by the example method $this->_description = preg_replace('#<code>.+</code>#ms', '', $this->_description); $this->_description = trim($this->_description); } else { $this->_description = $this->_text; } } $desc = $this->_description; $desc = $this->filter($desc); // apply different formats if ($format) { if (is_string($format)) { $format = (array) $format; } foreach ($format as $f) { switch (strtolower($f)) { case 'markdown': // must escape underscores to prevent <em> tags $desc = str_replace('_', '\\_', $desc); $desc = markdown($desc); // the we replace back any that didn't get processed'(e.g. ones inside links) $desc = str_replace('\\_', '_', $desc); break; case 'short': $desc_lines = explode(PHP_EOL, $desc); $first_line = TRUE; foreach ($desc_lines as $d) { if (!empty($d)) { if ($first_line) { $first_line = FALSE; $desc = $d; break; } } } break; case 'long': $desc_lines = explode(PHP_EOL, $desc); $new_desc = ''; $first_line = TRUE; foreach ($desc_lines as $d) { if (!empty($d)) { if ($first_line) { $first_line = FALSE; continue; } else { $new_desc .= $d . ' '; } } else { if (!$first_line) { $new_desc .= "\n\n"; } } } $desc = $new_desc; break; case 'one_line': $desc = str_replace(PHP_EOL, ' ', $desc); break; case 'entities': $desc = htmlentities($desc); break; case 'eval': $desc = eval_string($desc); break; case 'periods': $desc_lines = explode(PHP_EOL, $desc); $lines = ''; $past_first = FALSE; foreach ($desc_lines as $d) { $d = trim($d); if (!empty($d)) { if (!$past_first) { $d = preg_replace('#(.+[^\\.|>]\\s*)$#', '$1. ', $d); } $lines .= $d . ' '; $past_first = TRUE; } else { if ($past_first) { $lines .= "\n\n"; } } } $lines = preg_replace('#(.+[^\\.|>]\\s*)$#', '$1. ', trim($lines)); $desc = $lines; case 'ucfirst': $desc = ucfirst($desc); break; } } } // auto link $desc = auto_link($desc); // trim white space $desc = trim($desc); // clean $desc = xss_clean($desc); $desc = strip_image_tags($desc); return $desc; }
echo br(); } } if (count($updates)) { foreach ($updates as $key => $list) { $U = $user['username']; $stamp = mysql_to_unix($list->created); echo "<p><b>" . $U . ":</b> " . $list->update . br() . "<small>" . mdate($format, $stamp); echo "</small></p>"; } } echo heading("Recent Bookmarks", 2); if (count($bookmarks)) { foreach ($bookmarks as $key => $list) { $stamp = mysql_to_unix($list->created); echo "<p>" . auto_link($list->url) . br() . "<small>added " . mdate($format, $stamp); echo "</small></p>"; } } else { echo "Sorry, no bookmarks by this user available!"; } echo heading("Recent Posts", 2); if (count($posts)) { foreach ($posts as $key => $list) { $stamp = mysql_to_unix($list->created); echo "<p>" . anchor("blog/view_post/" . $list->id, $list->title) . br() . "<small>posted " . mdate($format, $stamp); echo "</small></p>"; } } else { echo "Sorry, no blog posts by this user available!"; }