diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/funchat.iml b/.idea/funchat.iml new file mode 100644 index 0000000..cc5f239 --- /dev/null +++ b/.idea/funchat.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5af62e9 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..9ef07eb --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/admin/addgroup.apnl.php b/admin/addgroup.apnl.php index 22b9f80..c5948fb 100644 --- a/admin/addgroup.apnl.php +++ b/admin/addgroup.apnl.php @@ -1,7 +1,7 @@ - * @package astat core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: addgroup.apnl.php 41 2009-06-21 19:24:29Z genuineparts $ -*/ -If (!defined("in_BL_ADMIN")) { + * @version $Id$ + */ + +If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } $addnav["right"]=FALSE; diff --git a/admin/adduser.apnl.php b/admin/adduser.apnl.php index aaba2d9..220835b 100644 --- a/admin/adduser.apnl.php +++ b/admin/adduser.apnl.php @@ -1,4 +1,4 @@ -title=$lang->_('ADDUSER'); - $panel->content=$lang->_('ADDUSERTEXT'); - $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=adduser")); - $panel->content.="

".$lang->_('USERNAME').":

"; - $panel->field(array("name"=>"name","typ"=>"text","value"=>$data["name"])); - $panel->content.="

".$lang->_('REALNAME').":

"; - $panel->field(array("name"=>"realname","typ"=>"text","value"=>$data["realname"])); - $panel->content.="

".$lang->_('MAIL').":

"; - $panel->field(array("name"=>"email","value"=>$data["email"],"typ"=>"text")); - $panel->content.="

".$lang->_('PASSWORD').":

"; - $panel->field(array("name"=>"password","value"=>$data["password"],"typ"=>"password")); - $panel->content.="

".$lang->_('LOCATION').":

"; - $panel->field(array("name"=>"from","value"=>$data["from"],"typ"=>"text")); - $panel->content.="

".$lang->_('GENDER').":

"; - $panel->select(array($lang->_('DIV')=>"u", $lang->_('FEMALE')=>"f",$lang->_('MALE')=>"m"),$data["gender"],"gender"); - $panel->content.="

".$lang->_('HOMEPAGE').":

"; - $panel->field(array("name"=>"homepage","value"=>$data["homepage"],"typ"=>"text")); - $panel->content.="

".$lang->_('BANREASON').":

"; - $panel->textarea(array("name"=>"bio","value"=>$data["bio"],"typ"=>"text")); - $panel->content.="

".$lang->_('ROLE').":

"; - $result=$db->query("SELECT `id`,`role_name` FROM `" . $config["prefix"] . "role`"); - while($rdata = $db->fetch_array($result)){ - $dd[$rdata["role_name"]]=$rdata["id"]; - } - $panel->select($dd,$data["role"],"role"); - $panel->content.="
"; - $panel->content.="

".$lang->_('STATUS').":

"; - $panel->select(array($lang->_('ACTIVE')=>1,$lang->_('INACTIVE')=>0,$lang->_('BANNED')=>2),$data["active"],"active"); - $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); - $panel->content.="
"; - $panel->content.="
"; - $panel->submit(); - $panel->formClose(); + $panel->title=$lang->_('ADDUSER'); + $panel->content=$lang->_('ADDUSERTEXT'); + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=adduser")); + $panel->content.="

".$lang->_('USERNAME').":

"; + $panel->field(array("name"=>"name","typ"=>"text","value"=>"")); + $panel->content.="

".$lang->_('REALNAME').":

"; + $panel->field(array("name"=>"realname","typ"=>"text","value"=>"")); + $panel->content.="

".$lang->_('MAIL').":

"; + $panel->field(array("name"=>"email","value"=>"","typ"=>"text")); + $panel->content.="

".$lang->_('PASSWORD').":

"; + $panel->field(array("name"=>"password","value"=>"","typ"=>"password")); + $panel->content.="

".$lang->_('LOCATION').":

"; + $panel->field(array("name"=>"from","value"=>"","typ"=>"text")); + $panel->content.="

".$lang->_('GENDER').":

"; + $panel->select(array($lang->_('DIV')=>"u", $lang->_('FEMALE')=>"f",$lang->_('MALE')=>"m"),"","gender"); + $panel->content.="

".$lang->_('HOMEPAGE').":

"; + $panel->field(array("name"=>"homepage","value"=>"","typ"=>"text")); + $panel->content.="

".$lang->_('BANREASON').":

"; + $panel->textarea(array("name"=>"bio","value"=>"","typ"=>"text")); + $panel->content.="

".$lang->_('ROLE').":

"; + $result=$db->query("SELECT `id`,`role_name` FROM `" . $config["prefix"] . "role`"); + while($rdata = $db->fetch_array($result)){ + $dd[$rdata["role_name"]]=$rdata["id"]; + } + $panel->select($dd,"","role"); + $panel->content.="
"; + $panel->content.="

".$lang->_('STATUS').":

