Improvements and typos
This commit is contained in:
parent
3bdbc74b0e
commit
5b27274fa7
13 changed files with 78 additions and 75 deletions
|
@ -1,4 +1,4 @@
|
||||||
<?php
|
<?php global $session;
|
||||||
/**
|
/**
|
||||||
* Project: BeCast WebEngine - simple site engine
|
* Project: BeCast WebEngine - simple site engine
|
||||||
* File: /admin/addusers.apnl.php
|
* File: /admin/addusers.apnl.php
|
||||||
|
|
|
@ -49,7 +49,7 @@ class config_panel extends admin_module{
|
||||||
$config[$row["name"]] = $row["value"];
|
$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)){
|
while ($row = $db->fetch_array($result)){
|
||||||
$data[$row["categoryname"]][]=$row;
|
$data[$row["categoryname"]][]=$row;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?php
|
<?php global $session;
|
||||||
/**
|
/**
|
||||||
* Project: BeCast WebEngine - simple site engine
|
* Project: BeCast WebEngine - simple site engine
|
||||||
* File: /admin/editusers.apnl.php
|
* File: /admin/editusers.apnl.php
|
||||||
|
@ -111,12 +111,12 @@ class editusers_panel extends admin_module{
|
||||||
$panel->content.="<table id=\"users\" width=\"90%\" cellspacing=\"2\">
|
$panel->content.="<table id=\"users\" width=\"90%\" cellspacing=\"2\">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th align=\"center\">".$lang->_('ID')."</th>
|
<th style=\"text-align='center';\">".$lang->_('ID')."</th>
|
||||||
<th align=\"center\">".$lang->_('USERNAME')."</th>
|
<th style=\"text-align='center';\">".$lang->_('USERNAME')."</th>
|
||||||
<th align=\"center\">".$lang->_('REALNAME')."</th>
|
<th style=\"text-align='center';\">".$lang->_('REALNAME')."</th>
|
||||||
<th align=\"center\">".$lang->_('ROLE')."</th>
|
<th style=\"text-align='center';\">".$lang->_('ROLE')."</th>
|
||||||
<th align=\"center\">".$lang->_('STATUS')."</th>
|
<th style=\"text-align='center';\">".$lang->_('STATUS')."</th>
|
||||||
<th align=\"center\">".$lang->_('ACTION')."</th>
|
<th style=\"text-align='center';\">".$lang->_('ACTION')."</th>
|
||||||
</tr></thead><tbody>";
|
</tr></thead><tbody>";
|
||||||
if(!empty($user)){
|
if(!empty($user)){
|
||||||
foreach($user as $u){
|
foreach($user as $u){
|
||||||
|
@ -131,22 +131,22 @@ class editusers_panel extends admin_module{
|
||||||
$u['activestyle']='style="font-style:italic;"';
|
$u['activestyle']='style="font-style:italic;"';
|
||||||
}
|
}
|
||||||
$panel->content.="<tr ".$u['activestyle'].">
|
$panel->content.="<tr ".$u['activestyle'].">
|
||||||
<td align=\"center\">".$u["uid"]."</td>
|
<td style=\"text-align='center';\">".$u["uid"]."</td>
|
||||||
<td align=\"center\">".$u["username"]."</td>
|
<td style=\"text-align='center';\">".$u["username"]."</td>
|
||||||
<td align=\"center\">".$u["realname"]."</td>
|
<td style=\"text-align='center';\">".$u["realname"]."</td>
|
||||||
<td align=\"center\">".$u["role_name"]."</td>
|
<td style=\"text-align='center';\">".$u["role_name"]."</td>
|
||||||
<td align=\"center\">".$u['activetext']."</td>";
|
<td style=\"text-align='center';\">".$u['activetext']."</td>";
|
||||||
if($u["uid"]==$session->userdata["uid"]){
|
if($u["uid"]==$session->userdata["uid"]){
|
||||||
$panel->content.="<td align=\"center\"><a onclick=\"return confirmLink(this,'".$lang->_('BADIDEA')."')\" href=\"".$config["path"]."/admin/index.php?panel=editusers&action=delete&user=".$u["uid"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=editusers&edituser=".$u["uid"]."\"><img src=\"".$config["path"]."/admin/images/icons/wrench.png\" /></a></td>
|
$panel->content.="<td style=\"text-align='center';\"><a onclick=\"return confirmLink(this,'".$lang->_('BADIDEA')."')\" href=\"".$config["path"]."/admin/index.php?panel=editusers&action=delete&user=".$u["uid"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=editusers&edituser=".$u["uid"]."\"><img src=\"".$config["path"]."/admin/images/icons/wrench.png\" /></a></td>
|
||||||
</tr>";
|
</tr>";
|
||||||
}else{
|
}else{
|
||||||
$panel->content.="<td align=\"center\"><a onclick=\"return confirmLink(this, '".sprintf($lang->_('DELETEUSER'),$u["username"])."')\" href=\"".$config["path"]."/admin/index.php?panel=editusers&action=delete&user=".$u["uid"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=editusers&edituser=".$u["uid"]."\"><img src=\"".$config["path"]."/admin/images/icons/wrench.png\" /></a></td>
|
$panel->content.="<td style=\"text-align='center';\"><a onclick=\"return confirmLink(this, '".sprintf($lang->_('DELETEUSER'),$u["username"])."')\" href=\"".$config["path"]."/admin/index.php?panel=editusers&action=delete&user=".$u["uid"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=editusers&edituser=".$u["uid"]."\"><img src=\"".$config["path"]."/admin/images/icons/wrench.png\" /></a></td>
|
||||||
</tr>";
|
</tr>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$panel->content.="<tr>
|
$panel->content.="<tr>
|
||||||
<td align=\"center\" colspan=\"5\">".$lang->_('NOUSERS')."</td>
|
<td style=\"text-align='center';\" colspan=\"5\">".$lang->_('NOUSERS')."</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
}
|
}
|
||||||
$panel->content.="</tbody></table><br />";
|
$panel->content.="</tbody></table><br />";
|
||||||
|
|
|
@ -68,11 +68,6 @@ require dirname(__FILE__, 2) .'/inc/logger.class.php';
|
||||||
*/
|
*/
|
||||||
require dirname(__FILE__, 2) .'/inc/datacache.class.php';
|
require dirname(__FILE__, 2) .'/inc/datacache.class.php';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cache
|
|
||||||
*/
|
|
||||||
require dirname(__FILE__, 2) .'/inc/cache.class.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Errors
|
* Errors
|
||||||
*/
|
*/
|
||||||
|
@ -119,10 +114,16 @@ if($config['LCLANG']){
|
||||||
$cache=new datacache();
|
$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.
|
* Look if we have a path Variable and try to autoset if not.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
/**
|
/**
|
||||||
* Project: BeCast Webengine - simple site engine
|
* Project: BeCast Webengine - simple site engine
|
||||||
* File: /inc/panel.class.php
|
* File: /inc/panel.class.php
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
|
@ -26,23 +26,23 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$module["panel"]["name"]="Panel Class";
|
$module["panel"]["name"]="Panel Class";
|
||||||
$module["panel"]["ver"]="0.3.5";
|
$module["panel"]["ver"]="0.3.6";
|
||||||
class panel {
|
class panel {
|
||||||
var $sidebar="";
|
var string $sidebar="";
|
||||||
var $page="";
|
var string $page="";
|
||||||
var $bodyext="";
|
var string $bodyext="";
|
||||||
var $title="";
|
var string $title="";
|
||||||
var $content="";
|
var string $content="";
|
||||||
var $meta="";
|
var string $meta="";
|
||||||
var $form="";
|
var string $form="";
|
||||||
var $foot="";
|
var string $foot="";
|
||||||
var $head="";
|
var string $head="";
|
||||||
var $menu_items ="";
|
var string $menu_items ="";
|
||||||
|
|
||||||
function page($additional_title="",$meta=""){
|
function page($additional_title="",$meta=""){
|
||||||
global $config,$db,$core;
|
global $config,$db,$core;
|
||||||
return '<!DOCTYPE html>
|
return '<!DOCTYPE html>
|
||||||
<html>
|
<html lang="de">
|
||||||
<head>
|
<head>
|
||||||
<title>'.$config['sitetitle'].'</title>
|
<title>'.$config['sitetitle'].'</title>
|
||||||
<link rel="stylesheet" type="text/css" href="admin.css" />
|
<link rel="stylesheet" type="text/css" href="admin.css" />
|
||||||
|
@ -77,24 +77,26 @@ class panel {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
function menu_item($panel,$text, $img=""){
|
function menu_item($panel,$text, $img=""): void
|
||||||
|
{
|
||||||
global $config, $userdata, $userinfo, $session, $meta;
|
global $config, $userdata, $userinfo, $session, $meta;
|
||||||
if($panel=="group_only"){
|
if($panel=="group_only"){
|
||||||
$this->menu_items.="<li><strong>".$text."</strong></li>";
|
$this->menu_items.="<li><strong>".$text."</strong></li>";
|
||||||
}elseif($panel=="admin_home"){
|
}elseif($panel=="admin_home"){
|
||||||
$this->menu_items.="<li><a href=\"".$config["path"]."/admin/index.php\"><img src=\"".$config["path"]."/admin/images/icons/".$img.".png\" /> ".$text."</a></li>";
|
$this->menu_items.="<li><a href=\"".$config["path"]."/admin/index.php\"><img src=\"".$config["path"]."/admin/images/icons/".$img.".png\" alt='".$img."'> ".$text."</a></li>";
|
||||||
}elseif($panel=="page_home"){
|
}elseif($panel=="page_home"){
|
||||||
$this->menu_items.="<li><a href=\"".$config["path"]."/index.php\"><img src=\"".$config["path"]."/admin/images/icons/".$img.".png\" /> ".$text."</a></li>";
|
$this->menu_items.="<li><a href=\"".$config["path"]."/index.php\"><img src=\"".$config["path"]."/admin/images/icons/".$img.".png\" alt='".$img."'> ".$text."</a></li>";
|
||||||
}else{
|
}else{
|
||||||
if($img!=""){
|
if($img!=""){
|
||||||
$this->menu_items.="<li><a href=\"".$config["path"]."/admin/index.php?panel=".$panel."\"><img src=\"".$config["path"]."/admin/images/icons/".$img.".png\" /> ".$text."</a></li>";
|
$this->menu_items.="<li><a href=\"".$config["path"]."/admin/index.php?panel=".$panel."\"><img src=\"".$config["path"]."/admin/images/icons/".$img.".png\" alt='".$img."'> ".$text."</a></li>";
|
||||||
}else{
|
}else{
|
||||||
$this->menu_items.="<li><a href=\"".$config["path"]."/admin/index.php?panel=".$panel."\">".$text."</a></li>";
|
$this->menu_items.="<li><a href=\"".$config["path"]."/admin/index.php?panel=".$panel."\">".$text."</a></li>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
global $config,$session,$lang;
|
||||||
$session->page_begin("Admin Message", True);
|
$session->page_begin("Admin Message", True);
|
||||||
if($panel!="" && $redirect){
|
if($panel!="" && $redirect){
|
||||||
|
@ -111,7 +113,8 @@ class panel {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function menu(){
|
function menu(): string
|
||||||
|
{
|
||||||
|
|
||||||
return '<div id="menu">
|
return '<div id="menu">
|
||||||
<ul>'.$this->menu_items.'</ul></div>';
|
<ul>'.$this->menu_items.'</ul></div>';
|
||||||
|
@ -120,8 +123,8 @@ class panel {
|
||||||
|
|
||||||
function form ($args = array(),$return=FALSE,$extra=""){
|
function form ($args = array(),$return=FALSE,$extra=""){
|
||||||
|
|
||||||
$method = $args["method"] ? $args["method"] : 'post';
|
$method = $args["method"] ?? 'POST';
|
||||||
$action = $args["action"] ? $args["action"] : $_SERVER['PHP_SELF'];
|
$action = $args["action"] ?? $_SERVER['PHP_SELF'];
|
||||||
$form = '<form action="' .$action. '" method="' .$method. '"' .$extra. '>';
|
$form = '<form action="' .$action. '" method="' .$method. '"' .$extra. '>';
|
||||||
if(!$return){
|
if(!$return){
|
||||||
$this->content .= $form;
|
$this->content .= $form;
|
||||||
|
@ -129,7 +132,7 @@ class panel {
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function formClose ()
|
function formClose ($return=FALSE)
|
||||||
{
|
{
|
||||||
|
|
||||||
$form = '</form>';
|
$form = '</form>';
|
||||||
|
@ -214,10 +217,10 @@ class panel {
|
||||||
*/
|
*/
|
||||||
function textarea ($args = array(),$extra="",$return=FALSE)
|
function textarea ($args = array(),$extra="",$return=FALSE)
|
||||||
{
|
{
|
||||||
$name = $args["name"] ? $args["name"] : 'field';
|
$name = $args["name"] ?? 'field';
|
||||||
$rows = $args["rows"] ? $args["rows"] : '3';
|
$rows = $args["rows"] ?? '3';
|
||||||
$cols = $args["cols"] ? $args["cols"] : '30';
|
$cols = $args["cols"] ?? '30';
|
||||||
$text = $args["value"] ? $args["value"] : '';
|
$text = $args["value"] ?? '';
|
||||||
|
|
||||||
$fld = '<textarea name="' .$name. '" rows="' .$rows. '" cols="' .$cols. '"' .$extra. '>' .$text. '</textarea>';
|
$fld = '<textarea name="' .$name. '" rows="' .$rows. '" cols="' .$cols. '"' .$extra. '>' .$text. '</textarea>';
|
||||||
if(!$return){
|
if(!$return){
|
||||||
|
|
|
@ -73,8 +73,8 @@ INSERT INTO `as_config` (`name`, `value`, `title`, `description`, `option`, `cat
|
||||||
-- Tabellenstruktur für Tabelle `as_config_categorys`
|
-- Tabellenstruktur für Tabelle `as_config_categorys`
|
||||||
--
|
--
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `as_config_categorys`;
|
DROP TABLE IF EXISTS `as_config_categories`;
|
||||||
CREATE TABLE IF NOT EXISTS `as_config_categorys` (
|
CREATE TABLE IF NOT EXISTS `as_config_categories` (
|
||||||
`cid` int(11) NOT NULL auto_increment,
|
`cid` int(11) NOT NULL auto_increment,
|
||||||
`categoryname` varchar(200) NOT NULL,
|
`categoryname` varchar(200) NOT NULL,
|
||||||
PRIMARY KEY (`cid`)
|
PRIMARY KEY (`cid`)
|
||||||
|
@ -84,7 +84,7 @@ CREATE TABLE IF NOT EXISTS `as_config_categorys` (
|
||||||
-- Daten für Tabelle `as_config_categorys`
|
-- Daten für Tabelle `as_config_categorys`
|
||||||
--
|
--
|
||||||
|
|
||||||
INSERT INTO `as_config_categorys` (`cid`, `categoryname`) VALUES
|
INSERT INTO `as_config_categories` (`cid`, `categoryname`) VALUES
|
||||||
(1, 'Allgemein'),
|
(1, 'Allgemein'),
|
||||||
(2, 'Wartungsmodus'),
|
(2, 'Wartungsmodus'),
|
||||||
(3, 'Registrierung'),
|
(3, 'Registrierung'),
|
||||||
|
|
|
@ -3,22 +3,21 @@
|
||||||
class module_contact extends admin_module{
|
class module_contact extends admin_module{
|
||||||
|
|
||||||
function admin_panels(){
|
function admin_panels(){
|
||||||
panels=array();
|
return array();
|
||||||
return $panels;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_info(){
|
function get_info(){
|
||||||
$info["name"]="Kontaktformular";
|
$info["name"]="Kontaktformular";
|
||||||
$info["file"]="contact";
|
$info["file"]="contact";
|
||||||
$info["author"]="BeCast";
|
$info["author"]="BeCast";
|
||||||
$info["version"]="1.0.0";
|
$info["version"]="1.0.1";
|
||||||
$info["url"]="http://www.becast.at";
|
$info["url"]="http://www.becast.at";
|
||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
|
|
||||||
function install(){
|
function install(){
|
||||||
global $config, $db;
|
global $config, $db;
|
||||||
$db->query("INSERT INTO `" . $config["prefix"] . "config_categorys` (
|
$db->query("INSERT INTO `" . $config["prefix"] . "config_categories` (
|
||||||
`cid` ,
|
`cid` ,
|
||||||
`categoryname`
|
`categoryname`
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,9 +10,9 @@ class module_news extends admin_module{
|
||||||
function get_info(){
|
function get_info(){
|
||||||
$info["name"]="Newsmodul";
|
$info["name"]="Newsmodul";
|
||||||
$info["file"]="news";
|
$info["file"]="news";
|
||||||
$info["author"]="astat";
|
$info["author"]="BeCast";
|
||||||
$info["version"]="1.0.0";
|
$info["version"]="1.0.1";
|
||||||
$info["url"]="http://www.astat.org";
|
$info["url"]="http://www.becast.at";
|
||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ class add_text_panel extends admin_module{
|
||||||
$panel->content.="<h3>Kategorien:</h3>
|
$panel->content.="<h3>Kategorien:</h3>
|
||||||
<table width=\"100%\">
|
<table width=\"100%\">
|
||||||
<tr>";
|
<tr>";
|
||||||
$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)){
|
while($row=$db->fetch_array($resultk)){
|
||||||
$navs[]=$row;
|
$navs[]=$row;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ class addcategory_text_panel extends admin_module{
|
||||||
}
|
}
|
||||||
$categoryname=$db->escape($_POST['categoryname']);
|
$categoryname=$db->escape($_POST['categoryname']);
|
||||||
$active=$db->escape($_POST['active']);
|
$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");
|
$panel->admin_message("Danke", "Die Kategorie wurde erfolgreich eingetragen!.",TRUE,"addcategory_text");
|
||||||
}else{
|
}else{
|
||||||
$fail="<span style=\"text-align: center; color: red;\">Der Kategoriename muss angegeben werden!</span>";
|
$fail="<span style=\"text-align: center; color: red;\">Der Kategoriename muss angegeben werden!</span>";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?php
|
<?php global $session;
|
||||||
/**
|
/**
|
||||||
* Project: astat - simple site engine
|
* Project: astat - simple site engine
|
||||||
* File: /modules/text/edit.apnl.php
|
* File: /modules/text/edit.apnl.php
|
||||||
|
@ -91,7 +91,7 @@ class edit_text_panel extends admin_module{
|
||||||
while($rowa=$db->fetch_array($resultn)){
|
while($rowa=$db->fetch_array($resultn)){
|
||||||
$cat[$rowa["c_id"]]=TRUE;
|
$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)){
|
while($row=$db->fetch_array($resultk)){
|
||||||
if($cat[$row["id"]]==TRUE){
|
if($cat[$row["id"]]==TRUE){
|
||||||
$row["checked"]="checked=\"checked\"";
|
$row["checked"]="checked=\"checked\"";
|
||||||
|
@ -132,7 +132,7 @@ class edit_text_panel extends admin_module{
|
||||||
}else{
|
}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`");
|
$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)){
|
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)){
|
while($crow=$db->fetch_array($cresult, $db->ASSOC)){
|
||||||
if(!$row["categoryname"]){
|
if(!$row["categoryname"]){
|
||||||
$row["categoryname"]=$crow["categoryname"];
|
$row["categoryname"]=$crow["categoryname"];
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?php
|
<?php global $session;
|
||||||
/**
|
/**
|
||||||
* Project: BeCast WebEngine - simple site engine
|
* Project: BeCast WebEngine - simple site engine
|
||||||
* File: /modules/text/editcategory.apnl.php
|
* File: /modules/text/editcategory.apnl.php
|
||||||
|
@ -50,12 +50,12 @@ class editcategory_text_panel extends admin_module{
|
||||||
if($ret!==TRUE){
|
if($ret!==TRUE){
|
||||||
$panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden <br /> Der Fehler war: ". $ret,TRUE,"editcategory_text");
|
$panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden <br /> 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);
|
$file=$db->fetch_array($result);
|
||||||
@unlink($filedir.$file['picture']);
|
@unlink($filedir.$file['picture']);
|
||||||
$db->query("UPDATE `" . $config["prefix"]. "article_categorys` SET `picture`='".$userfile_name."' WHERE `id`='".intval($_POST["id"])."'");
|
$db->query("UPDATE `" . $config["prefix"]. "article_categorys` SET `picture`='".$userfile_name."' WHERE `id`='".intval($_POST["id"])."'");
|
||||||
}elseif($_POST["delimg"]==1){
|
}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);
|
$file=$db->fetch_array($result);
|
||||||
@unlink($filedir.$file['picture']);
|
@unlink($filedir.$file['picture']);
|
||||||
$db->query("UPDATE `" . $config["prefix"]. "article_categorys` SET `picture`='' WHERE `id`='".intval($_POST["id"])."'") or die($db->error());
|
$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']!=""){
|
}elseif(isset($_GET['id'])&& $_GET['id']!=""){
|
||||||
if($_GET['action']=="edit"){
|
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);
|
$_POST=$db->fetch_array($result);
|
||||||
/*$resultna=$db->query("SELECT id,name FROM " . $config["prefix"] . "menue");
|
/*$resultna=$db->query("SELECT id,name FROM " . $config["prefix"] . "menue");
|
||||||
while($rowa=$db->fetch_array($resultna)){
|
while($rowa=$db->fetch_array($resultna)){
|
||||||
|
@ -112,15 +112,15 @@ class editcategory_text_panel extends admin_module{
|
||||||
$panel->parse_page();
|
$panel->parse_page();
|
||||||
|
|
||||||
}elseif($_GET["action"]=="delete" && $_GET["id"]){
|
}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);
|
$row = $db->fetch_array($result);
|
||||||
@unlink($root.'/catimages/'.$row["picture"]);
|
@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);
|
$panel->admin_message("Kategorie gelöscht!","Die Kategorie wurde erfolgreich gelöscht.",True,"editcategory_text",3);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}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)){
|
while($row=$db->fetch_array($result, $db->ASSOC)){
|
||||||
$articles[]=$row;
|
$articles[]=$row;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ class module_text extends admin_module{
|
||||||
KEY `eid` (`eid`)
|
KEY `eid` (`eid`)
|
||||||
) ENGINE=MyISAM");
|
) ENGINE=MyISAM");
|
||||||
|
|
||||||
$db->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,
|
`id` int(11) NOT NULL auto_increment,
|
||||||
`categoryname` varchar(80) NOT NULL default '',
|
`categoryname` varchar(80) NOT NULL default '',
|
||||||
`picture` varchar(80) NOT NULL default '',
|
`picture` varchar(80) NOT NULL default '',
|
||||||
|
@ -68,7 +68,7 @@ class module_text extends admin_module{
|
||||||
function uninstall(){
|
function uninstall(){
|
||||||
global $config, $db;
|
global $config, $db;
|
||||||
$db->query("DROP TABLE `" . $config["prefix"] . "article`");
|
$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_category`");
|
||||||
$db->query("DROP TABLE `" . $config["prefix"] . "article_menue`");
|
$db->query("DROP TABLE `" . $config["prefix"] . "article_menue`");
|
||||||
@$this->recursive($_SERVER["DOCUMENT_ROOT"]."/catimages");
|
@$this->recursive($_SERVER["DOCUMENT_ROOT"]."/catimages");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue