diff --git a/ext/chatbox/php/ajaxcall.class.php b/ext/chatbox/php/ajaxcall.class.php index 05aa5c06..affeafc7 100644 --- a/ext/chatbox/php/ajaxcall.class.php +++ b/ext/chatbox/php/ajaxcall.class.php @@ -1,5 +1,8 @@ banned(ip())) { $this->sendBanned(); break; } - if ($post = $ys->post($nickname, $message)) // To use $post somewheres later - $this->sendUpdates(); + if ($post = $ys->post($nickname, $message)) { + // To use $post somewheres later + $this->sendUpdates(); + } break; case 'refresh': @@ -138,7 +143,6 @@ $send['error'] = false; echo jsonEncode($send); - } function unbanSelf() { @@ -235,7 +239,7 @@ } function clearLog() { - $log = $_POST['log']; + //$log = $_POST['log']; $send = array(); $ys = ys($_SESSION['yLog']); @@ -254,10 +258,10 @@ function clearLogs() { global $prefs; - $log = $_POST['log']; + //$log = $_POST['log']; $send = array(); - $ys = ys($_SESSION['yLog']); + //$ys = ys($_SESSION['yLog']); switch(true) { case !loggedIn(): diff --git a/ext/chatbox/php/filestorage.class.php b/ext/chatbox/php/filestorage.class.php index 35b8ede1..a7ab5ba4 100644 --- a/ext/chatbox/php/filestorage.class.php +++ b/ext/chatbox/php/filestorage.class.php @@ -2,6 +2,8 @@ class FileStorage { + public $shoutLog, $path, $handle; + function FileStorage($path, $shoutLog = false) { $this->shoutLog = $shoutLog; $folder = 'logs'; @@ -56,7 +58,6 @@ class FileStorage { fseek($this->handle, 0); //return stream_get_contents($this->handle); return file_get_contents($this->path); - } function write($contents) { @@ -79,7 +80,5 @@ class FileStorage { $this->save($default, false); return $default; } - } -?> \ No newline at end of file diff --git a/ext/chatbox/php/functions.php b/ext/chatbox/php/functions.php index 07078599..c61a65e3 100644 --- a/ext/chatbox/php/functions.php +++ b/ext/chatbox/php/functions.php @@ -16,8 +16,8 @@ } function getVar($name) { - if (isset($_POST[$name])) return $_POST[$name]; - if (isset($_GET[$name])) return $_GET[$name]; + if (isset($_POST[$name])) { return $_POST[$name]; } + if (isset($_GET[$name])) { return $_GET[$name]; } return null; } @@ -28,7 +28,7 @@ } function magic($s) { - if (get_magic_quotes_gpc()) $s = stripslashes($s); + if (get_magic_quotes_gpc()) { $s = stripslashes($s); } return $s; } @@ -147,6 +147,5 @@ return $_SESSION['yLoginHash'] == md5($prefs['password']); return false; - } -?> \ No newline at end of file + diff --git a/ext/chatbox/php/yshout.class.php b/ext/chatbox/php/yshout.class.php index b5b83e0b..e0074cba 100644 --- a/ext/chatbox/php/yshout.class.php +++ b/ext/chatbox/php/yshout.class.php @@ -250,4 +250,3 @@ class YShout { } -?> \ No newline at end of file diff --git a/ext/tagger/script.js b/ext/tagger/script.js index 7a10f162..9f0987d3 100644 --- a/ext/tagger/script.js +++ b/ext/tagger/script.js @@ -1,4 +1,4 @@ -/*jshint bitwise:true, curly:true, forin:false, noarg:true, noempty:true, nonew:true, undef:true, strict:false, browser:true, jquery:true */ +/*jshint dojo:true, forin:false, nonew:true, undef:true, strict:false, browser:true, jquery:true */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ * Tagger - Advanced Tagging v2 * @@ -27,7 +27,7 @@ var Tagger = { this.tag.suggest = null; this.tag.image_tags(); - // reveal + // reveal this.editor.container.style.display = ""; // dragging @@ -41,7 +41,7 @@ var Tagger = { }, alert : function (type,text,timeout) { - var id = "tagger_alert-"+type + var id = "tagger_alert-"+type; var t_alert = byId(id); if (t_alert) { if(text === false) { @@ -152,10 +152,10 @@ var Tagger = { }, ajax : function (url, callback) { - var http = (new XMLHttpRequest || new ActiveXObject("Microsoft.XMLHTTP")); + var http = (new XMLHttpRequest() || new ActiveXObject("Microsoft.XMLHTTP")); http.open("GET",url,true); http.onreadystatechange = function () { - if(http.readyState == 4) callback(http); + if(http.readyState == 4) { callback(http); } }; http.send(null); } @@ -164,22 +164,19 @@ var Tagger = { position : { set : function (x,y) { if (!x || !y) { - with(this.parent.editor.container.style) { - top = "25px"; - left = ""; - right = "25px"; - bottom = ""; - } + this.parent.editor.container.style.top = "25px"; + this.parent.editor.container.style.left = ""; + this.parent.editor.container.style.right = "25px"; + this.parent.editor.container.style.bottom = ""; + var xy = this.get(); x = xy[0]; y = xy[1]; } - with(this.parent.editor.container.style) { - top = y+"px"; - left = x+"px"; - right = ""; - bottom = ""; - } + this.parent.editor.container.style.top = y+"px"; + this.parent.editor.container.style.left = x+"px"; + this.parent.editor.container.style.right = ""; + this.parent.editor.container.style.bottom = ""; }, get : function () { diff --git a/ext/tagger/theme.php b/ext/tagger/theme.php index 733db116..398fea7d 100644 --- a/ext/tagger/theme.php +++ b/ext/tagger/theme.php @@ -11,10 +11,14 @@ class taggerTheme extends Themelet { // Initialization code $base_href = get_base_href(); // TODO: AJAX test and fallback. + $page->add_html_header(""); $page->add_block(new Block(null, - "","main",1000)); + "","main",1000)); // Tagger block $page->add_block( new Block( diff --git a/themes/futaba/themelet.class.php b/themes/futaba/themelet.class.php index 5044c3fe..151f952b 100644 --- a/themes/futaba/themelet.class.php +++ b/themes/futaba/themelet.class.php @@ -11,7 +11,7 @@ class Themelet extends BaseThemelet { private function gen_page_link($base_url, $query, $page, $name) { $link = make_link("$base_url/$page", $query); - return "[$name]"; + return "[{$name}]"; } private function gen_page_link_block($base_url, $query, $page, $current_page, $name) { @@ -25,16 +25,16 @@ 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); + //$rand = mt_rand(1, $total_pages); $at_start = ($current_page <= 1 || $total_pages <= 1); $at_end = ($current_page >= $total_pages); - $first_html = $at_start ? "First" : $this->gen_page_link($base_url, $query, 1, "First"); + //$first_html = $at_start ? "First" : $this->gen_page_link($base_url, $query, 1, "First"); $prev_html = $at_start ? "Prev" : $this->gen_page_link($base_url, $query, $prev, "Prev"); - $random_html = $this->gen_page_link($base_url, $query, $rand, "Random"); + //$random_html = $this->gen_page_link($base_url, $query, $rand, "Random"); $next_html = $at_end ? "Next" : $this->gen_page_link($base_url, $query, $next, "Next"); - $last_html = $at_end ? "Last" : $this->gen_page_link($base_url, $query, $total_pages, "Last"); + //$last_html = $at_end ? "Last" : $this->gen_page_link($base_url, $query, $total_pages, "Last"); $start = $current_page-5 > 1 ? $current_page-5 : 1; $end = $start+10 < $total_pages ? $start+10 : $total_pages; @@ -47,7 +47,7 @@ class Themelet extends BaseThemelet { //return "

