diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php
index 1c8b56a5..36e1d678 100644
--- a/core/imageboard.pack.php
+++ b/core/imageboard.pack.php
@@ -73,7 +73,6 @@ class Image {
public static function by_id(/*int*/ $id) {
assert(is_numeric($id));
global $database;
- $image = null;
$row = $database->get_row("SELECT * FROM images WHERE images.id=:id", array("id"=>$id));
return ($row ? new Image($row) : null);
}
@@ -86,7 +85,6 @@ class Image {
public static function by_hash(/*string*/ $hash) {
assert(is_string($hash));
global $database;
- $image = null;
$row = $database->get_row("SELECT images.* FROM images WHERE hash=:hash", array("hash"=>$hash));
return ($row ? new Image($row) : null);
}
@@ -913,7 +911,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);
- $s_tag_list = join(', ', $s_tag_array);
$tag_id_array = array();
$tags_ok = true;
@@ -1058,7 +1055,7 @@ class Tag {
else {
global $database;
$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));
if(count($newtags) > 0) {
$resolved = $newtags;
diff --git a/ext/admin/main.php b/ext/admin/main.php
index 2f83e63a..c987c6bf 100644
--- a/ext/admin/main.php
+++ b/ext/admin/main.php
@@ -182,14 +182,18 @@ class AdminPage extends Extension {
case 'sqlite':
$cmd = "sqlite3 $database .dump";
break;
+ default:
+ $cmd = false;
}
//FIXME: .SQL dump is empty if cmd doesn't exist
- $page->set_mode("data");
- $page->set_type("application/x-unknown");
- $page->set_filename('shimmie-'.date('Ymd').'.sql');
- $page->set_data(shell_exec($cmd));
+ if($cmd) {
+ $page->set_mode("data");
+ $page->set_type("application/x-unknown");
+ $page->set_filename('shimmie-'.date('Ymd').'.sql');
+ $page->set_data(shell_exec($cmd));
+ }
return false;
}
diff --git a/ext/alias_editor/theme.php b/ext/alias_editor/theme.php
index d206a916..173f7bd2 100644
--- a/ext/alias_editor/theme.php
+++ b/ext/alias_editor/theme.php
@@ -29,7 +29,6 @@ class AliasEditorTheme extends Themelet {
}
$h_aliases = "";
- $n = 0;
foreach($aliases as $old => $new) {
$h_old = html_escape($old);
$h_new = "".html_escape($new)."";
diff --git a/ext/artists/theme.php b/ext/artists/theme.php
index b1acd803..1e00cf31 100644
--- a/ext/artists/theme.php
+++ b/ext/artists/theme.php
@@ -175,7 +175,6 @@ class ArtistsTheme extends Themelet {
$html .= "";
- $n = 0;
$deletionLinkActionArray =
array('artist' => 'artist/nuke/'
, 'alias' => 'artist/alias/delete/'
@@ -340,8 +339,6 @@ class ArtistsTheme extends Themelet {
$artist_link = "".str_replace("_", " ", $artist['name'])."";
- $n = 0;
-
$html = "
diff --git a/ext/blotter/theme.php b/ext/blotter/theme.php
index 9fe9dd79..4c35db3b 100644
--- a/ext/blotter/theme.php
+++ b/ext/blotter/theme.php
@@ -31,7 +31,6 @@ class BlotterTheme extends Themelet {
* Long function name, but at least I won't confuse it with something else ^_^
*/
- $html = "";
// Add_new stuff goes here.
$table_header = "
diff --git a/ext/comment/main.php b/ext/comment/main.php
index 3b97f597..e6132807 100644
--- a/ext/comment/main.php
+++ b/ext/comment/main.php
@@ -14,7 +14,7 @@ require_once "lib/akismet.class.php";
class CommentPostingEvent extends Event {
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->user = $user;
$this->comment = $comment;
@@ -29,7 +29,7 @@ class CommentPostingEvent extends Event {
class CommentDeletionEvent extends Event {
var $comment_id;
- public function CommentDeletionEvent($comment_id) {
+ public function __construct($comment_id) {
$this->comment_id = $comment_id;
}
}
@@ -37,7 +37,11 @@ class CommentDeletionEvent extends Event {
class CommentPostingException extends SCoreException {}
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_id = $row['user_id'];
$this->owner_name = $row['user_name'];
diff --git a/ext/ext_manager/theme.php b/ext/ext_manager/theme.php
index 599acf85..0b9cb270 100644
--- a/ext/ext_manager/theme.php
+++ b/ext/ext_manager/theme.php
@@ -17,7 +17,6 @@ class ExtManagerTheme extends Themelet {
";
- $n = 0;
foreach($extensions as $extension) {
if(!$editable && $extension->visibility == "admin") continue;
@@ -53,7 +52,6 @@ class ExtManagerTheme extends Themelet {
/*
public function display_blocks(Page $page, $extensions) {
global $user;
- $n = 0;
$col_1 = "";
$col_2 = "";
foreach($extensions as $extension) {
diff --git a/ext/forum/theme.php b/ext/forum/theme.php
index 101ff5a4..78c06261 100644
--- a/ext/forum/theme.php
+++ b/ext/forum/theme.php
@@ -83,9 +83,7 @@ class ForumTheme extends Themelet {
global $config, $page/*, $user*/;
$posts_per_page = $config->get_int('forumPostsPerPage');
- $theme_name = $config->get_string('theme');
- $html = "";
$current_post = 0;
$html =
diff --git a/ext/pm/main.php b/ext/pm/main.php
index 3af1993a..9cd781e7 100644
--- a/ext/pm/main.php
+++ b/ext/pm/main.php
@@ -11,12 +11,16 @@
*/
class SendPMEvent extends Event {
+ var $pm;
+
public function __construct(PM $pm) {
$this->pm = $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) {
# PHP: the P stands for "really", the H stands for "awful" and the other P stands for "language"
if(is_array($from_id)) {
diff --git a/ext/setup/main.php b/ext/setup/main.php
index e9fc3249..d6c0cd45 100644
--- a/ext/setup/main.php
+++ b/ext/setup/main.php
@@ -14,7 +14,7 @@
class ConfigSaveEvent extends Event {
var $config;
- public function ConfigSaveEvent(Config $config) {
+ public function __construct(Config $config) {
$this->config = $config;
}
}
@@ -26,7 +26,7 @@ class ConfigSaveEvent extends Event {
class SetupBuildingEvent extends Event {
var $panel;
- public function SetupBuildingEvent(SetupPanel $panel) {
+ public function __construct(SetupPanel $panel) {
$this->panel = $panel;
}
}
@@ -49,10 +49,11 @@ class SetupBlock extends Block {
var $header;
var $body;
- public function SetupBlock($title) {
+ public function __construct($title) {
$this->header = $title;
$this->section = "main";
$this->position = 50;
+ $this->body = "";
}
public function add_label($text) {
diff --git a/ext/wiki/main.php b/ext/wiki/main.php
index b0c573bc..94f9fb0f 100644
--- a/ext/wiki/main.php
+++ b/ext/wiki/main.php
@@ -12,7 +12,7 @@ class WikiUpdateEvent extends Event {
var $user;
var $wikipage;
- public function WikiUpdateEvent(User $user, WikiPage $wikipage) {
+ public function __construct(User $user, WikiPage $wikipage) {
$this->user = $user;
$this->wikipage = $wikipage;
}
@@ -31,7 +31,7 @@ class WikiPage {
var $locked;
var $body;
- public function WikiPage($row) {
+ public function __construct($row) {
assert(!empty($row));
$this->id = $row['id'];
@@ -157,7 +157,7 @@ class Wiki extends Extension {
global $database;
$wpage = $event->wikipage;
try {
- $row = $database->Execute("
+ $database->Execute("
INSERT INTO wiki_pages(owner_id, owner_ip, date, title, revision, locked, body)
VALUES (?, ?, now(), ?, ?, ?, ?)", array($event->user->id, $_SERVER['REMOTE_ADDR'],
$wpage->title, $wpage->rev, $wpage->locked?'Y':'N', $wpage->body));
diff --git a/themes/lite/layout.class.php b/themes/lite/layout.class.php
index 078bec53..3cf8e9d9 100644
--- a/themes/lite/layout.class.php
+++ b/themes/lite/layout.class.php
@@ -75,7 +75,6 @@ class Layout {
}
$custom_sublinks = "";
- $cs = null;
// hack
global $user;
$username = url_escape($user->name);