$order[$QUERY['task_id'][$i]] = $QUERY['sort_order'][$i]; } $Task->reOrder($order); $QUERY['action'] = 'change_order'; } //We bring in the pager. $options = array(); if (isset($_REQUEST['project'])) { $options['project'] = $_REQUEST['project']; } if (isset($_REQUEST['contexts'])) { $options['contexts'] = $_REQUEST['contexts']; } $pager = new SqlPager($qry_tasks, 10); $tasks = $pager->getPage(); $bbcode = new BBcode(); //Get the project name and context names into the $tasks array for ($i = 0; $i < count($tasks); $i++) { $tasks[$i]['project_name'] = $projects[$tasks[$i]['project_id']]; $tasks[$i]['contexts'] = $sql->getCol("SELECT context_id FROM {$config['db_prefix']}TaskContext WHERE task_id=" . $tasks[$i]['id']); $tasks[$i]['description'] = $bbcode->Parse($tasks[$i]['description']); } //Change Order Settings $change_order = false; $colspan = 6; if (isset($QUERY['action']) and $QUERY['action'] == 'change_order') { $colspan = 7; $change_order = true; } $template->addResource('bbcode.css', 'css'); $template->addResource('bbcode.js', 'js');
function bbcode_parse($str, $action = NULL, $uid = NULL) { $bbcode = new BBcode; return $bbcode->parse($str, $action, $uid); }
<?php include '../common.php'; include '../includes/classes/SqlPager.php'; //Show all the reminders in this month $reminder_qry = "SELECT id,name,created_on,day,description FROM {$config['db_prefix']}Reminder " . " WHERE MONTH(CURDATE())=MONTH(day) AND day>=CURDATE()" . " AND user_id='{$_SESSION['user']}' ORDER BY day"; $pager = new SqlPager($reminder_qry, 10); $reminders = $pager->getPage(); // Convert bbcode to html $bbcode = new BBcode(); for ($i = 0; $i < count($reminders); $i++) { $reminders[$i]['description'] = $bbcode->Parse($reminders[$i]['description']); } $template->addResource('bbcode.css', 'css'); $template->addResource('bbcode.js', 'js'); $template->addResource('_list.js', 'js'); $template->addResource('reminders/list.css', 'css'); $template->addResource('reminders/list.js', 'js'); render();
<div class="form-group"> <label for="comment">Message:</label> <textarea class="form-control" rows="5" id="comment" placeholder="Content" name = "content"></textarea> </div> </div> <div class="modal-footer"> <input name ="post" class="btn btn-info" type = "submit" value="Post"> </form> <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> </div> </div> </div> </div> <?php require_once "lib/bb/nbbc.php"; $bbcode = new BBcode(); $sql = "SELECT * FROM content ORDER BY id DESC"; $res = mysqli_query($dbConnect, $sql) or die(mysqli_error()); $post = ""; if (mysqli_num_rows($res) > 0) { while ($row = mysqli_fetch_assoc($res)) { $id = $row['id']; $title = $row['title']; $content = $row['content']; $date = $row['date']; $output = $bbcode->Parse($content); $post .= "<div class = 'alert alert-info'><h3>{$title}</h3><hr><h5>Date: {$date}</h5><hr><p>{$output}</p></div>"; } echo $post; } else { echo "There are no results";