Empty commit

This commit is contained in:
Git 2013-12-12 08:01:01 +00:00
parent ad53564f19
commit 2f5b14f13a
70 changed files with 240 additions and 381 deletions

View File

@ -27,7 +27,6 @@ public static function render_comments($Thread, $LastRead, $Baselink) {
* @todo Find a better way to pass the page (artist, collages, requests, torrents) to this function than extracting it from $Link
*/
function render_comment($AuthorID, $PostID, $Body, $AddedTime, $EditedUserID, $EditedTime, $Link, $Unread = false, $Header = '', $Tools = true) {
global $Text; // TODO: convert Text class to static and get rid of this crap
$UserInfo = Users::user_info($AuthorID);
$Header = '<strong>' . Users::format_username($AuthorID, true, true, true, true, false) . '</strong> ' . time_diff($AddedTime) . $Header;
?>
@ -76,7 +75,7 @@ function render_comment($AuthorID, $PostID, $Body, $AddedTime, $EditedUserID, $E
<? } ?>
<td class="body" valign="top">
<div id="content<?=$PostID?>">
<?=$Text->full_format($Body)?>
<?=Text::full_format($Body)?>
<? if ($EditedUserID) { ?>
<br />
<br />

View File

@ -97,7 +97,6 @@ public static function render_donor_stats($UserID) {
}
public static function render_profile_rewards($EnabledRewards, $ProfileRewards) {
$Text = new Text;
for ($i = 1; $i <= 4; $i++) {
if (isset($EnabledRewards['HasProfileInfo' . $i]) && $ProfileRewards['ProfileInfo' . $i]) {
?>
@ -107,7 +106,7 @@ public static function render_profile_rewards($EnabledRewards, $ProfileRewards)
<span style="float: right;"><a href="#" onclick="$('#profilediv_<?=$i?>').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); return false;" class="brackets">Hide</a></span>
</div>
<div class="pad profileinfo" id="profilediv_<?=$i?>">
<? echo $Text->full_format($ProfileRewards['ProfileInfo' . $i]); ?>
<? echo Text::full_format($ProfileRewards['ProfileInfo' . $i]); ?>
</div>
</div>
<?

View File

@ -14,7 +14,6 @@ public static function render_linkbox() {
}
public static function render_events($Events) {
$Text = new Text;
$Categories = SiteHistory::get_categories();
$SubCategories = SiteHistory::get_sub_categories();
$CanEdit = check_perms('users_mod') ;
@ -44,7 +43,7 @@ public static function render_events($Events) {
</div>
<? if (!empty($Event['Body'])) { ?>
<div class="body">
<?=$Text->full_format($Event['Body'])?>
<?=Text::full_format($Event['Body'])?>
</div>
<? } ?>
</div>

View File

@ -1,10 +1,17 @@
<?
class TEXT {
// tag=>max number of attributes
private $ValidTags = array('b'=>0, 'u'=>0, 'i'=>0, 's'=>0, '*'=>0, '#'=>0, 'artist'=>0, 'user'=>0, 'n'=>0, 'inlineurl'=>0, 'inlinesize'=>1, 'headline'=>1, 'align'=>1, 'color'=>1, 'colour'=>1, 'size'=>1, 'url'=>1, 'img'=>1, 'quote'=>1, 'pre'=>1, 'code'=>1, 'tex'=>0, 'hide'=>1, 'plain'=>0, 'important'=>0, 'torrent'=>0, 'rule'=>0, 'mature'=>1,
class Text {
/**
* Array of valid tags; tag => max number of attributes
* @var array $ValidTags
*/
private static $ValidTags = array('b'=>0, 'u'=>0, 'i'=>0, 's'=>0, '*'=>0, '#'=>0, 'artist'=>0, 'user'=>0, 'n'=>0, 'inlineurl'=>0, 'inlinesize'=>1, 'headline'=>1, 'align'=>1, 'color'=>1, 'colour'=>1, 'size'=>1, 'url'=>1, 'img'=>1, 'quote'=>1, 'pre'=>1, 'code'=>1, 'tex'=>0, 'hide'=>1, 'plain'=>0, 'important'=>0, 'torrent'=>0, 'rule'=>0, 'mature'=>1,
);
private $Smileys = array(
/**
* Array of smilies; code => image file in STATIC_SERVER/common/smileys
* @var array $Smileys
*/
private static $Smileys = array(
':angry:' => 'angry.gif',
':-D' => 'biggrin.gif',
':D' => 'biggrin.gif',
@ -53,22 +60,40 @@ class TEXT {
':wub:' => 'wub.gif',
);
private $NoImg = 0; // If images should be turned into URLs
/**
* Processed version of the $Smileys array, see {@link smileys}
* @var array $ProcessedSmileys
*/
private static $ProcessedSmileys = array();
private $Levels = 0;
/**
* Whether or not to turn images into URLs (used inside [quote] tags).
* This is an integer reflecting the number of levels we're doing that
* transition, i.e. images will only be displayed as images if $NoImg <= 0.
* By setting this variable to a negative number you can delay the
* transition to a deeper level of quotes.
* @var int $NoImg
*/
private static $NoImg = 0;
/**
* Internal counter for the level of recursion in to_html
* @var int $Levels
*/
private static $Levels = 0;
/**
* The maximum amount of nesting allowed (exclusive)
* In reality n-1 nests are shown.
* @var int $MaximumNests
*/
private $MaximumNests = 10;
private static $MaximumNests = 10;
/**
* Used to detect and disable parsing (e.g. TOC) within quotes
* @var int $InQuotes
*/
private $InQuotes = 0;
private static $InQuotes = 0;
/**
* Used to [hide] quote trains starting with the specified depth (inclusive)
@ -79,42 +104,31 @@ class TEXT {
* effectively overrides this variable, if $MaximumNests is less than the value
* of $NestsBeforeHide.
*/
private $NestsBeforeHide = 10;
private static $NestsBeforeHide = 10;
/**
* Array of headlines for Table Of Contents (TOC)
* @var array $HeadLines
*/
private $Headlines;
private static $Headlines;
/**
* Counter for making headline URLs unique
* @var int $HeadLines
*/
private $HeadlineID = 0;
private static $HeadlineID = 0;
/**
* Depth
* @var array $HeadlineLevels
*/
private $HeadlineLevels = array('1', '2', '3', '4');
private static $HeadlineLevels = array('1', '2', '3', '4');
/**
* TOC enabler
* @var bool $TOC
*/
private $TOC;
/**
* @param bool $TOC When used, will enabled TOC
*/
public function __construct ($TOC = false) {
$this->TOC = (boolean)$TOC;
foreach ($this->Smileys as $Key=>$Val) {
$this->Smileys[$Key] = '<img border="0" src="'.STATIC_SERVER.'common/smileys/'.$Val.'" alt="" />';
}
reset($this->Smileys);
}
public static $TOC = false;
/**
* Output BBCode as XHTML
@ -123,9 +137,9 @@ public function __construct ($TOC = false) {
* @param int $Min See {@link parse_toc}
* @return string
*/
public function full_format ($Str, $OutputTOC = true, $Min = 3) {
public static function full_format($Str, $OutputTOC = true, $Min = 3) {
$Str = display_str($Str);
$this->Headlines = array();
self::$Headlines = array();
//Inline links
$URLPrefix = '(\[url\]|\[url\=|\[img\=|\[img\])';
@ -135,7 +149,7 @@ public function full_format ($Str, $OutputTOC = true, $Min = 3) {
$callback = create_function('$matches', 'return str_replace("[inlineurl]", "", $matches[0]);');
$Str = preg_replace_callback('/(?<=\[inlineurl\]|'.$URLPrefix.')(\S*\[inlineurl\]\S*)/m', $callback, $Str);
if ($this->TOC) {
if (self::$TOC) {
$Str = preg_replace('/(\={5})([^=].*)\1/i', '[headline=4]$2[/headline]', $Str);
$Str = preg_replace('/(\={4})([^=].*)\1/i', '[headline=3]$2[/headline]', $Str);
$Str = preg_replace('/(\={3})([^=].*)\1/i', '[headline=2]$2[/headline]', $Str);
@ -146,34 +160,26 @@ public function full_format ($Str, $OutputTOC = true, $Min = 3) {
$Str = preg_replace('/(\={2})([^=].*)\1/i', '[inlinesize=7]$2[/inlinesize]', $Str);
}
$Str = $this->parse($Str);
$HTML = nl2br(self::to_html(self::parse($Str)));
$HTML = $this->to_html($Str);
$HTML = nl2br($HTML);
if ($this->TOC && $OutputTOC)
$HTML = $this->parse_toc($Min) . $HTML;
if (self::$TOC && $OutputTOC) {
$HTML = self::parse_toc($Min) . $HTML;
}
return $HTML;
}
public function strip_bbcode ($Str) {
public static function strip_bbcode($Str) {
$Str = display_str($Str);
//Inline links
$Str = preg_replace('/(?<!(\[url\]|\[url\=|\[img\=|\[img\]))http(s)?:\/\//i', '$1[inlineurl]http$2://', $Str);
$Str = $this->parse($Str);
$Str = $this->raw_text($Str);
$Str = nl2br($Str);
return $Str;
return nl2br(self::raw_text(self::parse($Str)));
}
private function valid_url ($Str, $Extension = '', $Inline = false) {
private static function valid_url($Str, $Extension = '', $Inline = false) {
$Regex = '/^';
$Regex .= '(https?|ftps?|irc):\/\/'; // protocol
$Regex .= '(\w+(:\w+)?@)?'; // user:pass@
@ -201,7 +207,7 @@ private function valid_url ($Str, $Extension = '', $Inline = false) {
return preg_match($Regex, $Str, $Matches);
}
public function local_url($Str) {
public static function local_url($Str) {
$URLInfo = parse_url($Str);
if (!$URLInfo) {
return false;
@ -242,7 +248,7 @@ public function local_url($Str) {
1b) If the next tag isn't where the pointer is, write everything up to there to a text block.
2) See if it's a [[wiki-link]] or an ordinary tag, and get the tag name
3) If it's not a wiki link:
3a) check it against the $this->ValidTags array to see if it's actually a tag and not [bullshit]
3a) check it against the self::$ValidTags array to see if it's actually a tag and not [bullshit]
If it's [not a tag], just leave it as plaintext and move on
3b) Get the attribute, if it exists [name=attribute]
4) Move the pointer past the end of the tag
@ -266,7 +272,7 @@ public function local_url($Str) {
7) Increment array pointer, start again (past the end of the [/close] tag)
*/
private function parse ($Str) {
private static function parse($Str) {
$i = 0; // Pointer to keep track of where we are in $Str
$Len = strlen($Str);
$Array = array();
@ -303,15 +309,15 @@ private function parse ($Str) {
$WikiLink = false;
$TagName = strtolower(substr($Tag[2][0], 1));
//3a) check it against the $this->ValidTags array to see if it's actually a tag and not [bullshit]
if (!isset($this->ValidTags[$TagName])) {
//3a) check it against the self::$ValidTags array to see if it's actually a tag and not [bullshit]
if (!isset(self::$ValidTags[$TagName])) {
$Array[$ArrayPos] = substr($Str, $i, ($TagPos - $i) + strlen($Tag[0][0]));
$i = $TagPos + strlen($Tag[0][0]);
++$ArrayPos;
continue;
}
$MaxAttribs = $this->ValidTags[$TagName];
$MaxAttribs = self::$ValidTags[$TagName];
// 3b) Get the attribute, if it exists [name=attribute]
if (!empty($Tag[3][0])) {
@ -424,11 +430,11 @@ private function parse ($Str) {
if (empty($Attrib)) { // [url]http://...[/url] - always set URL to attribute
$Array[$ArrayPos] = array('Type'=>'url', 'Attr'=>$Block, 'Val'=>'');
} else {
$Array[$ArrayPos] = array('Type'=>'url', 'Attr'=>$Attrib, 'Val'=>$this->parse($Block));
$Array[$ArrayPos] = array('Type'=>'url', 'Attr'=>$Attrib, 'Val'=>self::parse($Block));
}
break;
case 'quote':
$Array[$ArrayPos] = array('Type'=>'quote', 'Attr'=>$this->Parse($Attrib), 'Val'=>$this->parse($Block));
$Array[$ArrayPos] = array('Type'=>'quote', 'Attr'=>self::parse($Attrib), 'Val'=>self::parse($Block));
break;
case 'img':
case 'image':
@ -484,10 +490,10 @@ private function parse ($Str) {
$Array[$ArrayPos] = array('Type'=>$TagName, 'Val'=>$Block);
break;
case 'hide':
$Array[$ArrayPos] = array('Type'=>'hide', 'Attr'=>$Attrib, 'Val'=>$this->parse($Block));
$Array[$ArrayPos] = array('Type'=>'hide', 'Attr'=>$Attrib, 'Val'=>self::parse($Block));
break;
case 'mature':
$Array[$ArrayPos] = array('Type'=>'mature', 'Attr'=>$Attrib, 'Val'=>$this->parse($Block));
$Array[$ArrayPos] = array('Type'=>'mature', 'Attr'=>$Attrib, 'Val'=>self::parse($Block));
break;
case '#':
case '*':
@ -496,7 +502,7 @@ private function parse ($Str) {
$Array[$ArrayPos]['ListType'] = $TagName === '*' ? 'ul' : 'ol';
$Array[$ArrayPos]['Tag'] = $TagName;
foreach ($Array[$ArrayPos]['Val'] as $Key=>$Val) {
$Array[$ArrayPos]['Val'][$Key] = $this->parse(trim($Val));
$Array[$ArrayPos]['Val'][$Key] = self::parse(trim($Val));
}
break;
case 'n':
@ -509,7 +515,7 @@ private function parse ($Str) {
// Basic tags, like [b] or [size=5]
$Array[$ArrayPos] = array('Type'=>$TagName, 'Val'=>$this->parse($Block));
$Array[$ArrayPos] = array('Type'=>$TagName, 'Val'=>self::parse($Block));
if (!empty($Attrib) && $MaxAttribs > 0) {
$Array[$ArrayPos]['Attr'] = strtolower($Attrib);
}
@ -525,19 +531,19 @@ private function parse ($Str) {
* Generates a navigation list for TOC
* @param int $Min Minimum number of headlines required for a TOC list
*/
public function parse_toc ($Min = 3) {
if (count($this->Headlines) > $Min) {
public static function parse_toc ($Min = 3) {
if (count(self::$Headlines) > $Min) {
$list = '<ol class="navigation_list">';
$i = 0;
$level = 0;
$off = 0;
foreach ($this->Headlines as $t) {
foreach (self::$Headlines as $t) {
$n = (int)$t[0];
if ($i === 0 && $n > 1) {
$off = $n - $level;
}
$this->headline_level($n, $level, $list, $i, $off);
self::headline_level($n, $level, $list, $i, $off);
$list .= sprintf('<li><a href="#%2$s">%1$s</a>', $t[1], $t[2]);
$level = $t[0];
$off = 0;
@ -568,7 +574,7 @@ public function parse_toc ($Min = 3) {
* @param int $i Iterator digit
* @param int $Offset If the list doesn't start at level 1
*/
private function headline_level (&$ItemLevel, &$Level, &$List, $i, &$Offset) {
private static function headline_level (&$ItemLevel, &$Level, &$List, $i, &$Offset) {
if ($ItemLevel < $Level) {
$diff = $Level - $ItemLevel;
$List .= '</li>' . str_repeat('</ol></li>', $diff);
@ -585,9 +591,9 @@ private function headline_level (&$ItemLevel, &$Level, &$List, $i, &$Offset) {
}
}
private function to_html ($Array) {
private static function to_html ($Array) {
global $SSL;
$this->Levels++;
self::$Levels++;
/*
* Hax prevention
* That's the original comment on this.
@ -601,31 +607,31 @@ private function to_html ($Array) {
* tags should always be limiting ahead of this line.
* (Larger than vs. smaller than.)
*/
if ($this->Levels > $this->MaximumNests) {
if (self::$Levels > self::$MaximumNests) {
return $Block['Val']; // Hax prevention, breaks upon exceeding nests.
}
$Str = '';
foreach ($Array as $Block) {
if (is_string($Block)) {
$Str .= $this->smileys($Block);
$Str .= self::smileys($Block);
continue;
}
if ($this->Levels < $this->MaximumNests) {
if (self::$Levels < self::$MaximumNests) {
switch ($Block['Type']) {
case 'b':
$Str .= '<strong>'.$this->to_html($Block['Val']).'</strong>';
$Str .= '<strong>'.self::to_html($Block['Val']).'</strong>';
break;
case 'u':
$Str .= '<span style="text-decoration: underline;">'.$this->to_html($Block['Val']).'</span>';
$Str .= '<span style="text-decoration: underline;">'.self::to_html($Block['Val']).'</span>';
break;
case 'i':
$Str .= '<span style="font-style: italic;">'.$this->to_html($Block['Val'])."</span>";
$Str .= '<span style="font-style: italic;">'.self::to_html($Block['Val'])."</span>";
break;
case 's':
$Str .= '<span style="text-decoration: line-through;">'.$this->to_html($Block['Val']).'</span>';
$Str .= '<span style="text-decoration: line-through;">'.self::to_html($Block['Val']).'</span>';
break;
case 'important':
$Str .= '<strong class="important_text">'.$this->to_html($Block['Val']).'</strong>';
$Str .= '<strong class="important_text">'.self::to_html($Block['Val']).'</strong>';
break;
case 'user':
$Str .= '<a href="user.php?action=search&amp;search='.urlencode($Block['Val']).'">'.$Block['Val'].'</a>';
@ -677,60 +683,60 @@ private function to_html ($Array) {
$Str .= "<$Block[ListType] class=\"postlist\">";
foreach ($Block['Val'] as $Line) {
$Str .= '<li>'.$this->to_html($Line).'</li>';
$Str .= '<li>'.self::to_html($Line).'</li>';
}
$Str .= '</'.$Block['ListType'].'>';
break;
case 'align':
$ValidAttribs = array('left', 'center', 'right');
if (!in_array($Block['Attr'], $ValidAttribs)) {
$Str .= '[align='.$Block['Attr'].']'.$this->to_html($Block['Val']).'[/align]';
$Str .= '[align='.$Block['Attr'].']'.self::to_html($Block['Val']).'[/align]';
} else {
$Str .= '<div style="text-align: '.$Block['Attr'].';">'.$this->to_html($Block['Val']).'</div>';
$Str .= '<div style="text-align: '.$Block['Attr'].';">'.self::to_html($Block['Val']).'</div>';
}
break;
case 'color':
case 'colour':
$ValidAttribs = array('aqua', 'black', 'blue', 'fuchsia', 'green', 'grey', 'lime', 'maroon', 'navy', 'olive', 'purple', 'red', 'silver', 'teal', 'white', 'yellow');
if (!in_array($Block['Attr'], $ValidAttribs) && !preg_match('/^#[0-9a-f]{6}$/', $Block['Attr'])) {
$Str .= '[color='.$Block['Attr'].']'.$this->to_html($Block['Val']).'[/color]';
$Str .= '[color='.$Block['Attr'].']'.self::to_html($Block['Val']).'[/color]';
} else {
$Str .= '<span style="color: '.$Block['Attr'].';">'.$this->to_html($Block['Val']).'</span>';
$Str .= '<span style="color: '.$Block['Attr'].';">'.self::to_html($Block['Val']).'</span>';
}
break;
case 'headline':
$text = $this->to_html($Block['Val']);
$raw = $this->raw_text($Block['Val']);
if (!in_array($Block['Attr'], $this->HeadlineLevels)) {
$text = self::to_html($Block['Val']);
$raw = self::raw_text($Block['Val']);
if (!in_array($Block['Attr'], self::$HeadlineLevels)) {
$Str .= sprintf('%1$s%2$s%1$s', str_repeat('=', $Block['Attr'] + 1), $text);
} else {
$id = '_' . crc32($raw . $this->HeadlineID);
if ($this->InQuotes === 0) {
$this->Headlines[] = array($Block['Attr'], $raw, $id);
$id = '_' . crc32($raw . self::$HeadlineID);
if (self::$InQuotes === 0) {
self::$Headlines[] = array($Block['Attr'], $raw, $id);
}
$Str .= sprintf('<h%1$d id="%3$s">%2$s</h%1$d>', ($Block['Attr'] + 2), $text, $id);
$this->HeadlineID++;
self::$HeadlineID++;
}
break;
case 'inlinesize':
case 'size':
$ValidAttribs = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10');
if (!in_array($Block['Attr'], $ValidAttribs)) {
$Str .= '[size='.$Block['Attr'].']'.$this->to_html($Block['Val']).'[/size]';
$Str .= '[size='.$Block['Attr'].']'.self::to_html($Block['Val']).'[/size]';
} else {
$Str .= '<span class="size'.$Block['Attr'].'">'.$this->to_html($Block['Val']).'</span>';
$Str .= '<span class="size'.$Block['Attr'].'">'.self::to_html($Block['Val']).'</span>';
}
break;
case 'quote':
$this->NoImg++; // No images inside quote tags
$this->InQuotes++;
if ($this->InQuotes == $this->NestsBeforeHide) { //Put quotes that are nested beyond the specified limit in [hide] tags.
self::$NoImg++; // No images inside quote tags
self::$InQuotes++;
if (self::$InQuotes == self::$NestsBeforeHide) { //Put quotes that are nested beyond the specified limit in [hide] tags.
$Str .= '<strong>Older quotes</strong>: <a href="javascript:void(0);" onclick="BBCode.spoiler(this);">Show</a>';
$Str .= '<blockquote class="hidden spoiler">';
}
if (!empty($Block['Attr'])) {
$Exploded = explode('|', $this->to_html($Block['Attr']));
$Exploded = explode('|', self::to_html($Block['Attr']));
if (isset($Exploded[1]) && (is_numeric($Exploded[1]) || (in_array($Exploded[1][0], array('a', 't', 'c', 'r')) && is_numeric(substr($Exploded[1], 1))))) {
// the part after | is either a number or starts with a, t, c or r, followed by a number (forum post, artist comment, torrent comment, collage comment or request comment, respectively)
$PostID = trim($Exploded[1]);
@ -740,22 +746,22 @@ private function to_html ($Array) {
$Str .= '<strong class="quoteheader">'.$Exploded[0].'</strong> wrote: ';
}
}
$Str .= '<blockquote>'.$this->to_html($Block['Val']).'</blockquote>';
if ($this->InQuotes == $this->NestsBeforeHide) { //Close quote the deeply nested quote [hide].
$Str .= '<blockquote>'.self::to_html($Block['Val']).'</blockquote>';
if (self::$InQuotes == self::$NestsBeforeHide) { //Close quote the deeply nested quote [hide].
$Str .= '</blockquote><br />'; // Ensure new line after quote train hiding
}
$this->NoImg--;
$this->InQuotes--;
self::$NoImg--;
self::$InQuotes--;
break;
case 'hide':
$Str .= '<strong>'.(($Block['Attr']) ? $Block['Attr'] : 'Hidden text').'</strong>: <a href="javascript:void(0);" onclick="BBCode.spoiler(this);">Show</a>';
$Str .= '<blockquote class="hidden spoiler">'.$this->to_html($Block['Val']).'</blockquote>';
$Str .= '<blockquote class="hidden spoiler">'.self::to_html($Block['Val']).'</blockquote>';
break;
case 'mature':
if (G::$LoggedUser['EnableMatureContent']) {
if (!empty($Block['Attr'])) {
$Str .= '<strong class="mature" style="font-size: 1.2em;">Mature content:</strong><strong> ' . $Block['Attr'] . '</strong><br /> <a href="javascript:void(0);" onclick="BBCode.spoiler(this);">Show</a>';
$Str .= '<blockquote class="hidden spoiler">'.$this->to_html($Block['Val']).'</blockquote>';
$Str .= '<blockquote class="hidden spoiler">'.self::to_html($Block['Val']).'</blockquote>';
}
else {
$Str .= '<strong>Use of the [mature] tag requires a description.</strong> The correct format is as follows: <strong>[mature=description] ...content... [/mature]</strong>, where "description" is a mandatory description of the post. Misleading descriptions will be penalized. For further information on our mature content policies, please refer to this <a href="wiki.php?action=article&amp;id=1063">wiki</a>.';
@ -766,14 +772,14 @@ private function to_html ($Array) {
}
break;
case 'img':
if ($this->NoImg > 0 && $this->valid_url($Block['Val'])) {
if (self::$NoImg > 0 && self::valid_url($Block['Val'])) {
$Str .= '<a rel="noreferrer" target="_blank" href="'.$Block['Val'].'">'.$Block['Val'].'</a> (image)';
break;
}
if (!$this->valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) {
if (!self::valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) {
$Str .= '[img]'.$Block['Val'].'[/img]';
} else {
$LocalURL = $this->local_url($Block['Val']);
$LocalURL = self::local_url($Block['Val']);
if ($LocalURL) {
$Str .= '<img class="scale_image" onclick="lightbox.init(this, $(this).width());" alt="'.$Block['Val'].'" src="'.$LocalURL.'" />';
} else {
@ -783,11 +789,11 @@ private function to_html ($Array) {
break;
case 'aud':
if ($this->NoImg > 0 && $this->valid_url($Block['Val'])) {
if (self::$NoImg > 0 && self::valid_url($Block['Val'])) {
$Str .= '<a rel="noreferrer" target="_blank" href="'.$Block['Val'].'">'.$Block['Val'].'</a> (audio)';
break;
}
if (!$this->valid_url($Block['Val'], '\.(mp3|ogg|wav)')) {
if (!self::valid_url($Block['Val'], '\.(mp3|ogg|wav)')) {
$Str .= '[aud]'.$Block['Val'].'[/aud]';
} else {
//TODO: Proxy this for staff?
@ -801,14 +807,14 @@ private function to_html ($Array) {
$Block['Val'] = $Block['Attr'];
$NoName = true; // If there isn't a Val for this
} else {
$Block['Val'] = $this->to_html($Block['Val']);
$Block['Val'] = self::to_html($Block['Val']);
$NoName = false;
}
if (!$this->valid_url($Block['Attr'])) {
if (!self::valid_url($Block['Attr'])) {
$Str .= '[url='.$Block['Attr'].']'.$Block['Val'].'[/url]';
} else {
$LocalURL = $this->local_url($Block['Attr']);
$LocalURL = self::local_url($Block['Attr']);
if ($LocalURL) {
if ($NoName) { $Block['Val'] = substr($LocalURL,1); }
$Str .= '<a href="'.$LocalURL.'">'.$Block['Val'].'</a>';
@ -819,14 +825,14 @@ private function to_html ($Array) {
break;
case 'inlineurl':
if (!$this->valid_url($Block['Attr'], '', true)) {
$Array = $this->parse($Block['Attr']);
if (!self::valid_url($Block['Attr'], '', true)) {
$Array = self::parse($Block['Attr']);
$Block['Attr'] = $Array;
$Str .= $this->to_html($Block['Attr']);
$Str .= self::to_html($Block['Attr']);
}
else {
$LocalURL = $this->local_url($Block['Attr']);
$LocalURL = self::local_url($Block['Attr']);
if ($LocalURL) {
$Str .= '<a href="'.$LocalURL.'">'.substr($LocalURL,1).'</a>';
} else {
@ -839,11 +845,11 @@ private function to_html ($Array) {
}
}
}
$this->Levels--;
self::$Levels--;
return $Str;
}
private function raw_text ($Array) {
private static function raw_text ($Array) {
$Str = '';
foreach ($Array as $Block) {
if (is_string($Block)) {
@ -862,7 +868,7 @@ private function raw_text ($Array) {
case 'quote':
case 'align':
$Str .= $this->raw_text($Block['Val']);
$Str .= self::raw_text($Block['Val']);
break;
case 'tex': //since this will never strip cleanly, just remove it
break;
@ -877,7 +883,7 @@ private function raw_text ($Array) {
break;
case 'list':
foreach ($Block['Val'] as $Line) {
$Str .= $Block['Tag'].$this->raw_text($Line);
$Str .= $Block['Tag'].self::raw_text($Line);
}
break;
@ -886,17 +892,17 @@ private function raw_text ($Array) {
if (empty($Block['Val'])) {
$Block['Val'] = $Block['Attr'];
} else {
$Block['Val'] = $this->raw_text($Block['Val']);
$Block['Val'] = self::raw_text($Block['Val']);
}
$Str .= $Block['Val'];
break;
case 'inlineurl':
if (!$this->valid_url($Block['Attr'], '', true)) {
$Array = $this->parse($Block['Attr']);
if (!self::valid_url($Block['Attr'], '', true)) {
$Array = self::parse($Block['Attr']);
$Block['Attr'] = $Array;
$Str .= $this->raw_text($Block['Attr']);
$Str .= self::raw_text($Block['Attr']);
}
else {
$Str .= $Block['Attr'];
@ -908,11 +914,17 @@ private function raw_text ($Array) {
return $Str;
}
private function smileys ($Str) {
private static function smileys($Str) {
if (!empty(G::$LoggedUser['DisableSmileys'])) {
return $Str;
}
$Str = strtr($Str, $this->Smileys);
if (count(self::$ProcessedSmileys) == 0 && count(self::$Smileys) > 0) {
foreach (self::$Smileys as $Key => $Val) {
self::$ProcessedSmileys[$Key] = '<img border="0" src="'.STATIC_SERVER.'common/smileys/'.$Val.'" alt="" />';
}
reset(self::$ProcessedSmileys);
}
$Str = strtr($Str, self::$ProcessedSmileys);
return $Str;
}
}
@ -932,7 +944,6 @@ function check_perms($Perm) {
==hi==[/pre]
====hi====
hi";
$Text = new TEXT;
echo $Text->full_format($Str);
echo Text::full_format($Str);
echo "\n"
*/

View File

@ -1,5 +1,8 @@
CHANGE LOG
2013-12-12 by Y
Transform Text into a static class
2013-12-10 by alderaan
Fix bug that would assign the "Log" flag to torrents that shouldn't have it

View File

@ -75,7 +75,8 @@ use underscores instead of spaces.
All statement blocks, including functions, shall have the opening brace
at the end of the same line with a space before the brace. The astute
reader will note that this is K&R style with the exception of functions.
reader will note that this is K&R style with the exception of the opening
brace in function definitions.
There shall be a space between a control structure statement (e.g. `if`,
`elseif` in PHP, `for`) and the following parenthesis.

View File

@ -1,7 +1,4 @@
<?
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
if (!$News = $Cache->get_value('news')) {
$DB->query("
SELECT
@ -52,7 +49,7 @@
'author' => $Author,
'title' => $Title,
'bbBody' => $Body,
'body' => $Text->full_format($Body),
'body' => Text::full_format($Body),
'blogTime' => $BlogTime,
'threadId' => (int)$ThreadID
);
@ -70,7 +67,7 @@
'newsId' => (int)$NewsID,
'title' => $Title,
'bbBody' => $Body,
'body' => $Text->full_format($Body),
'body' => Text::full_format($Body),
'newsTime' => $NewsTime
);
@ -83,5 +80,3 @@
'announcements' => $JsonAnnouncements,
'blogPosts' => $JsonBlog
));
?>

View File

@ -4,9 +4,6 @@ function compare($X, $Y) {
return($Y['count'] - $X['count']);
}
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
if (!empty($_GET['artistreleases'])) {
$OnlyArtistReleases = true;
}
@ -347,7 +344,7 @@ function compare($X, $Y) {
'notificationsEnabled' => $notificationsEnabled,
'hasBookmarked' => Bookmarks::has_bookmarked('artist', $ArtistID),
'image' => $Image,
'body' => $Text->full_format($Body),
'body' => Text::full_format($Body),
'vanityHouse' => $VanityHouseArtist == 1,
'tags' => array_values($Tags),
'similarArtists' => $JsonSimilar,

View File

@ -4,7 +4,6 @@
json_die("failure", "bad parameters");
}
$CollageID = $_GET['id'];
$Text = new TEXT;
$CacheKey = "collage_$CollageID";
$CollageData = $Cache->get_value($CacheKey);
@ -43,7 +42,7 @@
$JSON = array(
'id' => (int)$CollageID,
'name' => $Name,
'description' => $Text->full_format($Description),
'description' => Text::full_format($Description),
'creatorID' => (int)$CreatorID,
'deleted' => (bool)$Deleted,
'collageCategoryID' => (int)$CollageCategoryID,

View File

@ -11,9 +11,6 @@
//---------- Things to sort out before it can start printing/generating content
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
// Check for lame SQL injection attempts
if (!isset($_GET['threadid']) || !is_number($_GET['threadid'])) {
if (isset($_GET['topicid']) && is_number($_GET['topicid'])) {
@ -249,7 +246,7 @@
'postId' => (int)$PostID,
'addedTime' => $AddedTime,
'bbBody' => $Body,
'body' => $Text->full_format($Body),
'body' => Text::full_format($Body),
'editedUserId' => (int)$EditedUserID,
'editedTime' => $EditedTime,
'editedUsername' => $UserInfo['Username'],

View File

@ -1,7 +1,4 @@
<?
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
$ConvID = $_GET['id'];
if (!$ConvID || !is_number($ConvID)) {
print json_encode(array('status' => 'failure'));
@ -88,7 +85,7 @@
'sentDate' => $SentDate,
'avatar' => $Users[(int)$SenderID]['Avatar'],
'bbBody' => $Body,
'body' => $Text->full_format($Body)
'body' => Text::full_format($Body)
);
$JsonMessages[] = $JsonMessage;
}

View File

@ -1,5 +1,4 @@
<?php
<?
//Don't allow bigger queries than specified below regardless of called function
$SizeLimit = 10;
@ -10,8 +9,7 @@
json_die('failure');
}
include(SERVER_ROOT . '/classes/text.class.php');
$Text = new TEXT(true);
Text::$TOC = true;
global $DB;
$DB->query("
@ -32,9 +30,9 @@
$NewsResponse,
array(
$NewsID,
$Text->full_format($Title),
Text::full_format($Title),
time_diff($NewsTime),
$Text->full_format($Body)
Text::full_format($Body)
)
);
}

View File

@ -1,12 +1,10 @@
<?
/* AJAX Previews, simple stuff. */
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT(true);
Text::$TOC = true;
if (!empty($_POST['AdminComment'])) {
echo $Text->full_format($_POST['AdminComment']);
echo Text::full_format($_POST['AdminComment']);
} else {
$Content = $_REQUEST['body']; // Don't use URL decode.
echo $Text->full_format($Content);
echo Text::full_format($Content);
}

View File

@ -9,9 +9,6 @@
* This is the page that displays the request to the end user after being created.
*/
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
if (empty($_GET['id']) || !is_number($_GET['id'])) {
json_die("failure");
}
@ -104,7 +101,7 @@
'class' => Users::make_class_string($PermissionID),
'addedTime' => $AddedTime,
'avatar' => $Avatar,
'comment' => $Text->full_format($Body),
'comment' => Text::full_format($Body),
'editedUserId' => (int)$EditedUserID,
'editedUsername' => $EditedUsername,
'editedTime' => $EditedTime
@ -135,7 +132,7 @@
'year' => (int)$Request['Year'],
'image' => $Request['Image'],
'bbDescription' => $Request['Description'],
'description' => $Text->full_format($Request['Description']),
'description' => Text::full_format($Request['Description']),
'musicInfo' => $JsonMusicInfo,
'catalogueNumber' => $Request['CatalogueNumber'],
'releaseType' => (int)$Request['ReleaseType'],

View File

@ -7,9 +7,6 @@
json_die('failure');
}
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
if (isset($LoggedUser['PostsPerPage'])) {
$PerPage = $LoggedUser['PostsPerPage'];
} else {

View File

@ -1,7 +1,4 @@
<?
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
if (empty($_GET['id']) || !is_number($_GET['id'])) {
json_die("failure");
}
@ -17,7 +14,7 @@
'postId' => (int)$PostID,
'addedTime' => $AddedTime,
'bbBody' => $Body,
'body' => $Text->full_format($Body),
'body' => Text::full_format($Body),
'editedUserId' => (int)$EditedUserID,
'editedTime' => $EditedTime,
'editedUsername' => $EditedUsername,

View File

@ -1,7 +1,5 @@
<?
require(SERVER_ROOT.'/sections/torrents/functions.php');
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
$GroupAllowed = array('WikiBody', 'WikiImage', 'ID', 'Name', 'Year', 'RecordLabel', 'CatalogueNumber', 'ReleaseType', 'CategoryID', 'Time', 'VanityHouse');
$TorrentAllowed = array('ID', 'Media', 'Format', 'Encoding', 'Remastered', 'RemasterYear', 'RemasterTitle', 'RemasterRecordLabel', 'RemasterCatalogueNumber', 'Scene', 'HasLog', 'HasCue', 'LogScore', 'FileCount', 'Size', 'Seeders', 'Leechers', 'Snatched', 'FreeTorrent', 'Time', 'Description', 'FileList', 'FilePath', 'UserID', 'Username');
@ -65,7 +63,7 @@
}
$JsonTorrentDetails = array(
'wikiBody' => $Text->full_format($TorrentDetails['WikiBody']),
'wikiBody' => Text::full_format($TorrentDetails['WikiBody']),
'wikiImage' => $TorrentDetails['WikiImage'],
'id' => (int)$TorrentDetails['ID'],
'name' => $TorrentDetails['Name'],

View File

@ -2,9 +2,6 @@
require(SERVER_ROOT.'/sections/torrents/functions.php');
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
$GroupAllowed = array('WikiBody', 'WikiImage', 'ID', 'Name', 'Year', 'RecordLabel', 'CatalogueNumber', 'ReleaseType', 'CategoryID', 'Time', 'VanityHouse');
$TorrentAllowed = array('ID', 'Media', 'Format', 'Encoding', 'Remastered', 'RemasterYear', 'RemasterTitle', 'RemasterRecordLabel', 'RemasterCatalogueNumber', 'Scene', 'HasLog', 'HasCue', 'LogScore', 'FileCount', 'Size', 'Seeders', 'Leechers', 'Snatched', 'FreeTorrent', 'Time', 'Description', 'FileList', 'FilePath', 'UserID', 'Username');
@ -60,7 +57,7 @@
}
$JsonTorrentDetails = array(
'wikiBody' => $Text->full_format($TorrentDetails['WikiBody']),
'wikiBody' => Text::full_format($TorrentDetails['WikiBody']),
'wikiImage' => $TorrentDetails['WikiImage'],
'id' => (int)$TorrentDetails['ID'],
'name' => $TorrentDetails['Name'],

View File

@ -1,8 +1,4 @@
<?php
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
if (empty($_GET['id']) || !is_numeric($_GET['id'])) {
json_die("failure", "bad id parameter");
}
@ -312,7 +308,7 @@ function check_paranoia_here($Setting) {
'username' => $Username,
'avatar' => $Avatar,
'isFriend' => $Friend,
'profileText' => $Text->full_format($Info),
'profileText' => Text::full_format($Info),
'stats' => array(
'joinedDate' => $JoinDate,
'lastAccess' => $LastAccess,

View File

@ -15,11 +15,6 @@ function error_out($reason = '') {
error_out('You do not have access to the forums!');
}
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
$UserID = empty($_GET['userid']) ? $LoggedUser['ID'] : $_GET['userid'];
if (!is_number($UserID)) {
error_out('User does not exist!');
@ -170,7 +165,7 @@ function error_out($reason = '') {
'locked' => $Locked === '1',
'sticky' => $Sticky === '1',
'addedTime' => $AddedTime,
'body' => $Text->full_format($Body),
'body' => Text::full_format($Body),
'bbbody' => $Body,
'editedUserId' => (int)$EditedUserID,
'editedTime' => $EditedTime,

View File

@ -1,7 +1,5 @@
<?
include(SERVER_ROOT . '/classes/text.class.php');
include(SERVER_ROOT . '/classes/alias.class.php');
$Text = new TEXT(true);
$Alias = new ALIAS;
@ -26,7 +24,8 @@
json_die("failure", "higher user class required to view article");
}
$TextBody = $Text->full_format($Body, false);
Text::$TOC = true;
$TextBody = Text::full_format($Body, false);
json_die("success", array(
'title' => $Title,
@ -38,4 +37,3 @@
'date' => $Date,
'revision' => (int)$Revision
));
?>

View File

@ -6,9 +6,6 @@ function compare($X, $Y) {
return($Y['count'] - $X['count']);
}
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
// Similar Artist Map
include(SERVER_ROOT.'/classes/artists_similar.class.php');
@ -943,7 +940,7 @@ function require(file, callback) {
<strong>Artist Information</strong>
<a href="#" class="brackets" onclick="$('#body').gtoggle(); return false;">Toggle</a>
</div>
<div id="body" class="body"><?=$Text->full_format($Body)?></div>
<div id="body" class="body"><?=Text::full_format($Body)?></div>
</div>
<?
if (defined('LASTFM_API_KEY')) {

View File

@ -3,8 +3,6 @@
define('ANNOUNCEMENT_FORUM_ID', 19);
View::show_header('Blog','bbcode');
require(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
if (check_perms('admin_manage_blog')) {
if (!empty($_REQUEST['action'])) {
@ -182,7 +180,7 @@
<? } ?>
</div>
<div class="pad">
<?=$Text->full_format($Body)?>
<?=Text::full_format($Body)?>
<? if ($ThreadID) { ?>
<br /><br />
<em><a href="forums.php?action=viewthread&amp;threadid=<?=$ThreadID?>">Discuss this post here</a></em>

View File

@ -1,6 +1,5 @@
<?
include(SERVER_ROOT.'/classes/feed.class.php'); // RSS feeds
include(SERVER_ROOT.'/classes/text.class.php'); // strip_bbcode
authorize();
@ -8,7 +7,6 @@
error(404);
}
$Feed = new FEED;
$Text = new TEXT;
$Type = $_GET['type'];
@ -86,7 +84,7 @@
$UploaderInfo = Users::user_info($UploaderID);
$Item = $Feed->item($Title,
$Text->strip_bbcode($Body),
Text::strip_bbcode($Body),
'torrents.php?action=download&amp;authkey=[[AUTHKEY]]&amp;torrent_pass=[[PASSKEY]]&amp;id='.$TorrentID,
$UploaderInfo['Username'],
"torrents.php?id=$PageID",

View File

@ -10,9 +10,6 @@
//---------- Things to sort out before it can start printing/generating content
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
// Check for lame SQL injection attempts
if (!is_number($_GET['collageid'])) {
error(0);

View File

@ -129,7 +129,7 @@
</div>
<div class="box box_description">
<div class="head"><strong>Description</strong></div>
<div class="pad"><?=$Text->full_format($Description)?></div>
<div class="pad"><?=Text::full_format($Description)?></div>
</div>
<div class="box box_info box_statistics_collage_torrents">
<div class="head"><strong>Statistics</strong></div>
@ -220,7 +220,7 @@
<br />
<a href="reports.php?action=report&amp;type=collages_comment&amp;id=<?=$CommentID?>" class="brackets">Report</a>
</div>
<div class="pad"><?=$Text->full_format($Body)?></div>
<div class="pad"><?=Text::full_format($Body)?></div>
</div>
<?
}

View File

@ -1,9 +1,6 @@
<?php
define('COLLAGES_PER_PAGE', 25);
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
list($Page, $Limit) = Format::page_limit(COLLAGES_PER_PAGE);

View File

@ -7,7 +7,6 @@
error(0);
}
$CollageID = $_GET['id'];
$Text = new TEXT;
$CollageData = $Cache->get_value("collage_$CollageID");
if ($CollageData) {

View File

@ -343,7 +343,7 @@ function compare($X, $Y) {
</div>
<div class="box box_description">
<div class="head"><strong>Description</strong></div>
<div class="pad"><?=$Text->full_format($Description)?></div>
<div class="pad"><?=Text::full_format($Description)?></div>
</div>
<?
if (check_perms('zip_downloader')) {
@ -532,7 +532,7 @@ function compare($X, $Y) {
<br />
<a href="reports.php?action=report&amp;type=collages_comment&amp;id=<?=$CommentID?>" class="brackets">Report</a>
</div>
<div class="pad"><?=$Text->full_format($Body)?></div>
<div class="pad"><?=Text::full_format($Body)?></div>
</div>
<?
}

View File

@ -13,9 +13,6 @@
* If missing or invalid, this defaults to the comments one made
*/
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
// User ID
if (isset($_GET['id']) && is_number($_GET['id'])) {
$UserID = (int)$_GET['id'];

View File

@ -1,9 +1,6 @@
<?
authorize();
include(SERVER_ROOT . '/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
if (!isset($_POST['postid']) || !is_number($_POST['postid']) || !isset($_POST['body']) || trim($_POST['body']) === '') {
error(0);
}
@ -15,4 +12,4 @@
Comments::edit((int)$_POST['postid'], $_POST['body']);
// This gets sent to the browser, which echoes it in place of the old body
echo $Text->full_format($_POST['body']);
echo Text::full_format($_POST['body']);

View File

@ -45,8 +45,6 @@
$Feed->open_feed();
switch ($_GET['feed']) {
case 'feed_news':
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
$Feed->channel('News', 'RSS feed for site news.');
if (!$News = $Cache->get_value('news')) {
require(SERVER_ROOT.'/classes/mysql.class.php'); //Require the database wrapper
@ -69,15 +67,13 @@
if (strtotime($NewsTime) >= time()) {
continue;
}
echo $Feed->item($Title, $Text->strip_bbcode($Body), "index.php#news$NewsID", SITE_NAME.' Staff', '', '', $NewsTime);
echo $Feed->item($Title, Text::strip_bbcode($Body), "index.php#news$NewsID", SITE_NAME.' Staff', '', '', $NewsTime);
if (++$Count > 4) {
break;
}
}
break;
case 'feed_blog':
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
$Feed->channel('Blog', 'RSS feed for site blog.');
if (!$Blog = $Cache->get_value('blog')) {
require(SERVER_ROOT.'/classes/mysql.class.php'); //Require the database wrapper
@ -100,9 +96,9 @@
foreach ($Blog as $BlogItem) {
list($BlogID, $Author, $Title, $Body, $BlogTime, $ThreadID) = $BlogItem;
if ($ThreadID) {
echo $Feed->item($Title, $Text->strip_bbcode($Body), 'forums.php?action=viewthread&amp;threadid='.$ThreadID, SITE_NAME.' Staff', '', '', $BlogTime);
echo $Feed->item($Title, Text::strip_bbcode($Body), 'forums.php?action=viewthread&amp;threadid='.$ThreadID, SITE_NAME.' Staff', '', '', $BlogTime);
} else {
echo $Feed->item($Title, $Text->strip_bbcode($Body), "blog.php#blog$BlogID", SITE_NAME.' Staff', '', '', $BlogTime);
echo $Feed->item($Title, Text::strip_bbcode($Body), "blog.php#blog$BlogID", SITE_NAME.' Staff', '', '', $BlogTime);
}
}
break;

View File

@ -20,9 +20,6 @@
}
$Type = $_GET['type'];
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
$Edits = $Cache->get_value($Type.'_edits_'.$PostID);
if (!is_array($Edits)) {
$DB->query("
@ -61,7 +58,7 @@
}
}
?>
<?=$Text->full_format($Body)?>
<?=Text::full_format($Body)?>
<br />
<br />

View File

@ -3,8 +3,6 @@
/*
Forums search result page
*/
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
list($Page, $Limit) = Format::page_limit(POSTS_PER_PAGE);
@ -370,7 +368,7 @@
</tr>
<? if ($Type == 'body') { ?>
<tr class="row<?=$Row?> hidden" id="post_<?=$PostID?>_text">
<td colspan="4"><?=$Text->full_format($Body)?></td>
<td colspan="4"><?=Text::full_format($Body)?></td>
</tr>
<? }
}

View File

@ -15,9 +15,6 @@
\*********************************************************************/
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
// Quick SQL injection check
if (!$_POST['post'] || !is_number($_POST['post']) || !is_number($_POST['key'])) {
error(0,true);
@ -126,6 +123,6 @@
('forums', $PostID, $UserID, '$SQLTime', '".db_string($OldBody)."')");
$Cache->delete_value("forums_edits_$PostID");
// This gets sent to the browser, which echoes it in place of the old body
echo $Text->full_format($Body);
echo Text::full_format($Body);
?>
<br /><br />Last edited by <a href="user.php?id=<?=$LoggedUser['ID']?>"><?=$LoggedUser['Username']?></a> Just now

View File

@ -11,10 +11,8 @@
//---------- Things to sort out before it can start printing/generating content
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT(true);
// Enable TOC
Text::$TOC = true;
// Check for lame SQL injection attempts
if (!isset($_GET['threadid']) || !is_number($_GET['threadid'])) {
@ -508,7 +506,7 @@
<? } ?>
<td class="body" valign="top"<? if (!Users::has_avatars_enabled()) { echo ' colspan="2"'; } ?>>
<div id="content<?=$PostID?>">
<?=$Text->full_format($Body) ?>
<?=Text::full_format($Body) ?>
<? if ($EditedUserID) { ?>
<br />
<br />
@ -561,7 +559,7 @@
<?
foreach ($Notes as $Note) {
?>
<tr><td><?=Users::format_username($Note['AuthorID'])?> (<?=time_diff($Note['AddedTime'], 2, true, true)?>)</td><td><?=$Text->full_format($Note['Body'])?></td></tr>
<tr><td><?=Users::format_username($Note['AuthorID'])?> (<?=time_diff($Note['AddedTime'], 2, true, true)?>)</td><td><?=Text::full_format($Note['Body'])?></td></tr>
<?
}
?>

View File

@ -1,7 +1,4 @@
<?
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
$ConvID = $_GET['id'];
if (!$ConvID || !is_number($ConvID)) {
error(404);
@ -94,7 +91,7 @@
<div style="float: right;"><a href="#">&uarr;</a> <a href="#messageform">&darr;</a></div>
</div>
<div class="body" id="message<?=$MessageID?>">
<?=$Text->full_format($Body)?>
<?=Text::full_format($Body)?>
</div>
</div>
<?

View File

@ -1,6 +1,5 @@
<?php
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT(true);
Text::$TOC = true;
$NewsCount = 5;
if (!$News = $Cache->get_value('news')) {
@ -471,14 +470,14 @@
?>
<div id="news<?=$NewsID?>" class="box news_post">
<div class="head">
<strong><?=$Text->full_format($Title)?></strong> <?=time_diff($NewsTime);?>
<strong><?=Text::full_format($Title)?></strong> <?=time_diff($NewsTime);?>
<? if (check_perms('admin_manage_news')) { ?>
- <a href="tools.php?action=editnews&amp;id=<?=$NewsID?>" class="brackets">Edit</a>
<? } ?>
<span style="float: right;"><a href="#" onclick="$('#newsbody<?=$NewsID?>').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); return false;" class="brackets">Hide</a></span>
</div>
<div id="newsbody<?=$NewsID?>" class="pad"><?=$Text->full_format($Body)?></div>
<div id="newsbody<?=$NewsID?>" class="pad"><?=Text::full_format($Body)?></div>
</div>
<?
if (++$Count > ($NewsCount - 1)) {

View File

@ -3,7 +3,7 @@
if (empty($ID)) {
die();
}
$Text = new TEXT(true);
Text::$TOC = true;
$UserID = (int)$_GET['userid'];
$UserIDSQL = "";
if (!empty($UserID)) {
@ -27,7 +27,7 @@
</span>
</div>
<div class="pad">
<?= $Text->full_format($Answer['Answer'])?>
<?= Text::full_format($Answer['Answer'])?>
</div>
</div>
<?

View File

@ -1,6 +1,5 @@
<?
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT(true);
Text::$TOC = true;
if (!check_perms("users_mod")) {
error(403);
}
@ -35,7 +34,7 @@
</span>
</div>
<div class="pad">
<?= $Text->full_format($Question['Question'])?>
<?= Text::full_format($Question['Question'])?>
</div>
</div>
<div class="center box pad">

View File

@ -1,6 +1,5 @@
<?
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT(true);
Text::$TOC = true;
G::$DB->query("
SELECT
@ -56,7 +55,7 @@
</span>
</div>
<div class="pad">
<?= $Text->full_format($Question['Question'])?>
<?= Text::full_format($Question['Question'])?>
</div>
</div>
<? } ?>

View File

@ -2,8 +2,7 @@
if (!check_perms("users_mod")) {
error(404);
}
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT(true);
Text::$TOC = true;
$DB->query("
SELECT
@ -78,7 +77,7 @@
</span>
</div>
<div class="pad">
<?=$Text->full_format($Question['Question'])?>
<?=Text::full_format($Question['Question'])?>
</div>
</div>
<div id="answer<?=$Question['ID']?>" class="hidden center box pad">

View File

@ -1,6 +1,5 @@
<?
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT(true);
Text::$TOC = true;
$UserID = $_GET['userid'];
@ -84,7 +83,7 @@
</span>
</div>
<div class="pad">
<?= $Text->full_format("[quote=" . $Question['Username'] . "]". $Question['Question'] . "[/quote]\n". $Question['Answer'])?>
<?= Text::full_format("[quote=" . $Question['Username'] . "]". $Question['Question'] . "[/quote]\n". $Question['Answer'])?>
</div>
</div>
<? } ?>

View File

@ -143,10 +143,6 @@
</div>
<?
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
switch ($Short) {
case 'user':
?>
@ -164,7 +160,7 @@
</tr>
<tr>
<td><?=display_str($Name)?></td>
<td><?=$Text->full_format($Desc)?></td>
<td><?=Text::full_format($Desc)?></td>
<td><strong><?=($Filled == 0 ? 'No' : 'Yes')?></strong></td>
</tr>
</table>
@ -220,7 +216,7 @@
</tr>
<tr>
<td><?=display_str($Name)?></td>
<td><?=$Text->full_format($Desc)?></td>
<td><?=Text::full_format($Desc)?></td>
<td><strong><?=($Filled == 0 ? 'No' : 'Yes')?></strong></td>
</tr>
</table>
@ -236,7 +232,7 @@
</tr>
<tr>
<td><?=display_str($Name)?></td>
<td><?=$Text->full_format($Desc)?></td>
<td><?=Text::full_format($Desc)?></td>
</tr>
</table>
<?
@ -266,7 +262,7 @@
</tr>
<tr>
<td><?=display_str($Username)?></td>
<td><?=$Text->full_format($Body)?></td>
<td><?=Text::full_format($Body)?></td>
</tr>
</table>
<?
@ -281,7 +277,7 @@
</tr>
<tr>
<td><?=display_str($Username)?></td>
<td><?=$Text->full_format($Body)?></td>
<td><?=Text::full_format($Body)?></td>
</tr>
</table>
<?

View File

@ -7,8 +7,6 @@
// Number of reports per page
define('REPORTS_PER_PAGE', '10');
include(SERVER_ROOT . '/classes/text.class.php');
$Text = NEW TEXT;
list($Page, $Limit) = Format::page_limit(REPORTS_PER_PAGE);
@ -200,7 +198,7 @@
</td>
</tr>
<tr>
<td colspan="2"><?=$Text->full_format($Reason)?></td>
<td colspan="2"><?=Text::full_format($Reason)?></td>
</tr>
<tr>
<td colspan="2">

View File

@ -9,9 +9,6 @@
error(403);
}
include(SERVER_ROOT.'/classes/text.class.php');
$Text = NEW TEXT;
$DB->query("
SELECT
@ -227,7 +224,7 @@
$Links = explode(' ', $Links);
foreach ($Links as $Link) {
if ($local_url = $Text->local_url($Link)) {
if ($local_url = Text::local_url($Link)) {
$Link = $local_url;
} ?>
<a href="<?=$Link?>"><?=$Link?></a>
@ -325,7 +322,7 @@
} ?>
<tr>
<td class="label">User comment:</td>
<td colspan="3"><?=$Text->full_format($UserComment)?></td>
<td colspan="3"><?=Text::full_format($UserComment)?></td>
</tr>
<? // END REPORTED STUFF :|: BEGIN MOD STUFF ?>
<tr>

View File

@ -5,9 +5,6 @@
*/
include(SERVER_ROOT.'/sections/torrents/functions.php');
include(SERVER_ROOT.'/classes/text.class.php');
$Text = NEW TEXT;
//If we're not coming from torrents.php, check we're being returned because of an error.
if (!isset($_GET['id']) || !is_number($_GET['id'])) {
@ -41,7 +38,7 @@
$DisplayName = $GroupName;
$AltName = $GroupName; // Goes in the alt text of the image
$Title = $GroupName; // goes in <title>
$WikiBody = $Text->full_format($WikiBody);
$WikiBody = Text::full_format($WikiBody);
//Get the artist name, group name etc.
$Artists = Artists::get_artist($GroupID);
@ -85,7 +82,7 @@
<td class="sign leechers"><img src="static/styles/<?=($LoggedUser['StyleName'])?>/images/leechers.png" class="tooltip" alt="Leechers" title="Leechers" /></td>
</tr>
<?
build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $GroupName, $GroupCategoryID, $ReleaseType, $TorrentList, $Types, $Text, $Username, $ReportedTimes);
build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $GroupName, $GroupCategoryID, $ReleaseType, $TorrentList, $Types, $Username, $ReportedTimes);
?>
</table>
</div>

View File

@ -13,9 +13,7 @@
error(403);
}
include(SERVER_ROOT.'/classes/text.class.php');
include(SERVER_ROOT.'/classes/reports.class.php');
$Text = NEW TEXT;
define('REPORTS_PER_PAGE', '10');
list($Page, $Limit) = Format::page_limit(REPORTS_PER_PAGE);
@ -404,7 +402,7 @@
$Links = explode(' ', $Links);
foreach ($Links as $Link) {
if ($local_url = $Text->local_url($Link)) {
if ($local_url = Text::local_url($Link)) {
$Link = $local_url;
}
?>
@ -504,7 +502,7 @@
} ?>
<tr>
<td class="label">User comment:</td>
<td colspan="3" class="wrap_overflow"><?=$Text->full_format($UserComment)?></td>
<td colspan="3" class="wrap_overflow"><?=Text::full_format($UserComment)?></td>
</tr>
<? // END REPORTED STUFF :|: BEGIN MOD STUFF
if ($Status == 'InProgress') { ?>

View File

@ -4,10 +4,6 @@
* This is the page that displays the request to the end user after being created.
*/
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
if (empty($_GET['id']) || !is_number($_GET['id'])) {
error(0);
}
@ -439,7 +435,7 @@
<div class="box box2 box_request_desc">
<div class="head"><strong>Description</strong></div>
<div class="pad">
<?= $Text->full_format($Request['Description']);?>
<?= Text::full_format($Request['Description']);?>
</div>
</div>
<?

View File

@ -13,7 +13,6 @@
* @return string $Row
*/
function make_staff_row($Row, $ID, $Paranoia, $Class, $LastAccess, $Remark = '', $HiddenBy = 'Hidden by user') {
$Text = new Text;
$Row = $Row === 'a' ? 'b' : 'a';
echo "\t\t\t<tr class=\"row$Row\">
@ -29,7 +28,7 @@ function make_staff_row($Row, $ID, $Paranoia, $Class, $LastAccess, $Remark = '',
}
echo "\n\t\t\t\t</td>
<td class=\"nobr\">"
. $Text->full_format($Remark) .
. Text::full_format($Remark) .
"</td>
</tr>\n"; // the "\n" is needed for pretty HTML
// the foreach loop that calls this function needs to know the new value of $Row

View File

@ -15,8 +15,6 @@
$Cache->delete_value('staff_blog_read_'.$LoggedUser['ID']);
define('ANNOUNCEMENT_FORUM_ID', 19);
require(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
if (check_perms('admin_manage_blog')) {
if (!empty($_REQUEST['action'])) {
@ -145,7 +143,7 @@
<? } ?>
</div>
<div class="pad">
<?=$Text->full_format($Body)?>
<?=Text::full_format($Body)?>
</div>
</div>
<?

View File

@ -27,9 +27,7 @@
if ($_GET['plain'] == 1) {
echo $Message;
} else {
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
echo $Text->full_format($Message);
echo Text::full_format($Message);
}
} else {

View File

@ -1,10 +1,6 @@
<?
/* AJAX Previews, simple stuff. */
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
if (!empty($_POST['message'])) {
echo $Text->full_format($_POST['message']);
echo Text::full_format($_POST['message']);
}
?>

View File

@ -6,9 +6,6 @@
View::show_header('Staff PMs', 'staffpm');
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
?>
<div class="thin">
<div class="header">
@ -80,7 +77,7 @@
</div>
<div class="pad">
<div class="box pad hidden" id="response_div_<?=$ID?>">
<?=$Text->full_format($Message)?>
<?=Text::full_format($Message)?>
</div>
<textarea rows="10" cols="87" id="response_message_<?=$ID?>" name="message"><?=display_str($Message)?></textarea>
<br />

View File

@ -1,6 +1,4 @@
<?
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
if ($ConvID = (int)$_GET['id']) {
// Get conversation info
@ -99,7 +97,7 @@
- <a href="#quickpost" onclick="Quote('<?=$MessageID?>', '<?=$Username?>');" class="brackets">Quote</a>
<? } ?>
</div>
<div class="body"><?=$Text->full_format($Message)?></div>
<div class="body"><?=Text::full_format($Message)?></div>
</div>
<div align="center" style="display: none;"></div>
<?

View File

@ -1,7 +1,7 @@
<?
$Campaign = 'forumaudio';
if (!$Votes = $Cache->get_value("support_$Campaign")) {
$Votes = array(0,0);
$Votes = array(0, 0);
}
if (!isset($_GET['support'])) {
?>
@ -9,7 +9,7 @@
<ul>
<li><?=number_format($Votes[0])?> +</li>
<li><?=number_format($Votes[1])?> -</li>
<li><?=number_format(($Votes[0] / ($Votes[0] + $Votes[1])) * 100, 3)?> %</li>
<li><?=number_format(($Votes[0] / ($Votes[0] + $Votes[1])) * 100, 3)?>%</li>
</ul>
<?
} elseif ($_GET['support'] === 'true') {
@ -18,5 +18,4 @@
$Votes[1]++;
}
$Cache->cache_value("support_$Campaign", $Votes, 0);
?>

View File

@ -25,6 +25,7 @@
}
echo '<div class="save_message">Key(s) ' . implode(', ', array_map('display_str', $Keys)) . ' cleared!</div>';
}
$MultiKeyTooltip = 'Enter cache keys delimited by any amount of whitespace.';
?>
<div class="header">
<h2>Clear a cache key</h2>
@ -44,7 +45,7 @@
</form>
</td>
</tr>
<tr>
<tr class="tooltip" title="<?=$MultiKeyTooltip?>">
<td>Multi-key</td>
<td>
<form class="manage_form" name="cache" method="get" action="">
@ -58,8 +59,12 @@
</form>
</td>
</tr>
</table>
<?
if (isset($Keys) && $_GET['type'] == 'view') {
?>
<table class="layout" cellpadding="2" cellspacing="1" border="0" align="center" style="margin-top: 1em;">
<?
foreach ($Keys as $Key) {
?>
<tr>
@ -68,10 +73,9 @@
<pre><? var_dump($Cache->get_value($Key)); ?></pre>
</td>
</tr>
<?
}
}
?>
<? } ?>
</table>
<?
}
View::show_footer();

View File

@ -4,8 +4,6 @@
error(403);
}
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
View::show_header('Manage news', 'bbcode');
switch ($_GET['action']) {
@ -79,7 +77,7 @@
- <a href="tools.php?action=editnews&amp;id=<?=$NewsID?>" class="brackets">Edit</a>
<a href="tools.php?action=deletenews&amp;id=<?=$NewsID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Delete</a>
</div>
<div class="pad"><?=$Text->full_format($Body) ?></div>
<div class="pad"><?=Text::full_format($Body) ?></div>
</div>
<? } ?>
</div>

View File

@ -83,8 +83,6 @@
include(SERVER_ROOT.'/classes/reports.class.php');
require(SERVER_ROOT.'/sections/reportsv2/array.php');
require(SERVER_ROOT.'/classes/text.class.php');
$Text = NEW TEXT;
$ReportID = 0;
$DB->query("
SELECT

View File

@ -7,10 +7,6 @@ function compare($X, $Y) {
define('MAX_PERS_COLLAGES', 3); // How many personal collages should be shown by default
define('MAX_COLLAGES', 5); // How many normal collages should be shown by default
include(SERVER_ROOT.'/classes/text.class.php');
$Text = NEW TEXT;
$GroupID = ceil($_GET['id']);
if (!empty($_GET['revisionid']) && is_number($_GET['revisionid'])) {
$RevisionID = $_GET['revisionid'];
@ -32,7 +28,7 @@ function compare($X, $Y) {
$DisplayName = $GroupName;
$AltName = $GroupName; // Goes in the alt text of the image
$Title = $GroupName; // goes in <title>
$WikiBody = $Text->full_format($WikiBody);
$WikiBody = Text::full_format($WikiBody);
$Artists = Artists::get_artist($GroupID);
@ -588,7 +584,7 @@ function filelist($Str) {
$ReportInfo .= "
<tr>
<td>$ReportLinks ".time_diff($Report['ReportedTime'], 2, true, true).' for the reason "'.$ReportType['title'].'":
<blockquote>'.$Text->full_format($Report['UserComment']).'</blockquote>
<blockquote>'.Text::full_format($Report['UserComment']).'</blockquote>
</td>
</tr>';
}
@ -750,7 +746,7 @@ function filelist($Str) {
<?
}
if (!empty($Description)) {
echo "\n<blockquote>".$Text->full_format($Description).'</blockquote>';
echo "\n<blockquote>".Text::full_format($Description).'</blockquote>';
}
?>
</td>

View File

@ -249,7 +249,7 @@ function get_group_requests($GroupID) {
}
//Used by both sections/torrents/details.php and sections/reportsv2/report.php
function build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $GroupName, $GroupCategoryID, $ReleaseType, $TorrentList, $Types, $Text, $Username, $ReportedTimes) {
function build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $GroupName, $GroupCategoryID, $ReleaseType, $TorrentList, $Types, $Username, $ReportedTimes) {
function filelist($Str) {
return "</td>\n<td>" . Format::get_size($Str[1]) . "</td>\n</tr>";
@ -316,7 +316,7 @@ function filelist($Str) {
$ReportInfo .= "
<tr>
<td>$ReportLinks ".time_diff($Report['ReportedTime'], 2, true, true).' for the reason "'.$ReportType['title'].'":
<blockquote>'.$Text->full_format($Report['UserComment']).'</blockquote>
<blockquote>'.Text::full_format($Report['UserComment']).'</blockquote>
</td>
</tr>';
}
@ -517,7 +517,7 @@ function filelist($Str) {
<div id="reported_<?=($TorrentID)?>" class="hidden"><?=($ReportInfo)?></div>
<? }
if (!empty($Description)) {
echo "\n\t\t\t\t\t\t<blockquote>" . $Text->full_format($Description) . '</blockquote>';
echo "\n\t\t\t\t\t\t<blockquote>" . Text::full_format($Description) . '</blockquote>';
} ?>
</td>
</tr>

View File

@ -1,10 +1,6 @@
<?
authorize();
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT;
// Quick SQL injection check
if (!$_REQUEST['groupid'] || !is_number($_REQUEST['groupid'])) {
error(404);

View File

@ -77,11 +77,6 @@
require(SERVER_ROOT.'/classes/torrent_form.class.php');
$TorrentForm = new TORRENT_FORM($Properties, $Err);
if (!isset($Text)) {
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
}
$GenreTags = $Cache->get_value('genre_tags');
if (!$GenreTags) {
$DB->query("
@ -129,12 +124,12 @@
?>
<tr>
<td>
<?=$Text->full_format($Name) . "\n" ?>
<?=Text::full_format($Name) . "\n" ?>
<? if ($TimeDiff < strtotime($Updated)) { ?>
<strong class="important_text">(New!)</strong>
<? } ?>
</td>
<td><?=$Text->full_format($Comment)?></td>
<td><?=Text::full_format($Comment)?></td>
</tr>
<? } ?>
</table>

View File

@ -14,7 +14,6 @@
define(MAX_FILENAME_LENGTH, 180);
include(SERVER_ROOT.'/classes/validate.class.php');
include(SERVER_ROOT.'/classes/feed.class.php');
include(SERVER_ROOT.'/classes/text.class.php');
include(SERVER_ROOT.'/sections/torrents/functions.php');
include(SERVER_ROOT.'/classes/file_checker.class.php');
@ -24,7 +23,6 @@
$Validate = new VALIDATE;
$Feed = new FEED;
$Text = new TEXT;
define('QUERY_EXCEPTION', true); // Shut up debugging
@ -851,7 +849,7 @@
}
// For RSS
$Item = $Feed->item($Title, $Text->strip_bbcode($Body), 'torrents.php?action=download&amp;authkey=[[AUTHKEY]]&amp;torrent_pass=[[PASSKEY]]&amp;id='.$TorrentID, $LoggedUser['Username'], 'torrents.php?id='.$GroupID, trim($Properties['TagList']));
$Item = $Feed->item($Title, Text::strip_bbcode($Body), 'torrents.php?action=download&amp;authkey=[[AUTHKEY]]&amp;torrent_pass=[[PASSKEY]]&amp;id='.$TorrentID, $LoggedUser['Username'], 'torrents.php?id='.$GroupID, trim($Properties['TagList']));
//Notifications

View File

@ -1,8 +1,4 @@
<?
include_once(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
function link_users($UserID, $TargetID) {
global $DB, $LoggedUser;
@ -127,7 +123,7 @@ function delete_dupegroup($GroupID) {
}
function dupe_comments($GroupID, $Comments) {
global $DB, $Text, $LoggedUser;
global $DB, $LoggedUser;
authorize();
if (!check_perms('users_mod')) {
@ -167,7 +163,6 @@ function dupe_comments($GroupID, $Comments) {
function user_dupes_table($UserID) {
global $DB, $LoggedUser;
$Text = new TEXT;
if (!check_perms('users_mod')) {
error(403);
@ -234,7 +229,7 @@ function user_dupes_table($UserID) {
</tr>
<tr>
<td colspan="5" align="left">
<div id="dupecomments" class="<?=($DupeCount ? '' : 'hidden')?>"><?=$Text->full_format($Comments);?></div>
<div id="dupecomments" class="<?=($DupeCount ? '' : 'hidden')?>"><?=Text::full_format($Comments);?></div>
<div id="editdupecomments" class="<?=($DupeCount ? 'hidden' : '')?>">
<textarea name="dupecomments" onkeyup="resize('dupecommentsbox');" id="dupecommentsbox" cols="65" rows="5" style="width: 98%;"><?=display_str($Comments)?></textarea>
</div>

View File

@ -1,8 +1,4 @@
<?
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
if (empty($_GET['id']) || !is_numeric($_GET['id']) || (!empty($_GET['preview']) && !is_numeric($_GET['preview']))) {
error(404);
}
@ -589,7 +585,7 @@ function check_paranoia_here($Setting) {
This profile is currently empty.
<?
} else {
echo $Text->full_format($Info);
echo Text::full_format($Info);
}
?>
</div>
@ -940,7 +936,7 @@ function check_paranoia_here($Setting) {
<div class="box">
<div class="head">Forum warnings</div>
<div class="pad">
<div id="forumwarningslinks" class="AdminComment" style="width: 98%;"><?=$Text->full_format($ForumWarnings)?></div>
<div id="forumwarningslinks" class="AdminComment" style="width: 98%;"><?=Text::full_format($ForumWarnings)?></div>
</div>
</div>
<?
@ -960,7 +956,7 @@ function check_paranoia_here($Setting) {
</div>
<div id="staffnotes" class="pad">
<input type="hidden" name="comment_hash" value="<?=$CommentHash?>" />
<div id="admincommentlinks" class="AdminComment" style="width: 98%;"><?=$Text->full_format($AdminComment)?></div>
<div id="admincommentlinks" class="AdminComment" style="width: 98%;"><?=Text::full_format($AdminComment)?></div>
<textarea id="admincomment" onkeyup="resize('admincomment');" class="AdminComment hidden" name="AdminComment" cols="65" rows="26" style="width: 98%;"><?=display_str($AdminComment)?></textarea>
<a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Toggle edit</a>
<script type="text/javascript">

View File

@ -7,9 +7,6 @@
error(403);
}
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
$UserID = empty($_GET['userid']) ? $LoggedUser['ID'] : $_GET['userid'];
if (!is_number($UserID)) {
error(0);
@ -268,7 +265,7 @@
<? } ?>
<td class="body" valign="top">
<div id="content<?=$PostID?>">
<?=$Text->full_format($Body)?>
<?=Text::full_format($Body)?>
<? if ($EditedUserID) { ?>
<br />
<br />

View File

@ -6,9 +6,6 @@
error(403);
}
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
View::show_header('Subscribed collages','browse,collage');
$ShowAll = !empty($_GET['showall']);

View File

@ -103,9 +103,6 @@
$TorrentGroups = Torrents::get_groups($TorrentGroups, true, true, false);
$Requests = Requests::get_requests($Requests);
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT;
?>
<div class="thin">
<div class="header">
@ -235,7 +232,7 @@
<? } ?>
<td class="body" valign="top">
<div class="content3">
<?=$Text->full_format($Result['LastReadBody']) ?>
<?=Text::full_format($Result['LastReadBody']) ?>
<? if ($Result['LastReadEditedUserID']) { ?>
<br /><br />
Last edited by <?=Users::format_username($Result['LastReadEditedUserID'], false, false, false) ?> <?=time_diff($Result['LastReadEditedTime'])?>

View File

@ -1,6 +1,5 @@
<?
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
$Text = new TEXT(true);
Text::$TOC = true;
if (!empty($_GET['id']) && is_number($_GET['id'])) { //Visiting article via ID
$ArticleID = $_GET['id'];
@ -37,8 +36,8 @@
error('You must be a higher user class to view this wiki article');
}
$TextBody = $Text->full_format($Body, false);
$TOC = $Text->parse_toc(0);
$TextBody = Text::full_format($Body, false);
$TOC = Text::parse_toc(0);
View::show_header($Title,'wiki,bbcode');
?>