tidy up a bunch of lint errors

This commit is contained in:
Shish 2014-03-17 22:05:37 +00:00
parent 6f0d898c28
commit da29912646
12 changed files with 27 additions and 27 deletions

View file

@ -73,7 +73,6 @@ class Image {
public static function by_id(/*int*/ $id) { public static function by_id(/*int*/ $id) {
assert(is_numeric($id)); assert(is_numeric($id));
global $database; global $database;
$image = null;
$row = $database->get_row("SELECT * FROM images WHERE images.id=:id", array("id"=>$id)); $row = $database->get_row("SELECT * FROM images WHERE images.id=:id", array("id"=>$id));
return ($row ? new Image($row) : null); return ($row ? new Image($row) : null);
} }
@ -86,7 +85,6 @@ class Image {
public static function by_hash(/*string*/ $hash) { public static function by_hash(/*string*/ $hash) {
assert(is_string($hash)); assert(is_string($hash));
global $database; global $database;
$image = null;
$row = $database->get_row("SELECT images.* FROM images WHERE hash=:hash", array("hash"=>$hash)); $row = $database->get_row("SELECT images.* FROM images WHERE hash=:hash", array("hash"=>$hash));
return ($row ? new Image($row) : null); return ($row ? new Image($row) : null);
} }
@ -913,7 +911,6 @@ class Image {
// more than one positive tag, or more than zero negative tags // more than one positive tag, or more than zero negative tags
else { else {
$s_tag_array = array_map("sql_escape", $tag_search->variables); $s_tag_array = array_map("sql_escape", $tag_search->variables);
$s_tag_list = join(', ', $s_tag_array);
$tag_id_array = array(); $tag_id_array = array();
$tags_ok = true; $tags_ok = true;
@ -1058,7 +1055,7 @@ class Tag {
else { else {
global $database; global $database;
$db_wild_tag = str_replace("%", "\%", $tag); $db_wild_tag = str_replace("%", "\%", $tag);
$db_wild_tag = str_replace("*", "%", $tag); $db_wild_tag = str_replace("*", "%", $db_wild_tag);
$newtags = $database->get_col($database->scoreql_to_sql("SELECT tag FROM tags WHERE SCORE_STRNORM(tag) LIKE SCORE_STRNORM(?)"), array($db_wild_tag)); $newtags = $database->get_col($database->scoreql_to_sql("SELECT tag FROM tags WHERE SCORE_STRNORM(tag) LIKE SCORE_STRNORM(?)"), array($db_wild_tag));
if(count($newtags) > 0) { if(count($newtags) > 0) {
$resolved = $newtags; $resolved = $newtags;

View file

@ -182,14 +182,18 @@ class AdminPage extends Extension {
case 'sqlite': case 'sqlite':
$cmd = "sqlite3 $database .dump"; $cmd = "sqlite3 $database .dump";
break; break;
default:
$cmd = false;
} }
//FIXME: .SQL dump is empty if cmd doesn't exist //FIXME: .SQL dump is empty if cmd doesn't exist
if($cmd) {
$page->set_mode("data"); $page->set_mode("data");
$page->set_type("application/x-unknown"); $page->set_type("application/x-unknown");
$page->set_filename('shimmie-'.date('Ymd').'.sql'); $page->set_filename('shimmie-'.date('Ymd').'.sql');
$page->set_data(shell_exec($cmd)); $page->set_data(shell_exec($cmd));
}
return false; return false;
} }

View file

@ -29,7 +29,6 @@ class AliasEditorTheme extends Themelet {
} }
$h_aliases = ""; $h_aliases = "";
$n = 0;
foreach($aliases as $old => $new) { foreach($aliases as $old => $new) {
$h_old = html_escape($old); $h_old = html_escape($old);
$h_new = "<a href='".make_link("post/list/".url_escape($new)."/1")."'>".html_escape($new)."</a>"; $h_new = "<a href='".make_link("post/list/".url_escape($new)."/1")."'>".html_escape($new)."</a>";

View file

@ -175,7 +175,6 @@ class ArtistsTheme extends Themelet {
$html .= "</tr></thead>"; $html .= "</tr></thead>";
$n = 0;
$deletionLinkActionArray = $deletionLinkActionArray =
array('artist' => 'artist/nuke/' array('artist' => 'artist/nuke/'
, 'alias' => 'artist/alias/delete/' , 'alias' => 'artist/alias/delete/'
@ -340,8 +339,6 @@ class ArtistsTheme extends Themelet {
$artist_link = "<a href='".make_link("post/list/".$artist['name']."/1")."'>".str_replace("_", " ", $artist['name'])."</a>"; $artist_link = "<a href='".make_link("post/list/".$artist['name']."/1")."'>".str_replace("_", " ", $artist['name'])."</a>";
$n = 0;
$html = "<table id='poolsList' class='zebra'> $html = "<table id='poolsList' class='zebra'>
<thead> <thead>
<tr> <tr>

View file

@ -31,7 +31,6 @@ class BlotterTheme extends Themelet {
* Long function name, but at least I won't confuse it with something else ^_^ * Long function name, but at least I won't confuse it with something else ^_^
*/ */
$html = "";
// Add_new stuff goes here. // Add_new stuff goes here.
$table_header = " $table_header = "
<tr> <tr>

View file

@ -14,7 +14,7 @@ require_once "lib/akismet.class.php";
class CommentPostingEvent extends Event { class CommentPostingEvent extends Event {
var $image_id, $user, $comment; var $image_id, $user, $comment;
public function CommentPostingEvent($image_id, $user, $comment) { public function __construct($image_id, $user, $comment) {
$this->image_id = $image_id; $this->image_id = $image_id;
$this->user = $user; $this->user = $user;
$this->comment = $comment; $this->comment = $comment;
@ -29,7 +29,7 @@ class CommentPostingEvent extends Event {
class CommentDeletionEvent extends Event { class CommentDeletionEvent extends Event {
var $comment_id; var $comment_id;
public function CommentDeletionEvent($comment_id) { public function __construct($comment_id) {
$this->comment_id = $comment_id; $this->comment_id = $comment_id;
} }
} }
@ -37,7 +37,11 @@ class CommentDeletionEvent extends Event {
class CommentPostingException extends SCoreException {} class CommentPostingException extends SCoreException {}
class Comment { class Comment {
public function Comment($row) { var $owner, $owner_id, $owner_name, $owner_email, $owner_class;
var $comment, $comment_id;
var $image_id, $poster_ip, $posted;
public function __construct($row) {
$this->owner = null; $this->owner = null;
$this->owner_id = $row['user_id']; $this->owner_id = $row['user_id'];
$this->owner_name = $row['user_name']; $this->owner_name = $row['user_name'];

View file

@ -17,7 +17,6 @@ class ExtManagerTheme extends Themelet {
</thead> </thead>
<tbody> <tbody>
"; ";
$n = 0;
foreach($extensions as $extension) { foreach($extensions as $extension) {
if(!$editable && $extension->visibility == "admin") continue; if(!$editable && $extension->visibility == "admin") continue;
@ -53,7 +52,6 @@ class ExtManagerTheme extends Themelet {
/* /*
public function display_blocks(Page $page, $extensions) { public function display_blocks(Page $page, $extensions) {
global $user; global $user;
$n = 0;
$col_1 = ""; $col_1 = "";
$col_2 = ""; $col_2 = "";
foreach($extensions as $extension) { foreach($extensions as $extension) {

View file

@ -83,9 +83,7 @@ class ForumTheme extends Themelet {
global $config, $page/*, $user*/; global $config, $page/*, $user*/;
$posts_per_page = $config->get_int('forumPostsPerPage'); $posts_per_page = $config->get_int('forumPostsPerPage');
$theme_name = $config->get_string('theme');
$html = "";
$current_post = 0; $current_post = 0;
$html = $html =

View file

@ -11,12 +11,16 @@
*/ */
class SendPMEvent extends Event { class SendPMEvent extends Event {
var $pm;
public function __construct(PM $pm) { public function __construct(PM $pm) {
$this->pm = $pm; $this->pm = $pm;
} }
} }
class PM { class PM {
var $id, $from_id, $from_ip, $to_id, $sent_date, $subject, $message, $is_read;
public function __construct($from_id=0, $from_ip="0.0.0.0", $to_id=0, $subject="A Message", $message="Some Text", $read=False) { public function __construct($from_id=0, $from_ip="0.0.0.0", $to_id=0, $subject="A Message", $message="Some Text", $read=False) {
# PHP: the P stands for "really", the H stands for "awful" and the other P stands for "language" # PHP: the P stands for "really", the H stands for "awful" and the other P stands for "language"
if(is_array($from_id)) { if(is_array($from_id)) {

View file

@ -14,7 +14,7 @@
class ConfigSaveEvent extends Event { class ConfigSaveEvent extends Event {
var $config; var $config;
public function ConfigSaveEvent(Config $config) { public function __construct(Config $config) {
$this->config = $config; $this->config = $config;
} }
} }
@ -26,7 +26,7 @@ class ConfigSaveEvent extends Event {
class SetupBuildingEvent extends Event { class SetupBuildingEvent extends Event {
var $panel; var $panel;
public function SetupBuildingEvent(SetupPanel $panel) { public function __construct(SetupPanel $panel) {
$this->panel = $panel; $this->panel = $panel;
} }
} }
@ -49,10 +49,11 @@ class SetupBlock extends Block {
var $header; var $header;
var $body; var $body;
public function SetupBlock($title) { public function __construct($title) {
$this->header = $title; $this->header = $title;
$this->section = "main"; $this->section = "main";
$this->position = 50; $this->position = 50;
$this->body = "";
} }
public function add_label($text) { public function add_label($text) {

View file

@ -12,7 +12,7 @@ class WikiUpdateEvent extends Event {
var $user; var $user;
var $wikipage; var $wikipage;
public function WikiUpdateEvent(User $user, WikiPage $wikipage) { public function __construct(User $user, WikiPage $wikipage) {
$this->user = $user; $this->user = $user;
$this->wikipage = $wikipage; $this->wikipage = $wikipage;
} }
@ -31,7 +31,7 @@ class WikiPage {
var $locked; var $locked;
var $body; var $body;
public function WikiPage($row) { public function __construct($row) {
assert(!empty($row)); assert(!empty($row));
$this->id = $row['id']; $this->id = $row['id'];
@ -157,7 +157,7 @@ class Wiki extends Extension {
global $database; global $database;
$wpage = $event->wikipage; $wpage = $event->wikipage;
try { try {
$row = $database->Execute(" $database->Execute("
INSERT INTO wiki_pages(owner_id, owner_ip, date, title, revision, locked, body) INSERT INTO wiki_pages(owner_id, owner_ip, date, title, revision, locked, body)
VALUES (?, ?, now(), ?, ?, ?, ?)", array($event->user->id, $_SERVER['REMOTE_ADDR'], VALUES (?, ?, now(), ?, ?, ?, ?)", array($event->user->id, $_SERVER['REMOTE_ADDR'],
$wpage->title, $wpage->rev, $wpage->locked?'Y':'N', $wpage->body)); $wpage->title, $wpage->rev, $wpage->locked?'Y':'N', $wpage->body));

View file

@ -75,7 +75,6 @@ class Layout {
} }
$custom_sublinks = "<div class='sbar'>"; $custom_sublinks = "<div class='sbar'>";
$cs = null;
// hack // hack
global $user; global $user;
$username = url_escape($user->name); $username = url_escape($user->name);