function autolink($text, $limit = 30, $tagfill = '', $auto_title = true) { $text = autolink_do($text, '![a-z][a-z-]+://!i', $limit, $tagfill, $auto_title); $text = autolink_do($text, '!(mailto|skype):!i', $limit, $tagfill, $auto_title); $text = autolink_do($text, '!www\\.!i', $limit, $tagfill, $auto_title, 'http://'); $text = autolink_email($text); return $text; }
function parse_desc($text) { // Don't allow tags and make the description HTML-safe $text = phpc_html_escape($text); $text = nl2br($text); // linkify urls $text = autolink($text, 0); // linkify emails $text = autolink_email($text); return $text; }
<dd><?php echo $announcement['Where']; ?> </dd> <?php } if ($announcement['Sponsor'] !== '') { ?> <dt>Sponsor</dt> <dd><?php echo $announcement['Sponsor']; ?> </dd> <?php } if ($announcement['Contact'] !== '') { ?> <dt>Contact</dt> <dd><?php echo autolink_email($announcement['Contact']); ?> </dd> <?php } ?> </dl> </article> <div class="bottom"> <a onclick="changeChannel($(this).closest('section'), 'default'); return false;" href="">go back</a> </div>
function detect_links($str) { $str = autolink($str); $str = autolink_email($str); return $str; }
function parse_desc($text) { // Don't allow tags and make the description HTML-safe $text = htmlspecialchars($text, ENT_COMPAT, "UTF-8"); $text = nl2br($text); // linkify urls $text = autolink($text, 0); // linkify emails $text = autolink_email($text); return $text; }