php - Notice Undefined index -
i saw several lines of errors today not know do. notice: use of undefined constant admin - assumed 'admin' in /home/qwikia.tk/public/core.php on line 14
call stack: 0.0001 238928 1. {main}() /home/qwikia.tk/public/index.php:0 0.0007 327920 2. require_once('/home/qwikia.tk/public/core.php') /home/qwikia.tk/public/index.php:3
warning: include_once(../core/engine.php): failed open stream: no such file or directory in /home/qwikia.tk/public/administration/admin.php on line 3
call stack: 0.0001 238928 1. {main}() /home/qwikia.tk/public/index.php:0 0.0007 327920 2. require_once('/home/qwikia.tk/public/core.php') /home/qwikia.tk/public/index.php:3 0.0341 1080536 3. require_once('/home/qwikia.tk/public/administration/admin.php') /home/qwikia.tk/public/core.php:15
warning: include_once(): failed opening '../core/engine.php' inclusion (include_path='.:/usr/local/php/php56/lib/php') in /home/qwikia.tk/public/administration/admin.php on line 3
call stack: 0.0001 238928 1. {main}() /home/qwikia.tk/public/index.php:0 0.0007 327920 2. require_once('/home/qwikia.tk/public/core.php') /home/qwikia.tk/public/index.php:3 0.0341 1080536 3. require_once('/home/qwikia.tk/public/administration/admin.php') /home/qwikia.tk/public/core.php:15
notice: undefined index: id in /home/qwikia.tk/public/core.php on line 19
call stack: 0.0001 238928 1. {main}() /home/qwikia.tk/public/index.php:0 0.0007 327920 2. require_once('/home/qwikia.tk/public/core.php') /home/qwikia.tk/public/index.php:3
notice: undefined index: account_username in /home/qwikia.tk/public/core.php on line 20
call stack: 0.0001 238928 1. {main}() /home/qwikia.tk/public/index.php:0 0.0007 327920 2. require_once('/home/qwikia.tk/public/core.php') /home/qwikia.tk/public/index.php:3
notice: undefined index: rank in /home/qwikia.tk/public/core.php on line 24
call stack: 0.0001 238928 1. {main}() /home/qwikia.tk/public/index.php:0 0.0007 327920 2. require_once('/home/qwikia.tk/public/core.php') /home/qwikia.tk/public/index.php:3
notice: undefined index: login in /home/qwikia.tk/public/core.php on line 26
call stack: 0.0001 238928 1. {main}() /home/qwikia.tk/public/index.php:0 0.0007 327920 2. require_once('/home/qwikia.tk/public/core.php') /home/qwikia.tk/public/index.php:3
notice: undefined index: msg in /home/qwikia.tk/public/core.php on line 27
call stack: 0.0001 238928 1. {main}() /home/qwikia.tk/public/index.php:0 0.0007 327920 2. require_once('/home/qwikia.tk/public/core.php') /home/qwikia.tk/public/index.php:3
notice: use of undefined constant error_page - assumed 'error_page' in /home/qwikia.tk/public/core.php on line 67
call stack: 0.0001 238928 1. {main}() /home/qwikia.tk/public/index.php:0 0.0007 327920 2. require_once('/home/qwikia.tk/public/core.php') /home/qwikia.tk/public/index.php:3
<?php require_once 'core.php'; checkuserloggedin(); require_once 'core/modules/mobile_detect/mobile_detect.php'; $detect = new mobile_detect; $devicetype = ($detect->ismobile() ? ($detect->istablet() ? 'tablet' : 'phone') : 'computer'); if($devicetype!='computer') { $template_session->head(site_name, 'm'); $template_session->loadtpl('m-index'); } else { if(first_stream_page==1) { /* page loaded unsigned users. signed redirected stream page */ define("type", 4); $template_session->head(get_text(8,1),"", "stream(4);"); $template_session->loadtpl("header"); $template_session->loadtpl('stream'); } else { $template_session->head(site_name); $template_session->loadtpl('login'); } } $template_session->loadend(); ?>
<?php error_reporting(0); ini_set('display_errors', 1); $servertimezone = 'europe/london'; date_default_timezone_set($servertimezone); session_start(); require_once 'core/config/mysql.config.php'; require_once('core/engine.php'); $engine_session = new engine(); require_once('core/template.php'); $template_session = new template(); if(admin==0) { require_once('administration/admin.php'); $admin_session = new admin(); } define("user_id", $_session['id']); define("user_username", $_session['account_username']); $photo = $engine_session->getuserdata(user_id, "photo"); if($photo=='') $photo='photo_default.png'; define("user_photo", $photo); define("user_rank", $_session['rank']); define("user_ip", getenv("remote_addr")); define("session_status", $_session['login']); define("session_message", $_session['msg']); define("script_version", "1.0.1"); define("author", "http://xandr.co/"); $config = include 'core/config/config.php'; define("photo_max_size", $config['photo_max_size']); define("photo_max_width", $config['photo_max_width']); define("photo_max_height", $config['photo_max_height']); define("site_name", $config['site_name']); define("site_domain", $config['site_domain']); define("site_description", $config['site_description']); define("site_keywords", $config['site_keywords']); define("site_fb_id", $config['fb_id']); define("site_fb_secret", $config['fb_secret']); define('tw_consumer_key', $config['tw_key']); define('tw_consumer_secret', $config['tw_secret']); define('tw_request_token_url', 'https://api.twitter.com/oauth/request_token'); define('tw_authorize_url', 'https://api.twitter.com/oauth/authorize'); define('tw_access_token_url', 'https://api.twitter.com/oauth/access_token'); define('tw_account_data_url', 'https://api.twitter.com/1.1/users/show.json'); define('tw_callback_url', 'http://'.site_domain.'/core/modules/twitter-auth.php'); define("site_adsense", $config['adsense']); define("site_m_adsense", $config['m_adsense']); define("site_email", $config['site_email']); define("smtp_host", $config['smtp_host']); define("smtp_port", $config['smtp_port']); define("smtp_user", $config['smtp_user']); define("smtp_pass", $config['smtp_pass']); define("save_visit", $config['save_visit']); define("convert_numbers", $config['convert_numbers']); define("enable_smiles", $config['enable_smiles']); define("first_stream_page", $config['first_stream']); define("site_fb", $config['auth_fb']); define("site_tw", $config['auth_tw']); define("signup_confirmation", $config['signup_confirmation']); $filter = include 'core/filter.php'; define("filter_words", $filter['words']); define("filter_ips", $filter['ips']); if(error_page!=1) { $bad_ips = explode(', ', filter_ips); if(in_array(user_ip, $bad_ips)) { header('location: http://'.site_domain.'/site/error'); } } if(user_id!="") { /* save user last activity time if option enabled */ if(save_visit==1) { $engine_session->savevisit(); } } function get_text($id, $return=0) { /* echo or return words texts file in core folder */ @include (dirname(__file__).'/core/texts.php'); $res = is_numeric($id) ? true : false; if($res && $return==0) { echo $arr[$id]; } elseif($res && $return!=0) { return $arr[$id]; } } function countnumber($num) { /* convert number in words if option enabled. e.g.: 130.000 -> 130k, 1.300.000 -> 1.3m */ if(convert_numbers==1) { $precision = 2; if ($num >= 1000 && $num < 1000000) { $n_format = number_format($num/1000,$precision).'k'; } else if ($num >= 1000000 && $num < 1000000000) { $n_format = number_format($num/1000000,$precision).'m'; } else if ($num >= 1000000000) { $n_format=number_format($num/1000000000,$precision).'b'; } else { $n_format = $num; } return $n_format; } else { return $num; } } function usertime($date) { /* convert time in user timezone */ if($_session['tzname']!="") { $tz = new datetimezone($_session['tzname']); $dtstr = date("c", $date); $date = new datetime($dtstr); $date->settimezone($tz); return $date->format('d.m.y h:i:s'); } else { return date('d.m.y h:i:s',$date); } } function get_time($date) { /* convert timestamp user timezone time words */ $date = usertime($date); $ndate = strtotime($date); $time = usertime(time()); $time = strtotime($time); $time = $time - $ndate; $tokens = array ( 86400 => get_text(4,1), 3600 => get_text(3,1), 60 => get_text(2,1), 1 => get_text(1,1) ); if($time==0 || $time<4) { return get_text(7,1); } elseif($time>3 && $time<604800) { foreach($tokens $unit => $text) { if($time<$unit) continue; $numberofunits = floor($time/$unit); if($numberofunits!=1) { $text .= 's'; } return $numberofunits.' '.$text.' '.get_text(5,1); } } else { $datestamp = strtotime($date); $month = 10 + intval(date("m", $datestamp)); $month = ' '.get_text($month,1).' '; return date("d", $datestamp).$month.date("y", $datestamp); } } function format_text($text) { /* function editing text before appear user */ if(enable_mentions==1) { $in = array('/\b@([a-za-z0-9\/\.]*)/'); $out = array('<a href="http://'.site_domain.'/$1" class=hashtag rel=nofollow target=_blank>@$1</a> '); $text = preg_replace($in, $out, $text); } if(enable_smiles==1) { $text = preg_replace("#]:\)#is","<img class='emoticon' src='media/images/smiles/12.gif'>", $text); $text = preg_replace("#:\)#is","<img class='emoticon' src='media/images/smiles/1.gif'>", $text); $text = preg_replace("#:\*#is","<img class='emoticon' src='media/images/smiles/2.gif'>", $text); $text = preg_replace("#\(:\|#is","<img class='emoticon' src='media/images/smiles/3.gif'>", $text); $text = preg_replace("#:\(#is","<img class='emoticon' src='media/images/smiles/4.gif'>", $text); $text = preg_replace("#-_#is","<img class='emoticon' src='media/images/smiles/5.gif'>", $text); $text = preg_replace("#:d#is","<img class='emoticon' src='media/images/smiles/6.gif'>", $text); $text = preg_replace("#\(o.o\)#is","<img class='emoticon' src='media/images/smiles/7.gif'>", $text); $text = preg_replace("#;\)#is","<img class='emoticon' src='media/images/smiles/8.gif'>", $text); $text = preg_replace("#:p#is","<img class='emoticon' src='media/images/smiles/9.gif'>", $text); $text = preg_replace("#\(:s\)#is","<img class='emoticon' src='media/images/smiles/10.gif'>", $text); $text = preg_replace("#\(8\)\)#is","<img class='emoticon' src='media/images/smiles/11.gif'>", $text); $text = preg_replace("#\(envy\)#is","<img class='emoticon' src='media/images/smiles/13.gif'>", $text); $text = preg_replace("#\(lol\)#is","<img class='emoticon' src='media/images/smiles/14.gif'>", $text); $text = preg_replace("#\(love\)#is","<img class='emoticon' src='media/images/smiles/15.gif'>", $text); $text = preg_replace("# :\/#is","<img class='emoticon' src='media/images/smiles/16.gif'>", $text); } return $text; } function txt2link($url) { /* convert text links , embed videos */ $url = str_replace("\\r","\r",$url); $url = str_replace("\\n","\n<br>",$url); $url = str_replace("\\n\\r","\n\r",$url); if(strpos($url,'youtube')==false) { $in = array('`http://(\s+[[:alnum:]]/?)`si'); $out = array('<a href="http://$1" class=hashtag rel=nofollow target=_blank>$1</a> '); $url = preg_replace($in, $out, $url); $in = array('`www.(\s+[[:alnum:]]/?)`si'); $out = array('<a href="http://$1" class=hashtag rel=nofollow target=_blank>$1</a> '); $url = preg_replace($in, $out, $url); } $in = array('`@(\s+[[:alnum:]]/?)`si'); $out = array('<a href="http://'.site_domain.'/$1" class=hashtag rel=nofollow target=_blank>@$1</a> '); $url = preg_replace($in, $out, $url); $in = array('`#(\s+[[:alnum:]]/?)`si'); $out = array('<a href="http://'.site_domain.'/search?hashtag=$1" class=hashtag>#$1</a> '); $url = preg_replace($in, $out, $url); return preg_replace("/\s*[a-za-z\/\/:\.]*youtube.com\/watch\?v=([a-za-z0-9\-_]+)([a-za-z0-9\/\*\-\_\?\&\;\%\=\.]*)/i", " <br /><iframe width=\"400\" height=\"225\" src=\"http://www.youtube.com/embed/$1?wmode=transparent\" frameborder=\"0\" wmode=\"opaque\" allowfullscreen></iframe><br />", $url); } function checkuserloggedoff() { /* check if user logged out redirecting sign in page */ if(session_status!=true) { header('location: http://'.site_domain.'/site/login'); } } function checkuserloggedin() { /* check if user logged in redirecting stream page */ if(session_status!=false) { header('location: http://'.site_domain.'/site/stream'); } } ?>
Comments
Post a Comment