"; + $panel->select(array($lang->_('ACTIVE')=>1,$lang->_('INACTIVE')=>0,$lang->_('BANNED')=>2),"","active"); + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->content.="
"; + $panel->content.="
"; + $panel->submit(); + $panel->formClose(); } } diff --git a/admin/banips.apnl.php b/admin/banips.apnl.php index 3f660c6..df3253c 100644 --- a/admin/banips.apnl.php +++ b/admin/banips.apnl.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ */ -If (!defined("in_BL_ADMIN")) { +If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } $addnav["right"]=FALSE; diff --git a/admin/config.apnl.php b/admin/config.apnl.php index c6a85cc..a944f6c 100644 --- a/admin/config.apnl.php +++ b/admin/config.apnl.php @@ -1,5 +1,30 @@ + * @package BcWe core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + */ +If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } $addnav["right"]=FALSE; @@ -24,7 +49,7 @@ class config_panel extends admin_module{ $config[$row["name"]] = $row["value"]; } } - $result = $db->query("SELECT * FROM `" . $config["prefix"] . "config` v LEFT JOIN `" . $config["prefix"] . "config_categorys` c ON v.`category`=c.`cid`"); + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "config` v LEFT JOIN `" . $config["prefix"] . "config_categories` c ON v.`category`=c.`cid`"); while ($row = $db->fetch_array($result)){ $data[$row["categoryname"]][]=$row; } diff --git a/admin/editgroup.apnl.php b/admin/editgroup.apnl.php index 47a176a..0642d1a 100644 --- a/admin/editgroup.apnl.php +++ b/admin/editgroup.apnl.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ */ -If (!defined("in_BL_ADMIN")) { +If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } $addnav["right"]=FALSE; diff --git a/admin/editusers.apnl.php b/admin/editusers.apnl.php index 4307178..fad2dd5 100644 --- a/admin/editusers.apnl.php +++ b/admin/editusers.apnl.php @@ -1,4 +1,4 @@ -formClose(); $panel->parse_page(); } - }elseif($_GET["action"]=="delete" && $_GET["user"]){ + }elseif(isset($_GET["action"]) && $_GET["action"]=="delete" && isset($_GET["user"])){ $result=$db->query("SELECT * FROM `" . $config["prefix"] . "users` WHERE `uid`='".intval($_GET["user"])."'"); $data = $db->fetch_array($result); $plugin->run_hook('admin_user_before_delete',array('data'=>$data)); @@ -111,12 +111,12 @@ class editusers_panel extends admin_module{ $panel->content.=" - - - - - - + + + + + + "; if(!empty($user)){ foreach($user as $u){ @@ -131,22 +131,22 @@ class editusers_panel extends admin_module{ $u['activestyle']='style="font-style:italic;"'; } $panel->content.=" - - - - - "; + + + + + "; if($u["uid"]==$session->userdata["uid"]){ - $panel->content.=" + $panel->content.=""; }else{ - $panel->content.=" + $panel->content.=""; } } }else{ $panel->content.=" - + "; } $panel->content.="
".$lang->_('ID')."".$lang->_('USERNAME')."".$lang->_('REALNAME')."".$lang->_('ROLE')."".$lang->_('STATUS')."".$lang->_('ACTION')."".$lang->_('ID')."".$lang->_('USERNAME')."".$lang->_('REALNAME')."".$lang->_('ROLE')."".$lang->_('STATUS')."".$lang->_('ACTION')."
".$u["uid"]."".$u["username"]."".$u["realname"]."".$u["role_name"]."".$u['activetext']."".$u["uid"]."".$u["username"]."".$u["realname"]."".$u["role_name"]."".$u['activetext']."_('BADIDEA')."')\" href=\"".$config["path"]."/admin/index.php?panel=editusers&action=delete&user=".$u["uid"]."\"> _('BADIDEA')."')\" href=\"".$config["path"]."/admin/index.php?panel=editusers&action=delete&user=".$u["uid"]."\">
_('DELETEUSER'),$u["username"])."')\" href=\"".$config["path"]."/admin/index.php?panel=editusers&action=delete&user=".$u["uid"]."\"> _('DELETEUSER'),$u["username"])."')\" href=\"".$config["path"]."/admin/index.php?panel=editusers&action=delete&user=".$u["uid"]."\">
".$lang->_('NOUSERS')."".$lang->_('NOUSERS')."

"; diff --git a/admin/index.php b/admin/index.php index a1dc852..5dca4fa 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,6 +1,6 @@ - * @package BeCast Webengine core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: index.php 100 2010-02-20 14:42:30Z genuineparts $ + * @version $Id$ */ ERROR_REPORTING(E_ALL ^E_NOTICE); $basepath=""; $nav_include="../"; -require_once dirname(dirname(__FILE__)).'/core/init_core.inc.php'; +require_once dirname(__FILE__, 2) .'/core/init_core.inc.php'; $session->page_begin("Admincenter", True); -define("in_BL_ADMIN",TRUE); +define("IN_BCWE_ADMIN",TRUE); function size_format($num, $prec = 2) { @@ -41,7 +41,6 @@ function size_format($num, $prec = 2) return $num . ' bytes'; } } - if(isset($session->userdata['uid']) && $session->userdata['uid']!=0 && ($session->userdata["admin_cp"] && $session->userdata["is_admin"])){ require_once dirname(dirname(__FILE__)).'/inc/admin.class.php'; require_once dirname(dirname(__FILE__)).'/inc/panel.class.php'; diff --git a/admin/module.apnl.php b/admin/module.apnl.php index 95b13b4..ecde576 100644 --- a/admin/module.apnl.php +++ b/admin/module.apnl.php @@ -1,6 +1,6 @@ - - * @package astat core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: module.apnl.php 64 2009-07-24 22:07:55Z genuineparts $ -*/ + * @version $Id$ + */ -If (!defined("in_BL_ADMIN")) { +If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } @@ -67,17 +67,16 @@ class module_panel extends admin_module{ $panel->content.="

Installierte Module


- - - - - + + + + + "; if(!empty($core->mod_)){ foreach($core->mod_ as $mod){ - If($mod["depends"]!=""){ - - $depends=""; + $depends=""; + if(isset($mod["depends"]) && $mod["depends"]!=""){ $dependands=unserialize($mod["depends"]); foreach($dependands as $dep){ if(!$deps){ @@ -89,11 +88,11 @@ class module_panel extends admin_module{ $depends.='
hängt ab von: '.$deps; } $panel->content.=" - - - - - + + + + + "; unset($deps); unset($depends); @@ -109,19 +108,18 @@ class module_panel extends admin_module{ $panel->content.="

Nicht Installierte Module


"; $panel->content.="
ModulVersionAutorHomepageAktionModulVersionAutorHomepageAktion
".$mod["name"].$depends."".$mod["version"]."".$mod["author"]."".$mod["url"]."Deinstallieren".$mod["name"].$depends."".$mod["version"]."".$mod["author"]."".$mod["url"]."Deinstallieren
- - - - - + + + + + "; $modules=$this->avaiable_modules(); if(is_array($modules)){ foreach($modules as $mod){ - If($mod["depends"]!=""){ - - $depends=""; + $depends=""; + if(isset($mod["depends"]) && $mod["depends"]!=""){ $dependands=explode(",",$mod["depends"]); foreach($dependands as $dep){ if(!$deps){ @@ -133,11 +131,11 @@ class module_panel extends admin_module{ $depends.='
hängt ab von: '.$deps; } $panel->content.=" - - - - - + + + + + "; unset($deps); unset($depends); diff --git a/admin/navigation.apnl.php b/admin/navigation.apnl.php index 4bd0d2b..b03e6d4 100644 --- a/admin/navigation.apnl.php +++ b/admin/navigation.apnl.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ */ -If (!defined("in_BL_ADMIN")) { +If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } $addnav["right"]=FALSE; diff --git a/admin/versions.apnl.php b/admin/versions.apnl.php index 7fcb8f1..d9f24f1 100644 --- a/admin/versions.apnl.php +++ b/admin/versions.apnl.php @@ -1,6 +1,6 @@ - * @package BeFramed core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ -*/ -If (!defined("in_BL_ADMIN")) { + */ +If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } $addnav["right"]=FALSE; diff --git a/core/init_core.inc.php b/core/init_core.inc.php index 9fe7cfb..646f8f2 100644 --- a/core/init_core.inc.php +++ b/core/init_core.inc.php @@ -1,6 +1,6 @@ - - * @package astat core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: init_core.inc.php 148 2012-03-27 19:48:30Z genuineparts $ -*/ + * @version $Id$ + */ -define('in_astat', true); +define("INBCWE", true); -function getTime() { +function getTime(): string +{ $timer = explode( ' ', microtime() ); - $timer = $timer[1] + $timer[0]; - return $timer; + return $timer[1] . $timer[0]; } $start = getTime(); /** * Configuration */ -require dirname(dirname(__FILE__)).'/inc/config.inc.php'; - +if(!is_file(dirname(__FILE__, 2) .'/inc/config.inc.php')){ + header("Location: install/install.php"); +} else { + require dirname(__FILE__, 2) . '/inc/config.inc.php'; +} /** * Smarty */ @@ -53,42 +56,37 @@ require $basepath.'database/'.$config['db_class'].'.class.php'; /** * Functions */ -include dirname(dirname(__FILE__)).'/inc/functions.class.php'; +include dirname(__FILE__, 2) .'/inc/functions.class.php'; /** * Logger */ -require dirname(dirname(__FILE__)).'/inc/logger.class.php'; +require dirname(__FILE__, 2) .'/inc/logger.class.php'; /** * Logger */ -require dirname(dirname(__FILE__)).'/inc/datacache.class.php'; - -/** -* Cache -*/ -require dirname(dirname(__FILE__)).'/inc/cache.class.php'; +require dirname(__FILE__, 2) .'/inc/datacache.class.php'; /** * Errors */ -include dirname(dirname(__FILE__)).'/inc/error.class.php'; +include dirname(__FILE__, 2) .'/inc/error.class.php'; /** * Plugins */ -include dirname(dirname(__FILE__)).'/inc/plugin.class.php'; +include dirname(__FILE__, 2) .'/inc/plugin.class.php'; /** * Mail */ -include dirname(dirname(__FILE__)).'/inc/mail.class.php'; +include dirname(__FILE__, 2) .'/inc/mail.class.php'; /** * Captcha */ -include dirname(dirname(__FILE__)).'/inc/captcha.class.php'; +include dirname(__FILE__, 2) .'/inc/captcha.class.php'; $plugin=new plugins(); $db= new db($config['host'], $config['user'], $config['pass'], $config['db'],'utf8', true); @@ -97,7 +95,7 @@ $db= new db($config['host'], $config['user'], $config['pass'], $config['db'],'ut * Select $config vars form Database * */ -$result = $db->query("SELECT `name`, `value` FROM " . $config['prefix'] . "config"); +$result = $db->query("SELECT `name`, `value` FROM `" . $config['prefix'] . "config`"); while ($row = $db->fetch_array($result)){ $config[$row['name']] = $row['value']; } @@ -116,10 +114,16 @@ if($config['LCLANG']){ $cache=new datacache(); /** -* Start Datacache -* +* Start Cache +* I think this is vestigial and can be deleted. Hesitant to remove it because some instance in the wild may use this? */ -$ccache=new cache(); +if(isset($config['MEMCACHE_SERVER'])) { + /** + * Cache + */ + require dirname(__FILE__, 2) .'/inc/cache.class.php'; + $ccache = new cache(); +} /** * Look if we have a path Variable and try to autoset if not. @@ -130,7 +134,7 @@ if(!isset($config['path'])){ $last = array_pop($path); $path = str_replace('/' . $last, '', $_SERVER['SCRIPT_NAME']); $config['path'] = $path; - $db->query("INSERT INTO " . $config['prefix'] . "config (`name`, `value`, `title`, `description`, `option`, `category`) VALUES + $db->query("INSERT INTO `" . $config['prefix'] . "config` (`name`, `value`, `title`, `description`, `option`, `category`) VALUES ( 'path', '".$path."', 'Pfad', 'Der Pfad auf ihrem Webserver z.b. /cms', 'text', 1)"); }else{ $path=$config['path']; @@ -140,7 +144,7 @@ if(!isset($config['path'])){ * Start Logger * */ -$log=new logger($config['logtype'],dirname(dirname(__FILE__)).'/logs/'.$config['logfile'],$config['loglevel']); +$log=new logger($config['logtype'], dirname(__FILE__, 2) .'/logs/'.$config['logfile'],$config['loglevel']); $tpl = new Smarty(); $error = new errorhandler(); $functions = new functions(); @@ -150,10 +154,9 @@ $root = $_SERVER['DOCUMENT_ROOT'] . $config['path']; * Start Language * */ -require dirname(dirname(__FILE__)).'/inc/lang.class.php'; +require dirname(__FILE__, 2) .'/inc/lang.class.php'; $lang=new lang(); - /** * Check if we have a Theme variable and the Theme exists * @TODO Theme Management @@ -171,8 +174,12 @@ if(isset($config['theme']) && $config['theme']!='' && is_dir($root . '/themes/'. $tpl->setCompileDir($root . '/core/template/templates_c'); $tpl->setCacheDir($root . '/core/template/cache'); $tpl->setConfigDir($root . '/core/template/config'); -$tpl->loadFilter(\Smarty\Smarty::FILTER_OUTPUT,'trimwhitespace'); -$tpl->registerFilter("output", "lang"); +try { + $tpl->registerFilter(\Smarty\Smarty::FILTER_OUTPUT, 'trimwhitespace'); + $tpl->registerFilter(\Smarty\Smarty::FILTER_OUTPUT, "lang"); +} catch (\Smarty\Exception $e) { + $log->write("Smarty Register Filter error", $e->getMessage()); +} //var_dump($tpl -> getAutoloadFilters()); /** * Well... This should vanish with Thememanagement @@ -186,7 +193,7 @@ $addnav['left'] = TRUE; * Start Sessions * */ -require dirname(dirname(__FILE__)).'/inc/sessions.class.php'; +require dirname(__FILE__, 2) .'/inc/sessions.class.php'; $session=new session(); @@ -194,12 +201,14 @@ $session=new session(); * Initiate Core Class * */ -require dirname(dirname(__FILE__)).'/inc/core.class.php'; +require dirname(__FILE__, 2) .'/inc/core.class.php'; $core=new core($db, $log, $tpl); if(defined('INSTALLED')){ - if(is_dir(dirname(dirname(__FILE__)).'/install')){ - return $core->message($lang->_('DELINSTALLDIR'), $lang->_('DELINSTALLDIRTEXT'),FALSE); + if(is_dir(dirname(__FILE__, 2) .'/install')){ + $session->page_begin("Maintenance", FALSE); + $core->message($lang->_('DELINSTALLDIR'), $lang->_('DELINSTALLDIRTEXT'),FALSE); + return; } }else{ header("Location: install/install.php"); @@ -211,7 +220,7 @@ $captcha = new captcha(); * OpenID */ if($config['use_openid']==1){ - include dirname(dirname(__FILE__)).'/inc/SimpleOpenID.class.php'; + include dirname(__FILE__, 2) .'/inc/SimpleOpenID.class.php'; } /** * Get all *.plugin.php files from the Modules and register the Pluginhooks @@ -250,13 +259,11 @@ function langstr($treffer) * Its useful but "undocumented". * */ -$moduledir = dirname(dirname(__FILE__)).'/core/modules'; +$moduledir = dirname(__FILE__, 2) .'/core/modules'; $modules = opendir($moduledir); while ($mods = readdir($modules)) { if (preg_match('/^.*?\.class.php$/', $mods)) { require_once($moduledir.'/'.$mods); } } -@closedir($modules); - -?> +@closedir($modules); \ No newline at end of file diff --git a/rp.php b/forumplugins/rp.php similarity index 100% rename from rp.php rename to forumplugins/rp.php diff --git a/inc/admin.class.php b/inc/admin.class.php index 33071a6..3046fdf 100644 --- a/inc/admin.class.php +++ b/inc/admin.class.php @@ -1,7 +1,7 @@ - * @package astat core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: admin.class.php 57 2009-07-10 19:34:56Z genuineparts $ + * @version $Id$ */ $module["admin"]["name"]="Admin Class"; -$module["admin"]["ver"]="0.2.4"; +$module["admin"]["ver"]="0.2.5"; class admin { var $module_=array(); diff --git a/inc/cache.class.php b/inc/cache.class.php index 0a2c7e1..b601fdb 100644 --- a/inc/cache.class.php +++ b/inc/cache.class.php @@ -1,6 +1,8 @@ - * @package beFramed Core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ -*/ + */ /* Already defined by PHP. I'll leave it here for Info define("LOG_EMERG", 0); @@ -34,8 +36,7 @@ define("LOG_WARNING", 4); define("LOG_INFO", 6); define("LOG_DEBUG", 7); */ -$module["cache"]["name"]="Cache Class"; -$module["cache"]["ver"]="0.9.10"; + class cache { var $server; var $prefix; @@ -85,12 +86,15 @@ class cache { $this->obj->quit(); } - function set($key,$var,$expiration=null){ - if($expriation=null){ - $expriation=$this->exp; + function set($key,$var,$exp=null): void + { + if($exp==null){ + $expiration = $this->exp; + }else{ + $expiration = $exp; } $this->obj->set($this->prefix.$key,$var,$expiration); - } + } function get($key){ diff --git a/inc/core.class.php b/inc/core.class.php index 980abaa..85249e2 100644 --- a/inc/core.class.php +++ b/inc/core.class.php @@ -1,7 +1,7 @@ - * @package astat core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: core.class.php 154 2012-03-27 21:50:46Z genuineparts $ + * @version $Id$ */ $module['core']['name']='Core Class'; -$module['core']['ver']='0.9.81'; +$module['core']['ver']='1.0.0'; class Core{ @@ -84,7 +84,7 @@ class Core{ * * @var string */ - var $ver_minor='0'; + var $ver_minor='1'; /** * @@ -100,7 +100,7 @@ class Core{ * * @var string */ - var $ver_codename='Antiochos'; + var $ver_codename='Tim'; /** * @@ -516,7 +516,7 @@ class Core{ * Renders the Page * * @param string $content The content for the page - * @param bool $minimal Render the Page in a minaml mode (e.g. for redirect) + * @param bool $minimal Render the Page in a minmal mode (e.g. for redirect) * @param string $minimal_tpl Custom minimal template * @param string $header_tpl Custom header template * @param string $footer_tpl Custom footer template diff --git a/inc/datacache.class.php b/inc/datacache.class.php index 0d1ea7f..ff4a3d2 100644 --- a/inc/datacache.class.php +++ b/inc/datacache.class.php @@ -2,7 +2,7 @@ $module["datacache"]["name"]="Datacache Module"; $module["datacache"]["ver"]="0.1.0"; /** - * Project: astat - simple site engine + * Project: BeCast WebEngine - simple site engine * File: /inc/datacache.class.php * * This library is free software; you can redistribute it and/or @@ -19,13 +19,13 @@ $module["datacache"]["ver"]="0.1.0"; * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * @link http://www.astat.org SVN: $URL$ - * @copyright 2010 becast.at + * @link http://www.becast.at + * @copyright 2009-2025 becast.at * @author Bernhard Jaud - * @package astat core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ -*/ + */ class datacache { var $data = array(); diff --git a/inc/functions.class.php b/inc/functions.class.php index cbc19ca..03a0bb3 100644 --- a/inc/functions.class.php +++ b/inc/functions.class.php @@ -1,9 +1,9 @@ - * @package astat core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: sessions.class.php 129 2010-02-21 22:04:51Z genuineparts $ + * @version $Id$ */ class functions { @@ -120,7 +120,9 @@ class functions { function get_ip(){ global $config; $ip = strtolower($_SERVER['REMOTE_ADDR']); - + if(empty($config['ip_forwarded_check'])){ + $config['ip_forwarded_check'] = false; + } if($config['ip_forwarded_check']) { $addresses = array(); diff --git a/inc/lang.class.php b/inc/lang.class.php index feade45..8929a00 100644 --- a/inc/lang.class.php +++ b/inc/lang.class.php @@ -1,7 +1,9 @@ - * @package astat core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ -*/ -$module["lang"]["name"]="Language Class"; -$module["lang"]["ver"]="0.1.1"; + */ + class lang{ var $langname=array('de'=>'Deutsch','en'=>'English'); var $language; var $languagedir; - var $lf; + var array $langdata; function __construct($languagedir='/languages/'){ $this->languagedir = dirname(dirname(__FILE__)).'/languages/'; } - function setlang($language){ - global $config, $error, $db, $log, $core, $plugin, $lang; + function setlang($language): void + { + global $config; unset($this->language); - unset($this->lf); + unset($this->langdata); if(!$language || $language==''){ $language=$config['lang']; if(!$language){ @@ -51,8 +53,10 @@ class lang{ }else{ $this->language=$language; } - include_once $this->languagedir.$this->language.'.lang.php'; - $this->lf=$lf; + require_once $this->languagedir.$this->language.'.lang.php'; + if (isset($lf)) { + $this->langdata = $lf; + } } function getlanguages(){ @@ -71,8 +75,8 @@ class lang{ } function _($string){ - if(isset($this->lf[$string])){ - return($this->lf[$string]); + if(isset($this->langdata[$string])){ + return($this->langdata[$string]); }else{ return($string); } diff --git a/inc/panel.class.php b/inc/panel.class.php index 3d1e6a4..77cdc16 100644 --- a/inc/panel.class.php +++ b/inc/panel.class.php @@ -1,8 +1,8 @@ - * @package BeCast Webengine core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: panel.class.php 128 2010-02-21 22:03:37Z genuineparts $ + * @version $Id$ */ $module["panel"]["name"]="Panel Class"; -$module["panel"]["ver"]="0.3.4"; +$module["panel"]["ver"]="0.3.6"; class panel { - var $sidebar=""; - var $page=""; - var $bodyext=""; - var $title=""; - var $content=""; - var $meta=""; - var $form=""; - var $foot=""; - var $head=""; - var $menu_items =""; + var string $sidebar=""; + var string $page=""; + var string $bodyext=""; + var string $title=""; + var string $content=""; + var string $meta=""; + var string $form=""; + var string $foot=""; + var string $head=""; + var string $menu_items =""; function page($additional_title="",$meta=""){ global $config,$db,$core; - return ' - + return ' + '.$config['sitetitle'].' @@ -77,24 +77,26 @@ class panel { exit(); } - function menu_item($panel,$text, $img=""){ + function menu_item($panel,$text, $img=""): void + { global $config, $userdata, $userinfo, $session, $meta; if($panel=="group_only"){ $this->menu_items.="
  • ".$text."
  • "; }elseif($panel=="admin_home"){ - $this->menu_items.="
  • ".$text."
  • "; + $this->menu_items.="
  • ".$img." ".$text."
  • "; }elseif($panel=="page_home"){ - $this->menu_items.="
  • ".$text."
  • "; + $this->menu_items.="
  • ".$img." ".$text."
  • "; }else{ if($img!=""){ - $this->menu_items.="
  • ".$text."
  • "; + $this->menu_items.="
  • ".$img." ".$text."
  • "; }else{ $this->menu_items.="
  • ".$text."
  • "; } } } - function admin_message($title,$message,$redirect=FALSE,$panel="",$time="4"){ + function admin_message($title,$message,$redirect=FALSE,$panel="",$time="4"): void + { global $config,$session,$lang; $session->page_begin("Admin Message", True); if($panel!="" && $redirect){ @@ -111,7 +113,8 @@ class panel { } - function menu(){ + function menu(): string + { return ''; @@ -120,8 +123,8 @@ class panel { function form ($args = array(),$return=FALSE,$extra=""){ - $method = $args["method"] ? $args["method"] : 'post'; - $action = $args["action"] ? $args["action"] : $_SERVER['PHP_SELF']; + $method = $args["method"] ?? 'POST'; + $action = $args["action"] ?? $_SERVER['PHP_SELF']; $form = '
    '; if(!$return){ $this->content .= $form; @@ -129,7 +132,7 @@ class panel { return $form; } } - function formClose () + function formClose ($return=FALSE) { $form = ''; @@ -200,7 +203,7 @@ class panel { } function submit ($args=array(),$extra="",$return=FALSE) { - $name = $args["name"] ? $args["name"] : 'submit'; + $name = $args["name"] ?? 'submit'; $fld = ''; // html: form submit button if(!$return){ $this->content .= $fld; @@ -214,10 +217,10 @@ class panel { */ function textarea ($args = array(),$extra="",$return=FALSE) { - $name = $args["name"] ? $args["name"] : 'field'; - $rows = $args["rows"] ? $args["rows"] : '3'; - $cols = $args["cols"] ? $args["cols"] : '30'; - $text = $args["value"] ? $args["value"] : ''; + $name = $args["name"] ?? 'field'; + $rows = $args["rows"] ?? '3'; + $cols = $args["cols"] ?? '30'; + $text = $args["value"] ?? ''; $fld = ''; if(!$return){ diff --git a/inc/plugin.class.php b/inc/plugin.class.php index c9e2e22..e015ed7 100644 --- a/inc/plugin.class.php +++ b/inc/plugin.class.php @@ -25,9 +25,9 @@ $module["module"]["name"]="Plugin Class"; $module["module"]["ver"]="0.1.1"; class plugins{ - var $hooks; - var $current_hook; - var $plugin_=array(); + var array $hooks; + var string $current_hook; + var array $plugin_=array(); function load_plugins($region='G'){ global $config, $db; @@ -63,6 +63,9 @@ class plugins{ function run_hook($name,$variables=array()) { + if(empty($this->hooks)){ + return false; + } if(array_key_exists($name,$this->hooks)){ if(!is_array($this->hooks[$name])) { @@ -92,6 +95,7 @@ class plugins{ $this->current_hook = ''; return $return; } + return false; } diff --git a/inc/sessions.class.php b/inc/sessions.class.php index 1268517..adce607 100644 --- a/inc/sessions.class.php +++ b/inc/sessions.class.php @@ -1,8 +1,8 @@ - * @package astat core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: sessions.class.php 129 2010-02-21 22:04:51Z genuineparts $ -*/ + * @version $Id$ + */ class session { var $sid = 0; @@ -38,7 +38,7 @@ class session { function page_begin($page = "UNDEFINED", $needlogin = TRUE){ global $config, $db, $log, $core, $lang, $plugin, $functions; $plugin->run_hook('page_begin_start',array('page'=>$page,'needlogin'=>$needlogin)); - if($this->userdata['uid']==0 || !$this->userdata['uid']){ + if(!isset($this->userdata['uid']) || $this->userdata['uid']==0){ $this->ip = $functions->get_ip(); $this->packip = $functions->my_inet_pton($this->ip); $this->useragent = $_SERVER["HTTP_USER_AGENT"]; diff --git a/index.php b/index.php index a9e8132..18ab812 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ - * @package astat core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: index.php 100 2010-02-20 14:42:30Z genuineparts $ + * @version $Id$ */ ini_set('display_errors', 1); diff --git a/modules/ajaxpm/admin/add.apnl.php b/modules/ajaxpm/admin/add.apnl.php deleted file mode 100644 index 498fb7e..0000000 --- a/modules/ajaxpm/admin/add.apnl.php +++ /dev/null @@ -1,142 +0,0 @@ - - * @package astat core - * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: add.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ -*/ -If (!defined("in_BL_ADMIN")) { - die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); -} -$session->page_begin("add News", True); - -class add_news_panel extends admin_module{ - - function output(){ - global $config, $db,$panel, $session; - $fail=FALSE; - if(isset($_POST['send'])&& $_POST['send']==1){ - if(isset($_POST['text'])&& $_POST['text']!=""||isset($_POST['title'])&& $_POST['title']!=""){ - $title=$db->escape($_POST['title']); - $db->query("INSERT INTO `" . $config["prefix"] . "news` (`text`,`date`,`author`,`category`,`title`,`active`) VALUES ('".$db->escape($_POST["text"])."','".time()."','".$session->userdata["uid"]."','".intval($_POST["category"])."','".$title."','".$_POST["active"]."')"); - $panel->admin_message("Danke", "Die News wurden erfolgreich eingetragen!.",TRUE,"add_news"); - }else{ - $fail="Du musst alle Felder ausfüllen!"; - } - }elseif(!isset($_POST['send']) || $fail){ - $panel->title="News schreiben"; - $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=add_news")); - if($fail){ - $panel->content.=$fail; - } - $panel->content.="

    Titel:

    "; - $panel->field(array("name"=>"title","typ"=>"text","value"=>$_POST["title"])); - $resultc=$db->query("SELECT `id`,`name` FROM `" . $config["prefix"] . "news_category` WHERE `active`='true'"); - $karray["Keine"]=""; - while($row=$db->fetch_array($resultc)){ - $karray[$row["name"]]=$row["id"]; - } - $panel->content.="

    Kategorie:

    "; - $panel->select($karray,$_POST["category"],"category"); - $panel->content.="
    "; - $panel->content.="

    Text:

    "; - $panel->textarea(array("name"=>"text","value"=>$_POST["text"],"rows"=>"30","cols"=>"80"),"class=\"mceEditor\""); - $panel->content.="

    Aktiv:

    "; - $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); - $panel->content.="
    "; - $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); - $panel->content.="
    "; - $panel->submit(); - $panel->formClose(); - } - } - - function meta(){ - global $config; - $meta=" - "; - $meta.=' - - - '; - return $meta; - } -} -?> \ No newline at end of file diff --git a/modules/ajaxpm/admin/addcategory.apnl.php b/modules/ajaxpm/admin/addcategory.apnl.php deleted file mode 100644 index 21978eb..0000000 --- a/modules/ajaxpm/admin/addcategory.apnl.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @package astat core - * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: addcategory.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ -*/ - -If (!defined("in_BL_ADMIN")) { - die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); -} -$session->page_begin("add news Category", True); - -class addcategory_news_panel extends admin_module{ - - function output(){ - global $config, $db,$panel, $root, $session, $core; - $fail=FALSE; - if(isset($_POST['send'])&& $_POST['send']==1){ - if(isset($_POST['name'])&& $_POST['name']!=""){ - $userfile_name = $_FILES['picture']['name']; - $userfile_tmp = $_FILES['picture']['tmp_name']; - $userfile_size = $_FILES['picture']['size']; - $userfile_type = $_FILES['picture']['type']; - $filedir = $root.'/newsimages/'; - $size = 120; - if (isset($_FILES['picture']['name']) && $_FILES['picture']['name']!=""){ - $prod_img = $filedir.$userfile_name; - $ret=$core->upload_file($prod_img, $userfile_tmp, $size, $size, TRUE, TRUE); - if($ret!==TRUE){ - $panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden
    Der Fehler war: ". $ret,TRUE,"addcategory_news"); - } - } - $name=$db->escape($_POST['name']); - $active=$db->escape($_POST['active']); - $db->query("INSERT INTO `" . $config["prefix"]. "news_category` (`name`,`picture`,`active`) VALUES ('".$name."','".$userfile_name."','".$active."')"); - $panel->admin_message("Danke", "Die Kategorie wurde erfolgreich eingetragen!.",TRUE,"addcategory_news"); - }else{ - $fail="Der Kategoriename muss angegeben werden!"; - } - }elseif(!isset($_POST['send']) || $fail){ - $panel->title="Kategorie hinzufügen"; - $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=addcategory_news"),FALSE,"enctype=\"multipart/form-data\""); - if($fail){ - $panel->content.=$fail; - } - $panel->content.="

    Kategoriename:

    "; - $panel->field(array("name"=>"name","typ"=>"text","value"=>$_POST["name"])); - $panel->content.="

    Kategoriebild:

    "; - $panel->field(array("name"=>"picture","typ"=>"file","value"=>$_POST["picture"])); - $panel->content.="
    "; - $panel->content.="

    Aktiv:

    "; - $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); - $panel->content.="
    "; - $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); - $panel->content.="
    "; - $panel->submit(); - $panel->formClose(); - } - } -} -?> \ No newline at end of file diff --git a/modules/ajaxpm/admin/edit.apnl.php b/modules/ajaxpm/admin/edit.apnl.php deleted file mode 100644 index 84afac5..0000000 --- a/modules/ajaxpm/admin/edit.apnl.php +++ /dev/null @@ -1,227 +0,0 @@ - - * @package astat core - * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: edit.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ -*/ -If (!defined('in_BL_ADMIN')) { - die('Dieses Script kann nicht ausserhalb des Frameworks laufen!'); -} -$session->page_begin('edit News', True); - -class edit_news_panel extends admin_module{ - - function output(){ - global $config, $db,$panel, $session, $admin; - $fail=FALSE; - if(isset($_POST['send'])&& $_POST['send']==1){ - if(isset($_POST['id'])&& $_POST['id']!=''||isset($_POST['text'])&& $_POST['text']!=''||isset($_POST['title'])&& $_POST['title']!=''){ - $id=intval($_POST['id']); - $title=$db->escape($_POST['title']); - $db->query("UPDATE `" . $config['prefix'] . "news` SET `text`='".$db->escape($_POST['text'])."',`category`='".intval($_POST['category'])."',`title`='".$title."',`active`='".$_POST['active']."' WHERE `id`='".$id."'"); - $panel->admin_message('Danke', 'News erfolgreich geändert!',TRUE,'edit_news'); - }else{ - $fail='Du musst alle Felder ausfüllen!'; - } - - }elseif(isset($_GET['id'])&& $_GET['id']!=''){ - if($_GET['action']=='edit'){ - $result = $db->query("SELECT * FROM " . $config['prefix'] . "news WHERE id='".intval($_GET['id'])."'"); - $_POST=$db->fetch_array($result); - - /*$resultna=$db->query("SELECT id,name FROM " . $config["prefix"] . "menue"); - while($rowa=$db->fetch_array($resultna)){ - $resultn = $db->query("SELECT m_id FROM " . $config["prefix"] . "article_menue WHERE a_id='".intval($_GET['id'])."' and m_id='".$rowa["id"]."'"); - if($db->num_rows($resultn) >= 1){ - $rowa["checked"]="checked=\"checked\""; - } - $navs[]=$rowa; - }*/ - - - $panel->title='News editieren'; - $panel->form(array('action'=>$config['path'].'/admin/index.php?panel=edit_news')); - if($fail){ - $panel->content.=$fail; - } - $panel->content.='

    Titel:

    '; - $panel->field(array('name'=>'title','typ'=>'text','value'=>$_POST['title'])); - $panel->content.='

    Kategorie:

    '; - $resultc=$db->query("SELECT `id`,`name` FROM `" . $config['prefix'] . "news_category` WHERE `active`='true'"); - $karray['Keine']=''; - while($row=$db->fetch_array($resultc)){ - $karray[$row['name']]=$row['id']; - } - $panel->select($karray,$_POST['category'],'category'); - $panel->content.='

    Text:

    '; - $panel->textarea(array('name'=>'text','value'=>$_POST['text'],'rows'=>'30','cols'=>'80'),'class="mceEditor"'); - $panel->content.='

    Aktiv:

    '; - $panel->select(array('Nein'=>'false','Ja'=>'true'),$_POST['active'],'active'); - $panel->content.='
    '; - $panel->field(array('name'=>'send','typ'=>'hidden','value'=>'1')); - $panel->field(array('name'=>'id','typ'=>'hidden','value'=>$_GET['id'])); - $panel->content.='
    '; - $panel->submit(); - $panel->formClose(); - }elseif($_GET['action']=='delete' && $_GET['id']){ - $db->query("DELETE FROM `" . $config['prefix'] . "news` WHERE `id`='".intval($_GET['id'])."'"); - $panel->admin_message('News gelöscht!','Die News wurden erfolgreich gelöscht.',True,'edit_news',3); - } - - }else{ - $result = $db->query("SELECT a.`title`,a.`id`,a.`active`,a.`date`,c.`name`,u.`username` FROM `" . $config['prefix'] . "news` a LEFT JOIN `" . $config['prefix'] . "news_category` c ON a.`category`=c.`id` LEFT JOIN `" . $config['prefix'] . "users` u on a.`author`=u.`uid`") or die($db->error()); - while($row=$db->fetch_array($result, MYSQL_ASSOC)){ - $row['dates']=date('d.m.Y',$row['date']); - $news[]=$row; - } - $panel->title='Vorhandene Artikel'; - $panel->content.='
    ModulVersionAutorHomepageAktionModulVersionAutorHomepageAktion
    ".$mod["name"].$depends."".$mod["version"]."".$mod["author"]."".$mod["url"]."Installieren".$mod["name"].$depends."".$mod["version"]."".$mod["author"]."".$mod["url"]."Installieren
    - - - - - - - - '; - if(!empty($news)){ - foreach($news as $u){ - if($u['active']=='true'){ - $u['a']='Ja'; - }else{ - $u['a']='Nein'; - } - $panel->content.=' - - - - - '; - $panel->content.=' - '; - } - }else{ - $panel->content.=' - - '; - } - $panel->content.='
    IDNameKategorienAktivUserAktionen
    '.$u['id'].''.$u['title'].''.$u['name'].''.$u['a'].''.$u['username'].'
    Keine News vorhanden.

    '; - } - } - - function meta(){ - global $config; - $meta=" - "; - $meta.=' - - '; - $meta.=''; - $meta.=' - - - '; - return $meta; - } -} -?> \ No newline at end of file diff --git a/modules/ajaxpm/admin/editcategory.apnl.php b/modules/ajaxpm/admin/editcategory.apnl.php deleted file mode 100644 index 5f0b4a1..0000000 --- a/modules/ajaxpm/admin/editcategory.apnl.php +++ /dev/null @@ -1,190 +0,0 @@ - - * @package astat core - * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: editcategory.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ -*/ - -If (!defined("in_BL_ADMIN")) { - die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); -} -$session->page_begin("edit news category", True); - -class editcategory_news_panel extends admin_module{ - - function output(){ - global $config, $db,$panel, $session, $root, $core, $admin; - $fail=FALSE; - - if(isset($_POST['send'])&& $_POST['send']==1){ - if(isset($_POST['name'])&& $_POST['name']!=""){ - $userfile_name = $_FILES['picture']['name']; - $userfile_tmp = $_FILES['picture']['tmp_name']; - $userfile_size = $_FILES['picture']['size']; - $userfile_type = $_FILES['picture']['type']; - $filedir = $root.'/newsimages/'; - $size = 120; - if (isset($_FILES['picture']['name']) && $_FILES['picture']['name']!=""){ - $prod_img = $filedir.$userfile_name; - $ret=$core->upload_file($prod_img, $userfile_tmp, $size, $size, TRUE, TRUE); - if($ret!==TRUE){ - $panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden
    Der Fehler war: ". $ret,TRUE,"editcategory_news"); - } - $result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "news_category` WHERE `id`='".intval($_POST["id"])."' LIMIT 1"); - $file=$db->fetch_array($result); - @unlink($filedir.$file['picture']); - $db->query("UPDATE `" . $config["prefix"]. "news_category` SET `picture`='".$userfile_name."' WHERE `id`='".intval($_POST["id"])."'"); - }elseif($_POST["delimg"]==1){ - $result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "news_category` WHERE `id`='".intval($_POST["id"])."' LIMIT 1"); - $file=$db->fetch_array($result); - @unlink($filedir.$file['picture']); - $db->query("UPDATE `" . $config["prefix"]. "news_category` SET `picture`='' WHERE `id`='".intval($_POST["id"])."'"); - } - - $name=$db->escape($_POST['name']); - $active=$db->escape($_POST['active']); - $db->query("UPDATE `" . $config["prefix"]. "news_category` SET `name`='".$name."', `active`='".$active."' WHERE `id`='".intval($_POST["id"])."'") or die($db->error()); - $panel->admin_message("Danke", "Die Kategorie wurde erfolgreich editiert!.",TRUE,"editcategory_news"); - }else{ - $fail="Der Kategoriename muss angegeben werden!"; - } - - }elseif(isset($_GET['id'])&& $_GET['id']!=""){ - if($_GET['action']=="edit"){ - $result = $db->query("SELECT * FROM `" . $config["prefix"] . "news_category` WHERE `id`='".intval($_GET['id'])."'"); - $_POST=$db->fetch_array($result); - /*$resultna=$db->query("SELECT id,name FROM " . $config["prefix"] . "menue"); - while($rowa=$db->fetch_array($resultna)){ - $resultn = $db->query("SELECT m_id FROM " . $config["prefix"] . "article_menue WHERE a_id='".intval($_GET['id'])."' and m_id='".$rowa["id"]."'"); - if($db->num_rows($resultn) >= 1){ - $rowa["checked"]="checked=\"checked\""; - } - $navs[]=$rowa; - }*/ - - - $panel->title="Kategorie editieren"; - $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=editcategory_news"),FALSE,"enctype=\"multipart/form-data\""); - if($fail){ - $panel->content.=$fail; - } - $panel->content.="

    Kategoriename:

    "; - $panel->field(array("name"=>"name","typ"=>"text","value"=>$_POST["name"])); - if($_POST["picture"]!=""){ - $panel->content.="

    aktuelles Kategoriebild:

    "; - $panel->content.="\"Kategoriebild\""; - $panel->content.="
    "; - $panel->checkbox(array("name"=>"delimg","value"=>"1")); - $panel->content.=" Bild löschen?"; - $panel->content.="
    "; - } - $panel->content.="

    neues Kategoriebild:

    "; - $panel->field(array("name"=>"picture","typ"=>"file")); - $panel->content.="
    "; - $panel->content.="

    Aktiv:

    "; - $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); - $panel->content.="
    "; - $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); - $panel->field(array("name"=>"id","typ"=>"hidden","value"=>$_GET['id'])); - $panel->content.="
    "; - $panel->submit(); - $panel->formClose(); - $panel->parse_page(); - - }elseif($_GET["action"]=="delete" && $_GET["id"]){ - $result=$db->query("SELECT `picture` FROM `" . $config["prefix"] . "news_category` where `id`='".intval($_GET["id"])."'"); - $row = $db->fetch_array($result); - @unlink($root.'/catimages/'.$row["picture"]); - $db->query("DELETE FROM `" . $config["prefix"] . "news_category` WHERE `id`='".intval($_GET["id"])."'"); - $panel->admin_message("Kategorie gelöscht!","Die Kategorie wurde erfolgreich gelöscht.",True,"editcategory_news",3); - } - - }else{ - $result = $db->query("SELECT * FROM `" . $config["prefix"] . "news_category`"); - while($row=$db->fetch_array($result, MYSQL_ASSOC)){ - $articles[]=$row; - } - $panel->title="Vorhandene Kategorien"; - $panel->content.=" - - - - - - - "; - if(!empty($articles)){ - foreach($articles as $u){ - $panel->content.=" - - - "; - if($u["active"]=="true"){ - $panel->content.=""; - }else{ - $panel->content.=""; - } - $panel->content.=" - "; - } - }else{ - $panel->content.=" - - "; - } - $panel->content.="
    IDNameBildAktivAktionen
    ".$u["id"]."".$u["name"]."".$u["picture"]."JaNein
    Keine Kategorien vorhanden.

    "; - } - } - - function meta(){ - $meta.=' - - '; - - $meta.=''; - return $meta; - } -} -?> \ No newline at end of file diff --git a/modules/ajaxpm/ajaxpm.ajax.php b/modules/ajaxpm/ajaxpm.ajax.php index 341ac5e..656ae45 100644 --- a/modules/ajaxpm/ajaxpm.ajax.php +++ b/modules/ajaxpm/ajaxpm.ajax.php @@ -1,5 +1,6 @@ page_begin("PM Module", FALSE); diff --git a/modules/ajaxpm/ajaxpm.module.php b/modules/ajaxpm/ajaxpm.module.php index 29070cc..0bb0e29 100644 --- a/modules/ajaxpm/ajaxpm.module.php +++ b/modules/ajaxpm/ajaxpm.module.php @@ -3,7 +3,7 @@ class module_ajaxpm extends admin_module{ function admin_panels(){ - return ""; + return array(); } function get_info(){ @@ -12,6 +12,7 @@ class module_ajaxpm extends admin_module{ $info["author"]="BeCast"; $info["version"]="1.0.1"; $info["url"]="http://www.becast.at"; + $info["depends"]='mybb_bridge'; return $info; } diff --git a/modules/ajaxpm/ajaxpm.plugins.php b/modules/ajaxpm/ajaxpm.plugins.php index 26c41e0..3aa0b2b 100644 --- a/modules/ajaxpm/ajaxpm.plugins.php +++ b/modules/ajaxpm/ajaxpm.plugins.php @@ -1,5 +1,5 @@ - * @package astat module + * @package BcWe module * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ -*/ -If (!defined("in_BL_ADMIN")) { + */ +If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } $session->page_begin("chat_admin", True); diff --git a/modules/chat/chat.ajax.php b/modules/chat/chat.ajax.php index 698d171..2184989 100644 --- a/modules/chat/chat.ajax.php +++ b/modules/chat/chat.ajax.php @@ -1,9 +1,10 @@ page_begin("Text Module", FALSE); +$session->page_begin("Chat Module", FALSE); class chat extends ajax_module{ diff --git a/modules/chat/chat.module.php b/modules/chat/chat.module.php index 583aaa2..2a17a9f 100644 --- a/modules/chat/chat.module.php +++ b/modules/chat/chat.module.php @@ -39,7 +39,7 @@ class module_chat extends admin_module{ $cid=$db->last_id(); $db->query("INSERT INTO `" . $config["prefix"] . "config` (`name`, `value`, `title`, `description`, `option`, `category`) VALUES ('LOGINKEY', 'zuzfshgw8qitr813841492', 'Loginkey', 'Der Secure Key des Chats.', 'text', ".$cid."), - ('SOCK_PORT', '8090', 'Chatport', 'Der Port auf dem der Server läuft.', 'text', ".$cid."), + ('SOCK_PORT', '8090', 'Chatport', 'Der Port auf dem der Server l�uft.', 'text', ".$cid."), ('ENABLE_WATCHSERVER', '', 'Watchserver einschalten', 'Soll der Watchserver aktiviert werden?.', 'select(Ja|true;Nein|false)', ".$cid."), ('SMILIES_URL', 'http://forum.recensio.org/', 'Smilieurl', 'Die Url zu den Smiliebildern', 'text', ".$cid.");"); @@ -87,6 +87,4 @@ class module_chat extends admin_module{ return TRUE; } -} - -?> +} \ No newline at end of file diff --git a/modules/chat/chat.output.php b/modules/chat/chat.output.php index 82031db..aa3091a 100644 --- a/modules/chat/chat.output.php +++ b/modules/chat/chat.output.php @@ -1,5 +1,6 @@ = 200 && $httpCode < 300){ @@ -87,7 +87,7 @@ function get_user_room($username) { curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 30); - // führe die Aktion aus und gebe die Daten an den Browser weiter + // f�hre die Aktion aus und gebe die Daten an den Browser weiter $fh=curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); diff --git a/modules/chatusers/chatusers.ajax.php b/modules/chatusers/chatusers.ajax.php index 713d182..c3be9a7 100644 --- a/modules/chatusers/chatusers.ajax.php +++ b/modules/chatusers/chatusers.ajax.php @@ -1,5 +1,5 @@ page_begin("Chatusers Module", FALSE); diff --git a/modules/chatusers/chatusers.module.php b/modules/chatusers/chatusers.module.php index cad911c..0cf85f8 100644 --- a/modules/chatusers/chatusers.module.php +++ b/modules/chatusers/chatusers.module.php @@ -9,9 +9,9 @@ class module_chatusers extends admin_module{ function get_info(){ $info["name"]="Chatusers AJAX"; $info["file"]="chatusers"; - $info["author"]="genuineparts"; + $info["author"]="BeCast"; $info["version"]="1.0.0"; - $info["url"]="http://www.ponytopia.net"; + $info["url"]="http://www.becast.at"; $info["depends"]='chat'; return $info; } diff --git a/modules/chatusers/chatusers.plugins.php b/modules/chatusers/chatusers.plugins.php index b46a95a..f7874ca 100644 --- a/modules/chatusers/chatusers.plugins.php +++ b/modules/chatusers/chatusers.plugins.php @@ -1,5 +1,5 @@ query("INSERT INTO `" . $config["prefix"] . "config_categorys` ( + $db->query("INSERT INTO `" . $config["prefix"] . "config_categories` ( `cid` , `categoryname` ) diff --git a/modules/contact/contact.output.php b/modules/contact/contact.output.php index c38d328..609ef07 100644 --- a/modules/contact/contact.output.php +++ b/modules/contact/contact.output.php @@ -24,7 +24,7 @@ * @version $Id$ */ -If (!defined("in_astat")) { +If (!defined("INBCWE")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } $session->page_begin("Contactform", FALSE); diff --git a/modules/mybb/mybb.plugins.php b/modules/mybb/mybb.plugins.php index b42fdb5..707bd37 100644 --- a/modules/mybb/mybb.plugins.php +++ b/modules/mybb/mybb.plugins.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ */ -If (!defined("in_astat")) { +If (!defined("INBCWE")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } class plugins_mybb { diff --git a/modules/mybbnews/mybbnews.module.php b/modules/mybbnews/mybbnews.module.php index 4f373e5..6bd130c 100644 --- a/modules/mybbnews/mybbnews.module.php +++ b/modules/mybbnews/mybbnews.module.php @@ -7,7 +7,7 @@ class module_mybbnews extends admin_module{ $info["file"]="mybbnews"; $info["author"]="genuineparts"; $info["version"]="1.0.2"; - $info["url"]="http://www.becast.ar"; + $info["url"]="http://www.becast.at"; return $info; } diff --git a/modules/mybbnews/mybbnews.plugins.php b/modules/mybbnews/mybbnews.plugins.php index 716440a..ba19a76 100644 --- a/modules/mybbnews/mybbnews.plugins.php +++ b/modules/mybbnews/mybbnews.plugins.php @@ -1,5 +1,5 @@ - * @package astat core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: add.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ -*/ -If (!defined("in_BL_ADMIN")) { + * @version $Id$ + */ +If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } $session->page_begin("add News", True); diff --git a/modules/news/admin/addcategory.apnl.php b/modules/news/admin/addcategory.apnl.php index 4e57e3e..48c2cf7 100644 --- a/modules/news/admin/addcategory.apnl.php +++ b/modules/news/admin/addcategory.apnl.php @@ -25,7 +25,7 @@ * @version $Id: addcategory.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ */ -If (!defined("in_BL_ADMIN")) { +If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } $session->page_begin("add news Category", True); diff --git a/modules/news/admin/edit.apnl.php b/modules/news/admin/edit.apnl.php index 66b0989..8a557be 100644 --- a/modules/news/admin/edit.apnl.php +++ b/modules/news/admin/edit.apnl.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id: edit.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ */ -If (!defined('in_BL_ADMIN')) { +If (!defined('IN_BCWE_ADMIN')) { die('Dieses Script kann nicht ausserhalb des Frameworks laufen!'); } $session->page_begin('edit News', True); diff --git a/modules/news/admin/editcategory.apnl.php b/modules/news/admin/editcategory.apnl.php index 29059ce..7da7e3b 100644 --- a/modules/news/admin/editcategory.apnl.php +++ b/modules/news/admin/editcategory.apnl.php @@ -25,7 +25,7 @@ * @version $Id: editcategory.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ */ -If (!defined("in_BL_ADMIN")) { +If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } $session->page_begin("edit news category", True); diff --git a/modules/news/news.module.php b/modules/news/news.module.php index 9f65751..087b158 100644 --- a/modules/news/news.module.php +++ b/modules/news/news.module.php @@ -10,9 +10,9 @@ class module_news extends admin_module{ function get_info(){ $info["name"]="Newsmodul"; $info["file"]="news"; - $info["author"]="astat"; - $info["version"]="1.0.0"; - $info["url"]="http://www.astat.org"; + $info["author"]="BeCast"; + $info["version"]="1.0.1"; + $info["url"]="http://www.becast.at"; return $info; } diff --git a/modules/news/news.plugins.php b/modules/news/news.plugins.php index 527b95e..c96cc0e 100644 --- a/modules/news/news.plugins.php +++ b/modules/news/news.plugins.php @@ -1,5 +1,5 @@ page_begin("Nickpage", FALSE); @@ -232,7 +232,7 @@ class nickpage extends module{ $filedir = $root.'/np_images/'; $size = 200; if(($userfile_size/1024)>250){ - $err='Das Bild darf nicht grösser als 250kb sein.'; + $err='Das Bild darf nicht gr�sser als 250kb sein.'; } if (isset($_FILES['np_picture']['name']) && $_FILES['np_picture']['name']!="" && !$err){ $prod_img = $filedir.$userfile_name; diff --git a/modules/nickpage/nickpage.plugins.php b/modules/nickpage/nickpage.plugins.php index 5e166f3..68dbadc 100644 --- a/modules/nickpage/nickpage.plugins.php +++ b/modules/nickpage/nickpage.plugins.php @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ */ -If (!defined("in_astat")) { +If (!defined("INBCWE")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } class plugins_nickpage{ diff --git a/modules/nickpage/text.ajax.php b/modules/nickpage/text.ajax.php deleted file mode 100644 index 271aa5b..0000000 --- a/modules/nickpage/text.ajax.php +++ /dev/null @@ -1,29 +0,0 @@ -page_begin("Text Module", FALSE); - -$topnav_home="
  • Home
  • "; - -class text extends ajax_module{ - - function ajax(){ - global $module,$config,$db,$tpl,$log,$error; - if($_POST['call']=="url"){ - if(isset($_POST['url'])&& $_POST['url']!=""){ - $url=$db->escape($_POST['url']); - $result = $db->query("SELECT count(`id`) as `count` FROM `" . $config["prefix"] . "article` WHERE `url`='".$url."'"); - $row = $db->fetch_array($result, MYSQL_ASSOC); - if($row["count"]==0){ - echo 0; - }else{ - echo 1; - } - } - } - } - -} -?> diff --git a/modules/search/search.module.php b/modules/search/search.module.php index be74ae8..bd87ace 100644 --- a/modules/search/search.module.php +++ b/modules/search/search.module.php @@ -3,16 +3,15 @@ class module_search extends admin_module{ function admin_panels(){ - //$panels=array(array("add_text","Text hinzufügen","page_add"),array("edit_text","Text editieren","page_edit"),array("group_only","Textkategorien"),array("addcategory_text","Kategorie hinzufügen","tag_blue_add"),array("editcategory_text","Kategorie editieren","tag_blue_edit")); - return $panels; + return array(); } function get_info(){ $info["name"]="Review Search"; $info["file"]="search"; - $info["author"]="astat"; - $info["version"]="1.0.0"; - $info["url"]="http://www.astat.org"; + $info["author"]="BeCast"; + $info["version"]="1.0.1"; + $info["url"]="http://www.becast.at"; $info["depends"]='reviews'; return $info; } diff --git a/modules/search/search.output.php b/modules/search/search.output.php index 7e21aa0..8eb355a 100644 --- a/modules/search/search.output.php +++ b/modules/search/search.output.php @@ -1,5 +1,6 @@ page_begin("add Text", True); @@ -81,7 +81,7 @@ class add_text_panel extends admin_module{ $panel->content.="

    Kategorien:

    "; - $resultk=$db->query("SELECT `id`,`categoryname` FROM `" . $config["prefix"] . "article_categorys` WHERE `active`='true'") or die($db->error()); + $resultk=$db->query("SELECT `id`,`categoryname` FROM `" . $config["prefix"] . "article_categories` WHERE `active`='true'") or die($db->error()); while($row=$db->fetch_array($resultk)){ $navs[]=$row; } diff --git a/modules/text/admin/addcategory.apnl.php b/modules/text/admin/addcategory.apnl.php index bccf4f7..ca7c3b9 100644 --- a/modules/text/admin/addcategory.apnl.php +++ b/modules/text/admin/addcategory.apnl.php @@ -25,7 +25,7 @@ * @version $Id$ */ -If (!defined("in_BL_ADMIN")) { +If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } $session->page_begin("add Category", True); @@ -52,7 +52,7 @@ class addcategory_text_panel extends admin_module{ } $categoryname=$db->escape($_POST['categoryname']); $active=$db->escape($_POST['active']); - $db->query("INSERT INTO `" . $config["prefix"]. "article_categorys` (`categoryname`,`picture`,`active`) VALUES ('".$categoryname."','".$userfile_name."','".$active."')") or die ($db->error()); + $db->query("INSERT INTO `" . $config["prefix"]. "article_categories` (`categoryname`,`picture`,`active`) VALUES ('".$categoryname."','".$userfile_name."','".$active."')") or die ($db->error()); $panel->admin_message("Danke", "Die Kategorie wurde erfolgreich eingetragen!.",TRUE,"addcategory_text"); }else{ $fail="Der Kategoriename muss angegeben werden!"; diff --git a/modules/text/admin/edit.apnl.php b/modules/text/admin/edit.apnl.php index 1cd0eb4..f08e37a 100644 --- a/modules/text/admin/edit.apnl.php +++ b/modules/text/admin/edit.apnl.php @@ -1,4 +1,4 @@ -page_begin("edit Text", True); @@ -91,7 +91,7 @@ class edit_text_panel extends admin_module{ while($rowa=$db->fetch_array($resultn)){ $cat[$rowa["c_id"]]=TRUE; } - $resultk=$db->query("SELECT `id`,`categoryname` FROM `" . $config["prefix"] . "article_categorys` WHERE `active`='true'"); + $resultk=$db->query("SELECT `id`,`categoryname` FROM `" . $config["prefix"] . "article_categories` WHERE `active`='true'"); while($row=$db->fetch_array($resultk)){ if($cat[$row["id"]]==TRUE){ $row["checked"]="checked=\"checked\""; @@ -132,7 +132,7 @@ class edit_text_panel extends admin_module{ }else{ $result = $db->query("SELECT a.title,a.id,a.active,a.date,a.url,u.username FROM `" . $config["prefix"] . "article` a LEFT JOIN `" . $config["prefix"] . "users` u on a.`author`=u.`uid`"); while($row=$db->fetch_array($result, $db->ASSOC)){ - $cresult=$db->query("SELECT a.`categoryname` FROM `" . $config["prefix"] . "article_categorys` a LEFT JOIN `" . $config["prefix"] . "article_category` c on a.`id`=c.`c_id` WHERE c.`a_id`='".$row["id"]."'"); + $cresult=$db->query("SELECT a.`categoryname` FROM `" . $config["prefix"] . "article_categories` a LEFT JOIN `" . $config["prefix"] . "article_category` c on a.`id`=c.`c_id` WHERE c.`a_id`='".$row["id"]."'"); while($crow=$db->fetch_array($cresult, $db->ASSOC)){ if(!$row["categoryname"]){ $row["categoryname"]=$crow["categoryname"]; diff --git a/modules/text/admin/editcategory.apnl.php b/modules/text/admin/editcategory.apnl.php index 3b68035..08fb4f4 100644 --- a/modules/text/admin/editcategory.apnl.php +++ b/modules/text/admin/editcategory.apnl.php @@ -1,4 +1,4 @@ -page_begin("edit category", True); @@ -50,12 +50,12 @@ class editcategory_text_panel extends admin_module{ if($ret!==TRUE){ $panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden
    Der Fehler war: ". $ret,TRUE,"editcategory_text"); } - $result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "article_categorys` WHERE `id`='".intval($_POST["id"])."' LIMIT 1"); + $result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "article_categories` WHERE `id`='".intval($_POST["id"])."' LIMIT 1"); $file=$db->fetch_array($result); @unlink($filedir.$file['picture']); $db->query("UPDATE `" . $config["prefix"]. "article_categorys` SET `picture`='".$userfile_name."' WHERE `id`='".intval($_POST["id"])."'"); }elseif($_POST["delimg"]==1){ - $result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "article_categorys` WHERE `id`='".intval($_POST["id"])."' LIMIT 1"); + $result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "article_categories` WHERE `id`='".intval($_POST["id"])."' LIMIT 1"); $file=$db->fetch_array($result); @unlink($filedir.$file['picture']); $db->query("UPDATE `" . $config["prefix"]. "article_categorys` SET `picture`='' WHERE `id`='".intval($_POST["id"])."'") or die($db->error()); @@ -71,7 +71,7 @@ class editcategory_text_panel extends admin_module{ }elseif(isset($_GET['id'])&& $_GET['id']!=""){ if($_GET['action']=="edit"){ - $result = $db->query("SELECT * FROM `" . $config["prefix"] . "article_categorys` WHERE `id`='".intval($_GET['id'])."'"); + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "article_categories` WHERE `id`='".intval($_GET['id'])."'"); $_POST=$db->fetch_array($result); /*$resultna=$db->query("SELECT id,name FROM " . $config["prefix"] . "menue"); while($rowa=$db->fetch_array($resultna)){ @@ -112,15 +112,15 @@ class editcategory_text_panel extends admin_module{ $panel->parse_page(); }elseif($_GET["action"]=="delete" && $_GET["id"]){ - $result=$db->query("SELECT `picture` FROM `" . $config["prefix"] . "article_categorys` where `id`='".intval($_GET["id"])."'"); + $result=$db->query("SELECT `picture` FROM `" . $config["prefix"] . "article_categories` where `id`='".intval($_GET["id"])."'"); $row = $db->fetch_array($result); @unlink($root.'/catimages/'.$row["picture"]); - $db->query("DELETE FROM `" . $config["prefix"] . "article_categorys` WHERE `id`='".intval($_GET["id"])."'"); + $db->query("DELETE FROM `" . $config["prefix"] . "article_categories` WHERE `id`='".intval($_GET["id"])."'"); $panel->admin_message("Kategorie gelöscht!","Die Kategorie wurde erfolgreich gelöscht.",True,"editcategory_text",3); } }else{ - $result = $db->query("SELECT * FROM `" . $config["prefix"] . "article_categorys`"); + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "article_categories`"); while($row=$db->fetch_array($result, $db->ASSOC)){ $articles[]=$row; } diff --git a/modules/text/text.ajax.php b/modules/text/text.ajax.php index 271aa5b..676e8fd 100644 --- a/modules/text/text.ajax.php +++ b/modules/text/text.ajax.php @@ -1,5 +1,5 @@ query("CREATE TABLE IF NOT EXISTS `" . $config["prefix"] . "article_categorys` ( + $db->query("CREATE TABLE IF NOT EXISTS `" . $config["prefix"] . "article_categories` ( `id` int(11) NOT NULL auto_increment, `categoryname` varchar(80) NOT NULL default '', `picture` varchar(80) NOT NULL default '', @@ -68,7 +68,7 @@ class module_text extends admin_module{ function uninstall(){ global $config, $db; $db->query("DROP TABLE `" . $config["prefix"] . "article`"); - $db->query("DROP TABLE `" . $config["prefix"] . "article_categorys`"); + $db->query("DROP TABLE `" . $config["prefix"] . "article_categories`"); $db->query("DROP TABLE `" . $config["prefix"] . "article_category`"); $db->query("DROP TABLE `" . $config["prefix"] . "article_menue`"); @$this->recursive($_SERVER["DOCUMENT_ROOT"]."/catimages"); diff --git a/modules/text/text.output.php b/modules/text/text.output.php index 27a1f5a..23db1f5 100644 --- a/modules/text/text.output.php +++ b/modules/text/text.output.php @@ -1,7 +1,7 @@ -* @package astat core -* @license http://opensource.org/licenses/gpl-license.php GNU Public License -* @version $Id$ -*/ + * @link http://www.becast.at + * @copyright 2010-2025 becast.at + * @author Bernhard Jaud + * @package BcWe core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + */ -If (!defined("in_astat")) { +If (!defined("INBCWE")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); } diff --git a/nav_modules/nav_ads.php b/nav_modules/nav_ads.php index 92d88d1..cf974c7 100644 --- a/nav_modules/nav_ads.php +++ b/nav_modules/nav_ads.php @@ -1,5 +1,5 @@ assign('navtitle', "Suche"); diff --git a/nav_modules/nav_stats.php b/nav_modules/nav_stats.php index 8e5d1f0..10fe8df 100644 --- a/nav_modules/nav_stats.php +++ b/nav_modules/nav_stats.php @@ -1,5 +1,5 @@ load(Twitter::ME,5); -foreach ($channel as $status){ - $stat['screenname'] = $status->user->screen_name; - $stat['image'] = htmlspecialchars($status->user->profile_image_url); - $stat['user'] = htmlspecialchars($status->user->name); - $stat['text'] = Twitter::clickable($status); - $stat['date'] = date("d.m.Y H:i",strtotime($status->created_at)); - $stats[]=$stat; -} - -}catch(Exception $e){ - $stats="Twitter down :,("; -} - -$navtpl-> assign("status",$stats); - -$navrow .= $navtpl->fetch('nav_twitter.tpl'); - -?> diff --git a/nav_twitter.php b/nav_twitter.php deleted file mode 100644 index 02d7d74..0000000 --- a/nav_twitter.php +++ /dev/null @@ -1,24 +0,0 @@ -load(Twitter::ME,5); - -foreach($channel->status as $status){ - $stat['screenname'] = $status->user->screen_name; - $stat['image'] = htmlspecialchars($status->user->profile_image_url); - $stat['user'] = htmlspecialchars($status->user->name); - $stat['text'] = Twitter::clickable($status->text); - $stat['date'] = date("d.m.Y H:i",strtotime($status->created_at)); - $stats[]=$stat; -} - -$navtpl-> assign("status",$stats); - -$navrow .= $navtpl->fetch('nav_twitter.tpl'); - -?> diff --git a/test.php b/test.php deleted file mode 100644 index 5ed5380..0000000 --- a/test.php +++ /dev/null @@ -1,78 +0,0 @@ -cmd = "[yt]0gfniCDbbzg[/yt]"; - echo 'message before parse: '.$command->cmd.'
    '; - $command->cmd = preg_replace_callback("|\[yt\](.*?)\[\/yt\]|", 'yt', $command->cmd); - //$command->cmd = preg_replace_callback("|\[yt (.*?)=(.*?) (.*?)=(.*?)\](.*?)\[\/yt\]|", 'yt', $command->cmd); - - function get_tiny_url($url) { - $ch = curl_init(); - $timeout = 5; - curl_setopt($ch,CURLOPT_URL,'http://tinyurl.com/api-create.php?url='.$url); - curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); - curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); - $data = curl_exec($ch); - curl_close($ch); - return $data; - } - function getTitle($Url){ - echo "parse"; - $ustr = parse_url($Url); - echo "file"; - $ctx = stream_context_create(array( - 'http' => array( - 'timeout' => 10 - ) - ) - ); - $str = file_get_contents($Url, 0, $ctx); - echo "rest"; - if(strlen($str)>0){ - if(strpos($ustr['host'],'youtu')===FALSE){ - preg_match("/\(.*)\<\/title\>/",$str,$title); - }else{ - preg_match('/\/',$str,$title); - } - - if($title[1]!=""){ - unset($Url); - unset($ustr); - return $title[1]; - }else{ - unset($ustr); - return basename($Url); - } - } - } - - function url($matches) { - echo getTitle($matches[0]); - $url = get_tiny_url($matches[0]); - return ''.$url.''; - } - echo 'message after parse: '.$command->cmd.'
    '; - - -function yt($matches) { - global $session,$config,$db,$tpl,$log,$core; - - var_dump($matches); - if($matches[1]=='h'){ - $height=$matches[2]; - $width=$matches[4]; - $url=$matches[5]; - }elseif($matches[1]=='w'){ - $height=$matches[4]; - $width=$matches[2]; - $url=$matches[5]; - }elseif($matches[2]==''){ - $height=315; - $width=560; - $url=$matches[1]; - }else{ - return $matches[0]; - } - - return ''; - }*/ -?>