|
@ -1,9 +1,10 @@ |
|
|
<?php |
|
|
<?php |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
* Copyright (c) 2010-2012 Tinyboard Development Group |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
require 'inc/functions.php'; |
|
|
require 'inc/functions.php'; |
|
|
require 'inc/display.php'; |
|
|
|
|
|
require 'inc/template.php'; |
|
|
|
|
|
require 'inc/database.php'; |
|
|
|
|
|
require 'inc/user.php'; |
|
|
|
|
|
require 'inc/mod.php'; |
|
|
require 'inc/mod.php'; |
|
|
|
|
|
|
|
|
if (get_magic_quotes_gpc()) { |
|
|
if (get_magic_quotes_gpc()) { |
|
@ -57,7 +58,7 @@ |
|
|
|
|
|
|
|
|
// A sort of "cache" |
|
|
// A sort of "cache" |
|
|
// Stops calling preg_quote and str_replace when not needed; only does it once |
|
|
// Stops calling preg_quote and str_replace when not needed; only does it once |
|
|
$regex = Array( |
|
|
$regex = array( |
|
|
'board' => str_replace('%s', '(\w{1,8})', preg_quote($config['board_path'], '/')), |
|
|
'board' => str_replace('%s', '(\w{1,8})', preg_quote($config['board_path'], '/')), |
|
|
'page' => str_replace('%d', '(\d+)', preg_quote($config['file_page'], '/')), |
|
|
'page' => str_replace('%d', '(\d+)', preg_quote($config['file_page'], '/')), |
|
|
'img' => preg_quote($config['dir']['img'], '/'), |
|
|
'img' => preg_quote($config['dir']['img'], '/'), |
|
@ -68,7 +69,7 @@ |
|
|
|
|
|
|
|
|
if(preg_match('/^\/?$/', $query)) { |
|
|
if(preg_match('/^\/?$/', $query)) { |
|
|
// Dashboard |
|
|
// Dashboard |
|
|
$fieldset = Array( |
|
|
$fieldset = array( |
|
|
'Boards' => '', |
|
|
'Boards' => '', |
|
|
'Noticeboard' => '', |
|
|
'Noticeboard' => '', |
|
|
'Administration' => '', |
|
|
'Administration' => '', |
|
@ -187,7 +188,7 @@ |
|
|
if($code = @file_get_contents('http://tinyboard.org/version.txt', 0, $ctx)) { |
|
|
if($code = @file_get_contents('http://tinyboard.org/version.txt', 0, $ctx)) { |
|
|
eval($code); |
|
|
eval($code); |
|
|
if(preg_match('/v(\d+)\.(\d)\.(\d+)(-dev.+)?$/', $config['version'], $m)) { |
|
|
if(preg_match('/v(\d+)\.(\d)\.(\d+)(-dev.+)?$/', $config['version'], $m)) { |
|
|
$current = Array( |
|
|
$current = array( |
|
|
'massive' => (int)$m[1], |
|
|
'massive' => (int)$m[1], |
|
|
'major' => (int)$m[2], |
|
|
'major' => (int)$m[2], |
|
|
'minor' => (int)$m[3] |
|
|
'minor' => (int)$m[3] |
|
@ -236,7 +237,7 @@ |
|
|
$body .= '<fieldset><legend>' . _($title) . '</legend><ul>' . $data . '</ul></fieldset>'; |
|
|
$body .= '<fieldset><legend>' . _($title) . '</legend><ul>' . $data . '</ul></fieldset>'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>_('Dashboard'), |
|
|
'title'=>_('Dashboard'), |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -257,7 +258,7 @@ |
|
|
'</p>' . |
|
|
'</p>' . |
|
|
'<p style="text-align:center"><a style="margin:block;font-size:150%;font-weight:bold" href="?/' . utf8tohtml($uri) . '">Confirm</a></p>'; |
|
|
'<p style="text-align:center"><a style="margin:block;font-size:150%;font-weight:bold" href="?/' . utf8tohtml($uri) . '">Confirm</a></p>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'Confirm', |
|
|
'title'=>'Confirm', |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -274,7 +275,7 @@ |
|
|
$body = '<div class="ban"><h2>git pull</h2>'; |
|
|
$body = '<div class="ban"><h2>git pull</h2>'; |
|
|
$body .= '<p>' . str_replace("\n", '<br/>', shell_exec('git pull')) . '</p>'; |
|
|
$body .= '<p>' . str_replace("\n", '<br/>', shell_exec('git pull')) . '</p>'; |
|
|
$body .= '</div>'; |
|
|
$body .= '</div>'; |
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config' => $config, |
|
|
'config' => $config, |
|
|
'title' => 'Upgraded', |
|
|
'title' => 'Upgraded', |
|
|
'body' => $body |
|
|
'body' => $body |
|
@ -332,7 +333,7 @@ |
|
|
|
|
|
|
|
|
$version = preg_replace('/^savetheinternet-Tinyboard-(\w+)\//', '$1', $dir = $zip->getNameIndex(0)); |
|
|
$version = preg_replace('/^savetheinternet-Tinyboard-(\w+)\//', '$1', $dir = $zip->getNameIndex(0)); |
|
|
|
|
|
|
|
|
$errors = Array(); |
|
|
$errors = array(); |
|
|
for($i = 1; $i < $zip->numFiles; $i++) { |
|
|
for($i = 1; $i < $zip->numFiles; $i++) { |
|
|
$filename = str_replace($dir, '', $zip->getNameIndex($i)); |
|
|
$filename = str_replace($dir, '', $zip->getNameIndex($i)); |
|
|
|
|
|
|
|
@ -357,7 +358,7 @@ |
|
|
|
|
|
|
|
|
unlink($temp); |
|
|
unlink($temp); |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config' => $config, |
|
|
'config' => $config, |
|
|
'title' => 'Error(s) upgrading', |
|
|
'title' => 'Error(s) upgrading', |
|
|
'body' => $body |
|
|
'body' => $body |
|
@ -371,7 +372,7 @@ |
|
|
|
|
|
|
|
|
unlink($temp); |
|
|
unlink($temp); |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config' => $config, |
|
|
'config' => $config, |
|
|
'title' => 'Upgraded', |
|
|
'title' => 'Upgraded', |
|
|
'body' => '<p style="text-align:center">Upgrading seems to have gone okay. You are now at revision <strong>' . $version . '</strong>.</p>' |
|
|
'body' => '<p style="text-align:center">Upgrading seems to have gone okay. You are now at revision <strong>' . $version . '</strong>.</p>' |
|
@ -381,7 +382,7 @@ |
|
|
|
|
|
|
|
|
$page = isset($match[2]) ? $match[2] : 1; |
|
|
$page = isset($match[2]) ? $match[2] : 1; |
|
|
|
|
|
|
|
|
$boards = Array(); |
|
|
$boards = array(); |
|
|
$_boards = listBoards(); |
|
|
$_boards = listBoards(); |
|
|
foreach($_boards as &$_b) { |
|
|
foreach($_boards as &$_b) { |
|
|
$boards[$_b['id']] = $_b['uri']; |
|
|
$boards[$_b['id']] = $_b['uri']; |
|
@ -470,7 +471,7 @@ |
|
|
$body .= '</p>'; |
|
|
$body .= '</p>'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>_('Moderation log'), |
|
|
'title'=>_('Moderation log'), |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -483,7 +484,7 @@ |
|
|
// Clearsettings |
|
|
// Clearsettings |
|
|
query("TRUNCATE TABLE `theme_settings`") or error(db_error()); |
|
|
query("TRUNCATE TABLE `theme_settings`") or error(db_error()); |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'No theme', |
|
|
'title'=>'No theme', |
|
|
'body'=>'<p style="text-align:center">Successfully uninstalled all themes.</p>' . |
|
|
'body'=>'<p style="text-align:center">Successfully uninstalled all themes.</p>' . |
|
@ -496,7 +497,7 @@ |
|
|
|
|
|
|
|
|
rebuildTheme($match[1], 'all'); |
|
|
rebuildTheme($match[1], 'all'); |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'Rebuilt', |
|
|
'title'=>'Rebuilt', |
|
|
'body'=>'<p style="text-align:center">Successfully rebuilt the <strong>' . $match[1] . '</strong> theme.</p>' . |
|
|
'body'=>'<p style="text-align:center">Successfully rebuilt the <strong>' . $match[1] . '</strong> theme.</p>' . |
|
@ -511,7 +512,7 @@ |
|
|
$query->bindValue(':theme', $match[1]); |
|
|
$query->bindValue(':theme', $match[1]); |
|
|
$query->execute() or error(db_error($query)); |
|
|
$query->execute() or error(db_error($query)); |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'Uninstalled', |
|
|
'title'=>'Uninstalled', |
|
|
'body'=>'<p style="text-align:center">Successfully uninstalled the <strong>' . $match[1] . '</strong> theme.</p>' . |
|
|
'body'=>'<p style="text-align:center">Successfully uninstalled the <strong>' . $match[1] . '</strong> theme.</p>' . |
|
@ -585,7 +586,7 @@ |
|
|
// Build themes |
|
|
// Build themes |
|
|
rebuildThemes('all'); |
|
|
rebuildThemes('all'); |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>($result ? 'Installed "' . utf8tohtml($theme['name']) . '"' : 'Installation failed!'), |
|
|
'title'=>($result ? 'Installed "' . utf8tohtml($theme['name']) . '"' : 'Installation failed!'), |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -626,7 +627,7 @@ |
|
|
|
|
|
|
|
|
$body .= '<p style="text-align:center"><input name="install" type="submit" value="Install theme" /></p></form>'; |
|
|
$body .= '<p style="text-align:center"><input name="install" type="submit" value="Install theme" /></p></form>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'Installing "' . utf8tohtml($theme['name']) . '"', |
|
|
'title'=>'Installing "' . utf8tohtml($theme['name']) . '"', |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -636,14 +637,14 @@ |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
$themes_in_use = Array(); |
|
|
$themes_in_use = array(); |
|
|
$query = query("SELECT `theme` FROM `theme_settings` WHERE `name` IS NULL AND `value` IS NULL") or error(db_error()); |
|
|
$query = query("SELECT `theme` FROM `theme_settings` WHERE `name` IS NULL AND `value` IS NULL") or error(db_error()); |
|
|
while($theme = $query->fetch()) { |
|
|
while($theme = $query->fetch()) { |
|
|
$themes_in_use[$theme['theme']] = true; |
|
|
$themes_in_use[$theme['theme']] = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Scan directory for themes |
|
|
// Scan directory for themes |
|
|
$themes = Array(); |
|
|
$themes = array(); |
|
|
while($file = readdir($dir)) { |
|
|
while($file = readdir($dir)) { |
|
|
if($file[0] != '.' && is_dir($config['dir']['themes'] . '/' . $file)) { |
|
|
if($file[0] != '.' && is_dir($config['dir']['themes'] . '/' . $file)) { |
|
|
$themes[] = $file; |
|
|
$themes[] = $file; |
|
@ -702,7 +703,7 @@ |
|
|
if(!empty($themes_in_use)) |
|
|
if(!empty($themes_in_use)) |
|
|
$body .= '<p style="text-align:center"><a href="?/themes/none">' . _('Uninstall all themes.') . '</a></p>'; |
|
|
$body .= '<p style="text-align:center"><a href="?/themes/none">' . _('Uninstall all themes.') . '</a></p>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>_('Manage themes'), |
|
|
'title'=>_('Manage themes'), |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -785,7 +786,7 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>_('Noticeboard'), |
|
|
'title'=>_('Noticeboard'), |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -867,7 +868,7 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>_('News'), |
|
|
'title'=>_('News'), |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -916,7 +917,7 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>_('PM Inbox') . ' (' . ($query->rowCount() == 0 ? _('empty') : $unread_pms . ' ' . _('unread')) . ')', |
|
|
'title'=>_('PM Inbox') . ' (' . ($query->rowCount() == 0 ? _('empty') : $unread_pms . ' ' . _('unread')) . ')', |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -1002,7 +1003,7 @@ |
|
|
|
|
|
|
|
|
'<p style="text-align:center"><a href="?/new_PM/' . $pm['sender'] . '/' . $pm['id'] . '">Reply with quote</a></p>'; |
|
|
'<p style="text-align:center"><a href="?/new_PM/' . $pm['sender'] . '/' . $pm['id'] . '">Reply with quote</a></p>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'Private message', |
|
|
'title'=>'Private message', |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -1042,7 +1043,7 @@ |
|
|
|
|
|
|
|
|
modLog('Sent a PM to ' . $to['username']); |
|
|
modLog('Sent a PM to ' . $to['username']); |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'PM sent', |
|
|
'title'=>'PM sent', |
|
|
'body'=>'<p style="text-align:center">Message sent successfully to ' . utf8tohtml($to['username']) . '.</p>', |
|
|
'body'=>'<p style="text-align:center">Message sent successfully to ' . utf8tohtml($to['username']) . '.</p>', |
|
@ -1084,7 +1085,7 @@ |
|
|
|
|
|
|
|
|
'</form>'; |
|
|
'</form>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'New PM for ' . utf8tohtml($to['username']), |
|
|
'title'=>'New PM for ' . utf8tohtml($to['username']), |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -1109,14 +1110,14 @@ |
|
|
$phrase = &$_POST['search']; |
|
|
$phrase = &$_POST['search']; |
|
|
$_body = ''; |
|
|
$_body = ''; |
|
|
|
|
|
|
|
|
$filters = Array(); |
|
|
$filters = array(); |
|
|
|
|
|
|
|
|
function search_filters($m) { |
|
|
function search_filters($m) { |
|
|
global $filters; |
|
|
global $filters; |
|
|
$name = $m[2]; |
|
|
$name = $m[2]; |
|
|
$value = isset($m[4]) ? $m[4] : $m[3]; |
|
|
$value = isset($m[4]) ? $m[4] : $m[3]; |
|
|
|
|
|
|
|
|
if(!in_array($name, Array('id', 'thread', 'subject', 'email', 'name', 'trip', 'capcode', 'filename', 'filehash', 'ip'))) { |
|
|
if(!in_array($name, array('id', 'thread', 'subject', 'email', 'name', 'trip', 'capcode', 'filename', 'filehash', 'ip'))) { |
|
|
// unknown filter |
|
|
// unknown filter |
|
|
return $m[0]; |
|
|
return $m[0]; |
|
|
} |
|
|
} |
|
@ -1138,7 +1139,7 @@ |
|
|
$phrase = str_replace('*', '%', $phrase); |
|
|
$phrase = str_replace('*', '%', $phrase); |
|
|
|
|
|
|
|
|
$like = ''; |
|
|
$like = ''; |
|
|
$match = Array(); |
|
|
$match = array(); |
|
|
|
|
|
|
|
|
// Find exact phrases |
|
|
// Find exact phrases |
|
|
if(preg_match_all('/"(.+?)"/', $phrase, $m)) { |
|
|
if(preg_match_all('/"(.+?)"/', $phrase, $m)) { |
|
@ -1204,7 +1205,7 @@ |
|
|
$body .= '<p style="text-align:center" class="unimportant">(No results.)</p>'; |
|
|
$body .= '<p style="text-align:center" class="unimportant">(No results.)</p>'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'Search', |
|
|
'title'=>'Search', |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -1279,7 +1280,7 @@ |
|
|
|
|
|
|
|
|
$body .= '</form>'; |
|
|
$body .= '</form>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>_('Manage users'), |
|
|
'title'=>_('Manage users'), |
|
|
'body'=>$body |
|
|
'body'=>$body |
|
@ -1307,7 +1308,7 @@ |
|
|
error(sprintf($config['error']['modexists'], $_mod['id'])); |
|
|
error(sprintf($config['error']['modexists'], $_mod['id'])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$boards = Array(); |
|
|
$boards = array(); |
|
|
foreach($_POST as $name => $null) { |
|
|
foreach($_POST as $name => $null) { |
|
|
if(preg_match('/^board_(.+)$/', $name, $m)) |
|
|
if(preg_match('/^board_(.+)$/', $name, $m)) |
|
|
$boards[] = $m[1]; |
|
|
$boards[] = $m[1]; |
|
@ -1327,7 +1328,7 @@ |
|
|
|
|
|
|
|
|
$__boards = '<ul style="list-style:none;padding:2px 5px">'; |
|
|
$__boards = '<ul style="list-style:none;padding:2px 5px">'; |
|
|
$boards = array_merge( |
|
|
$boards = array_merge( |
|
|
Array(Array('uri' => '*', 'title' => 'All') |
|
|
array(array('uri' => '*', 'title' => 'All') |
|
|
), listBoards()); |
|
|
), listBoards()); |
|
|
foreach($boards as &$_board) { |
|
|
foreach($boards as &$_board) { |
|
|
$__boards .= '<li>' . |
|
|
$__boards .= '<li>' . |
|
@ -1365,7 +1366,7 @@ |
|
|
// End form |
|
|
// End form |
|
|
'</form></fieldset>'; |
|
|
'</form></fieldset>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'New user', |
|
|
'title'=>'New user', |
|
|
'body'=>$body |
|
|
'body'=>$body |
|
@ -1419,7 +1420,7 @@ |
|
|
|
|
|
|
|
|
if((isset($_POST['username']) && isset($_POST['password'])) || (isset($change_password_only) && isset($_POST['password']))) { |
|
|
if((isset($_POST['username']) && isset($_POST['password'])) || (isset($change_password_only) && isset($_POST['password']))) { |
|
|
if(!isset($change_password_only)) { |
|
|
if(!isset($change_password_only)) { |
|
|
$boards = Array(); |
|
|
$boards = array(); |
|
|
foreach($_POST as $name => $null) { |
|
|
foreach($_POST as $name => $null) { |
|
|
if(preg_match('/^board_(.+)$/', $name, $m)) |
|
|
if(preg_match('/^board_(.+)$/', $name, $m)) |
|
|
$boards[] = $m[1]; |
|
|
$boards[] = $m[1]; |
|
@ -1469,7 +1470,7 @@ |
|
|
|
|
|
|
|
|
$__boards = '<ul style="list-style:none;padding:2px 5px">'; |
|
|
$__boards = '<ul style="list-style:none;padding:2px 5px">'; |
|
|
$boards = array_merge( |
|
|
$boards = array_merge( |
|
|
Array(Array('uri' => '*', 'title' => 'All') |
|
|
array(array('uri' => '*', 'title' => 'All') |
|
|
), listBoards()); |
|
|
), listBoards()); |
|
|
|
|
|
|
|
|
$_mod['boards'] = explode(',', $_mod['boards']); |
|
|
$_mod['boards'] = explode(',', $_mod['boards']); |
|
@ -1526,7 +1527,7 @@ |
|
|
|
|
|
|
|
|
'</fieldset>'; |
|
|
'</fieldset>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'Edit user', |
|
|
'title'=>'Edit user', |
|
|
'body'=>$body |
|
|
'body'=>$body |
|
@ -1605,7 +1606,7 @@ |
|
|
$body .= '<p class="unimportant" style="text-align:center">Showing ' . |
|
|
$body .= '<p class="unimportant" style="text-align:center">Showing ' . |
|
|
($reports == $count['count'] ? 'all ' . $reports . ' reports' : $reports . ' of ' . $count['count'] . ' reports') . '.</p>'; |
|
|
($reports == $count['count'] ? 'all ' . $reports . ' reports' : $reports . ' of ' . $count['count'] . ' reports') . '.</p>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>_('Report queue') . ' (' . $count['count'] . ')', |
|
|
'title'=>_('Report queue') . ' (' . $count['count'] . ')', |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -1761,7 +1762,7 @@ |
|
|
|
|
|
|
|
|
'</fieldset>'; |
|
|
'</fieldset>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'Manage – ' . sprintf($config['board_abbreviation'], $board['uri']), |
|
|
'title'=>'Manage – ' . sprintf($config['board_abbreviation'], $board['uri']), |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -1874,7 +1875,7 @@ |
|
|
'</form>'; |
|
|
'</form>'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>_('Ban list'), |
|
|
'title'=>_('Ban list'), |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -1892,7 +1893,7 @@ |
|
|
$body = 'An error occured while trying to flush cache.'; |
|
|
$body = 'An error occured while trying to flush cache.'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'Flushed', |
|
|
'title'=>'Flushed', |
|
|
'body'=>'<p style="text-align:center">' . $body . '</p>', |
|
|
'body'=>'<p style="text-align:center">' . $body . '</p>', |
|
@ -1906,7 +1907,7 @@ |
|
|
$body = '<div class="ban"><h2>Rebuilding…</h2><p>'; |
|
|
$body = '<div class="ban"><h2>Rebuilding…</h2><p>'; |
|
|
|
|
|
|
|
|
$body .= 'Clearing template cache…<br/>'; |
|
|
$body .= 'Clearing template cache…<br/>'; |
|
|
$twig = new Twig_Environment($loader, Array( |
|
|
$twig = new Twig_Environment($loader, array( |
|
|
'cache' => "{$config['dir']['template']}/cache" |
|
|
'cache' => "{$config['dir']['template']}/cache" |
|
|
)); |
|
|
)); |
|
|
$twig->clearCacheFiles(); |
|
|
$twig->clearCacheFiles(); |
|
@ -1945,7 +1946,7 @@ |
|
|
unset($board); |
|
|
unset($board); |
|
|
modLog('Rebuilt everything'); |
|
|
modLog('Rebuilt everything'); |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'Rebuilt', |
|
|
'title'=>'Rebuilt', |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -1962,8 +1963,8 @@ |
|
|
|
|
|
|
|
|
$body = '<fieldset><legend>' . _('Configuration') . '</legend><form action="" method="post"><table style="width:100%">'; |
|
|
$body = '<fieldset><legend>' . _('Configuration') . '</legend><form action="" method="post"><table style="width:100%">'; |
|
|
|
|
|
|
|
|
$var_force_string = Array('blotter'); |
|
|
$var_force_string = array('blotter'); |
|
|
$var_system = Array('version'); |
|
|
$var_system = array('version'); |
|
|
|
|
|
|
|
|
if(isset($_POST['save_changes'])) { |
|
|
if(isset($_POST['save_changes'])) { |
|
|
$config_append = ''; |
|
|
$config_append = ''; |
|
@ -2009,7 +2010,7 @@ |
|
|
|
|
|
|
|
|
if($config['minify_html']) |
|
|
if($config['minify_html']) |
|
|
$config_append = str_replace("\n", '
', $config_append); |
|
|
$config_append = str_replace("\n", '
', $config_append); |
|
|
$page = Array(); |
|
|
$page = array(); |
|
|
$page['title'] = 'Cannot write to file!'; |
|
|
$page['title'] = 'Cannot write to file!'; |
|
|
$page['config'] = $config; |
|
|
$page['config'] = $config; |
|
|
$page['body'] = ' |
|
|
$page['body'] = ' |
|
@ -2049,7 +2050,7 @@ |
|
|
|
|
|
|
|
|
$body .= '</table><div style="text-align:center"><input name="save_changes" type="submit" value="Save changes"></div></form></fieldset>'; |
|
|
$body .= '</table><div style="text-align:center"><input name="save_changes" type="submit" value="Save changes"></div></form></fieldset>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>_('Configuration'), |
|
|
'title'=>_('Configuration'), |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -2104,7 +2105,7 @@ |
|
|
'<a href="?/config/edit">[Edit using web editor]</a>' : '') . |
|
|
'<a href="?/config/edit">[Edit using web editor]</a>' : '') . |
|
|
'<fieldset><legend>' . _('Configuration') . '</legend><table>' . $data . '</table></fieldset>'; |
|
|
'<fieldset><legend>' . _('Configuration') . '</legend><table>' . $data . '</table></fieldset>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>_('Configuration'), |
|
|
'title'=>_('Configuration'), |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -2124,7 +2125,7 @@ |
|
|
!isset($_POST['subtitle']) |
|
|
!isset($_POST['subtitle']) |
|
|
) error($config['error']['missedafield']); |
|
|
) error($config['error']['missedafield']); |
|
|
|
|
|
|
|
|
$b = Array( |
|
|
$b = array( |
|
|
'uri' => $_POST['uri'], |
|
|
'uri' => $_POST['uri'], |
|
|
'title' => $_POST['title'], |
|
|
'title' => $_POST['title'], |
|
|
'subtitle' => $_POST['subtitle'] |
|
|
'subtitle' => $_POST['subtitle'] |
|
@ -2165,7 +2166,7 @@ |
|
|
openBoard($b['uri']) or error(_("Couldn't open board after creation.")); |
|
|
openBoard($b['uri']) or error(_("Couldn't open board after creation.")); |
|
|
|
|
|
|
|
|
// Create the posts table |
|
|
// Create the posts table |
|
|
query(Element('posts.sql', Array('board' => $board['uri']))) or error(db_error()); |
|
|
query(Element('posts.sql', array('board' => $board['uri']))) or error(db_error()); |
|
|
|
|
|
|
|
|
if($config['cache']['enabled']) |
|
|
if($config['cache']['enabled']) |
|
|
cache::delete('all_boards'); |
|
|
cache::delete('all_boards'); |
|
@ -2182,7 +2183,7 @@ |
|
|
|
|
|
|
|
|
// TODO: Statistics, etc, in the dashboard. |
|
|
// TODO: Statistics, etc, in the dashboard. |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'New board', |
|
|
'title'=>'New board', |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -2316,7 +2317,7 @@ |
|
|
'</table>' . |
|
|
'</table>' . |
|
|
'</form>'; |
|
|
'</form>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config' => $config, |
|
|
'config' => $config, |
|
|
'body' => $body, |
|
|
'body' => $body, |
|
|
'title' => 'Edit Post #' . $postID |
|
|
'title' => 'Edit Post #' . $postID |
|
@ -2493,7 +2494,7 @@ |
|
|
if($global) |
|
|
if($global) |
|
|
$boards = listBoards(); |
|
|
$boards = listBoards(); |
|
|
else |
|
|
else |
|
|
$boards = Array(Array('uri' => $board['uri'])); |
|
|
$boards = array(array('uri' => $board['uri'])); |
|
|
|
|
|
|
|
|
$query = ''; |
|
|
$query = ''; |
|
|
foreach($boards as $_board) { |
|
|
foreach($boards as $_board) { |
|
@ -2508,7 +2509,7 @@ |
|
|
if($query->rowCount() < 1) |
|
|
if($query->rowCount() < 1) |
|
|
error($config['error']['invalidpost']); |
|
|
error($config['error']['invalidpost']); |
|
|
|
|
|
|
|
|
$boards = Array(); |
|
|
$boards = array(); |
|
|
while($post = $query->fetch()) { |
|
|
while($post = $query->fetch()) { |
|
|
openBoard($post['board']); |
|
|
openBoard($post['board']); |
|
|
$boards[] = $post['board']; |
|
|
$boards[] = $post['board']; |
|
@ -2714,7 +2715,7 @@ |
|
|
$query->bindValue(':id', $postID, PDO::PARAM_INT); |
|
|
$query->bindValue(':id', $postID, PDO::PARAM_INT); |
|
|
$query->execute() or error(db_error($query)); |
|
|
$query->execute() or error(db_error($query)); |
|
|
|
|
|
|
|
|
$replies = Array(); |
|
|
$replies = array(); |
|
|
while($post = $query->fetch()) { |
|
|
while($post = $query->fetch()) { |
|
|
$post['mod'] = true; |
|
|
$post['mod'] = true; |
|
|
$post['thread'] = $newID; |
|
|
$post['thread'] = $newID; |
|
@ -2731,7 +2732,7 @@ |
|
|
$replies[] = $post; |
|
|
$replies[] = $post; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$newIDs = Array($postID => $newID); |
|
|
$newIDs = array($postID => $newID); |
|
|
|
|
|
|
|
|
openBoard($targetBoard); |
|
|
openBoard($targetBoard); |
|
|
foreach($replies as &$post) { |
|
|
foreach($replies as &$post) { |
|
@ -2784,7 +2785,7 @@ |
|
|
$query->bindValue(':id', $postID, PDO::PARAM_INT); |
|
|
$query->bindValue(':id', $postID, PDO::PARAM_INT); |
|
|
$query->execute() or error(db_error($query)); |
|
|
$query->execute() or error(db_error($query)); |
|
|
|
|
|
|
|
|
$post = Array( |
|
|
$post = array( |
|
|
'mod' => true, |
|
|
'mod' => true, |
|
|
'subject' => '', |
|
|
'subject' => '', |
|
|
'email' => '', |
|
|
'email' => '', |
|
@ -2861,7 +2862,7 @@ |
|
|
'</table>' . |
|
|
'</table>' . |
|
|
'</form></fieldset>'; |
|
|
'</form></fieldset>'; |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'Move #' . $postID, |
|
|
'title'=>'Move #' . $postID, |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -2897,7 +2898,7 @@ |
|
|
|
|
|
|
|
|
$body = form_newBan($post['ip'], null, '?/' . sprintf($config['board_path'], $board['uri']) . $config['file_index'], $post['id'], $boardName, !$delete); |
|
|
$body = form_newBan($post['ip'], null, '?/' . sprintf($config['board_path'], $board['uri']) . $config['file_index'], $post['id'], $boardName, !$delete); |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'New ban', |
|
|
'title'=>'New ban', |
|
|
'body'=>$body, |
|
|
'body'=>$body, |
|
@ -3112,7 +3113,7 @@ |
|
|
if(hasPermission($config['mod']['ip_banform'])) |
|
|
if(hasPermission($config['mod']['ip_banform'])) |
|
|
$body .= form_newBan($ip, null, '?/IP/' . $ip); |
|
|
$body .= form_newBan($ip, null, '?/IP/' . $ip); |
|
|
|
|
|
|
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'IP: ' . $ip, |
|
|
'title'=>'IP: ' . $ip, |
|
|
'subtitle' => $host, |
|
|
'subtitle' => $host, |
|
@ -3126,4 +3127,3 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
?> |
|
|
|
|
|