function codeBlock($text) { $pattern = "@{code}(.*?){/code}@s"; $subject = html_entity_decode($text['original']); preg_match_all($pattern, $subject, $matches); $replace = preg_replace($pattern, "{code}", $subject); $replace = nl2p($replace); $count = 0; foreach ($matches[1] as $match) { $d = preg_replace("@^\n@", "", $match); $replace = preg_replace("@({code})@s", $d, $replace, 1); } $text['modified'] = $replace; return $text; }
/** * Post comment link */ function post_comment() { global $cd, $cfg, $lang, $id, $row, $session_status, $row, $trows, $comment_class, $forum_table, $block_spam; $tsql = "SELECT `id`, `tid`, `user_name`, `user_uri`, `title`, `comment`, `date`, `color`, `trash` FROM `{$forum_table}`" . " WHERE (`refer_id` = '{$row['id']}') AND (`trash` = '0') ORDER BY `date` ASC"; $tres = mysql_query($tsql); if (!$tres) { return ' Comment : Off'; exit; } $trow = mysql_num_rows($tres); if ($trow == '0') { $cstr = 'Comment'; } elseif ($trow == '1') { $cstr = $trow . ' Comment'; } else { $cstr = $trow . ' Comments'; } // comment field name $comment_field_name = md5($block_spam['comment_field_name']); if ($trow != 0) { // When there are some comments... $comments = ''; while ($trows = mysql_fetch_array($tres)) { $trows['title'] = htmlspecialchars(utf8_convert($trows['title'])); $trows['comment'] = nl2p(htmlspecialchars(utf8_convert($trows['comment']))); $trows['user_name'] = htmlspecialchars(utf8_convert($trows['user_name'])); $class_order = array_keys($comment_class); $color_class = $class_order[$trows['color']]; // If user's website URI was posted, wrap the user name with anchor. if (isset($trows['user_uri']) && preg_match('/([^=^\\"]|^)(http\\:[\\w\\.\\~\\-\\/\\?\\&\\+\\=\\:\\@\\%\\;\\#\\%]+)/', $trows['user_uri'])) { $user_name = '<a href="' . $trows['user_uri'] . '" rel="nofollow">' . $trows['user_name'] . '</a>'; } else { $user_name = $trows['user_name']; } // Smiley! $trows = smiley($trows); $comments .= '<h5 id="c' . $trows['id'] . '">' . $trows['title'] . "</h5>\n" . '<div class="' . $color_class . '">' . "\n" . $trows['comment'] . '<p class="author">From : ' . $user_name . ' @ ' . $trows['date'] . ' ' . '<span class="edit"><a href="./forum/comment_edit.php?id=' . $trows['id'] . '">' . $lang['edit'] . '</a></span>' . "</p>\n" . "</div>\n"; // Admin button if ($session_status == 'on') { $comments .= '<form action="./forum/admin/comment_edit.php" method="post">' . "\n" . '<div class="submit-button">' . "\n" . '<input type="hidden" name="edit" value="1" />' . "\n" . '<input type="hidden" name="id" value="' . $trows['id'] . '" />' . "\n" . '<input type="submit" value="' . $lang['mod_del'] . '" />' . "\n" . '</div>' . "\n" . '</form>' . "\n"; } $tid = $trows['tid']; } // Cookies if (isset($_COOKIE['p_blog_forum_user'])) { $user_name = $_COOKIE['p_blog_forum_user']; $checked = ' checked="checked"'; } else { $user_name = ''; $checked = ''; } if (isset($_COOKIE['p_blog_forum_email'])) { $user_email = $_COOKIE['p_blog_forum_email']; } else { $user_email = ''; } if (isset($_COOKIE['p_blog_forum_uri'])) { $user_uri = $_COOKIE['p_blog_forum_uri']; } else { $user_uri = ''; } // Settings for "Comment Form Template" $post_title = ''; $title = 'Re: ' . $row['name']; $comment = $lang['no_tags_allowed']; $action = './forum/comment_reply.php'; $refer_id = $row['id']; // Set parent key = 0 since parent comment is already posted, // and specify the topic id. $parent_key = '<input type="hidden" name="parent_key" value="0" />' . "\n" . '<input type="hidden" name="tid" value="' . $tid . '" />'; $comment_title = $lang['view_com_title_1'] . htmlspecialchars(strip_tags($row['name'])) . $lang['view_com_title_2']; $comment_link = '<a href="./article.php?id=' . $row['id'] . '#comments" title="' . $comment_title . '" class="status-on">' . $cstr . '</a> '; } else { // When No Comment... // Settings for "Comment Form Template" $post_title = ''; $action = './forum/comment_reply.php'; $refer_id = $row['id']; // Initialize user info because it's the first time post $user_name = ''; $user_email = ''; $user_uri = ''; $title = 'Re: ' . $row['name']; $comment = $lang['no_tags_allowed']; $checked = ''; // Set parent key = 1 $parent_key = '<input type="hidden" name="parent_key" value="1" />'; $comments = '<p class="gray-out">No Comments</p>'; $comment_title = $lang['post_com_title_1'] . htmlspecialchars(strip_tags($row['name'])) . $lang['post_com_title_2']; $comment_link = '<a href="./article.php?id=' . $row['id'] . '#comments" title="' . $comment_title . '">' . 'Post Comment</a> '; $tid = ''; } // Load the presentation template of "Comment Form" $comment_form = ''; // Initialize comment form require_once $cd . '/forum/contents/comment_form.tpl.php'; $comment_list = <<<EOD <!-- Begin #comment-list --> <div id="comment-list"> <h4 id="comments">{$cstr}</h4> {$comments} {$comment_form} </div> <!-- End #comment-list --> EOD; if (!empty($id)) { // When Permalink $comment = $comment_list; } else { $comment = $comment_link; } return $comment; }
/** * Find product by id * * @param Illuminate\Http\Request $request * @param int $id * * @return type */ public function ajaxFindProductById(Request $request, $id, $full = '') { // Only accept AJAX with HTTP GET request if ($request->ajax() && $request->isMethod('GET')) { $id = (int) $id; $product = product($id); $full = $full === 'fz' ? true : false; if ($product === null) { return pong(0, _t('not_found'), 404); } // Rebuild product data structure $productPath = config('front.product_path') . store()->id . '/'; $product->toImage(); $data = ['id' => $product->id, 'name' => $product->name, 'price' => $product->price, 'old_price' => $product->old_price, 'description' => $full ? nl2p($product->description, false) : $product->description, 'images' => ['image_1' => $product->image_1 !== null ? asset($productPath . ($full ? $product->image_1->big : $product->image_1->thumb)) : '', 'image_2' => $product->image_2 !== null ? asset($productPath . ($full ? $product->image_2->big : $product->image_2->thumb)) : '', 'image_3' => $product->image_3 !== null ? asset($productPath . ($full ? $product->image_3->big : $product->image_3->thumb)) : '', 'image_4' => $product->image_4 !== null ? asset($productPath . ($full ? $product->image_4->big : $product->image_4->thumb)) : ''], 'pin' => ['count' => $product->total_pin, 'viewer_has_pinned' => $product->pin->isPinned()], 'comments' => ['action' => route('front_comments_add', $product->id), 'count' => ($c = $product->comments) !== null ? $c->count() : 0, 'nodes' => ($c = $product->comments) !== null ? $this->_rebuildComment($c->all()) : []], 'last_modified' => $product->updated_at]; return pong(1, ['data' => $data]); } }
- JOB DESCRIPTION</a></h3> <div class="pane"> <table width="100%" border="0" class="content"> <tr> <td align="left" valign="top" class="tableheader"><?php echo $row_empalldetails['title']; ?> - Job Description</td></tr> <tr><td> <table border="0" align="left" width="100%" class="listcontent"> <tr> <td><?php if ($row_empalldetails['jobdescription'] != "") { ?> <div align="left"><?php echo nl2p($row_empalldetails['jobdescription']); ?> </div><?php } else { echo "No Job Descriptions"; } ?> </td> </tr></table></td></tr></table></div> <h3><a href="#">ACADEMICS QUALIFICATIONS & PROFILE</a></h3> <div class="pane"> <table width="100%" border="0" class="content"> <tr> <td align="left" valign="top" class="tableheader">ACADEMICS QUALIFICATIONS</td></tr> <tr><td>
public function testThreeParagraphs() { $text = "Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.\n\n Nullam id dolor id nibh ultricies vehicula ut id elit. Etiam porta sem malesuada magna mollis euismod. Nullam quis risus eget urna mollis ornare vel eu leo. Sed posuere consectetur est at lobortis.\n\n Etiam porta sem malesuada magna mollis euismod. Maecenas sed diam eget risus varius blandit sit amet non magna. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nulla vitae elit libero, a pharetra augue. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit."; $expected = "<p>Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>\n<p>Nullam id dolor id nibh ultricies vehicula ut id elit. Etiam porta sem malesuada magna mollis euismod. Nullam quis risus eget urna mollis ornare vel eu leo. Sed posuere consectetur est at lobortis.</p>\n<p>Etiam porta sem malesuada magna mollis euismod. Maecenas sed diam eget risus varius blandit sit amet non magna. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nulla vitae elit libero, a pharetra augue. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>"; $this->assertEquals($expected, nl2p($text)); }
function get_instructions($title) { $id = preg_replace("/\\W/", "", $this->config_item_name); $group_name = preg_replace("/\\W/", "", $title); $i = "<tr class=\"header\" id=\"{$id}\">\n<td class=\"part\" width=\"100%\" colspan=\"2\" bgcolor=\"#eeeeee\">\n"; $i .= "<h2>" . $title . "</h2>\n " . nl2p($this->_get_description()) . "\n"; $i .= "<p><a href=\"javascript:toggle_group('{$id}')\" id=\"{$id}_text\">Hide options.</a></p>"; return $i . "</td>\n"; }
protected function NotificationMembers($action, $all = false, $data) { $usersEmail = array(); if ($all == true) { $links = $this->getPropertyMembers(); foreach ($links as $key => $link) { array_push($usersEmail, $link['user']['email']); } } else { $usersEmail = array(); } $description = $action; if ($action == "Edited") { $action = "Updated"; } if ($action == "Added") { $action = "New"; $description = "Created"; } $layoutBefore = $this->layout; if (!empty($usersEmail)) { $this->layout = "emailmaster"; $emailBody = $this->render('../emails/emailHouseRule', array('data' => array('fullname' => Yii::app()->user->getState('firstname') . ' ' . Yii::app()->user->getState('lastname'), 'property' => $this->propertyName, 'text' => nl2p($data['text']), 'title' => $data['title'], 'action' => $action, 'description' => $description)), true); $property = $this->propertyName; MailHelper::send($emailBody, "SharedKey.com - {$property} - {$action} House Rules", $usersEmail); } }
<td style="font-family: Arial, Helvetica, sans-serif; color:#666; font-size: 14px; padding-top:6px; padding-bottom:6px; border-bottom-color:#D9D9D9; border-bottom-style:solid; border-bottom-width:1px; padding-left:5px;"><?php echo $data['property']; ?> </td> </tr> <tr> <td width="25%" style="font-family: Arial, Helvetica, sans-serif; color:#999; font-size: 14px; padding-top:6px; padding-bottom:6px; border-bottom-color:#D9D9D9; border-bottom-style:solid; border-bottom-width:1px;">Title:</td> <td width="75%" style="font-family: Arial, Helvetica, sans-serif; color:#666; font-size: 14px; padding-top:6px; padding-bottom:6px; border-bottom-color:#D9D9D9; border-bottom-style:solid; border-bottom-width:1px; padding-left:5px;"><?php echo $data['title']; ?> </td> </tr> </table> <p style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #666; line-height: 20px; font-weight: normal; margin-top: 2.8em; margin-right: 0; margin-bottom: 3.8em; margin-left: 0;" ><?php echo nl2p($data['text']); ?> </p> <p style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #666; line-height: 20px; font-weight: normal; margin-top: 0.8em; margin-right: 0; margin-bottom: 0.8em; margin-left: 0;" ><?php echo $data['description']; ?> by <?php echo $data['fullname']; ?> on <?php echo date('F d, Y'); ?> </p></td> </tr> </table>
/** * Article Box */ function display_forum_log_box($row) { global $cfg, $keys, $lang, $log_table, $comment_class, $forum_table, $cd, $row, $tid, $session_status, $rrow, $case, $i, $keys, $request_uri, $p, $pn; $row['title'] = sanitize($row['title']); $row['comment'] = sanitize($row['comment']); $row['user_name'] = sanitize($row['user_name']); $row['user_uri'] = sanitize($row['user_uri']); $row['date'] = sanitize($row['date']); $row['parent_key'] = sanitize(intval($row['parent_key'])); hit_key_highlight(); // Check the ID of the latest post $check_latest_sql = "SELECT `id` FROM `{$forum_table}` WHERE `tid` = '{$row['tid']}' AND `parent_key` = '0' AND `trash` = '0' ORDER BY `mod` DESC LIMIT 1"; $check_latest_res = mysql_query($check_latest_sql); $check_latest_row = mysql_fetch_array($check_latest_res); if ($check_latest_row[0] == $row['id']) { $check_latest = ' id="latest"'; } else { $check_latest = ''; } if ($row['parent_key'] == 1) { if (isset($row['refer_id']) && $row['refer_id'] != 0) { $rsql = "SELECT `name` FROM `{$log_table}` WHERE `id` = '{$row['refer_id']}'"; $rres = mysql_query($rsql); $rrow = mysql_fetch_array($rres); $rrow = convert_to_utf8($rrow); $anchor = '<h2>' . '» ' . '<a href="../article.php?id=' . $row['refer_id'] . '"> ' . $rrow['name'] . " </a></h2>\n"; $top_title = '<div class="comments">' . "\n" . '<h3>' . $row['title'] . "</h3>\n"; } else { $anchor = ''; $top_title = '<div class="comments"' . $check_latest . '>' . "\n" . '<h2 id="topic-title">' . $row['title'] . "</h2>\n"; // Parent post title } $comment = $anchor . $top_title; } else { $comment = '<div class="comments"' . $check_latest . '>' . "\n" . '<h3>' . $row['title'] . "</h3>\n"; } // in case ">" is posted...convert ">" to ">" //$row['comment'] = htmlspecialchars($row['comment']); // auto line-breaks $row['comment'] = nl2p($row['comment']); // generate URI if (isset($row['user_uri']) && preg_match('/([^=^\\"]|^)(http\\:[\\w\\.\\~\\-\\/\\?\\&\\+\\=\\:\\@\\%\\;\\#\\%]+)/', $row['user_uri'])) { $author = '<a href="' . $row['user_uri'] . '">' . $row['user_name'] . '</a>'; } else { $author = $row['user_name']; } $comment .= '<p class="author">' . 'From : ' . $author . ' @ ' . $row['date'] . ' ' . '<span class="edit"><a href="./modify.php?tid=' . $row['tid'] . '&id=' . $row['id'] . '">' . $lang['edit'] . "</a></span>\n" . '<span class="quote"><a href="./topic.php?tid=' . $row['tid'] . '&p=' . $p . '&pn=' . $pn . '&pm=' . $cfg['pagemax'] . '&qid=' . $row['id'] . '#addform">' . $lang['quote'] . "</a></span></p>\n"; $class_order = array_keys($comment_class); $color_class = $class_order[$row['color']]; $comment .= '<div class="' . $color_class . '">' . "\n" . $row['comment'] . "</div>\n"; if (preg_match('/forum\\/search.php/', $request_uri)) { $comment .= '<div class="a-footer"><a href="./topic.php?tid=' . $row['tid'] . '">' . $lang['topic'] . '</a></div>'; } // Display "Update" and "Delete" button while admin is logged-in. if ($session_status == 'on') { $comment .= '<form action="./admin/modify.php" method="post">' . "\n" . '<div class="submit-button">' . "\n" . '<input type="hidden" name="id" value="' . $row['id'] . '" />' . "\n" . '<input type="hidden" name="tid" value="' . $row['tid'] . '" />' . "\n" . '<input type="submit" value="' . $lang['mod'] . '" />' . "\n" . "</div>\n" . "</form>\n" . '<form method="post" action="./admin/delete.php">' . "\n" . '<div class="submit-button">' . "\n" . '<input type="hidden" name="id" value="' . $row['id'] . '" />' . "\n" . '<input type="hidden" name="tid" value="' . $row['tid'] . '" />' . "\n" . '<input type="submit" value="' . $lang['delete'] . '" />' . "\n" . "</div>\n" . '</form>' . "\n"; } else { $comment .= ''; } $comment .= "</div>\n"; $comment = smiley($comment); return $comment; }
<div class="wrap" id="addForm" style="display: none"> <img src="<?php echo basePath('images/add-photo-frame.png'); ?> " id="dragImg" alt=""> <div class="entry"> <a href="#" class="add-photos"><span> </span>Add Photos and Upload</a> </div> </div> <div class="img-holder" id="slideShow"> <ul > </ul> <div style="text-align: left;"><?php echo nl2p($welcomeMessage); ?> </div> </div> <div class="nav"> <div class="carousel"> <ul> </ul> </div> <div class="buttons"> <a href="#" class="prev left" > </a> <a href="#" class="next right" > </a> <div class="cl"> </div> </div> <?php
function create_xml_tcspec_from_xls($xls_filename, $xml_filename) { define('FIRST_DATA_ROW', 2); define('IDX_COL_NAME', 1); define('IDX_COL_SUMMARY', 2); define('IDX_COL_STEPS', 3); define('IDX_COL_EXPRESULTS', 4); $xls_handle = new Spreadsheet_Excel_Reader(); $xls_handle->setOutputEncoding(config_get('charset')); $xls_handle->read($xls_filename); $xls_rows = $xls_handle->sheets[0]['cells']; $xls_row_qty = sizeof($xls_rows); if ($xls_row_qty < FIRST_DATA_ROW) { return; // >>>----> bye! } $xmlFileHandle = fopen($xml_filename, 'w') or die("can't open file"); fwrite($xmlFileHandle, "<testcases>\n"); for ($idx = FIRST_DATA_ROW; $idx <= $xls_row_qty; $idx++) { $name = htmlspecialchars($xls_rows[$idx][IDX_COL_NAME]); fwrite($xmlFileHandle, "<testcase name=" . '"' . $name . '"' . ">\n"); // $summary = htmlspecialchars(iconv("CP1252","UTF-8",$xls_rows[$idx][IDX_COL_SUMMARY])); // 20090117 - contribution - BUGID 1992 // 20090402 - BUGID 1519 // $summary = str_replace('…',"...",$xls_rows[$idx][IDX_COL_SUMMARY]); $summary = convert_special_char($xls_rows[$idx][IDX_COL_SUMMARY]); $summary = nl2p(htmlspecialchars($summary)); fwrite($xmlFileHandle, "<summary><![CDATA[" . $summary . "]]></summary>\n"); // 20090117 - BUGID 1991,1992 // 20090402 - BUGID 1519 // $steps = str_replace('…',"...",$xls_rows[$idx][IDX_COL_STEPS]); $steps = convert_special_char($xls_rows[$idx][IDX_COL_STEPS]); $steps = nl2p(htmlspecialchars($steps)); fwrite($xmlFileHandle, "<steps><![CDATA[" . $steps . "]]></steps>\n"); // 20090117 - BUGID 1991,1992 // 20090402 - BUGID 1519 // $expresults = str_replace('…',"...",$xls_rows[$idx][IDX_COL_EXPRESULTS]); $expresults = convert_special_char($xls_rows[$idx][IDX_COL_EXPRESULTS]); $expresults = nl2p(htmlspecialchars($expresults)); fwrite($xmlFileHandle, "<expectedresults><![CDATA[" . $expresults . "]]></expectedresults>\n"); fwrite($xmlFileHandle, "</testcase>\n"); } fwrite($xmlFileHandle, "</testcases>\n"); fclose($xmlFileHandle); }
public static function nl2p($txt) { return nl2p($txt); }
if ($att['domain'] == 'post_format') { $format = (string) $att['nicename']; $post_format = $format == 'post-format-video' ? 'video' : 'post'; } } $post_status = $status == 'draft' ? 'draft' : 'NULL'; $comment_status = $comm == 'open' ? '1' : '0'; $type_type = !empty($post_format) && $post_format == 'video' ? 'video' : 'simple'; $title = $item->title; $seo = $item->xpath('wp:post_name'); $seo = $seo['0']; $content = $item->xpath('content:encoded'); $content = $content['0']; $descr = html_excerpt($content, 120); $content = str_replace('<!--more-->', '<!-- pagebreak -->', $content); $content = nl2p($content); $content = htmlspecialchars($content); //htmlentities($content, ENT_IGNORE, "UTF-8"); $net = explode(" ", $date); $dt = $net['0']; $nedt = explode("-", $dt); $dt2 = $net['1']; $nedt2 = explode(":", $dt2); $time = mktime($nedt2['0'], $nedt2['1'], $nedt2['2'], $nedt['1'], $nedt['2'], $nedt['0']); if (empty($time)) { $time = time(); } $mdate = str_replace(array('-', ':', ' '), '.', $date); if ($type == 'post') { $postnum++; foreach ($item->category as $c) {
?> : </div> <div class="field-items"><div class="field-item"><?php echo $parent_movie; ?> </div></div> </div> <?php } ?> </div> </section> <main class="row"> <section class="col-md-8"> <div class="quote"><?php echo nl2p(render($content['field_citata'])); ?> </div> <ul class="list-unstyled schedule"> <?php foreach ($movie_repertoires as $r) { ?> <li class="row"> <p class="col-xs-9 col-md-10"> <?php $dt = new DateTime($r->dt); ?> <?php echo '<span>' . format_date($dt->getTimestamp(), 'repertuaro') . ' </span> ' . $r->hall_full_name; ?>
function autoformat($html) { $html = stripslashes($html); $html = preg_replace(array('/on(\\w+)="[^"]+"/is', '/<script[^>]*?>.*?<\\/script>/si', '/<style[^>]*?>.*?<\\/style>/si', '/style=[" ]?([^"]+)[" ]/is', '/<br[^>]*>/i', '/<div[^>]*>(.*?)<\\/div>/is', '/<p[^>]*>(.*?)<\\/p>/is', '/<img[^>]+src=[" ]?([^"]+)[" ]?[^>]*>/is'), array('', '', '', '', "\n", "\$1\n", "\$1\n", "\n[img]\$1[/img]"), $html); if (stripos($html, '<embed') !== false) { preg_match_all("/<embed[^>]*>/is", $html, $embed_match); foreach ((array) $embed_match[0] as $key => $value) { preg_match("/.*?src\\s*=[\"|'|](.*?)[\"|'|]/is", $value, $src_match); preg_match("/.*?class\\s*=[\"|'|](.*?)[\"|'|]/is", $value, $class_match); preg_match("/.*?width\\s*=[\"|'|](\\d+)[\"|'|]/is", $value, $width_match); preg_match("/.*?height\\s*=[\"|'|](\\d+)[\"|'|]/is", $value, $height_match); $embed_width = $width_match[1]; $embed_height = $height_match[1]; if ($class_match[1] == 'edui-faked-music') { empty($embed_width) && ($embed_width = "400"); empty($embed_height) && ($embed_height = "95"); $html = str_replace($value, '[music=' . $embed_width . ',' . $embed_height . ']' . $src_match[1] . '[/music]', $html); } else { empty($embed_width) && ($embed_width = "500"); empty($embed_height) && ($embed_height = "450"); $html = str_replace($value, '[video=' . $embed_width . ',' . $embed_height . ']' . $src_match[1] . '[/video]', $html); } } } $html = str_replace(array(" ", " "), '', $html); $html = preg_replace(array('/<b[^>]*>(.*?)<\\/b>/i', '/<strong[^>]*>(.*?)<\\/strong>/i'), "[b]\$1[/b]", $html); $html = preg_replace('/<[\\/\\!]*?[^<>]*?>/is', '', $html); $html = ubb2html($html); $html = nl2p($html); return addslashes($html); }
<?php switch (isset($_GET['ac']) ? $_GET['ac'] : 'default') { case 'eldoni': $_POST['descricao'] = nl2p($_POST['descricao']); jf_update(PREFIXO . 'comunidade', $_POST, array('id' => $cmdd['id'])); header('location: ' . $shHome . $cmdd['id']); break; default: header('location: ' . $shHome . $cmdd['id']); break; case 'hubs': case 'addhub': case 'delhub': case 'peshub': require_once 'onserverHubs.php'; break; }
function textOutput($string) { return empty($string) ? "" : nl2p(html_entity_decode($string)); }
function htmlify($content, $lineSpacing = 1) { $content = strip_tags($content); $content = htmlentities($content); $content = stripslashes($content); switch ($lineSpacing) { case 0: break; case 1: $content = nl2p($content); break; case 2: $content = nl2br($content); break; } return $content; }
$gacode = "ga('create', 'UA-63495608-1', { 'userId': '%s' });"; echo sprintf($gacode, $userId); } else { $gacode = "ga('create', 'UA-63495608-1');"; echo sprintf($gacode); } ?> ga('send', 'pageview'); </script> </head> <body> <div id="wrapper"> <h1><a href="zahabe.php">Minns vi den gången Zahabe...</a></h1> <div class="lank edit"> <a href="allstories.php" title="Stories"><img src="assets/read.png" alt="Stories"></a> </div> <div class="lank edit rightmenu"> <a href="remove.php?id=<?php echo $row['cnt']; ?> " title="Edit"><img src="assets/edit.png" alt="edit"></a> </div> <?php $titel = str_replace("Minns vi den gången Zahabe ", "...", $row['Text']); echo "<h2>" . $titel . "</h2>"; echo "<div id='storytext'>" . nl2p($row['Story']) . "</div>"; ?> </div> </div> </body> </html>
<?php foreach ($items as $key => $item) { if (!isset($item->id)) { continue; } ?> <div class="houserule-item"> <div class="titleHeadHouserule"><!-- # <?php echo $key + 1; ?> - --><?php echo $item->title; ?> </div> <div class="titleBodyHouserule"> <?php echo nl2p($item->text); ?> </div> </div> <?php } ?> </div> </div> <style> #houserulesPrint{
$link = 'http://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'forum/reply.php?tid=' . $row['tid'] . '&qid=' . $row['id']; $title = htmlspecialchars($row['title']); $row['comment'] = nl2p(htmlspecialchars($row['comment'])); $item .= $p_rss->getItems($link, $title, $row); } $p_rss->feedRSS2(); // Forum Index } elseif (isset($_GET['f_index'])) { $f_index = $_GET['f_index']; $sql = 'SELECT' . " `id`, `tid`, `title`, DATE_FORMAT(`date`, '%Y-%m-%dT%T') as `date`, `comment`" . " FROM `{$forum_table}`" . " WHERE `parent_key` = 1 ORDER BY `mod` DESC LIMIT " . $cfg['topic_max']; $res = mysql_query($sql); $item = ''; while ($row = mysql_fetch_array($res)) { $row = convert_to_utf8($row); $link = 'http://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'forum/topic.php?tid=' . $row['tid'] . '&p=0'; $row['comment'] = nl2p(htmlspecialchars($row['comment'])); $title = htmlspecialchars($row['title']); $item .= $p_rss->getItems($link, $title, $row); } $p_rss->feedRSS2(); // Recent Articles } else { $sql = 'SELECT' . " `id`, `href`, `name`, DATE_FORMAT(`date`,'%Y-%m-%dT%T') as `date`, `comment`, `category`" . " FROM `{$log_table}` WHERE `draft` = '0' ORDER BY `date` desc LIMIT {$cfg['pagemax']}"; $res = mysql_query($sql); $item = ''; while ($row = mysql_fetch_array($res)) { $row = convert_to_utf8($row); $link = 'http://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'article.php?id=' . $row['id']; $title = htmlspecialchars($row['name']); if (file_exists($cd . '/include/user_include/plugins/plg_markdown.inc.php')) { include_once $cd . '/include/user_include/plugins/plg_markdown.inc.php';
Name: </td> <td style="font-family: Arial, Helvetica, sans-serif; color:#666; font-size: 14px; padding-top:6px; padding-bottom:6px; border-bottom-color:#D9D9D9; border-bottom-style:solid; border-bottom-width:1px; padding-left:5px;"><?php echo $data['name']; ?> </td> </tr> <tr> <td width="25%" style="font-family: Arial, Helvetica, sans-serif; color:#999; font-size: 14px; padding-top:6px; padding-bottom:6px; border-bottom-color:#D9D9D9; border-bottom-style:solid; border-bottom-width:1px;"> Email: </td> <td width="75%" style="font-family: Arial, Helvetica, sans-serif; color:#666; font-size: 14px; padding-top:6px; padding-bottom:6px; border-bottom-color:#D9D9D9; border-bottom-style:solid; border-bottom-width:1px; padding-left:5px;"><?php echo $data['email']; ?> </td> </tr> </table> <p style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #666; line-height: 20px; font-weight: normal; margin-top: 2.8em; margin-right: 0; margin-bottom: 3.8em; margin-left: 0;"><?php echo nl2p($data['message']); ?> </p> <p style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #666; line-height: 20px; font-weight: normal; margin-top: 0.8em; margin-right: 0; margin-bottom: 0.8em; margin-left: 0;"> Created on <?php echo date('F d, Y'); ?> </p> <!-- END CONTENT -->
$paragraphs .= $mystr; //'<p class="app-item">' . $mystr . '</p>'; } return $paragraphs; } $email = $_SESSION['email']; $reg = $_POST["registration"]; $rowId = $_POST["rowid"]; $reqTime = intval($_POST["reqtime"]); include_once '../db_functions.php'; $db = new DB_Functions(); if (!$db->userDeviceVerify($rowId, $email)) { header($_SERVER["SERVER_PROTOCOL"] . " 507 User Not Authorized for Device"); exit; } $updTime = 1; $updTime = $db->getAppsUpdateTime($reg); error_log("rtime " . $reqTime); error_log("updTime " . $updTime); if ($reqTime > $updTime) { header($_SERVER["SERVER_PROTOCOL"] . " 204 No Content"); exit; } header($_SERVER["SERVER_PROTOCOL"] . " 200 OK"); $appList = $db->getInstalledApps($reg); if ($appList == "") { echo ""; exit; } $xdata = nl2p($appList); echo $xdata;
/** * Private function trying to detect, if the text is html or plain. If it is plain, it converts \n to <p> * @param string $text text to convert */ function universal_autohtml(&$text) { global $serendipity; if (empty($text)) { return $text; } $text = trim($text); if (!serendipity_db_bool($serendipity['xmlrpc_htmlconvert'])) { return $text; } // if no p or br formatting is found, add it. if (!preg_match('@<p(.*)>@Usi', $text) && !preg_match('@</p>@Usi', $text) && !preg_match('@<br/?>@Usi', $text)) { $text = nl2p($text); $text = str_replace("\n", "", $text); // strip nl's in order not to have the nl2br plugin responding. } return $text; }
} rss_feed(); } elseif (isset($_GET['f_index'])) { // RDF for forum index $f_index = $_GET['f_index']; // get topic index $sql = 'SELECT' . " `id`, `tid`, `title`, DATE_FORMAT(`date`, '%Y-%m-%dT%T') as `date`, `comment`" . " FROM `{$forum_table}` WHERE `parent_key` = 1 ORDER BY `mod` DESC LIMIT " . $cfg['topic_max']; $res = mysql_query($sql); $rdf_about_uri = 'http://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'rss/1.0.php?f_index'; $items = ''; $item = ''; while ($row = mysql_fetch_array($res)) { // Convert retrieved data into UTF-8. $row = convert_to_utf8($row); $link = 'http://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'forum/topic.php?tid=' . $row['tid'] . '&p=0'; $items .= '<rdf:li rdf:resource="' . $link . '" />' . "\n"; $item .= "<item>\n" . '<title>' . htmlspecialchars($row['title']) . "</title>\n" . '<link>' . $link . "</link>\n"; // Just replace "<foo>" tag code into <foo> // -- this looks better in NetNewsWire RSS Viewer. $row['comment'] = str_replace("./resources/", 'http://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'resources/', $row['comment']); // Trim "comment" data for description $description = htmlspecialchars(mb_substr(strip_tags($row['comment']), 0, 125, 'UTF-8')) . '...'; // This is for "content module" $content_encoded = '<![CDATA[' . "\n" . nl2p(htmlspecialchars($row['comment'])) . "\n" . ']]>'; //$content_encoded = htmlspecialchars($row['comment']); $tz = tz(); $item .= '<dc:date>' . $row['date'] . $tz . "</dc:date>\n" . '<description>' . $description . "</description>\n" . '<content:encoded>' . "\n" . $content_encoded . "\n" . '</content:encoded>' . "\n" . "</item>\n"; } rss_feed(); } }