remove a bunch of dead code

This commit is contained in:
Shish 2014-03-29 11:44:34 +00:00
parent 7b68d8ebfd
commit db5aa56300
34 changed files with 17 additions and 77 deletions

View file

@ -910,8 +910,6 @@ class Image {
// more than one positive tag, or more than zero negative tags
else {
$s_tag_array = array_map("sql_escape", $tag_search->variables);
$tag_id_array = array();
$tags_ok = true;
foreach($tag_search->variables as $tag) {
@ -1113,7 +1111,6 @@ function move_upload_to_archive(DataUploadEvent $event) {
if(!@copy($event->tmpname, $target)) {
$errors = error_get_last(); // note: requires php 5.2
throw new UploadException("Failed to copy file from uploads ({$event->tmpname}) to archive ($target): {$errors['type']} / {$errors['message']}");
return false;
}
return true;
}

View file

@ -451,7 +451,7 @@ function captcha_get_html() {
}
else {
session_start();
$securimg = new Securimage();
//$securimg = new Securimage();
$base = get_base_href();
$captcha = "<br/><img src='$base/lib/securimage/securimage_show.php?sid=". md5(uniqid(time())) ."'>".
"<br/>CAPTCHA: <input type='text' name='code' value='' />";

View file

@ -198,7 +198,7 @@ class ArtistsTheme extends Themelet {
$artist['name'] = str_replace("_", " ", $artist['name']);
$elementLink = "<a href='".make_link("artist/view/".$artist['artist_id'])."'>".str_replace("_", " ", $artist['name'])."</a>";
$artist_link = "<a href='".make_link("artist/view/".$artist['artist_id'])."'>".str_replace("_", " ", $artist['artist_name'])."</a>";
//$artist_link = "<a href='".make_link("artist/view/".$artist['artist_id'])."'>".str_replace("_", " ", $artist['artist_name'])."</a>";
$user_link = "<a href='".make_link("user/".$artist['user_name'])."'>".$artist['user_name']."</a>";
$edit_link = "<a href='".make_link($editionLinkActionArray[$artist['type']].$artist['id'])."'>Edit</a>";
$del_link = "<a href='".make_link($deletionLinkActionArray[$artist['type']].$artist['id'])."'>Delete</a>";

View file

@ -133,7 +133,7 @@ class BlotterTheme extends Themelet {
// Reset variables:
$i_open = "";
$i_close = "";
$id = $entries[$i]['id'];
//$id = $entries[$i]['id'];
$messy_date = $entries[$i]['entry_date'];
$clean_date = date("m/d/y", strtotime($messy_date));
$entry_text = $entries[$i]['entry_text'];
@ -144,8 +144,6 @@ class BlotterTheme extends Themelet {
$entries_list .= "<li>{$i_open}{$clean_date} - {$entry_text}{$i_close}</li>";
}
$out_text = "";
$in_text = "";
$pos_break = "";
$pos_align = "text-align: right; position: absolute; right: 0px;";

View file

@ -244,7 +244,7 @@ class CommentListTheme extends Themelet {
$hb = ($comment->owner_class == "hellbanned" ? "hb" : "");
if($trim) {
return "
$html = "
<div class=\"comment $hb\">
$h_userlink: $h_comment
<a href=\"".make_link("post/view/$i_image_id#c$i_comment_id")."\">&gt;&gt;&gt;</a>
@ -263,7 +263,7 @@ class CommentListTheme extends Themelet {
$h_del = $user->can("delete_comment") ?
' - <a onclick="return confirm(\'Delete comment by '.$h_name.':\\n'.$stripped_nonl.'\');" '.
'href="'.make_link('comment/delete/'.$i_comment_id.'/'.$i_image_id).'">Del</a>' : '';
return "
$html = "
<div class=\"comment $hb\" id=\"c$i_comment_id\">
<div class=\"info\">
$h_avatar
@ -273,7 +273,7 @@ class CommentListTheme extends Themelet {
</div>
";
}
return "";
return $html;
}
protected function build_postbox(/*int*/ $image_id) {

View file

@ -106,9 +106,6 @@ class DanbooruApi extends Extension {
if($user->can("create_image"))
{
$file = null;
$filename = "";
$source = "";
if(isset($_FILES['file']))
{ // A file was POST'd in
$file = $_FILES['file']['tmp_name'];

View file

@ -51,7 +51,7 @@ class Favorites extends Extension {
public function onDisplayingImage(DisplayingImageEvent $event) {
$people = $this->list_persons_who_have_favorited($event->image);
if(count($people) > 0) {
$html = $this->theme->display_people($people);
$this->theme->display_people($people);
}
}

View file

@ -60,7 +60,6 @@ class IcoFileHandler extends Extension {
$image = new Image();
$info = "";
$fp = fopen($filename, "r");
$header = unpack("snull/stype/scount", fread($fp, 6));

View file

@ -18,8 +18,8 @@ class PixelFileHandler extends DataHandlerExtension {
$image = new Image();
$info = "";
if(!($info = getimagesize($filename))) return null;
$info = getimagesize($filename);
if(!$info) return null;
$image->width = $info[0];
$image->height = $info[1];

View file

@ -10,7 +10,6 @@ class SVGFileHandler extends Extension {
public function onDataUpload(DataUploadEvent $event) {
if($this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {
$hash = $event->hash;
$ha = substr($hash, 0, 2);
if(!move_upload_to_archive($event)) return;
send_event(new ThumbnailGenerationEvent($event->hash, $event->type));
$image = $this->create_image_from_data(warehouse_path("images", $hash), $event->metadata);
@ -27,7 +26,6 @@ class SVGFileHandler extends Extension {
global $config;
if($this->supported_ext($event->type)) {
$hash = $event->hash;
$ha = substr($hash, 0, 2);
copy("ext/handle_svg/thumb.jpg", warehouse_path("thumbs", $hash));
}

View file

@ -22,7 +22,6 @@ class ImageBanTheme extends Themelet {
*/
public function display_image_hash_bans(Page $page, $page_number, $page_count, $bans) {
$h_bans = "";
$n = 0;
foreach($bans as $ban) {
$h_bans .= "
<tr>

View file

@ -14,7 +14,6 @@ class IPBanTheme extends Themelet {
public function display_bans(Page $page, $bans) {
global $database, $user;
$h_bans = "";
$n = 0;
$prefix = ($database->get_driver_name() == "sqlite" ? "bans." : "");
$prefix2 = ($database->get_driver_name() == "sqlite" ? "users." : "");
foreach($bans as $ban) {

View file

@ -40,7 +40,6 @@ class LogDatabaseTheme extends Themelet {
</form>
</thead>
<tbody>\n";
$n = 0;
reset($events); // rewind to first element in array.
foreach($events as $event) {

View file

@ -2,7 +2,6 @@
class NotATagTheme extends Themelet {
public function display_untags(Page $page, $page_number, $page_count, $bans) {
$h_bans = "";
$n = 0;
foreach($bans as $ban) {
$h_bans .= "
<tr>

View file

@ -588,7 +588,6 @@ class Notes extends Extension {
$noteEnable = $history['note_enable'];
$noteID = $history['note_id'];
$imageID = $history['image_id'];
$userID = $user->id;
$noteX1 = $history['x1'];
$noteY1 = $history['y1'];
$noteHeight = $history['height'];

View file

@ -189,7 +189,6 @@ class NotesTheme extends Themelet {
$html .= "</tr></thead>".
"<tbody>";
$n = 0;
foreach($histories as $history) {
$image_link = "<a href='".make_link("post/view/".$history['image_id'])."'>".$history['image_id']."</a>";
$history_link = "<a href='".make_link("note/history/".$history['note_id'])."'>".$history['note_id'].".".$history['review_id']."</a>";
@ -237,7 +236,6 @@ class NotesTheme extends Themelet {
$html .= "</tr></thead>".
"<tbody>";
$n = 0;
foreach($histories as $history) {
$image_link = "<a href='".make_link("post/view/".$history['image_id'])."'>".$history['image_id']."</a>";
$history_link = "<a href='".make_link("note/history/".$history['note_id'])."'>".$history['note_id'].".".$history['review_id']."</a>";

View file

@ -9,7 +9,6 @@ class OekakiTheme extends Themelet {
global $config, $page;
$base_href = get_base_href();
$http_base = make_http($base_href);
$oekW = $config->get_int("oekaki_width", 400);
$oekH = $config->get_int("oekaki_height", 400);

View file

@ -8,7 +8,6 @@ class PrivMsgTheme extends Themelet {
<table id='pms' class='zebra sortable'>
<thead><tr><th>R?</th><th>Subject</th><th>From</th><th>Date</th><th>Action</th></tr></thead>
<tbody>";
$n = 0;
foreach($pms as $pm) {
$h_subject = html_escape($pm->subject);
if(strlen(trim($h_subject)) == 0) $h_subject = "(No subject)";

View file

@ -12,7 +12,6 @@ class PoolsTheme extends Themelet {
}
public function get_adder_html(Image $image, /*array*/ $pools) {
$editor = "";
$h = "";
foreach($pools as $pool) {
$h .= "<option value='".$pool['id']."'>".html_escape($pool['title'])."</option>";
@ -43,8 +42,6 @@ class PoolsTheme extends Themelet {
<th>Public</th>
</tr></thead><tbody>';
$n = 0;
// Build up the list of pools.
foreach($pools as $pool) {
$pool_link = '<a href="'.make_link("pool/view/".$pool['id']).'">'.html_escape($pool['title'])."</a>";
@ -133,7 +130,6 @@ class PoolsTheme extends Themelet {
<th class="left">Description</th>
</tr></thead><tbody>';
$n = 0;
foreach($pools as $pool) {
$pool_info .= "<tr>".
"<td class='left'>".html_escape($pool['title'])."</td>".
@ -303,15 +299,15 @@ class PoolsTheme extends Themelet {
$this->display_top($pools, "Sorting Pool");
$pool_images = "\n<form action='".make_link("pool/order")."' method='POST' name='checks'>";
$n = 0;
$i = 0;
foreach($images as $pair) {
$image = $pair[0];
$thumb_html = $this->build_thumb_html($image);
$pool_images .= '<span class="thumb">'."\n".$thumb_html."\n".
'<br><input name="imgs['.$n.'][]" type="text" style="max-width:50px;" value="'.$image->image_order.'" />'.
'<input name="imgs['.$n.'][]" type="hidden" value="'.$image->id.'" />'.
'<br><input name="imgs['.$i.'][]" type="text" style="max-width:50px;" value="'.$image->image_order.'" />'.
'<input name="imgs['.$i.'][]" type="hidden" value="'.$image->id.'" />'.
'</span>';
$n++;
$i++;
}
$pool_images .= "<br>".
@ -382,7 +378,6 @@ class PoolsTheme extends Themelet {
<th>Action</th>
</tr></thead><tbody>';
$n = 0;
foreach($histories as $history) {
$pool_link = "<a href='".make_link("pool/view/".$history['pool_id'])."'>".html_escape($history['title'])."</a>";
$user_link = "<a href='".make_link("user/".url_escape($history['user_name']))."'>".html_escape($history['user_name'])."</a>";

View file

@ -2,7 +2,6 @@
class RatingsTheme extends Themelet {
public function get_rater_html(/*int*/ $image_id, /*string*/ $rating) {
$i_image_id = int_escape($image_id);
$s_checked = $rating == 's' ? " checked" : "";
$q_checked = $rating == 'q' ? " checked" : "";
$e_checked = $rating == 'e' ? " checked" : "";

View file

@ -15,7 +15,6 @@ class ReportImageTheme extends Themelet {
global $config;
$h_reportedimages = "";
$n = 0;
foreach($reports as $report) {
$image = $report['image'];
$h_reason = format_text($report['reason']);

View file

@ -229,7 +229,7 @@ class ResizeImage extends Extension {
$transparency = imagecolortransparent($image);
if ($transparency >= 0) {
$transparent_color = imagecolorsforindex($image, $trnprt_indx);
//$transparent_color = imagecolorsforindex($image, $trnprt_indx);
$transparency = imagecolorallocate($image_resized, $trnprt_color['red'], $trnprt_color['green'], $trnprt_color['blue']);
imagefill($image_resized, 0, 0, $transparency);
imagecolortransparent($image_resized, $transparency);

View file

@ -7,7 +7,6 @@ class ResizeImageTheme extends Themelet {
public function get_resize_html(Image $image) {
global $user, $config;
$i_image_id = int_escape($image->id);
$default_width = $config->get_int('resize_default_width');
$default_height = $config->get_int('resize_default_height');

View file

@ -7,8 +7,6 @@ class RotateImageTheme extends Themelet {
public function get_rotate_html(/*int*/ $image_id) {
global $user, $config;
$i_image_id = int_escape($image_id);
$html = "
".make_form(make_link('rotate/'.$image_id), 'POST')."
<input type='hidden' name='image_id' value='$image_id'>

View file

@ -23,7 +23,6 @@ class SetupTheme extends Themelet {
*/
$setupblock_html = "";
foreach($panel->blocks as $block) {
$html = $this->sb_to_html($block);
$setupblock_html .= $this->sb_to_html($block);
}
@ -44,12 +43,10 @@ class SetupTheme extends Themelet {
global $user;
$h_rows = "";
$n = 0;
ksort($options);
foreach($options as $name => $value) {
$h_name = html_escape($name);
$h_value = html_escape($value);
$len = strlen($h_value);
$h_box = "";
if(strpos($value, "\n") > 0) {

View file

@ -63,7 +63,7 @@ class XMLSitemap extends Extension {
{
global $database, $config;
// add index
$index[0] = $base_href = $config->get_string("front_page");
$index[0] = $config->get_string("front_page");
$this->add_sitemap_queue($index, "weekly", "1");
/* --- Add 20 most used tags --- */
@ -162,4 +162,4 @@ class XMLSitemap extends Extension {
$page->set_data($xml);
}
}
?>
?>

View file

@ -351,7 +351,7 @@ class Source_History extends Extension {
}
// add a history entry
$row = $database->execute("
$database->execute("
INSERT INTO source_histories(image_id, source, user_id, user_ip, date_set)
VALUES (?, ?, ?, ?, now())",
array($image->id, $new_source, $user->id, $_SERVER['REMOTE_ADDR']));

View file

@ -80,7 +80,6 @@ class TaggerXML extends Extension {
$q_where = "WHERE {$match} {$hidden} AND count > 0";
// FROM based on return count
$q_from = null;
$count = $this->count($q_where,$values);
if ($count > $max_rows) {
$q_from = "FROM (SELECT * FROM `tags` {$q_where} ".
@ -139,25 +138,5 @@ class TaggerXML extends Extension {
return $database->Execute(
"SELECT COUNT(*) FROM `tags` $query",$values)->fields['COUNT(*)'];
}
private function image_tags ($image_id) {
global $database;
$list = "(";
$i_tags = $database->Execute(
"SELECT tag_id FROM `image_tags` WHERE image_id=?",
array($image_id));
$b = false;
foreach($i_tags as $tag) {
if($b)
$list .= ",";
$b = true;
$list .= $tag['tag_id'];
}
$list .= ")";
return $list;
}
}
?>

View file

@ -65,7 +65,6 @@ class TipsTheme extends Themelet {
$html .= "</tr></thead>";
$n = 0;
foreach ($tips as $tip) {
$tip_enable = ($tip['enable'] == "Y") ? "Yes" : "No";
$set_link = "<a href='".make_link("tips/status/".$tip['id'])."'>".$tip_enable."</a>";

View file

@ -39,7 +39,6 @@ class WikiTheme extends Themelet {
protected function create_edit_html(WikiPage $page) {
$h_title = html_escape($page->title);
$u_title = url_escape($page->title);
$i_revision = int_escape($page->revision) + 1;
global $user;

View file

@ -21,7 +21,6 @@ class Themelet extends BaseThemelet {
private function build_paginator($current_page, $total_pages, $base_url, $query) {
$next = $current_page + 1;
$prev = $current_page - 1;
$rand = mt_rand(1, $total_pages);
$at_start = ($current_page <= 3 || $total_pages <= 3);
$at_end = ($current_page >= $total_pages -2);

View file

@ -35,7 +35,6 @@ class CustomUserPageTheme extends UserPageTheme {
}
public function display_user_block(Page $page, User $user, $parts) {
$h_name = html_escape($user->name);
$html = "";
$blocked = array("Pools", "Pool Changes", "Alias Editor", "My Profile");
foreach($parts as $part) {

View file

@ -21,7 +21,6 @@ class Themelet extends BaseThemelet {
private function build_paginator($current_page, $total_pages, $base_url, $query) {
$next = $current_page + 1;
$prev = $current_page - 1;
$rand = mt_rand(1, $total_pages);
$at_start = ($current_page <= 3 || $total_pages <= 3);
$at_end = ($current_page >= $total_pages -2);

View file

@ -35,7 +35,6 @@ class CustomUserPageTheme extends UserPageTheme {
}
public function display_user_block(Page $page, User $user, $parts) {
$h_name = html_escape($user->name);
$html = "";
$blocked = array("Pools", "Pool Changes", "Alias Editor", "My Profile");
foreach($parts as $part) {