Empty commit

This commit is contained in:
Git 2013-06-21 08:00:44 +00:00
parent 0b71f53227
commit 54148e5f2b
3 changed files with 144 additions and 85 deletions

View File

@ -604,38 +604,38 @@ private function to_html ($Array) {
$Str = ''; $Str = '';
foreach ($Array as $Block) { foreach ($Array as $Block) {
if (is_string($Block)) { if (is_string($Block)) {
$Str.=$this->smileys($Block); $Str .= $this->smileys($Block);
continue; continue;
} }
if ($this->Levels < $this->MaximumNests) { if ($this->Levels < $this->MaximumNests) {
switch ($Block['Type']) { switch ($Block['Type']) {
case 'b': case 'b':
$Str.='<strong>'.$this->to_html($Block['Val']).'</strong>'; $Str .= '<strong>'.$this->to_html($Block['Val']).'</strong>';
break; break;
case 'u': case 'u':
$Str.='<span style="text-decoration: underline;">'.$this->to_html($Block['Val']).'</span>'; $Str .= '<span style="text-decoration: underline;">'.$this->to_html($Block['Val']).'</span>';
break; break;
case 'i': case 'i':
$Str.='<span style="font-style: italic;">'.$this->to_html($Block['Val'])."</span>"; $Str .= '<span style="font-style: italic;">'.$this->to_html($Block['Val'])."</span>";
break; break;
case 's': case 's':
$Str.='<span style="text-decoration: line-through;">'.$this->to_html($Block['Val']).'</span>'; $Str .= '<span style="text-decoration: line-through;">'.$this->to_html($Block['Val']).'</span>';
break; break;
case 'important': case 'important':
$Str.='<strong class="important_text">'.$this->to_html($Block['Val']).'</strong>'; $Str .= '<strong class="important_text">'.$this->to_html($Block['Val']).'</strong>';
break; break;
case 'user': case 'user':
$Str.='<a href="user.php?action=search&amp;search='.urlencode($Block['Val']).'">'.$Block['Val'].'</a>'; $Str .= '<a href="user.php?action=search&amp;search='.urlencode($Block['Val']).'">'.$Block['Val'].'</a>';
break; break;
case 'artist': case 'artist':
$Str.='<a href="artist.php?artistname='.urlencode(Format::undisplay_str($Block['Val'])).'">'.$Block['Val'].'</a>'; $Str .= '<a href="artist.php?artistname='.urlencode(Format::undisplay_str($Block['Val'])).'">'.$Block['Val'].'</a>';
break; break;
case 'rule': case 'rule':
$Rule = trim(strtolower($Block['Val'])); $Rule = trim(strtolower($Block['Val']));
if ($Rule[0] != 'r' && $Rule[0] != 'h') { if ($Rule[0] != 'r' && $Rule[0] != 'h') {
$Rule = 'r'.$Rule; $Rule = 'r'.$Rule;
} }
$Str.='<a href="rules.php?p=upload#'.urlencode(Format::undisplay_str($Rule)).'">'.preg_replace('/[aA-zZ]/', '', $Block['Val']).'</a>'; $Str .= '<a href="rules.php?p=upload#'.urlencode(Format::undisplay_str($Rule)).'">'.preg_replace('/[aA-zZ]/', '', $Block['Val']).'</a>';
break; break;
case 'torrent': case 'torrent':
$Pattern = '/('.NONSSL_SITE_URL.'\/torrents\.php.*[\?&]id=)?(\d+)($|&|\#).*/i'; $Pattern = '/('.NONSSL_SITE_URL.'\/torrents\.php.*[\?&]id=)?(\d+)($|&|\#).*/i';
@ -655,43 +655,43 @@ private function to_html ($Array) {
} }
break; break;
case 'wiki': case 'wiki':
$Str.='<a href="wiki.php?action=article&amp;name='.urlencode($Block['Val']).'">'.$Block['Val'].'</a>'; $Str .= '<a href="wiki.php?action=article&amp;name='.urlencode($Block['Val']).'">'.$Block['Val'].'</a>';
break; break;
case 'tex': case 'tex':
$Str.='<img style="vertical-align: middle;" src="'.STATIC_SERVER.'blank.gif" onload="if (this.src.substr(this.src.length-9,this.src.length) == \'blank.gif\') { this.src = \'http://chart.apis.google.com/chart?cht=tx&amp;chf=bg,s,FFFFFF00&amp;chl='.urlencode(mb_convert_encoding($Block['Val'], 'UTF-8', 'HTML-ENTITIES')).'&amp;chco=\' + hexify(getComputedStyle(this.parentNode,null).color); }" alt="'.$Block['Val'].'" />'; $Str .= '<img style="vertical-align: middle;" src="'.STATIC_SERVER.'blank.gif" onload="if (this.src.substr(this.src.length-9,this.src.length) == \'blank.gif\') { this.src = \'http://chart.apis.google.com/chart?cht=tx&amp;chf=bg,s,FFFFFF00&amp;chl='.urlencode(mb_convert_encoding($Block['Val'], 'UTF-8', 'HTML-ENTITIES')).'&amp;chco=\' + hexify(getComputedStyle(this.parentNode,null).color); }" alt="'.$Block['Val'].'" />';
break; break;
case 'plain': case 'plain':
$Str.=$Block['Val']; $Str .= $Block['Val'];
break; break;
case 'pre': case 'pre':
$Str.='<pre>'.$Block['Val'].'</pre>'; $Str .= '<pre>'.$Block['Val'].'</pre>';
break; break;
case 'code': case 'code':
$Str.='<code>'.$Block['Val'].'</code>'; $Str .= '<code>'.$Block['Val'].'</code>';
break; break;
case 'list': case 'list':
$Str.='<'.$Block['ListType'].'>'; $Str .= '<'.$Block['ListType'].'>';
foreach ($Block['Val'] as $Line) { foreach ($Block['Val'] as $Line) {
$Str.='<li>'.$this->to_html($Line).'</li>'; $Str .= '<li>'.$this->to_html($Line).'</li>';
} }
$Str.='</'.$Block['ListType'].'>'; $Str .= '</'.$Block['ListType'].'>';
break; break;
case 'align': case 'align':
$ValidAttribs = array('left', 'center', 'right'); $ValidAttribs = array('left', 'center', 'right');
if (!in_array($Block['Attr'], $ValidAttribs)) { if (!in_array($Block['Attr'], $ValidAttribs)) {
$Str.='[align='.$Block['Attr'].']'.$this->to_html($Block['Val']).'[/align]'; $Str .= '[align='.$Block['Attr'].']'.$this->to_html($Block['Val']).'[/align]';
} else { } else {
$Str.='<div style="text-align: '.$Block['Attr'].';">'.$this->to_html($Block['Val']).'</div>'; $Str .= '<div style="text-align: '.$Block['Attr'].';">'.$this->to_html($Block['Val']).'</div>';
} }
break; break;
case 'color': case 'color':
case 'colour': case 'colour':
$ValidAttribs = array('aqua', 'black', 'blue', 'fuchsia', 'green', 'grey', 'lime', 'maroon', 'navy', 'olive', 'purple', 'red', 'silver', 'teal', 'white', 'yellow'); $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'])) { 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'].']'.$this->to_html($Block['Val']).'[/color]';
} else { } else {
$Str.='<span style="color: '.$Block['Attr'].';">'.$this->to_html($Block['Val']).'</span>'; $Str .= '<span style="color: '.$Block['Attr'].';">'.$this->to_html($Block['Val']).'</span>';
} }
break; break;
case 'headline': case 'headline':
@ -713,81 +713,81 @@ private function to_html ($Array) {
case 'size': case 'size':
$ValidAttribs = array('1','2','3','4','5','6','7','8','9','10'); $ValidAttribs = array('1','2','3','4','5','6','7','8','9','10');
if (!in_array($Block['Attr'], $ValidAttribs)) { if (!in_array($Block['Attr'], $ValidAttribs)) {
$Str.='[size='.$Block['Attr'].']'.$this->to_html($Block['Val']).'[/size]'; $Str .= '[size='.$Block['Attr'].']'.$this->to_html($Block['Val']).'[/size]';
} else { } else {
$Str.='<span class="size'.$Block['Attr'].'">'.$this->to_html($Block['Val']).'</span>'; $Str .= '<span class="size'.$Block['Attr'].'">'.$this->to_html($Block['Val']).'</span>';
} }
break; break;
case 'quote': case 'quote':
$this->NoImg++; // No images inside quote tags $this->NoImg++; // No images inside quote tags
$this->InQuotes++; $this->InQuotes++;
if ($this->InQuotes == $this->NestsBeforeHide) { //Put quotes that are nested beyond the specified limit in [hide] tags. if ($this->InQuotes == $this->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 .= '<strong>Older quotes</strong>: <a href="javascript:void(0);" onclick="BBCode.spoiler(this);">Show</a>';
$Str.='<blockquote class="hidden spoiler">'; $Str .= '<blockquote class="hidden spoiler">';
} }
if (!empty($Block['Attr'])) { if (!empty($Block['Attr'])) {
$Exploded = explode('|', $this->to_html($Block['Attr'])); $Exploded = explode('|', $this->to_html($Block['Attr']));
if (isset($Exploded[1]) && is_numeric($Exploded[1])) { if (isset($Exploded[1]) && is_numeric($Exploded[1])) {
$PostID = trim($Exploded[1]); $PostID = trim($Exploded[1]);
$Str.='<a href="forums.php?action=viewthread&amp;postid='.$PostID.'" onclick="QuoteJump(event, '.$PostID.'); return false;"><strong class="quoteheader">'.$Exploded[0].'</strong> wrote: </a>'; $Str .= '<a href="forums.php?action=viewthread&amp;postid='.$PostID.'" onclick="QuoteJump(event, '.$PostID.'); return false;"><strong class="quoteheader">'.$Exploded[0].'</strong> wrote: </a>';
} }
else { else {
$Str.='<strong class="quoteheader">'.$Exploded[0].'</strong> wrote: '; $Str .= '<strong class="quoteheader">'.$Exploded[0].'</strong> wrote: ';
} }
} }
$Str.='<blockquote>'.$this->to_html($Block['Val']).'</blockquote>'; $Str .= '<blockquote>'.$this->to_html($Block['Val']).'</blockquote>';
if ($this->InQuotes == $this->NestsBeforeHide) { //Close quote the deeply nested quote [hide]. if ($this->InQuotes == $this->NestsBeforeHide) { //Close quote the deeply nested quote [hide].
$Str.='</blockquote><br />'; // Ensure new line after quote train hiding $Str .= '</blockquote><br />'; // Ensure new line after quote train hiding
} }
$this->NoImg--; $this->NoImg--;
$this->InQuotes--; $this->InQuotes--;
break; break;
case 'hide': case 'hide':
$Str.='<strong>'.(($Block['Attr']) ? $Block['Attr'] : 'Hidden text').'</strong>: <a href="javascript:void(0);" onclick="BBCode.spoiler(this);">Show</a>'; $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">'.$this->to_html($Block['Val']).'</blockquote>';
break; break;
case 'mature': case 'mature':
global $LoggedUser; global $LoggedUser;
if ($LoggedUser['EnableMatureContent']) { if ($LoggedUser['EnableMatureContent']) {
if (!empty($Block['Attr'])) { 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 .= '<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">'.$this->to_html($Block['Val']).'</blockquote>';
} }
else { 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>.'; $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>.';
} }
} }
else { else {
$Str.='<span class="mature_blocked" style="font-style: italic;"><a href="wiki.php?action=article&amp;id=1063">Mature content</a> has been blocked. You can choose to view mature content by editing your <a href="user.php?action=edit&amp;userid=' . $LoggedUser['ID'] . '">settings</a>.</span>'; $Str .= '<span class="mature_blocked" style="font-style: italic;"><a href="wiki.php?action=article&amp;id=1063">Mature content</a> has been blocked. You can choose to view mature content by editing your <a href="user.php?action=edit&amp;userid=' . $LoggedUser['ID'] . '">settings</a>.</span>';
} }
break; break;
case 'img': case 'img':
if ($this->NoImg > 0 && $this->valid_url($Block['Val'])) { if ($this->NoImg > 0 && $this->valid_url($Block['Val'])) {
$Str.='<a rel="noreferrer" target="_blank" href="'.$Block['Val'].'">'.$Block['Val'].'</a> (image)'; $Str .= '<a rel="noreferrer" target="_blank" href="'.$Block['Val'].'">'.$Block['Val'].'</a> (image)';
break; break;
} }
if (!$this->valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) { if (!$this->valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) {
$Str.='[img]'.$Block['Val'].'[/img]'; $Str .= '[img]'.$Block['Val'].'[/img]';
} else { } else {
$LocalURL = $this->local_url($Block['Val']); $LocalURL = $this->local_url($Block['Val']);
if ($LocalURL) { if ($LocalURL) {
$Str.='<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$LocalURL.'" />'; $Str .= '<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$LocalURL.'" />';
} else { } else {
$Str.='<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.ImageTools::process($Block['Val']).'" />'; $Str .= '<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.ImageTools::process($Block['Val']).'" />';
} }
} }
break; break;
case 'aud': case 'aud':
if ($this->NoImg > 0 && $this->valid_url($Block['Val'])) { if ($this->NoImg > 0 && $this->valid_url($Block['Val'])) {
$Str.='<a rel="noreferrer" target="_blank" href="'.$Block['Val'].'">'.$Block['Val'].'</a> (audio)'; $Str .= '<a rel="noreferrer" target="_blank" href="'.$Block['Val'].'">'.$Block['Val'].'</a> (audio)';
break; break;
} }
if (!$this->valid_url($Block['Val'], '\.(mp3|ogg|wav)')) { if (!$this->valid_url($Block['Val'], '\.(mp3|ogg|wav)')) {
$Str.='[aud]'.$Block['Val'].'[/aud]'; $Str .= '[aud]'.$Block['Val'].'[/aud]';
} else { } else {
//TODO: Proxy this for staff? //TODO: Proxy this for staff?
$Str.='<audio controls="controls" src="'.$Block['Val'].'"><a rel="noreferrer" target="_blank" href="'.$Block['Val'].'">'.$Block['Val'].'</a></audio>'; $Str .= '<audio controls="controls" src="'.$Block['Val'].'"><a rel="noreferrer" target="_blank" href="'.$Block['Val'].'">'.$Block['Val'].'</a></audio>';
} }
break; break;
@ -802,14 +802,14 @@ private function to_html ($Array) {
} }
if (!$this->valid_url($Block['Attr'])) { if (!$this->valid_url($Block['Attr'])) {
$Str.='[url='.$Block['Attr'].']'.$Block['Val'].'[/url]'; $Str .= '[url='.$Block['Attr'].']'.$Block['Val'].'[/url]';
} else { } else {
$LocalURL = $this->local_url($Block['Attr']); $LocalURL = $this->local_url($Block['Attr']);
if ($LocalURL) { if ($LocalURL) {
if ($NoName) { $Block['Val'] = substr($LocalURL,1); } if ($NoName) { $Block['Val'] = substr($LocalURL,1); }
$Str.='<a href="'.$LocalURL.'">'.$Block['Val'].'</a>'; $Str .= '<a href="'.$LocalURL.'">'.$Block['Val'].'</a>';
} else { } else {
$Str.='<a rel="noreferrer" target="_blank" href="'.$Block['Attr'].'">'.$Block['Val'].'</a>'; $Str .= '<a rel="noreferrer" target="_blank" href="'.$Block['Attr'].'">'.$Block['Val'].'</a>';
} }
} }
break; break;
@ -818,15 +818,15 @@ private function to_html ($Array) {
if (!$this->valid_url($Block['Attr'], '', true)) { if (!$this->valid_url($Block['Attr'], '', true)) {
$Array = $this->parse($Block['Attr']); $Array = $this->parse($Block['Attr']);
$Block['Attr'] = $Array; $Block['Attr'] = $Array;
$Str.=$this->to_html($Block['Attr']); $Str .= $this->to_html($Block['Attr']);
} }
else { else {
$LocalURL = $this->local_url($Block['Attr']); $LocalURL = $this->local_url($Block['Attr']);
if ($LocalURL) { if ($LocalURL) {
$Str.='<a href="'.$LocalURL.'">'.substr($LocalURL,1).'</a>'; $Str .= '<a href="'.$LocalURL.'">'.substr($LocalURL,1).'</a>';
} else { } else {
$Str.='<a rel="noreferrer" target="_blank" href="'.$Block['Attr'].'">'.$Block['Attr'].'</a>'; $Str .= '<a rel="noreferrer" target="_blank" href="'.$Block['Attr'].'">'.$Block['Attr'].'</a>';
} }
} }
@ -843,7 +843,7 @@ private function raw_text ($Array) {
$Str = ''; $Str = '';
foreach ($Array as $Block) { foreach ($Array as $Block) {
if (is_string($Block)) { if (is_string($Block)) {
$Str.=$Block; $Str .= $Block;
continue; continue;
} }
switch ($Block['Type']) { switch ($Block['Type']) {
@ -858,7 +858,7 @@ private function raw_text ($Array) {
case 'quote': case 'quote':
case 'align': case 'align':
$Str.=$this->raw_text($Block['Val']); $Str .= $this->raw_text($Block['Val']);
break; break;
case 'tex': //since this will never strip cleanly, just remove it case 'tex': //since this will never strip cleanly, just remove it
break; break;
@ -869,11 +869,11 @@ private function raw_text ($Array) {
case 'code': case 'code':
case 'aud': case 'aud':
case 'img': case 'img':
$Str.=$Block['Val']; $Str .= $Block['Val'];
break; break;
case 'list': case 'list':
foreach ($Block['Val'] as $Line) { foreach ($Block['Val'] as $Line) {
$Str.=$Block['Tag'].$this->raw_text($Line); $Str .= $Block['Tag'].$this->raw_text($Line);
} }
break; break;
@ -885,17 +885,17 @@ private function raw_text ($Array) {
$Block['Val'] = $this->raw_text($Block['Val']); $Block['Val'] = $this->raw_text($Block['Val']);
} }
$Str.=$Block['Val']; $Str .= $Block['Val'];
break; break;
case 'inlineurl': case 'inlineurl':
if (!$this->valid_url($Block['Attr'], '', true)) { if (!$this->valid_url($Block['Attr'], '', true)) {
$Array = $this->parse($Block['Attr']); $Array = $this->parse($Block['Attr']);
$Block['Attr'] = $Array; $Block['Attr'] = $Array;
$Str.=$this->raw_text($Block['Attr']); $Str .= $this->raw_text($Block['Attr']);
} }
else { else {
$Str.=$Block['Attr']; $Str .= $Block['Attr'];
} }
break; break;

View File

@ -723,6 +723,12 @@ CREATE TABLE `schedule` (
`NextBiWeekly` int(2) NOT NULL DEFAULT '0' `NextBiWeekly` int(2) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `sphinx_a` (
`gid` int(11) DEFAULT NULL,
`aname` text CHARACTER SET utf8 COLLATE utf8_bin,
KEY `gid` (`gid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
CREATE TABLE `sphinx_delta` ( CREATE TABLE `sphinx_delta` (
`ID` int(10) NOT NULL, `ID` int(10) NOT NULL,
`GroupID` int(11) NOT NULL DEFAULT '0', `GroupID` int(11) NOT NULL DEFAULT '0',
@ -862,6 +868,46 @@ CREATE TABLE `sphinx_requests_delta` (
KEY `LastVote` (`LastVote`) KEY `LastVote` (`LastVote`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `sphinx_t` (
`id` int(11) NOT NULL,
`gid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`size` bigint(20) DEFAULT NULL,
`snatched` int(11) DEFAULT NULL,
`seeders` int(11) DEFAULT NULL,
`leechers` int(11) DEFAULT NULL,
`time` int(11) DEFAULT NULL,
`logscore` smallint(6) DEFAULT NULL,
`scene` tinyint(4) DEFAULT NULL,
`haslog` tinyint(4) DEFAULT NULL,
`hascue` tinyint(4) DEFAULT NULL,
`freetorrent` tinyint(4) DEFAULT NULL,
`media` varchar(15) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`format` varchar(15) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`encoding` varchar(30) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`remyear` smallint(6) DEFAULT NULL,
`remtitle` varchar(80) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`remrlabel` varchar(80) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`remcnumber` varchar(80) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`filelist` mediumtext CHARACTER SET utf8 COLLATE utf8_bin,
`remident` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `gid_remident` (`gid`,`remident`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
CREATE TABLE `sphinx_tg` (
`id` int(11) NOT NULL,
`name` varchar(300) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`tags` varchar(500) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`year` smallint(6) DEFAULT NULL,
`rlabel` varchar(80) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`cnumber` varchar(80) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`catid` smallint(6) DEFAULT NULL,
`reltype` smallint(6) DEFAULT NULL,
`vanityhouse` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
CREATE TABLE `staff_blog` ( CREATE TABLE `staff_blog` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT, `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`UserID` int(10) unsigned NOT NULL, `UserID` int(10) unsigned NOT NULL,

View File

@ -37,52 +37,34 @@ source torrents : torrents_base {
sql_query_pre = set group_concat_max_len = 101400 sql_query_pre = set group_concat_max_len = 101400
sql_query_pre = set @starttime = now() sql_query_pre = set @starttime = now()
sql_query_pre = create temporary table sphinx_tg \ sql_query_pre = truncate sphinx_tg
(id int primary key, name varchar(300), tags varchar(500), \
year smallint, rlabel varchar(80), \
cnumber varchar(80), catid smallint, time int, \
reltype smallint, vanityhouse tinyint) \
engine=myisam;
sql_query_pre = insert into sphinx_tg \ sql_query_pre = insert into sphinx_tg \
(id, name, tags, year, rlabel, cnumber, catid, time, reltype, \ (id, name, tags, year, rlabel, cnumber, catid, reltype, \
vanityhouse) \ vanityhouse) \
select id, name, taglist, year, recordlabel, cataloguenumber, \ select id, name, taglist, year, recordlabel, cataloguenumber, \
categoryid, unix_timestamp(time), releasetype, \ categoryid, unix_timestamp(time), releasetype, \
vanityhouse \ vanityhouse \
from torrents_group \ from torrents_group \
where time < @starttime; where time < @starttime
sql_query_pre = create temporary table sphinx_t \ sql_query_pre = truncate sphinx_t
(id int primary key, gid int, size bigint, snatched int, \
seeders int, leechers int, time int, logscore smallint, \
scene tinyint, haslog tinyint, hascue tinyint, \
freetorrent tinyint, media varchar(15), \
format varchar(15), encoding varchar(30), \
remyear smallint, remtitle varchar(50), \
remrlabel varchar(50), remcnumber varchar(50), \
filelist mediumtext, \
index (gid)) \
engine=myisam;
sql_query_pre = insert into sphinx_t \ sql_query_pre = insert into sphinx_t \
(id, gid, size, snatched, seeders, leechers, time, logscore, scene, \ (id, gid, size, snatched, seeders, leechers, time, logscore, scene, \
haslog, hascue, freetorrent, media, format, encoding, \ haslog, hascue, freetorrent, media, format, encoding, \
remyear, remtitle, remrlabel, remcnumber, filelist) \ remyear, remtitle, remrlabel, remcnumber, filelist, uid, remident) \
select id, groupid, size, snatched, seeders, leechers, time, \ select id, groupid, size, snatched, seeders, leechers, unix_timestamp(time), \
logscore, cast(scene as char), cast(haslog as char), \ logscore, cast(scene as char), cast(haslog as char), \
cast(hascue as char), cast(freetorrent as char), media, \ cast(hascue as char), cast(freetorrent as char), media, \
format, encoding, remasteryear, remastertitle, \ format, encoding, remasteryear, remastertitle, \
remasterrecordlabel, remastercataloguenumber, filelist \ remasterrecordlabel, remastercataloguenumber, filelist, userid, \
crc32(concat_ws(' ', media, remasteryear, remastertitle, \
remasterrecordlabel, remastercataloguenumber)) \
from torrents \ from torrents \
where time < @starttime; where time < @starttime
sql_query_pre = create temporary table sphinx_a \ sql_query_pre = truncate sphinx_a
(gid int primary key, aname text) \
engine=myisam;
sql_query_pre = insert into sphinx_a \ sql_query_pre = insert into sphinx_a \
(gid, aname) \ (gid, aname) \
select groupid, group_concat(aa.name separator ' ') \ select groupid, group_concat(aa.name separator ' ') \
@ -90,7 +72,7 @@ source torrents : torrents_base {
join artists_alias aa using(aliasid) \ join artists_alias aa using(aliasid) \
where importance in ('1','3','4','5','6') \ where importance in ('1','3','4','5','6') \
group by ta.groupid \ group by ta.groupid \
order by null; order by null
sql_query = select t.id, g.id groupid, g.name groupname, tags taglist, \ sql_query = select t.id, g.id groupid, g.name groupname, tags taglist, \
@ -450,6 +432,37 @@ index log_delta : log {
path = /var/data/sphinx/log_delta path = /var/data/sphinx/log_delta
} }
source better_transcode : connect {
sql_attr_uint = logscore
sql_attr_uint = groupid
sql_attr_uint = uploader
sql_query = select t.id, groupid, logscore, format, encoding, \
name groupname, tags taglist, year, uploader, remident \
from (select t.id, gid groupid, uid uploader, remident, \
if(media='cd',max(t.logscore),100) logscore, \
group_concat(distinct format separator ' ') \
format, \
group_concat(distinct encoding separator ' ') \
encoding \
from sphinx_t t \
where format in ('mp3', 'flac') \
group by gid, remident) t \
join sphinx_tg g on g.id = groupid \
where catid = 1
sql_joined_field = artistname from query; \
select t.id, aname \
from sphinx_a \
join sphinx_t t using(gid) \
order by t.id asc
}
index better_transcode : torrents {
source = better_transcode
path = /var/data/sphinx/better_transcode
phrase_boundary =
}
indexer { indexer {
mem_limit = 64M mem_limit = 64M
} }