##
## ==================================================== */
if(!ini_get("register_globals") || (@get_cfg_var('register_globals')==1)){
//@import_request_variables('GPC');
@extract($_COOKIE,EXTR_SKIP);
@extract($_POST,EXTR_SKIP);
@extract($_GET,EXTR_SKIP);
@extract($_REQUEST,EXTR_SKIP);
}
/* ==================================================== ##
## STRIP SLASHES ALL FUNCTION ##
## ==================================================== */
function stripslashesall(&$array) {
reset($array);
while (list($key, $val) = each($array)) {
if (is_string($val)) $array[$key] = stripslashes($val);
elseif (is_array($val)) $array[$key] = stripslashesall($val); }
return $array;
}
/* ==================================================== ##
## IF GET MAGICQUOTES GPC ##
## ==================================================== */
if(get_magic_quotes_gpc()) {
if($_POST) $_POST = stripslashesall($_POST);
if($_GET) $_GET = stripslashesall($_GET);
if($_REQUEST) $_REQUEST = stripslashesall($_REQUEST);
if($_COOKIE) $_COOKIE = stripslashesall($_COOKIE);
}
/* ==================================================== ##
## DEFINE TYPES ##
## ==================================================== */
define('THIS_INT',1);
define('THIS_STR',2);
define('THIS_MD_5',3);
define('THIS_ADD_SLASH',4);
define('THIS_STRLEN',5);
define('THIS_ARRAY',6);
define('THIS_EMPTY',7);
define('THIS_TRIM',8);
define('THIS_SYMNUM',9);
define('THIS_EMAIL',10);
define('THIS_NUMBER',11);
/* ==================================================== ##
## DEFINE TIME ##
## ==================================================== */
define('NEWDATE', date("d-m-Y"));
define('NEWDAY', date("d"));
define('NEWMONT', date("m"));
define('NEWYEAR', date("Y"));
define('NEWTIME', time());
define('TODAY', mktime(0,0,0,date('m'),date('d'),date('Y')));
/* ==================================================== ##
## USER AGENT ##
## ==================================================== */
if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']!="-"){
define('USER_AGENT',$_SERVER['HTTP_USER_AGENT']);
} else { die(); }
/* ==================================================== ##
## PREPARSE FUNCTION ##
## ==================================================== */
function preparse($resursing,$type){
if($type==THIS_INT){ return (intval($resursing)>0) ? intval($resursing) : 0; }
if($type==THIS_MD_5){ return md5($resursing); }
if($type==THIS_ADD_SLASH){ return addslashes($resursing); }
if($type==THIS_STRLEN){ return strlen($resursing); }
if($type==THIS_TRIM){ return trim($resursing); }
if($type==THIS_ARRAY){ return (is_array($resursing)) ? 1 : 0; }
if($type==THIS_EMPTY){ return (empty($resursing)) ? 1 : 0; }
if($type==THIS_SYMNUM){ return $resursing = ((eregi("[^a-zA-Z0-9_]",$resursing))) ? 1 : 0; }
if($type==THIS_EMAIL){ return (preg_match('/[\w\.\-]+@\w+[\w\.\-]*?\.\w{2,4}/',$email)) ? 1 : 0; }
if($type==THIS_NUMBER){ return (eregi("[^0-9]",$resursing)) ? 1 : 0; }
}
/* ==================================================== ##
## SETTING INI ##
## ==================================================== */
@include(DNBASE."cache/cache.setting.php");
if(!defined('CACHESET')){
$setting['cache'] = true; $setting['cachetime'] = 3600;
$setinq = $db->query("SELECT setname,setval FROM ".$basepref."_settings",$setting['cachetime']);
while($setval = $db->fetchrow($setinq,$setting['cache'])){ $setting[$setval['setname']] = $setval['setval']; }
}
/* ==================================================== ##
## SETTING CACHE ##
## ==================================================== */
$setting['cache'] = ($setting['cache']=='yes') ? true : false;
$setting['cachetime'] = ($setting['cache']==true) ? $setting['cachetime'] : false;tcode']]='';
}
}
/* ==================================================== ##
## TRACK INI ##
## ==================================================== */
include(DNBASE."base/danneo.track.php");
/* ==================================================== ##
## USER ##
## ==================================================== */
// USER ?
if($setting['regtype']=="yes"){
// CMS ?
if(empty($setting['userbase'])){
require_once(DNBASE."base/userbase/danneo/danneo.user.php");
// FORUM ?
} else {
$setting['editpass'] = 'no';
require_once(DNBASE."base/userbase/".$setting['userbase']."/danneo.user.php");
}
// USER ?
} else {
require_once(DNBASE."base/userbase/empty.user.php");
}
/* ==================================================== ##
## USERAPI & USERMAIN ##
## ==================================================== */
$userapi = new userapi($db,true);
$usermain = $userapi->usermain;
/* ==================================================== ##
## SITEMENU INI ##
## ==================================================== */
if(preparse($setting['site_menu'],THIS_EMPTY)==0){
// ISSET
foreach(@unserialize($setting['site_menu']) as $mk => $mv){
$siteglobal['insert'][$mk] = '';
if(is_array($mv)){
foreach($mv as $nk => $nv){
$lv = ''.$nv['title'].' ';
$siteglobal['insert'][$mk].= ($nv['acc']=='user') ? (($usermain['logged']==1 && $usermain['userid']>0) ? $lv : '') : $lv;
}
}
}
// ISSET
}
/* ==================================================== ##
## IF REMOTE ADDRES ##
## ==================================================== */
if(isset($_SERVER['REMOTE_ADDR'])) { $REMOTE_ADDR = $_SERVER['REMOTE_ADDR']; }
elseif(isset($HTTP_SERVER_VARS['REMOTE_ADDR'])){ $REMOTE_ADDR = $HTTP_SERVER_VARS['REMOTE_ADDR']; }
elseif(getenv('REMOTE_ADDR')){ $REMOTE_ADDR = getenv('REMOTE_ADDR'); }
if($REMOTE_ADDR!="") {
if(preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/",$REMOTE_ADDR,$ipm)){
$private = array("/^0\./","/^127\.0\.0\.1/","/^192\.168\..*/","/^172\.16\..*/","/^10..*/","/^224..*/","/^240..*/");
$REMOTE_ADDR = preg_replace($private,$REMOTE_ADDR,$ipm[1]);
}
}
if(strlen($REMOTE_ADDR)>16){ $REMOTE_ADDR = substr($REMOTE_ADDR,0,16); }
if(!empty($REMOTE_ADDR)){ define('REMOTE_ADDRS',$REMOTE_ADDR); }
/* ==================================================== ##
## REFFERAL STATISTIC ##
## ==================================================== */
if($setting['ref']=="yes"){
if(isset($_SERVER['HTTP_REFERER'])){ $refers = $_SERVER['HTTP_REFERER']; }
if(empty($refers) && getenv('HTTP_REFERER')){ $refers = getenv('HTTP_REFERER'); }
if(isset($refers)){ define('HTTP_REFERERS',$refers); }
$refers = @eregi_replace("UNION|OUTFILE|FROM|SELECT|WHERE|SHUTDOWN|UPDATE|DELETE|CHANGE|MODIFY|RENAME|RELOAD|ALTER|GRANT|DROP|INSERT|CONCAT",'',$refers);
$refers = (!preg_match('#^http[s]?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i',$refers)) ? '' : substr($refers,0,150);
$hostrefers = @parse_url($setting['site_url']);
if(isset($refers) && !empty($refers) && (!eregi($hostrefers['host'],$refers))){
$inq = $db->query("SELECT refid FROM ".$basepref."_statis_ref WHERE refurl='".$db->escape($refers)."'");
if($db->numrows($inq) > 0){
$db->query("UPDATE ".$basepref."_statis_ref SET refdate='".NEWTIME."',hits=hits+1 WHERE refurl='".$db->escape($refers)."'");
} else {
$db->query("INSERT INTO ".$basepref."_statis_ref VALUES (NULL,'".NEWTIME."','".$db->escape($refers)."','1')");
}
}
}
/* ==================================================== ##
## REDIRECT FUNCTION ##
## ==================================================== */
function redirect($url){
$url = str_replace('&','&',$url);
header("Location: $url");
exit();
}
/* ==================================================== ##
## PAGES ##
## ==================================================== */
function pages($table,$id,$page,$func,$num,$p,$count=false){
global $db,$basepref;
$outpages = array();
if($count==0){
$item_num = $db->fetchrow($db->query("SELECT COUNT(".$id.") AS total FROM ".$basepref."_".$table.""));
} else {
$item_num['total'] = $count;
}
$nums = @ceil($item_num['total']/$num);
if($nums <= 1){
$outpages[]=("1 ");
} else {
if($p > 1){
$goback=$p-1;
$outpages[]=("<< ");
$outpages[]=("< ");
}
for($i=1; $i<$nums+1; $i++) {
if($i==$p){
$outpages[]=("$i ");
} else {
if(($i > $p) && ($i < $p+5) || ($i < $p) && ($i > $p-5)){ $outpages[]=("$i "); }
}
}
if($p<$nums){
$gonext=$p+1;
$outpages[]=("> ");
$outpages[]=(">> ");
}
}
return implode(' ',$outpages);
}
/* ==================================================== ##
## FILE SIZE ##
## ==================================================== */
function file_size($size){
$farr = array('Bt','Kb','Mb','Gb','Tb','Pb');
$i = 0;
while($size>=1024){ $size/=1024; $i++; }
return round($size,2)." ".$farr[$i];
}
/* ==================================================== ##
## VERIFY PWD ##
## ==================================================== */
function verify_pwd($pwd){
global $setting;
return ((preparse($pwd,THIS_STRLEN) < $setting['minpass']) || (preparse($pwd,THIS_STRLEN) > $setting['m
$code.= substr($chars,(mt_rand() % strlen($chars)),1);
}
return $code;
}
/* ==================================================== ##
## THIS TEXT ##
## ==================================================== */
function this_text($carray,$contents){
foreach($carray as $key=>$value){ $newkey[$key] = "{".$key."}"; $newval[$key] = $value; }
return str_replace($newkey,$newval,$contents);
}
/* ==================================================== ##
## SEND MAIL ##
## ==================================================== */
function send_mail($to,$subject,$message,$title,$re){
global $setting;
$headers = "Content-Type: text/plain; charset=".$setting['langcharset']."\n";
$headers.= "From: $title <$re>\n";
$headers.= "X-Mailer: PHP/".phpversion();
@mail($to,$subject,$message,$headers);
}
/* ==================================================== ##
## CODE ##
## ==================================================== */
function code($text,$liter){
$glif=array();
for($exi=128; $exi<=143; $exi++){
$glif['w'][]=chr($exi+112);
$glif['u'][]=chr(209).chr($exi);
}
for($exi=144; $exi<=191; $exi++){
$glif['w'][]=chr($exi+48);
$glif['u'][]=chr(208).chr($exi);
}
$glif['w'][]=chr(168);
$glif['w'][]=chr(184);
$glif['u'][]=chr(208).chr(129);
$glif['u'][]=chr(209).chr(145);
$glif['w'][]=chr(185);
$glif['u'][]=chr(226).chr(132).chr(150);
return ($liter=='w') ? str_replace($glif['u'],$glif['w'],$text) : str_replace($glif['w'],$glif['u'],$text);
}
/* ==================================================== ##
## ADDPARSE ##
## ==================================================== */
function commentparse($text){
$text = htmlspecialchars(strip_tags($text));
$text = str_replace(array(' ','%20%20','%20'),' ',$text);
// XSS
$xss = array("'data'is","'javascript:'is","'alert'is","'vbscript'is","'onmouseover'is","'onclick'is","'onload'is");
$text = preg_replace($xss,"",$text);
// XSS
return nl2br($text);
}
/* ==================================================== ##
## SMILIEPARSE ##
## ==================================================== */
function smilieparse($contents,$carray){
$newkey = array(); $newval = array();
while(list(,$smilie) = @each($carray)){
$newkey[$smilie['code']] = $smilie['code'];
$newval[$smilie['code']] = " ";
}
return str_replace($newkey,$newval,$contents);
}
/* ==================================================== ##
## LINKPARSE ##
## ==================================================== */
function linkparse($url,$text){
global $setting;
return ($setting['comwrap'] > 0) ? "".$text."... " : $text;
}
/* ==================================================== ##
## PHOTO CAT ##
## ==================================================== */
function print_cat($catid=0,$depth){
global $tm,$lang,$siteglobal,$api,$print,$catcache,$catcount;
if(!isset($catcache[$catid])){ return false; }
$stylecount = 0;
// FOREACH
foreach($catcache[$catid] as $key => $val){
$sub = ""; $brcount = 0;
static $sub,$brcount;
// ROWS STYLE
$stylecount++;
$catcount++;
$style = ($stylecount % 2 == 0) ? WORKMOD.'two' : WORKMOD.'one';
// ROWS STYLE
// STATIS
// $depth
if($depth > 0){
$subcatname = $api->siteuni($val['catname']);
$subcpu = ($siteglobal['seourl']==1 && $val['catcpu']) ? "&cpu=".$val['catcpu'] : "";
$sub.= ''.$subcatname.' '.(($val['total']>0) ? ' ['.$val['total'].'] ' : '').', ';
$brcount++;
if($brcount==3){ $brcount=0; $sub.= ' ';}
unset($sub,$brcount);
}
// $depth
// print_cat
print_cat($val['catid'],$depth + 1);
// print_cat
if($depth == 0){
// COUNT
$catname = $api->siteuni($val['catname']);
$cpu = ($siteglobal['seourl']==1 && $val['catcpu']) ? "&cpu=".$val['catcpu'] : "";
$title = ''.$catname.' '.(($val['total']>0) ? ' ['.$val['total'].'] ' : '');
$icon = ($val['icon']) ? ' ' : '';
$desc = ($val['catdesc']) ? ' '.$val['catdesc'] : "";
$sub = (substr($sub,-1)==">") ? substr($sub,0,-8).'.' : substr($sub,0,-2).(($sub) ? '.' : '');
// COUNT
$print.= $tm->parse(array('style'=>$style,
'icon'=>$icon,
'title'=>$title,
'desc'=>$desc,
'sub'=>$sub,
'total'=>$val['total'],
),$tm->manuale['rows']);
}
// cat
}
// FOREACH
return $print;
}
/* ==================================================== ##
## COMMENTOUT ##
## ==================================================== */
function commentout($text){
global $setting;
// BAD
if(!empty($setting['combad'])){
$bwords = explode('|',$setting['combad']);
$text = str_replace($bwords,'****',$text);
}
// AUTO
if($setting['comauto']=="yes"){
$text = preg_replace("'(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)'is","\\1[URL]\\2[/URL]",$text);
$text = preg_replace("'(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)'is","\\1[URL]\\2[/URL]",$text);
$find = array("/([ \n\r\t])([_a-z0-9-]+(\.[_a-z0-9-]+)*@[^\s]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))/si","/^([_a-z0-9-]+(\.[_a-z0-9-]+)*@[^\s]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))/si");
$re = array("\\1[MAIL]\\2[/MAIL]","[MAIL]\\0[/MAIL]");
$text=(strpos($text,"@")) ? preg_replace($find,$re,$text) : $text;
}
// WRAP
if($setting['comwrap']>0){
$text = preg_replace('#(?>[^\s&/<>"\\-\[\]]|&[\#a-z0-9]{1,4};){'.$setting['comwrap'].'}#i','$0 ',$text);
}
// FIND
$find = array("'\[B\](.*?)\[/B\]'is","'\[I\](.*?)\[/I\]'is",
"'\[U\](.*?)\[/U\]'is",
"'\[URL\]([\w]+?://[^ \"\n\r\t<]*?)\[/URL\]'is",
"'\[URL\]((www|ftp)\.[^ \"\n\r\t<]*?)\[/URL\]'is",
"'\[URL=([\w]+?://[^ \"\n\r\t<]*?)\](.*?)\[/URL\]'i",
"'\[URL=((www|ftp)\.[^ \"\n\r\t<]*?)\]([^?\n\r\t].*?)](.*?)\[/URL\]'is",
"'\[MAIL\](.*?)\[/MAIL\]'is",
"'\[MAIL=(.*?)\](.*?)\[/MAIL\]'is"
);
// REPLACE
$replace = array("\\1 ","\\1 ",
"\\1 ",
"\\1 ",
"\\1 ",
"\\2 ",
"\\2 ",
"\\1 ",
"\\2 "
);
// PREG
$text = preg_replace($find,$replace,$text);
// RETURN DEL
return preg_replace("#\[(/?)(B|U|I|URL|MAIL)(.*?)\]#is","",$text);
}
/* ==================================================== ##
## NOTSLASHES ##
## ==================================================== */
function notslashes($resursing){
return str_replace(array('\\','\'','\"'),array("","'",'"'),$resursing);
}
/* ==================================================== ##
## DELTAGS ##
## ==================================================== */
function deltags($text){
$text = htmlspecialchars(strip_tags($text));
$text = preg_replace("#\[(/?)(B|U|I|URL|MAIL)require_once($_SERVER['DOCUMENT_ROOT'].'/'._SAPE_USER.'/sape.php');
$sape = new SAPE_client();
?>
Deprecated : Function eregi() is deprecated in /home/users/a/aghost/domains/anahata.ru/base/danneo.initapi.php on line 83
Warning : include(/home/users/a/aghost/domains/anahata.ru/mod//index.php) [function.include ]: failed to open stream: Нет такого файла или каталога in /home/users/a/aghost/domains/anahata.ru/index.php on line 159
Warning : include() [function.include ]: Failed opening '/home/users/a/aghost/domains/anahata.ru/mod//index.php' for inclusion (include_path='.:/usr/local/zend-5.3/share/pear') in /home/users/a/aghost/domains/anahata.ru/index.php on line 159