diff --git a/core/database.class.php b/core/database.class.php index 14bac1af..eb00e1ab 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -271,13 +271,13 @@ class Database { /** * Meta info about the database engine - * @var DBEngine + * @var DBEngine */ private $engine = null; /** * The currently active cache engine - * @var CacheEngine + * @var CacheEngine */ public $cache = null; diff --git a/core/extension.class.php b/core/extension.class.php index bce72590..9d881c80 100644 --- a/core/extension.class.php +++ b/core/extension.class.php @@ -140,8 +140,8 @@ abstract class FormatterExtension extends Extension { */ abstract class DataHandlerExtension extends Extension { public function onDataUpload(DataUploadEvent $event) { - $supported_ext = $this->supported_ext($event->type); - $check_contents = $this->check_contents($event->tmpname); + $supported_ext = $this->supported_ext($event->type); + $check_contents = $this->check_contents($event->tmpname); if($supported_ext && $check_contents) { if(!move_upload_to_archive($event)) return; send_event(new ThumbnailGenerationEvent($event->hash, $event->type)); diff --git a/core/user.class.php b/core/user.class.php index 110774c5..3adceadc 100644 --- a/core/user.class.php +++ b/core/user.class.php @@ -15,9 +15,9 @@ class User { var $name; var $email; var $join_date; - var $passhash; + var $passhash; - /* @var UserClass */ + /* @var UserClass */ var $class; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * diff --git a/core/util.inc.php b/core/util.inc.php index 6bda7f04..587f66a0 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -1282,7 +1282,7 @@ function _sanitise_environment() { } function _get_themelet_files($_theme) { - $base_themelets = array(); + $base_themelets = array(); if(file_exists('themes/'.$_theme.'/custompage.class.php')) $base_themelets[] = 'themes/'.$_theme.'/custompage.class.php'; $base_themelets[] = 'themes/'.$_theme.'/layout.class.php'; $base_themelets[] = 'themes/'.$_theme.'/themelet.class.php'; diff --git a/ext/artists/theme.php b/ext/artists/theme.php index 3fddc369..c6d957a3 100644 --- a/ext/artists/theme.php +++ b/ext/artists/theme.php @@ -17,7 +17,7 @@ class ArtistsTheme extends Themelet { public function sidebar_options(/*string*/ $mode, $artistID=NULL, $is_admin=FALSE){ global $page, $user; - $html = ""; + $html = ""; if($mode == "neutral"){ $html = "
@@ -65,51 +65,51 @@ class ArtistsTheme extends Themelet {
"; } - if($html) $page->add_block(new Block("Manage Artists", $html, "left", 10)); + if($html) $page->add_block(new Block("Manage Artists", $html, "left", 10)); } - public function show_artist_editor($artist, $aliases, $members, $urls) - { - global $user; + public function show_artist_editor($artist, $aliases, $members, $urls) + { + global $user; - $artistName = $artist['name']; - $artistNotes = $artist['notes']; - $artistID = $artist['id']; + $artistName = $artist['name']; + $artistNotes = $artist['notes']; + $artistID = $artist['id']; - // aliases - $aliasesString = ""; - $aliasesIDsString = ""; - foreach ($aliases as $alias) - { - $aliasesString .= $alias["alias_name"]." "; - $aliasesIDsString .= $alias["alias_id"]." "; - } - $aliasesString = rtrim($aliasesString); - $aliasesIDsString = rtrim($aliasesIDsString); + // aliases + $aliasesString = ""; + $aliasesIDsString = ""; + foreach ($aliases as $alias) + { + $aliasesString .= $alias["alias_name"]." "; + $aliasesIDsString .= $alias["alias_id"]." "; + } + $aliasesString = rtrim($aliasesString); + $aliasesIDsString = rtrim($aliasesIDsString); - // members - $membersString = ""; - $membersIDsString = ""; - foreach ($members as $member) - { - $membersString .= $member["name"]." "; - $membersIDsString .= $member["id"]." "; - } - $membersString = rtrim($membersString); - $membersIDsString = rtrim($membersIDsString); + // members + $membersString = ""; + $membersIDsString = ""; + foreach ($members as $member) + { + $membersString .= $member["name"]." "; + $membersIDsString .= $member["id"]." "; + } + $membersString = rtrim($membersString); + $membersIDsString = rtrim($membersIDsString); - // urls - $urlsString = ""; - $urlsIDsString = ""; - foreach ($urls as $url) - { - $urlsString .= $url["url"]."\n"; - $urlsIDsString .= $url["id"]." "; - } - $urlsString = substr($urlsString, 0, strlen($urlsString) -1); - $urlsIDsString = rtrim($urlsIDsString); + // urls + $urlsString = ""; + $urlsIDsString = ""; + foreach ($urls as $url) + { + $urlsString .= $url["url"]."\n"; + $urlsIDsString .= $url["id"]." "; + } + $urlsString = substr($urlsString, 0, strlen($urlsString) -1); + $urlsIDsString = rtrim($urlsIDsString); - $html = + $html = '
'.$user->get_auth_html().' @@ -126,113 +126,113 @@ class ArtistsTheme extends Themelet {
- + '; - global $page; - $page->add_block(new Block("Edit artist", $html, "main", 10)); - } + global $page; + $page->add_block(new Block("Edit artist", $html, "main", 10)); + } public function new_artist_composer() - { - global $page, $user; + { + global $page, $user; - $html = "
+ $html = " ".$user->get_auth_html()." - - - - - +
Name:
Aliases:
Members:
URLs:
+ + + + - -
Name:
Aliases:
Members:
URLs:
Notes:
- "; + + + "; - $page->set_title("Artists"); - $page->set_heading("Artists"); - $page->add_block(new Block("Artists", $html, "main", 10)); + $page->set_title("Artists"); + $page->set_heading("Artists"); + $page->add_block(new Block("Artists", $html, "main", 10)); } public function list_artists($artists, $pageNumber, $totalPages) - { - global $user, $page; + { + global $user, $page; - $html = "". - "". - "". - "". - "". - ""; + $html = "
NameTypeLast updaterPosts
". + "". + "". + "". + "". + ""; - if(!$user->is_anonymous()) $html .= ""; // space for edit link - - $html .= ""; + if(!$user->is_anonymous()) $html .= ""; // space for edit link + + $html .= ""; - $deletionLinkActionArray = - array('artist' => 'artist/nuke/' - , 'alias' => 'artist/alias/delete/' - , 'member' => 'artist/member/delete/' - ); + $deletionLinkActionArray = + array('artist' => 'artist/nuke/' + , 'alias' => 'artist/alias/delete/' + , 'member' => 'artist/member/delete/' + ); - $editionLinkActionArray = - array('artist' => 'artist/edit/' - , 'alias' => 'artist/alias/edit/' - , 'member' => 'artist/member/edit/' - ); + $editionLinkActionArray = + array('artist' => 'artist/edit/' + , 'alias' => 'artist/alias/edit/' + , 'member' => 'artist/member/edit/' + ); - $typeTextArray = - array('artist' => 'Artist' - , 'alias' => 'Alias' - , 'member' => 'Member' - ); + $typeTextArray = + array('artist' => 'Artist' + , 'alias' => 'Alias' + , 'member' => 'Member' + ); - foreach ($artists as $artist) { - if ($artist['type'] != 'artist') - $artist['name'] = str_replace("_", " ", $artist['name']); + foreach ($artists as $artist) { + if ($artist['type'] != 'artist') + $artist['name'] = str_replace("_", " ", $artist['name']); - $elementLink = "".str_replace("_", " ", $artist['name']).""; - //$artist_link = "".str_replace("_", " ", $artist['artist_name']).""; - $user_link = "".$artist['user_name'].""; - $edit_link = "Edit"; - $del_link = "Delete"; + $elementLink = "".str_replace("_", " ", $artist['name']).""; + //$artist_link = "".str_replace("_", " ", $artist['artist_name']).""; + $user_link = "".$artist['user_name'].""; + $edit_link = "Edit"; + $del_link = "Delete"; - $html .= "". - "". + "". - "". - "". - ""; + $html .= "". + "". + "". + ""; - if(!$user->is_anonymous()) $html .= ""; - if($user->is_admin()) $html .= ""; + if(!$user->is_anonymous()) $html .= ""; + if($user->is_admin()) $html .= ""; - $html .= ""; - } + $html .= ""; + } - $html .= "
NameTypeLast updaterPostsAction
Action
".$elementLink; + $html .= "
".$elementLink; - //if ($artist['type'] == 'member') - // $html .= " (member of ".$artist_link.")"; + //if ($artist['type'] == 'member') + // $html .= " (member of ".$artist_link.")"; - //if ($artist['type'] == 'alias') - // $html .= " (alias for ".$artist_link.")"; + //if ($artist['type'] == 'alias') + // $html .= " (alias for ".$artist_link.")"; - $html .= "".$typeTextArray[$artist['type']]."".$user_link."".$artist['posts']."".$typeTextArray[$artist['type']]."".$user_link."".$artist['posts']."".$edit_link."".$del_link."".$edit_link."".$del_link."
"; + $html .= ""; - $page->set_title("Artists"); - $page->set_heading("Artists"); - $page->add_block(new Block("Artists", $html, "main", 10)); + $page->set_title("Artists"); + $page->set_heading("Artists"); + $page->add_block(new Block("Artists", $html, "main", 10)); - $this->display_paginator($page, "artist/list", null, $pageNumber, $totalPages); + $this->display_paginator($page, "artist/list", null, $pageNumber, $totalPages); } - public function show_new_alias_composer($artistID) - { - global $user; + public function show_new_alias_composer($artistID) + { + global $user; - $html = - ' + $html = + ' '.$user->get_auth_html().'
Alias: @@ -240,266 +240,265 @@ class ArtistsTheme extends Themelet {
- '; + '; - global $page; - $page->add_block(new Block("Artist Aliases", $html, "main", 20)); - } - public function show_new_member_composer($artistID) - { - global $user; + global $page; + $page->add_block(new Block("Artist Aliases", $html, "main", 20)); + } + public function show_new_member_composer($artistID) + { + global $user; - $html = - '
+ $html = + ' '.$user->get_auth_html().'
Members:
-
- '; + + '; - global $page; - $page->add_block(new Block("Artist members", $html, "main", 30)); - } + global $page; + $page->add_block(new Block("Artist members", $html, "main", 30)); + } - public function show_new_url_composer($artistID) - { - global $user; + public function show_new_url_composer($artistID) + { + global $user; - $html = - '
+ $html = + ' '.$user->get_auth_html().'
URL:
-
- '; + + '; - global $page; - $page->add_block(new Block("Artist URLs", $html, "main", 40)); - } + global $page; + $page->add_block(new Block("Artist URLs", $html, "main", 40)); + } - public function show_alias_editor($alias) - { - global $user; + public function show_alias_editor($alias) + { + global $user; - $html = - ' -
+ $html = + ' + '.$user->get_auth_html().' - - - - -
- '; + + + + + + '; - global $page; - $page->add_block(new Block("Edit Alias", $html, "main", 10)); - } + global $page; + $page->add_block(new Block("Edit Alias", $html, "main", 10)); + } - public function show_url_editor($url) - { - global $user; + public function show_url_editor($url) + { + global $user; - $html = - ' -
+ $html = + ' + '.$user->get_auth_html().' - - - - -
- '; + + + + + + '; - global $page; - $page->add_block(new Block("Edit URL", $html, "main", 10)); - } + global $page; + $page->add_block(new Block("Edit URL", $html, "main", 10)); + } - public function show_member_editor($member) - { - global $user; + public function show_member_editor($member) + { + global $user; - $html = - ' -
+ $html = + ' + '.$user->get_auth_html().' - - - - -
- '; + + + + + + '; - global $page; - $page->add_block(new Block("Edit Member", $html, "main", 10)); - } + global $page; + $page->add_block(new Block("Edit Member", $html, "main", 10)); + } public function show_artist($artist, $aliases, $members, $urls, $images, $userIsLogged, $userIsAdmin) - { - global $page; + { + global $page; - $artist_link = "".str_replace("_", " ", $artist['name']).""; + $artist_link = "".str_replace("_", " ", $artist['name']).""; - $html = " - - - - "; - - if ($userIsLogged) - $html .= ""; - - if ($userIsAdmin) - $html .= ""; - - $html .= " - - - - - "; - if ($userIsLogged) $html .= ""; - if ($userIsAdmin) $html .= ""; - $html .= ""; - - if (count($aliases) > 0) - { - $aliasViewLink = str_replace("_", " ", $aliases[0]['alias_name']); // no link anymore - $aliasEditLink = "Edit"; - $aliasDeleteLink = "Delete"; - - $html .= " - - "; - - if ($userIsLogged) - $html .= ""; - - if ($userIsAdmin) - $html .= ""; - - $html .= ""; - - if (count($aliases) > 1) - { - for ($i = 1; $i < count($aliases); $i++) - { - $aliasViewLink = str_replace("_", " ", $aliases[$i]['alias_name']); // no link anymore - $aliasEditLink = "Edit"; - $aliasDeleteLink = "Delete"; - - $html .= " - - "; - if ($userIsLogged) - $html .= ""; - if ($userIsAdmin) - $html .= ""; - - $html .= ""; - } - } - } - - if (count($members) > 0) - { - $memberViewLink = str_replace("_", " ", $members[0]['name']); // no link anymore - $memberEditLink = "Edit"; - $memberDeleteLink = "Delete"; - - $html .= " - - "; - if ($userIsLogged) - $html .= ""; - if ($userIsAdmin) - $html .= ""; - - $html .= ""; - - if (count($members) > 1) - { - for ($i = 1; $i < count($members); $i++) - { - $memberViewLink = str_replace("_", " ", $members[$i]['name']); // no link anymore - $memberEditLink = "Edit"; - $memberDeleteLink = "Delete"; - - $html .= " - - "; - if ($userIsLogged) - $html .= ""; - if ($userIsAdmin) - $html .= ""; - - $html .= ""; - } - } - } - - if (count($urls) > 0) - { - $urlViewLink = "".str_replace("_", " ", $urls[0]['url']).""; - $urlEditLink = "Edit"; - $urlDeleteLink = "Delete"; - - $html .= " - - "; - - if ($userIsLogged) - $html .= ""; - - if ($userIsAdmin) - $html .= ""; - - $html .= ""; - - if (count($urls) > 1) - { - for ($i = 1; $i < count($urls); $i++) - { - $urlViewLink = "".str_replace("_", " ", $urls[$i]['url']).""; - $urlEditLink = "Edit"; - $urlDeleteLink = "Delete"; - - $html .= " - - "; - if ($userIsLogged) - $html .= ""; - - if ($userIsAdmin) - $html .= ""; - - $html .= ""; - } - } - } - - $html .= - " - - "; - if ($userIsLogged) $html .= ""; - if ($userIsAdmin) $html .= ""; - //TODO how will notes be edited? On edit artist? (should there be an editartist?) or on a editnotes? - //same question for deletion - $html .= " -
Name:".$artist_link."
Aliases:".$aliasViewLink."".$aliasEditLink."".$aliasDeleteLink."
 ".$aliasViewLink."".$aliasEditLink."".$aliasDeleteLink."
Members:".$memberViewLink."".$memberEditLink."".$memberDeleteLink."
 ".$memberViewLink."".$memberEditLink."".$memberDeleteLink."
URLs:".$urlViewLink."".$urlEditLink."".$urlDeleteLink."
 ".$urlViewLink."".$urlEditLink."".$urlDeleteLink."
Notes:".$artist["notes"]."
"; - - $page->set_title("Artist"); - $page->set_heading("Artist"); - $page->add_block(new Block("Artist", $html, "main", 10)); - + $html = " + + + + "; + if ($userIsLogged) + $html .= ""; + + if ($userIsAdmin) + $html .= ""; + + $html .= " + + + + + "; + if ($userIsLogged) $html .= ""; + if ($userIsAdmin) $html .= ""; + $html .= ""; + + if (count($aliases) > 0) + { + $aliasViewLink = str_replace("_", " ", $aliases[0]['alias_name']); // no link anymore + $aliasEditLink = "Edit"; + $aliasDeleteLink = "Delete"; + + $html .= " + + "; + + if ($userIsLogged) + $html .= ""; + + if ($userIsAdmin) + $html .= ""; + + $html .= ""; + + if (count($aliases) > 1) + { + for ($i = 1; $i < count($aliases); $i++) + { + $aliasViewLink = str_replace("_", " ", $aliases[$i]['alias_name']); // no link anymore + $aliasEditLink = "Edit"; + $aliasDeleteLink = "Delete"; + + $html .= " + + "; + if ($userIsLogged) + $html .= ""; + if ($userIsAdmin) + $html .= ""; + + $html .= ""; + } + } + } + + if (count($members) > 0) + { + $memberViewLink = str_replace("_", " ", $members[0]['name']); // no link anymore + $memberEditLink = "Edit"; + $memberDeleteLink = "Delete"; + + $html .= " + + "; + if ($userIsLogged) + $html .= ""; + if ($userIsAdmin) + $html .= ""; + + $html .= ""; + + if (count($members) > 1) + { + for ($i = 1; $i < count($members); $i++) + { + $memberViewLink = str_replace("_", " ", $members[$i]['name']); // no link anymore + $memberEditLink = "Edit"; + $memberDeleteLink = "Delete"; + + $html .= " + + "; + if ($userIsLogged) + $html .= ""; + if ($userIsAdmin) + $html .= ""; + + $html .= ""; + } + } + } + + if (count($urls) > 0) + { + $urlViewLink = "".str_replace("_", " ", $urls[0]['url']).""; + $urlEditLink = "Edit"; + $urlDeleteLink = "Delete"; + + $html .= " + + "; + + if ($userIsLogged) + $html .= ""; + + if ($userIsAdmin) + $html .= ""; + + $html .= ""; + + if (count($urls) > 1) + { + for ($i = 1; $i < count($urls); $i++) + { + $urlViewLink = "".str_replace("_", " ", $urls[$i]['url']).""; + $urlEditLink = "Edit"; + $urlDeleteLink = "Delete"; + + $html .= " + + "; + if ($userIsLogged) + $html .= ""; + + if ($userIsAdmin) + $html .= ""; + + $html .= ""; + } + } + } + + $html .= + " + + "; + if ($userIsLogged) $html .= ""; + if ($userIsAdmin) $html .= ""; + //TODO how will notes be edited? On edit artist? (should there be an editartist?) or on a editnotes? + //same question for deletion + $html .= " +
Name:".$artist_link."
Aliases:".$aliasViewLink."".$aliasEditLink."".$aliasDeleteLink."
 ".$aliasViewLink."".$aliasEditLink."".$aliasDeleteLink."
Members:".$memberViewLink."".$memberEditLink."".$memberDeleteLink."
 ".$memberViewLink."".$memberEditLink."".$memberDeleteLink."
URLs:".$urlViewLink."".$urlEditLink."".$urlDeleteLink."
 ".$urlViewLink."".$urlEditLink."".$urlDeleteLink."
Notes:".$artist["notes"]."
"; + + $page->set_title("Artist"); + $page->set_heading("Artist"); + $page->add_block(new Block("Artist", $html, "main", 10)); + //we show the images for the artist $artist_images = ""; foreach($images as $image) { diff --git a/ext/bulk_add/main.php b/ext/bulk_add/main.php index 408db0fc..cf58e4a3 100644 --- a/ext/bulk_add/main.php +++ b/ext/bulk_add/main.php @@ -30,7 +30,7 @@ class BulkAdd extends Extension { public function onCommand(CommandEvent $event) { if($event->cmd == "help") { print " bulk-add [directory]\n"; - print " Import this directory\n\n"; + print " Import this directory\n\n"; } if($event->cmd == "bulk-add") { if(count($event->args) == 1) { @@ -53,7 +53,7 @@ class BulkAdd extends Extension { if(!array_key_exists('extension', $pathinfo)) { throw new UploadException("File has no extension"); } - $metadata = array(); + $metadata = array(); $metadata['filename'] = $pathinfo['basename']; $metadata['extension'] = $pathinfo['extension']; $metadata['tags'] = $tags; diff --git a/ext/bulk_add_csv/main.php b/ext/bulk_add_csv/main.php index cd9ead8b..4ff15773 100644 --- a/ext/bulk_add_csv/main.php +++ b/ext/bulk_add_csv/main.php @@ -33,7 +33,7 @@ class BulkAddCSV extends Extension { public function onCommand(CommandEvent $event) { if($event->cmd == "help") { print " bulk-add-csv [/path/to.csv]\n"; - print " Import this .csv file (refer to documentation)\n\n"; + print " Import this .csv file (refer to documentation)\n\n"; } if($event->cmd == "bulk-add-csv") { global $user; @@ -62,7 +62,7 @@ class BulkAddCSV extends Extension { if(!array_key_exists('extension', $pathinfo)) { throw new UploadException("File has no extension"); } - $metadata = array(); + $metadata = array(); $metadata['filename'] = $pathinfo['basename']; $metadata['extension'] = $pathinfo['extension']; $metadata['tags'] = $tags; diff --git a/ext/cron_uploader/main.php b/ext/cron_uploader/main.php index 56d23f40..24c62c55 100644 --- a/ext/cron_uploader/main.php +++ b/ext/cron_uploader/main.php @@ -305,7 +305,7 @@ class CronUploader extends Extension { if (! array_key_exists ( 'extension', $pathinfo )) { throw new UploadException ( "File has no extension" ); } - $metadata = array(); + $metadata = array(); $metadata ['filename'] = $pathinfo ['basename']; $metadata ['extension'] = $pathinfo ['extension']; $metadata ['tags'] = ""; // = $tags; doesn't work when not logged in here @@ -370,7 +370,7 @@ class CronUploader extends Extension { * Adds a message to the info being published at the end * @param $text string * @param $addon int Enter a value to modify an existing value (enter value number) - * @return int + * @return int */ private function add_upload_info($text, $addon = 0) { $info = $this->upload_info; @@ -415,4 +415,4 @@ class CronUploader extends Extension { file_put_contents ($log_path, $content); } } -?> \ No newline at end of file +?> diff --git a/ext/ext_manager/main.php b/ext/ext_manager/main.php index 3d92a092..fdd59c4e 100644 --- a/ext/ext_manager/main.php +++ b/ext/ext_manager/main.php @@ -21,7 +21,7 @@ function __extman_extcmp(ExtensionInfo $a, ExtensionInfo $b) { class ExtensionInfo { var $ext_name, $name, $link, $author, $email; var $description, $documentation, $version, $visibility; - var $enabled; + var $enabled; function __construct($main) { $matches = array(); @@ -132,7 +132,7 @@ class ExtManager extends Extension { public function onCommand(CommandEvent $event) { if($event->cmd == "help") { print " disable-all-ext\n"; - print " disable all extensions\n\n"; + print " disable all extensions\n\n"; } if($event->cmd == "disable-all-ext") { $this->write_config(array()); @@ -168,7 +168,7 @@ class ExtManager extends Extension { private function set_things($settings) { $core = explode(",", CORE_EXTS); - $extras = array(); + $extras = array(); foreach(glob("ext/*/main.php") as $main) { $matches = array(); diff --git a/ext/handle_archive/main.php b/ext/handle_archive/main.php index a6787ac6..f4dfe3dc 100644 --- a/ext/handle_archive/main.php +++ b/ext/handle_archive/main.php @@ -54,7 +54,7 @@ class ArchiveFileHandler extends Extension { if(!array_key_exists('extension', $pathinfo)) { throw new UploadException("File has no extension"); } - $metadata = array(); + $metadata = array(); $metadata['filename'] = $pathinfo['basename']; $metadata['extension'] = $pathinfo['extension']; $metadata['tags'] = $tags; diff --git a/ext/handle_flash/main.php b/ext/handle_flash/main.php index d7e42f9b..88becce7 100644 --- a/ext/handle_flash/main.php +++ b/ext/handle_flash/main.php @@ -20,13 +20,13 @@ class FlashFileHandler extends DataHandlerExtension { $image = new Image(); $image->filesize = $metadata['size']; - $image->hash = $metadata['hash']; + $image->hash = $metadata['hash']; $image->filename = $metadata['filename']; $image->ext = $metadata['extension']; $image->tag_array = Tag::explode($metadata['tags']); $image->source = $metadata['source']; - $info = getimagesize($filename); + $info = getimagesize($filename); if(!$info) return null; $image->width = $info[0]; @@ -36,14 +36,14 @@ class FlashFileHandler extends DataHandlerExtension { } protected function check_contents(/*string*/ $file) { - if (!file_exists($file)) return false; + if (!file_exists($file)) return false; - $fp = fopen($file, "r"); - $head = fread($fp, 3); - fclose($fp); - if (!in_array($head, array("CWS", "FWS"))) return false; + $fp = fopen($file, "r"); + $head = fread($fp, 3); + fclose($fp); + if (!in_array($head, array("CWS", "FWS"))) return false; - return true; - } + return true; + } } ?> diff --git a/ext/handle_pixel/main.php b/ext/handle_pixel/main.php index da8e5e31..0ee4ca69 100644 --- a/ext/handle_pixel/main.php +++ b/ext/handle_pixel/main.php @@ -23,11 +23,11 @@ class PixelFileHandler extends DataHandlerExtension { $image->height = $info[1]; $image->filesize = $metadata['size']; - $image->hash = $metadata['hash']; + $image->hash = $metadata['hash']; $image->filename = (($pos = strpos($metadata['filename'],'?')) !== false) ? substr($metadata['filename'],0,$pos) : $metadata['filename']; - $image->ext = (($pos = strpos($metadata['extension'],'?')) !== false) ? substr($metadata['extension'],0,$pos) : $metadata['extension']; + $image->ext = (($pos = strpos($metadata['extension'],'?')) !== false) ? substr($metadata['extension'],0,$pos) : $metadata['extension']; $image->tag_array = Tag::explode($metadata['tags']); - $image->source = $metadata['source']; + $image->source = $metadata['source']; return $image; } @@ -50,7 +50,7 @@ class PixelFileHandler extends DataHandlerExtension { } protected function create_thumb_force(/*string*/ $hash) { - global $config; + global $config; $inname = warehouse_path("images", $hash); $outname = warehouse_path("thumbs", $hash); diff --git a/ext/handle_video/theme.php b/ext/handle_video/theme.php index b4e87dde..3e584ce3 100644 --- a/ext/handle_video/theme.php +++ b/ext/handle_video/theme.php @@ -31,9 +31,9 @@ else { "; } - else { - $html = "Video type '$ext' not recognised"; - } + else { + $html = "Video type '$ext' not recognised"; + } $page->add_block(new Block("Video", $html, "main", 10)); } } diff --git a/ext/image/main.php b/ext/image/main.php index 51de36b0..32d1bf97 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -94,8 +94,8 @@ class ThumbnailGenerationEvent extends Event { * Request a thumbnail be made for an image object * * @param $hash string The unique hash of the image - * @param $type string The type of the image - * @param $force boolean Regenerate the thumbnail even if one already exists + * @param $type string The type of the image + * @param $force boolean Regenerate the thumbnail even if one already exists */ public function __construct($hash, $type, $force=false) { $this->hash = $hash; diff --git a/ext/index/theme.php b/ext/index/theme.php index 99a0e839..7c04910b 100644 --- a/ext/index/theme.php +++ b/ext/index/theme.php @@ -1,7 +1,7 @@ page_number = $page_number; diff --git a/ext/log_net/main.php b/ext/log_net/main.php index 918a1b8e..f82d01d3 100644 --- a/ext/log_net/main.php +++ b/ext/log_net/main.php @@ -42,7 +42,7 @@ class LogNet extends Extension { fwrite($fp, "$data\n"); fclose($fp); } catch (Exception $e) { - /* logging errors shouldn't break everything */ + /* logging errors shouldn't break everything */ } } } diff --git a/ext/notes/theme.php b/ext/notes/theme.php index 38bfcbb3..99359b92 100644 --- a/ext/notes/theme.php +++ b/ext/notes/theme.php @@ -1,6 +1,6 @@ Add a note -->
@@ -39,32 +39,32 @@ class NotesTheme extends Themelet { $page->set_title(html_escape("Search Note")); $page->set_heading(html_escape("Search Note")); - $page->add_block(new Block("Search Note", $html, "main", 10)); + $page->add_block(new Block("Search Note", $html, "main", 10)); } // check action POST on form public function display_note_system(Page $page, $image_id, $recovered_notes, $adminOptions) { $to_json = array(); - foreach($recovered_notes as $note) - { - $parsedNote = $note["note"]; - $parsedNote = str_replace("\n", "\\n", $parsedNote); - $parsedNote = str_replace("\r", "\\r", $parsedNote); + foreach($recovered_notes as $note) + { + $parsedNote = $note["note"]; + $parsedNote = str_replace("\n", "\\n", $parsedNote); + $parsedNote = str_replace("\r", "\\r", $parsedNote); - $to_json[] = array( + $to_json[] = array( 'x1' => $note["x1"], - 'y1' => $note["y1"], - 'height' => $note["height"], - 'width' => $note["width"], - 'note' => $parsedNote, - 'note_id' => $note["id"], + 'y1' => $note["y1"], + 'height' => $note["height"], + 'width' => $note["width"], + 'note' => $parsedNote, + 'note_id' => $note["id"], ); - } + } $html = " + $html .= "
".make_form(make_link("note/add_note"))." @@ -88,41 +88,41 @@ class NotesTheme extends Themelet {
-
+
".make_form(make_link("note/edit_note"))." - - - - - - - - - - - - - - -
- -
- "; + + + + + + + + + + + + + + +
+ +
+ "; - if($adminOptions) - $html .= " + if($adminOptions) + $html .= " ".make_form(make_link("note/delete_note"))." - - - - - - -
- + + + + + + +
+ "; - $html .= "
"; + $html .= "
"; $page->add_block(new Block(null, $html, "main", 1)); } @@ -170,64 +170,64 @@ class NotesTheme extends Themelet { $page->add_block(new Block("Note Requests", $pool_images, "main", 20)); } - private function get_history($histories) { - global $user; + private function get_history($histories) { + global $user; - $html = "". - "". - "". - "". - "". - "". - ""; + $html = "
ImageNoteBodyUpdaterDate
". + "". + "". + "". + "". + "". + ""; - if(!$user->is_anonymous()){ - $html .= ""; - } + if(!$user->is_anonymous()){ + $html .= ""; + } - $html .= "". - ""; + $html .= "". + ""; - foreach($histories as $history) { - $image_link = "".$history['image_id'].""; - $history_link = "".$history['note_id'].".".$history['review_id'].""; - $user_link = "".$history['user_name'].""; - $revert_link = "Revert"; + foreach($histories as $history) { + $image_link = "".$history['image_id'].""; + $history_link = "".$history['note_id'].".".$history['review_id'].""; + $user_link = "".$history['user_name'].""; + $revert_link = "Revert"; - $html .= "". - "". - "". - "". - "". - ""; + $html .= "". + "". + "". + "". + "". + ""; - if(!$user->is_anonymous()){ - $html .= ""; - } + if(!$user->is_anonymous()){ + $html .= ""; + } - } + } - $html .= "
ImageNoteBodyUpdaterDateActionAction
".$image_link."".$history_link."".$history['note']."".$user_link."".autodate($history['date'])."
".$image_link."".$history_link."".$history['note']."".$user_link."".autodate($history['date'])."".$revert_link."".$revert_link."
"; + $html .= ""; - return $html; - } + return $html; + } public function display_histories($histories, $pageNumber, $totalPages) { - global $page; + global $page; - $html = $this->get_history($histories); + $html = $this->get_history($histories); - $page->set_title("Note Updates"); - $page->set_heading("Note Updates"); - $page->add_block(new Block("Note Updates", $html, "main", 10)); + $page->set_title("Note Updates"); + $page->set_heading("Note Updates"); + $page->add_block(new Block("Note Updates", $html, "main", 10)); - $this->display_paginator($page, "note/updated", null, $pageNumber, $totalPages); + $this->display_paginator($page, "note/updated", null, $pageNumber, $totalPages); } public function display_history($histories, $pageNumber, $totalPages) { - global $page; + global $page; - $html = $this->get_history($histories); + $html = $this->get_history($histories); $page->set_title("Note History"); $page->set_heading("Note History"); @@ -235,5 +235,5 @@ class NotesTheme extends Themelet { $this->display_paginator($page, "note/updated", null, $pageNumber, $totalPages); } -} +} ?> diff --git a/ext/oekaki/main.php b/ext/oekaki/main.php index 942e5f30..6c114537 100644 --- a/ext/oekaki/main.php +++ b/ext/oekaki/main.php @@ -28,7 +28,7 @@ class Oekaki extends Extension { throw new UploadException("File has no extension"); } log_info("oekaki", "Processing file [{$pathinfo['filename']}]"); - $metadata = array(); + $metadata = array(); $metadata['filename'] = 'oekaki.png'; $metadata['extension'] = $pathinfo['extension']; $metadata['tags'] = 'oekaki tagme';