More linting and cleanup.
This commit is contained in:
parent
be385deaab
commit
c527ae91d6
@ -1,4 +1,4 @@
|
|||||||
<?
|
<?php
|
||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
include '../php/filestorage.class.php';
|
include '../php/filestorage.class.php';
|
||||||
@ -39,6 +39,9 @@
|
|||||||
|
|
||||||
$banned = $ys->banned($post['adminInfo']['ip']);
|
$banned = $ys->banned($post['adminInfo']['ip']);
|
||||||
$html .= '<div ' . ($admin ? 'rel="' . $post['adminInfo']['ip'] . '" ' : '') . 'id="ys-post-' . $id . '" class="ys-post' . ($post['admin'] ? ' ys-admin-post' : '') . ($banned ? ' ys-banned-post' : '') . '">' . "\n";
|
$html .= '<div ' . ($admin ? 'rel="' . $post['adminInfo']['ip'] . '" ' : '') . 'id="ys-post-' . $id . '" class="ys-post' . ($post['admin'] ? ' ys-admin-post' : '') . ($banned ? ' ys-banned-post' : '') . '">' . "\n";
|
||||||
|
|
||||||
|
$ts = '';
|
||||||
|
|
||||||
switch($prefs['timestamp']) {
|
switch($prefs['timestamp']) {
|
||||||
case 12:
|
case 12:
|
||||||
$ts = date('h:i', $post['timestamp']);
|
$ts = date('h:i', $post['timestamp']);
|
||||||
|
@ -47,7 +47,7 @@ class Layout {
|
|||||||
global $config, $user;
|
global $config, $user;
|
||||||
|
|
||||||
$theme_name = $config->get_string('theme');
|
$theme_name = $config->get_string('theme');
|
||||||
$base_href = $config->get_string('base_href');
|
//$base_href = $config->get_string('base_href');
|
||||||
$data_href = get_base_href();
|
$data_href = get_base_href();
|
||||||
$contact_link = $config->get_string('contact_link');
|
$contact_link = $config->get_string('contact_link');
|
||||||
|
|
||||||
@ -122,11 +122,9 @@ class Layout {
|
|||||||
|
|
||||||
$custom_sublinks = "";
|
$custom_sublinks = "";
|
||||||
// hack
|
// hack
|
||||||
global $user;
|
|
||||||
$username = url_escape($user->name);
|
$username = url_escape($user->name);
|
||||||
// hack
|
// hack
|
||||||
$qp = explode("/", ltrim(@$_GET["q"], "/"));
|
$qp = explode("/", ltrim(@$_GET["q"], "/"));
|
||||||
$hw = class_exists("Wiki");
|
|
||||||
// php sucks
|
// php sucks
|
||||||
switch($qp[0]) {
|
switch($qp[0]) {
|
||||||
default:
|
default:
|
||||||
@ -142,10 +140,10 @@ class Layout {
|
|||||||
case "upload":
|
case "upload":
|
||||||
if(class_exists("NumericScore")){ $custom_sublinks .= "<li><b>Popular by </b><a href='".make_link('popular_by_day')."'>Day</a>/<a href='".make_link('popular_by_month')."'>Month</a>/<a href='".make_link('popular_by_year')."'>Year</a></li>";}
|
if(class_exists("NumericScore")){ $custom_sublinks .= "<li><b>Popular by </b><a href='".make_link('popular_by_day')."'>Day</a>/<a href='".make_link('popular_by_month')."'>Month</a>/<a href='".make_link('popular_by_year')."'>Year</a></li>";}
|
||||||
$custom_sublinks .= "<li><a href='".make_link('post/list')."'>All</a></li>";
|
$custom_sublinks .= "<li><a href='".make_link('post/list')."'>All</a></li>";
|
||||||
if(class_exists("Favorites")){ $custom_sublinks .= "<li><a href='".make_link("post/list/favorited_by=$username/1")."'>My Favorites</a></li>";}
|
if(class_exists("Favorites")){ $custom_sublinks .= "<li><a href='".make_link("post/list/favorited_by={$username}/1")."'>My Favorites</a></li>";}
|
||||||
if(class_exists("RSS_Images")){ $custom_sublinks .= "<li><a href='".make_link('rss/images')."'>Feed</a></li>";}
|
if(class_exists("RSS_Images")){ $custom_sublinks .= "<li><a href='".make_link('rss/images')."'>Feed</a></li>";}
|
||||||
if(class_exists("RandomImage")){ $custom_sublinks .= "<li><a href='".make_link("random_image/view")."'>Random Image</a></li>";}
|
if(class_exists("RandomImage")){ $custom_sublinks .= "<li><a href='".make_link("random_image/view")."'>Random Image</a></li>";}
|
||||||
if($hw){ $custom_sublinks .= "<li><a href='".make_link("wiki/posts")."'>Help</a></li>";
|
if(class_exists("Wiki")){ $custom_sublinks .= "<li><a href='".make_link("wiki/posts")."'>Help</a></li>";
|
||||||
}else{ $custom_sublinks .= "<li><a href='".make_link("ext_doc/index")."'>Help</a></li>";}
|
}else{ $custom_sublinks .= "<li><a href='".make_link("ext_doc/index")."'>Help</a></li>";}
|
||||||
break;
|
break;
|
||||||
case "comment":
|
case "comment":
|
||||||
@ -252,7 +250,7 @@ EOD;
|
|||||||
$re1='.*?';
|
$re1='.*?';
|
||||||
$re2='((?:[a-z][a-z_]+))';
|
$re2='((?:[a-z][a-z_]+))';
|
||||||
|
|
||||||
if ($c=preg_match_all ("/".$re1.$re2."/is", $url, $matches)) {
|
if (preg_match_all("/".$re1.$re2."/is", $url, $matches)) {
|
||||||
$url=$matches[1][0];
|
$url=$matches[1][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,9 +46,9 @@ class Layout {
|
|||||||
public function display_page($page) {
|
public function display_page($page) {
|
||||||
global $config, $user;
|
global $config, $user;
|
||||||
|
|
||||||
$theme_name = $config->get_string('theme');
|
//$theme_name = $config->get_string('theme');
|
||||||
$base_href = $config->get_string('base_href');
|
//$base_href = $config->get_string('base_href');
|
||||||
$data_href = get_base_href();
|
//$data_href = get_base_href();
|
||||||
$contact_link = $config->get_string('contact_link');
|
$contact_link = $config->get_string('contact_link');
|
||||||
|
|
||||||
|
|
||||||
@ -124,11 +124,9 @@ class Layout {
|
|||||||
|
|
||||||
$custom_sublinks = "";
|
$custom_sublinks = "";
|
||||||
// hack
|
// hack
|
||||||
global $user;
|
|
||||||
$username = url_escape($user->name);
|
$username = url_escape($user->name);
|
||||||
// hack
|
// hack
|
||||||
$qp = explode("/", ltrim(@$_GET["q"], "/"));
|
$qp = explode("/", ltrim(@$_GET["q"], "/"));
|
||||||
$hw = class_exists("Wiki");
|
|
||||||
// php sucks
|
// php sucks
|
||||||
switch($qp[0]) {
|
switch($qp[0]) {
|
||||||
default:
|
default:
|
||||||
@ -156,11 +154,11 @@ class Layout {
|
|||||||
case "upload":
|
case "upload":
|
||||||
if(class_exists("NumericScore")){ $custom_sublinks .= "<li><b>Popular by </b><a href='".make_link('popular_by_day')."'>Day</a>/<a href='".make_link('popular_by_month')."'>Month</a>/<a href='".make_link('popular_by_year')."'>Year</a></li>";}
|
if(class_exists("NumericScore")){ $custom_sublinks .= "<li><b>Popular by </b><a href='".make_link('popular_by_day')."'>Day</a>/<a href='".make_link('popular_by_month')."'>Month</a>/<a href='".make_link('popular_by_year')."'>Year</a></li>";}
|
||||||
$custom_sublinks .= "<li><a href='".make_link('post/list')."'>Listing</a></li>";
|
$custom_sublinks .= "<li><a href='".make_link('post/list')."'>Listing</a></li>";
|
||||||
if(class_exists("Favorites")){ $custom_sublinks .= "<li><a href='".make_link("post/list/favorited_by=$username/1")."'>My Favorites</a></li>";}
|
if(class_exists("Favorites")){ $custom_sublinks .= "<li><a href='".make_link("post/list/favorited_by={$username}/1")."'>My Favorites</a></li>";}
|
||||||
if(class_exists("RSS_Images")){ $custom_sublinks .= "<li><a href='".make_link('rss/images')."'>Feed</a></li>";}
|
if(class_exists("RSS_Images")){ $custom_sublinks .= "<li><a href='".make_link('rss/images')."'>Feed</a></li>";}
|
||||||
if(class_exists("RandomImage")){ $custom_sublinks .= "<li><a href='".make_link("random_image/view")."'>Random</a></li>";}
|
if(class_exists("RandomImage")){ $custom_sublinks .= "<li><a href='".make_link("random_image/view")."'>Random</a></li>";}
|
||||||
$custom_sublinks .= "<li><a href='".make_link('upload')."'>Upload</a></li>";
|
$custom_sublinks .= "<li><a href='".make_link('upload')."'>Upload</a></li>";
|
||||||
if($hw){ $custom_sublinks .= "<li><a href='".make_link("wiki/posts")."'>Help</a></li>";
|
if(class_exists("Wiki")){ $custom_sublinks .= "<li><a href='".make_link("wiki/posts")."'>Help</a></li>";
|
||||||
}else{ $custom_sublinks .= "<li><a href='".make_link("ext_doc/index")."'>Help</a></li>";}
|
}else{ $custom_sublinks .= "<li><a href='".make_link("ext_doc/index")."'>Help</a></li>";}
|
||||||
break;
|
break;
|
||||||
case "comment":
|
case "comment":
|
||||||
@ -278,7 +276,7 @@ EOD;
|
|||||||
$re1='.*?';
|
$re1='.*?';
|
||||||
$re2='((?:[a-z][a-z_]+))';
|
$re2='((?:[a-z][a-z_]+))';
|
||||||
|
|
||||||
if ($c=preg_match_all ("/".$re1.$re2."/is", $url, $matches)) {
|
if (preg_match_all("/".$re1.$re2."/is", $url, $matches)) {
|
||||||
$url=$matches[1][0];
|
$url=$matches[1][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user