-Wall cleanup
This commit is contained in:
parent
768acb0a3f
commit
fab63ca751
8 changed files with 32 additions and 20 deletions
7
boot.php
7
boot.php
|
@ -129,11 +129,15 @@ class App {
|
||||||
$this->pager= array();
|
$this->pager= array();
|
||||||
|
|
||||||
$this->scheme = ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'])) ? 'https' : 'http' );
|
$this->scheme = ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'])) ? 'https' : 'http' );
|
||||||
|
|
||||||
|
if(x($_SERVER,'SERVER_NAME'))
|
||||||
$this->hostname = $_SERVER['SERVER_NAME'];
|
$this->hostname = $_SERVER['SERVER_NAME'];
|
||||||
|
|
||||||
set_include_path("include/$this->hostname" . PATH_SEPARATOR . 'include' . PATH_SEPARATOR . '.' );
|
set_include_path("include/$this->hostname" . PATH_SEPARATOR . 'include' . PATH_SEPARATOR . '.' );
|
||||||
|
|
||||||
if(substr($_SERVER['QUERY_STRING'],0,2) == "q=")
|
if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) == "q=")
|
||||||
$_SERVER['QUERY_STRING'] = substr($_SERVER['QUERY_STRING'],2);
|
$_SERVER['QUERY_STRING'] = substr($_SERVER['QUERY_STRING'],2);
|
||||||
|
if(x($_GET,'q'))
|
||||||
$this->cmd = trim($_GET['q'],'/');
|
$this->cmd = trim($_GET['q'],'/');
|
||||||
|
|
||||||
|
|
||||||
|
@ -1226,6 +1230,7 @@ function allowed_email($email) {
|
||||||
|
|
||||||
if(! function_exists('format_like')) {
|
if(! function_exists('format_like')) {
|
||||||
function format_like($cnt,$arr,$type,$id) {
|
function format_like($cnt,$arr,$type,$id) {
|
||||||
|
$o = '';
|
||||||
if($cnt == 1)
|
if($cnt == 1)
|
||||||
$o .= $arr[0] . (($type === 'like') ? t(' likes this.') : t(' doesn\'t like this.')) . EOL ;
|
$o .= $arr[0] . (($type === 'like') ? t(' likes this.') : t(' doesn\'t like this.')) . EOL ;
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
// login/logout
|
// login/logout
|
||||||
|
|
||||||
if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] === 'login'))) {
|
if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] === 'login'))) {
|
||||||
|
|
||||||
if($_POST['auth-params'] === 'logout' || $a->module === 'logout') {
|
if($_POST['auth-params'] === 'logout' || $a->module === 'logout') {
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] === 'login'))) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
if(isset($_SESSION)) {
|
||||||
unset($_SESSION['authenticated']);
|
unset($_SESSION['authenticated']);
|
||||||
unset($_SESSION['uid']);
|
unset($_SESSION['uid']);
|
||||||
unset($_SESSION['visitor_id']);
|
unset($_SESSION['visitor_id']);
|
||||||
|
@ -61,7 +62,9 @@ else {
|
||||||
unset($_SESSION['theme']);
|
unset($_SESSION['theme']);
|
||||||
unset($_SESSION['my_url']);
|
unset($_SESSION['my_url']);
|
||||||
unset($_SESSION['page_flags']);
|
unset($_SESSION['page_flags']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(x($_POST,'password'))
|
||||||
$encrypted = hash('whirlpool',trim($_POST['password']));
|
$encrypted = hash('whirlpool',trim($_POST['password']));
|
||||||
|
|
||||||
if((x($_POST,'auth-params')) && $_POST['auth-params'] === 'login') {
|
if((x($_POST,'auth-params')) && $_POST['auth-params'] === 'login') {
|
||||||
|
|
|
@ -36,8 +36,8 @@ class dba {
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
if($this->db->mysqli->errno)
|
if($this->db->errno)
|
||||||
$debug_text .= $this->db->mysqli->error . EOL;
|
$debug_text .= $this->db->error . EOL;
|
||||||
|
|
||||||
if($result === false)
|
if($result === false)
|
||||||
$mesg = 'false';
|
$mesg = 'false';
|
||||||
|
|
|
@ -12,7 +12,7 @@ $install = ((file_exists('.htconfig.php')) ? false : true);
|
||||||
|
|
||||||
@include(".htconfig.php");
|
@include(".htconfig.php");
|
||||||
|
|
||||||
if(x($lang))
|
if(isset($lang) && strlen($lang))
|
||||||
load_translation_table($lang);
|
load_translation_table($lang);
|
||||||
|
|
||||||
require_once("dba.php");
|
require_once("dba.php");
|
||||||
|
|
|
@ -173,7 +173,7 @@ function network_content(&$a, $update = 0) {
|
||||||
$comment = '';
|
$comment = '';
|
||||||
$template = $tpl;
|
$template = $tpl;
|
||||||
$commentww = '';
|
$commentww = '';
|
||||||
|
$owner_url = $owner_photo = $owner_name = '';
|
||||||
$profile_url = $item['url'];
|
$profile_url = $item['url'];
|
||||||
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ function ping_init(&$a) {
|
||||||
);
|
);
|
||||||
$intro = $r[0]['total'];
|
$intro = $r[0]['total'];
|
||||||
|
|
||||||
$myurl = $a->get_baseurl() . '/profile/' . $user['nickname'] ;
|
$myurl = $a->get_baseurl() . '/profile/' . $a->user['nickname'] ;
|
||||||
$r = q("SELECT COUNT(*) AS `total` FROM `mail`
|
$r = q("SELECT COUNT(*) AS `total` FROM `mail`
|
||||||
WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
|
WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
|
|
|
@ -85,7 +85,7 @@ function profile_content(&$a, $update = 0) {
|
||||||
$groups = array();
|
$groups = array();
|
||||||
|
|
||||||
$tab = 'posts';
|
$tab = 'posts';
|
||||||
|
$o = '';
|
||||||
|
|
||||||
if($update) {
|
if($update) {
|
||||||
// Ensure we've got a profile owner if updating.
|
// Ensure we've got a profile owner if updating.
|
||||||
|
@ -256,7 +256,6 @@ function profile_content(&$a, $update = 0) {
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$cmnt_tpl = load_view_file('view/comment_item.tpl');
|
$cmnt_tpl = load_view_file('view/comment_item.tpl');
|
||||||
|
|
||||||
$like_tpl = load_view_file('view/like.tpl');
|
$like_tpl = load_view_file('view/like.tpl');
|
||||||
|
|
|
@ -5,6 +5,11 @@
|
||||||
|
|
||||||
include 'boot.php';
|
include 'boot.php';
|
||||||
|
|
||||||
|
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
|
||||||
|
ini_set('display_errors', '1');
|
||||||
|
ini_set('log_errors','0');
|
||||||
|
|
||||||
|
|
||||||
$a = new App();
|
$a = new App();
|
||||||
|
|
||||||
$files = glob('mod/*.php');
|
$files = glob('mod/*.php');
|
||||||
|
|
Loading…
Reference in a new issue