$first_html | $prev_html | $random_html | $next_html | $last_html". // "
<< $pages_html >>

"; - return "

$prev_html $pages_html $next_html

"; + return "

{$prev_html} {$pages_html} {$next_html}

"; } } diff --git a/themes/lite/layout.class.php b/themes/lite/layout.class.php index 73ae0a4e..f4922887 100644 --- a/themes/lite/layout.class.php +++ b/themes/lite/layout.class.php @@ -16,21 +16,21 @@ class Layout { $h = $block->header; $b = $block->body; $i = str_replace(' ', '_', $h) . $salt; - $html = "
"; + $html = "
"; if(!is_null($h)) { if($salt == "main") { - $html .= ""; + $html .= ""; } else { - $html .= ""; + $html .= ""; } } if(!is_null($b)) { if($salt =="main") { - $html .= "
$b
"; + $html .= "
{$b}
"; } else { $html .= " - + "; } } @@ -56,11 +56,11 @@ class Layout { for($i=0; $i < $count_pages_matched; $i++) { if($url == $pages_matched[$i]) { - $html = "$desc"; + $html = "{$desc}"; } } - if(is_null($html)) {$html = "$desc";} + if(is_null($html)) {$html = "{$desc}";} return $html; } @@ -79,12 +79,12 @@ class Layout { $header_html = ""; ksort($page->html_headers); foreach($page->html_headers as $line) { - $header_html .= "\t\t$line\n"; + $header_html .= "\t\t{$line}\n"; } $menu = ""; + $menu .= "{$custom_links}"; $left_block_html = ""; $main_block_html = ""; @@ -134,11 +134,9 @@ class Layout { $custom_sublinks = "
"; // hack - global $user; $username = url_escape($user->name); // hack $qp = explode("/", ltrim(@$_GET["q"], "/")); - $hw = class_exists("Wiki"); $cs = ""; // php sucks @@ -153,12 +151,14 @@ class Layout { # the subnav links aren't shown, but it would # be nice to be correct case "post": - if(class_exists("NumericScore")){ $cs .= "Popular by Day/Month/Year ";} + if(class_exists("NumericScore")){ + $cs .= "Popular by Day/Month/Year "; + } $cs .= "All"; - if(class_exists("Favorites")){ $cs .= "My Favorites";} + if(class_exists("Favorites")){ $cs .= "My Favorites";} if(class_exists("RSS_Images")){ $cs .= "Feed";} if(class_exists("Random_Image")){ $cs .= "Random Image";} - if($hw){ $cs .= "Help"; + if(class_exists("Wiki")){ $cs .= "Help"; }else{ $cs .= "Help";} break; case "comment": @@ -187,7 +187,7 @@ class Layout { $cs .= "Help"; break; case "upload": - if($hw) $cs .= "Guidelines"; + if(class_exists("Wiki")) { $cs .= "Guidelines"; } break; case "random": $cs .= "Shuffle"; @@ -197,25 +197,28 @@ class Layout { $cs .= "Download"; break; } - if($cs == "") {$custom_sublinks = "";} else { - $custom_sublinks .= "$cs
";} + if($cs == "") { + $custom_sublinks = ""; + } else { + $custom_sublinks .= "$cs"; + } $debug = get_debug_info(); - $contact = empty($contact_link) ? "" : "
Contact"; + $contact = empty($contact_link) ? "" : "
Contact"; //$subheading = empty($page->subheading) ? "" : "
{$page->subheading}
"; /*$wrapper = ""; if(strlen($page->heading) > 100) { $wrapper = ' style="height: 3em; overflow: auto;"'; }*/ - if($page->left_enabled==false) { + if($page->left_enabled == false) { $left_block_html = ""; - $main_block_html = "
$main_block_html
"; + $main_block_html = "
{$main_block_html}
"; } else { - $left_block_html = ""; - $main_block_html = "
$main_block_html
"; + $left_block_html = ""; + $main_block_html = "
{$main_block_html}
"; } $flash = get_prefixed_cookie("flash_message");