Use bbcode

svn path=/trunk/boinc/; revision=6147
This commit is contained in:
Janus B. Kristensen 2005-05-13 19:14:19 +00:00
parent 1b7975ad33
commit cc8b10f067
3 changed files with 39 additions and 3 deletions

33
html/user/bbcode.php Normal file
View File

@ -0,0 +1,33 @@
<?php
require_once("../inc/util.inc");
page_head("BBCode tags");
?>
<p>BBCode tags are a way to specify what kind of formatting you want where on various
pages on this project. It's similar to HTML, although simplified for use here. The
tags start with a [ (where you would have used &lt; in HTML) and stop with ] (where
you would have used &gt; in HTML).</p>
<p>Examples:</p>
<ul>
<li>[b]Bold[/b] to <b>Bold</b></li>
<li>[i]Italic[/i] to <i>Italic</i></li>
<li>[u]Underline[/u] to <u>Underline</u></li>
<li>[size=15]Big text[/size] to <span style="font-size: 15px">Big text</span></li>
<li>[color=red]Red text[/color] to <font color="red">Red text</font></li>
<li>[url=http://google.com/]Google[/url] to <a href="http://google.com/">Google</a></li>
<li>[quote]Quoted[/quote] for quoted blocks of text</li>
<li>[img]http://some.web.site/pic.jpg[/img] to display an image</li>
<li>[code]Code snippet here[/code] to display some code</li>
<li>[pre]Pre-formatted text here[/pre] to display some pre-formatted text</li>
</ul>
<p>Lists are also possible:<br/>[list]<br/>*Item 1<br/>*Item 2<br/>[/list] to:</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<p>Please note if you mess up and don't close a tag or don't specify a parameter
correctly, the raw tag itself will display instead of the formatted text.</p>
<?
page_tail();
?>

View File

@ -6,6 +6,7 @@ require_once('../inc/util.inc');
db_init();
$logged_in_user = get_logged_in_user();
$logged_in_user = getForumPreferences($logged_in_user);
// decorate object with forum preference info (uses DB)
// needed to see if user is 'special'.
@ -31,7 +32,8 @@ if ($_POST['submit']) {
exit();
}
if ($logged_in_user->id != $post->user) {
// Can't edit other's posts.
//if (!(isSpecialUser($logged_in_user,0)) && ($logged_in_user->id != $post->user)) {
// Can't edit other's posts unless you're a moderator
echo "You are not authorized to edit this post.";
exit();
}
@ -57,7 +59,8 @@ if (!$is_spec && (time() > $post->timestamp + MAXIMUM_EDIT_TIME)){
}
if ($logged_in_user->id != $post->user) {
// Can't edit other's posts.
//if (!(isSpecialUser($logged_in_user,0)) && ($logged_in_user->id != $post->user)) {
// Can't edit other's posts unless you're a moderator
echo "You are not authorized to edit this post.";
exit();
}

View File

@ -153,7 +153,7 @@ function show_message_row($thread, $category, $post=NULL) {
function quote_text($text, $cols = 0) {
/* $cols is depricated. */
$text = "<blockquote>" . $text . "</blockquote>";
$text = "[quote]" . $text . "[/quote]";
return $text;
}
?>