Update to latest version

This commit is contained in:
genuineparts 2025-06-24 23:26:25 +02:00
parent 8a89842ec6
commit fe9ecfad73
77 changed files with 1701 additions and 5404 deletions

View file

@ -0,0 +1,142 @@
<?php
/**
* Project: astat - simple site engine
* File: /modules/news/add.apnl.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* 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: file:///var/local/svn/astat/trunk/modules/news/admin/add.apnl.php $
* @copyright 2009 becast.at
* @author Bernhard Jaud <bernhard at becast dot at>
* @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="<span style=\"text-align: center; color: red;\">Du musst alle Felder ausf&uuml;llen!</span>";
}
}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.="<h3>Titel:</h3>";
$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.="<h3>Kategorie:</h3>";
$panel->select($karray,$_POST["category"],"category");
$panel->content.="<br />";
$panel->content.="<h3>Text:</h3>";
$panel->textarea(array("name"=>"text","value"=>$_POST["text"],"rows"=>"30","cols"=>"80"),"class=\"mceEditor\"");
$panel->content.="<h3>Aktiv:</h3>";
$panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active");
$panel->content.="<br />";
$panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1"));
$panel->content.="<br />";
$panel->submit();
$panel->formClose();
}
}
function meta(){
global $config;
$meta="<script type=\"text/javascript\" src=\"".$config["path"]."/js/jquery/jquery.min.js\"></script>
<script type=\"text/javascript\">
$(document).ready(function()
{
$(\"#url\").blur(function()
{
//remove all the class add the messagebox classes and start fading
$(\"#msgbox\").removeClass().addClass('messagebox').text('Warten...').fadeIn(\"slow\");
//check the username exists or not from ajax
$.post(\"ajax.php\",{ call:'url',url:$(this).val() } ,function(data)
{
if(data==1) //if username not avaiable
{
$(\"#msgbox\").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Url vergeben').addClass('messageboxerror').fadeTo(900,1);
});
}
else
{
$(\"#msgbox\").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('').removeClass().fadeTo(900,1);
});
}
});
});
});
</script>";
$meta.='<script type="text/javascript" src="'.$config["path"].'/thirdparty/tiny/tiny_mce_gzip.js"></script>
<script type="text/javascript">
tinyMCE_GZ.init({
theme : "advanced",
mode : "textareas",
language : "de",
plugins : "table,advhr,advimage,advlink,insertdatetime,searchreplace",
disk_cache : true,
debug : false
});
</script>
<script type="text/javascript" src="'.$config["path"].'/thirdparty/tiny/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
theme : "advanced",
mode : "textareas",
language : "de",
plugins : "table,advhr,advimage,advlink,insertdatetime,searchreplace",
theme_advanced_disable : "styleselect,formatselect ",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "seperator,forecolor,removeformat,advhr",
theme_advanced_buttons3 : "tablecontrols,seperator",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "center",
remove_linebreaks : false,
convert_urls : false,
editor_selector : "mceEditor",
editor_deselector : "mceNoEditor"
});
</script>';
return $meta;
}
}
?>

View file

@ -0,0 +1,81 @@
<?php
/**
* Project: astat - simple site engine
* File: /modules/news/addcategory.apnl.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* 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: file:///var/local/svn/astat/trunk/modules/news/admin/addcategory.apnl.php $
* @copyright 2009 becast.at
* @author Bernhard Jaud <bernhard at becast dot at>
* @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 <br /> 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="<span style=\"text-align: center; color: red;\">Der Kategoriename muss angegeben werden!</span>";
}
}elseif(!isset($_POST['send']) || $fail){
$panel->title="Kategorie hinzuf&uuml;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.="<h3>Kategoriename:</h3>";
$panel->field(array("name"=>"name","typ"=>"text","value"=>$_POST["name"]));
$panel->content.="<h3>Kategoriebild:</h3>";
$panel->field(array("name"=>"picture","typ"=>"file","value"=>$_POST["picture"]));
$panel->content.="<br />";
$panel->content.="<h3>Aktiv:</h3>";
$panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active");
$panel->content.="<br />";
$panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1"));
$panel->content.="<br />";
$panel->submit();
$panel->formClose();
}
}
}
?>

View file

@ -0,0 +1,227 @@
<?php
/**
* Project: astat - simple site engine
* File: /modules/news/edit.apnl.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* 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: file:///var/local/svn/astat/trunk/modules/news/admin/edit.apnl.php $
* @copyright 2009 becast.at
* @author Bernhard Jaud <bernhard at becast dot at>
* @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&auml;ndert!',TRUE,'edit_news');
}else{
$fail='<span style="text-align: center; color: red;">Du musst alle Felder ausf&uuml;llen!</span>';
}
}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.='<h3>Titel:</h3>';
$panel->field(array('name'=>'title','typ'=>'text','value'=>$_POST['title']));
$panel->content.='<h3>Kategorie:</h3>';
$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.='<h3>Text:</h3>';
$panel->textarea(array('name'=>'text','value'=>$_POST['text'],'rows'=>'30','cols'=>'80'),'class="mceEditor"');
$panel->content.='<h3>Aktiv:</h3>';
$panel->select(array('Nein'=>'false','Ja'=>'true'),$_POST['active'],'active');
$panel->content.='<br />';
$panel->field(array('name'=>'send','typ'=>'hidden','value'=>'1'));
$panel->field(array('name'=>'id','typ'=>'hidden','value'=>$_GET['id']));
$panel->content.='<br />';
$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&ouml;scht!','Die News wurden erfolgreich gel&ouml;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.='<table class="sortable" width="90%" cellspacing="2">
<tr>
<th align="center">ID</th>
<th align="center">Name</th>
<th align="center">Kategorien</th>
<th align="center">Aktiv</th>
<th align="center">User</th>
<th class="nosort sortcol" align="center" width="18%">Aktionen</th>
</tr>';
if(!empty($news)){
foreach($news as $u){
if($u['active']=='true'){
$u['a']='Ja';
}else{
$u['a']='Nein';
}
$panel->content.='<tr>
<td align="center">'.$u['id'].'</td>
<td align="center">'.$u['title'].'</td>
<td align="center">'.$u['name'].'</td>
<td align="center">'.$u['a'].'</td>
<td align="center">'.$u['username'].'</td>';
$panel->content.='<td align="center"><a onclick="return confirmLink(this, "Willst du wirklich den News '.$u['title'].' l&ouml;schen? ")" href="'.$config['path'].'/admin/index.php?panel=edit_news&amp;action=delete&amp;id='.$u['id'].'"><img src="'.$config['path'].'/admin/images/icons/delete.png" /></a> <a href="'.$config['path'].'/admin/index.php?panel=edit_news&amp;action=edit&amp;id='.$u['id'].'"><img src="'.$config['path'].'/admin/images/icons/wrench.png" /></a></td>
</tr>';
}
}else{
$panel->content.='<tr>
<td align="center" colspan="7">Keine News vorhanden.</td>
</tr>';
}
$panel->content.='</table><br />';
}
}
function meta(){
global $config;
$meta="<script type=\"text/javascript\" src=\"".$config["path"]."/js/jquery/jquery.min.js\"></script>
<script type=\"text/javascript\">
$(document).ready(function()
{
$(\"#url\").blur(function()
{
//remove all the class add the messagebox classes and start fading
$(\"#msgbox\").removeClass().addClass('messagebox').text('Warten...').fadeIn(\"slow\");
//check the username exists or not from ajax
$.post(\"ajax.php\",{ call:'url',url:$(this).val() } ,function(data)
{
if(data==1) //if username not avaiable
{
$(\"#msgbox\").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Url vergeben').addClass('messageboxerror').fadeTo(900,1);
});
}
else
{
$(\"#msgbox\").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('').removeClass().fadeTo(900,1);
});
}
});
});
});
</script>";
$meta.='<script type="text/javascript" src="'.$config["path"].'/js/scriptaculous/prototype.js"></script>
<script src="'.$config["path"].'/js/fastinit.js" type="text/javascript">
</script>
<script src="'.$config["path"].'/js/tablesort.js" type="text/javascript">
</script>';
$meta.='<script type="text/javascript">
function confirmLink(theLink, text)
{
// Confirmation is not required in the configuration file
// or browser is Opera (crappy js implementation)
if (typeof(window.opera) != \'undefined\') {
return true;
}
var is_confirmed = confirm(text);
if (is_confirmed) {
if ( typeof(theLink.href) != \'undefined\' ) {
theLink.href += \'&is_js_confirmed=1\';
} else if ( typeof(theLink.form) != \'undefined\' ) {
theLink.form.action += \'?is_js_confirmed=1\';
}
}
return is_confirmed;
}
</script>';
$meta.='<script type="text/javascript" src="/thirdparty/tiny/tiny_mce_gzip.js"></script>
<script type="text/javascript">
tinyMCE_GZ.init({
theme : "advanced",
mode : "textareas",
language : "de",
plugins : "table,advhr,advimage,advlink,insertdatetime,searchreplace",
disk_cache : true,
debug : false
});
</script>
<script type="text/javascript" src="/thirdparty/tiny/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
theme : "advanced",
mode : "textareas",
language : "de",
plugins : "table,advhr,advimage,advlink,insertdatetime,searchreplace",
theme_advanced_disable : "styleselect,formatselect ",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "seperator,forecolor,removeformat,advhr",
theme_advanced_buttons3 : "tablecontrols,seperator",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "center",
remove_linebreaks : false,
convert_urls : false,
editor_selector : "mceEditor",
editor_deselector : "mceNoEditor"
});
</script>';
return $meta;
}
}
?>

View file

@ -0,0 +1,190 @@
<?php
/**
* Project: astat - simple site engine
* File: /modules/news/editcategory.apnl.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* 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: file:///var/local/svn/astat/trunk/modules/news/admin/editcategory.apnl.php $
* @copyright 2009 becast.at
* @author Bernhard Jaud <bernhard at becast dot at>
* @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 <br /> 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="<span style=\"text-align: center; color: red;\">Der Kategoriename muss angegeben werden!</span>";
}
}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.="<h3>Kategoriename:</h3>";
$panel->field(array("name"=>"name","typ"=>"text","value"=>$_POST["name"]));
if($_POST["picture"]!=""){
$panel->content.="<h3>aktuelles Kategoriebild:</h3>";
$panel->content.="<img src=\"".$config["path"]."/newsimages/".$_POST["picture"]."\" alt=\"Kategoriebild\" />";
$panel->content.="<br />";
$panel->checkbox(array("name"=>"delimg","value"=>"1"));
$panel->content.=" Bild l&ouml;schen?";
$panel->content.="<br />";
}
$panel->content.="<h3>neues Kategoriebild:</h3>";
$panel->field(array("name"=>"picture","typ"=>"file"));
$panel->content.="<br />";
$panel->content.="<h3>Aktiv:</h3>";
$panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active");
$panel->content.="<br />";
$panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1"));
$panel->field(array("name"=>"id","typ"=>"hidden","value"=>$_GET['id']));
$panel->content.="<br />";
$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&ouml;scht!","Die Kategorie wurde erfolgreich gel&ouml;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.="<table class=\"sortable\" width=\"90%\" cellspacing=\"2\">
<tr>
<th align=\"center\">ID</th>
<th align=\"center\">Name</th>
<th align=\"center\">Bild</th>
<th align=\"center\">Aktiv</th>
<th class=\"nosort sortcol\" align=\"center\" width=\"18%\">Aktionen</th>
</tr>";
if(!empty($articles)){
foreach($articles as $u){
$panel->content.="<tr>
<td align=\"center\">".$u["id"]."</td>
<td align=\"center\">".$u["name"]."</td>
<td align=\"center\">".$u["picture"]."</td>";
if($u["active"]=="true"){
$panel->content.="<td align=\"center\">Ja</td>";
}else{
$panel->content.="<td align=\"center\">Nein</td>";
}
$panel->content.="<td align=\"center\"><a onclick=\"return confirmLink(this, 'Willst du wirklich die Kategorie ".$u["categoryname"]." l&ouml;schen? ')\" href=\"".$config["path"]."/admin/index.php?panel=editcategory_news&amp;action=delete&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=editcategory_news&amp;action=edit&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/wrench.png\" /></a></td>
</tr>";
}
}else{
$panel->content.="<tr>
<td align=\"center\" colspan=\"5\">Keine Kategorien vorhanden.</td>
</tr>";
}
$panel->content.="</table><br />";
}
}
function meta(){
$meta.='<script type="text/javascript" src="'.$config["path"].'/js/scriptaculous/prototype.js"></script>
<script src="'.$config["path"].'/js/fastinit.js" type="text/javascript">
</script>
<script src="'.$config["path"].'/js/tablesort.js" type="text/javascript">
</script>';
$meta.='<script type="text/javascript">
function confirmLink(theLink, text)
{
// Confirmation is not required in the configuration file
// or browser is Opera (crappy js implementation)
if (typeof(window.opera) != \'undefined\') {
return true;
}
var is_confirmed = confirm(text);
if (is_confirmed) {
if ( typeof(theLink.href) != \'undefined\' ) {
theLink.href += \'&is_js_confirmed=1\';
} else if ( typeof(theLink.form) != \'undefined\' ) {
theLink.form.action += \'?is_js_confirmed=1\';
}
}
return is_confirmed;
}
</script>';
return $meta;
}
}
?>

View file

@ -3,7 +3,7 @@
class module_ajaxpm extends admin_module{
function admin_panels(){
return array();
return "";
}
function get_info(){

View file

@ -11,7 +11,7 @@ class module_contact extends admin_module{
$info["file"]="contact";
$info["author"]="BeCast";
$info["version"]="1.0.1";
$info["url"]="http://www.becast.at";
$info["url"]="https://www.becast.at";
return $info;
}
@ -26,7 +26,7 @@ class module_contact extends admin_module{
);");
$cid=$db->last_id();
$db->query("INSERT INTO `" . $config["prefix"] . "config` (`name`, `value`, `title`, `description`, `option`, `category`) VALUES
('contact_email', 'contact@example.com', 'E-Mailadresse', 'Die E-Mailadresse(n) an die Kontaktanfragen gesendet werden sollen (meherer Adressen mit Komma trennen).', 'text', ".$cid."),
('contact_email', 'contact@example.com', 'E-Mailadresse', 'Die E-Mailadresse(n) an die Kontaktanfragen gesendet werden sollen (mehrere Adressen mit Komma trennen).', 'text', ".$cid."),
('contact_captcha', '1', 'Captcha verwenden?', 'Soll bei der Kontaktaufnahme ein Captcha angezeigt werden?', 'yesno', ".$cid.");");
return TRUE;
}

View file

@ -1,4 +1,4 @@
<?php
<?php global $session;
/**
* Project: astat - simple site engine
* File: /modules/contact/contact.output.php
@ -21,7 +21,7 @@
* @author Bernhard Jaud <bernhard at becast dot at>
* @package astat core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @version $Id: 1c1aad35216bcebbefdb0b9e052dfd98790dd4f5 $
*/
If (!defined("INBCWE")) {

View file

@ -22,7 +22,7 @@
* @author Bernhard Jaud <bernhard at becast dot at>
* @package BcWe core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @version $Id: a77f484c5af9480fe4eb2692627e2328278573ea $
*/
If (!defined("IN_BCWE_ADMIN")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");

View file

@ -22,7 +22,7 @@
* @author Bernhard Jaud <bernhard at becast dot at>
* @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 $
* @version $Id: bc487c72e70ee89c97e2348303049f9a0c268b90 $
*/
If (!defined("IN_BCWE_ADMIN")) {

View file

@ -22,7 +22,7 @@
* @author Bernhard Jaud <bernhard at becast dot at>
* @package BeCast WebEngine 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 $
* @version $Id: e570239bc108247b89c17cf3fd52cf8826a900d8 $
*/
If (!defined('IN_BCWE_ADMIN')) {
die('Dieses Script kann nicht ausserhalb des Frameworks laufen!');
@ -95,14 +95,14 @@ class edit_news_panel extends admin_module{
$news[]=$row;
}
$panel->title='Vorhandene Artikel';
$panel->content.='<table class="sortable" width="90%" cellspacing="2">
$panel->content.='<table class="sortable" style=\"width: 90%; border-spacing: 2px;\">
<tr>
<th align="center">ID</th>
<th align="center">Name</th>
<th align="center">Kategorien</th>
<th align="center">Aktiv</th>
<th align="center">User</th>
<th class="nosort sortcol" align="center" width="18%">Aktionen</th>
<th style=\"text-align: center;\">ID</th>
<th style=\"text-align: center;\">Name</th>
<th style=\"text-align: center;\">Kategorien</th>
<th style=\"text-align: center;\">Aktiv</th>
<th style=\"text-align: center;\">User</th>
<th class="nosort sortcol" style=\"text-align: center; width: 18%\">Aktionen</th>
</tr>';
if(!empty($news)){
foreach($news as $u){
@ -112,17 +112,17 @@ class edit_news_panel extends admin_module{
$u['a']='Nein';
}
$panel->content.='<tr>
<td align="center">'.$u['id'].'</td>
<td align="center">'.$u['title'].'</td>
<td align="center">'.$u['name'].'</td>
<td align="center">'.$u['a'].'</td>
<td align="center">'.$u['username'].'</td>';
$panel->content.='<td align="center"><a onclick="return confirmLink(this, "Willst du wirklich den News '.$u['title'].' l&ouml;schen? ")" href="'.$config['path'].'/admin/index.php?panel=edit_news&amp;action=delete&amp;id='.$u['id'].'"><img src="'.$config['path'].'/admin/images/icons/delete.png" /></a> <a href="'.$config['path'].'/admin/index.php?panel=edit_news&amp;action=edit&amp;id='.$u['id'].'"><img src="'.$config['path'].'/admin/images/icons/wrench.png" /></a></td>
<td style=\"text-align: center;\">'.$u['id'].'</td>
<td style=\"text-align: center;\">'.$u['title'].'</td>
<td style=\"text-align: center;\">'.$u['name'].'</td>
<td style=\"text-align: center;\">'.$u['a'].'</td>
<td style=\"text-align: center;\">'.$u['username'].'</td>';
$panel->content.='<td style=\"text-align: center;\"><a onclick="return confirmLink(this, "Willst du wirklich den News '.$u['title'].' l&ouml;schen? ")" href="'.$config['path'].'/admin/index.php?panel=edit_news&amp;action=delete&amp;id='.$u['id'].'"><img src="'.$config['path'].'/admin/images/icons/delete.png" /></a> <a href="'.$config['path'].'/admin/index.php?panel=edit_news&amp;action=edit&amp;id='.$u['id'].'"><img src="'.$config['path'].'/admin/images/icons/wrench.png" /></a></td>
</tr>';
}
}else{
$panel->content.='<tr>
<td align="center" colspan="7">Keine News vorhanden.</td>
<td style=\"text-align: center;\" colspan="7">Keine News vorhanden.</td>
</tr>';
}
$panel->content.='</table><br />';

View file

@ -1,4 +1,4 @@
<?php
<?php global $session;
/**
* Project: BeCast WebEngine - simple site engine
* File: /modules/news/editcategory.apnl.php
@ -22,7 +22,7 @@
* @author Bernhard Jaud <bernhard at becast dot at>
* @package BeCast WebEngine 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 $
* @version $Id: ef38cf94caf9812acfbf9f594045a1ca24c42eae $
*/
If (!defined("IN_BCWE_ADMIN")) {
@ -125,31 +125,31 @@ class editcategory_news_panel extends admin_module{
$articles[]=$row;
}
$panel->title="Vorhandene Kategorien";
$panel->content.="<table class=\"sortable\" width=\"90%\" cellspacing=\"2\">
$panel->content.="<table class=\"sortable\" style=\"width: 90%; border-spacing: 2px;\">
<tr>
<th align=\"center\">ID</th>
<th align=\"center\">Name</th>
<th align=\"center\">Bild</th>
<th align=\"center\">Aktiv</th>
<th class=\"nosort sortcol\" align=\"center\" width=\"18%\">Aktionen</th>
<th style=\"text-align: center;\">ID</th>
<th style=\"text-align: center;\">Name</th>
<th style=\"text-align: center;\">Bild</th>
<th style=\"text-align: center;\">Aktiv</th>
<th class=\"nosort sortcol\" style=\"text-align: center; width: 18%\">Aktionen</th>
</tr>";
if(!empty($articles)){
foreach($articles as $u){
$panel->content.="<tr>
<td align=\"center\">".$u["id"]."</td>
<td align=\"center\">".$u["name"]."</td>
<td align=\"center\">".$u["picture"]."</td>";
<td style=\"text-align: center;\">".$u["id"]."</td>
<td style=\"text-align: center;\">".$u["name"]."</td>
<td style=\"text-align: center;\">".$u["picture"]."</td>";
if($u["active"]=="true"){
$panel->content.="<td align=\"center\">Ja</td>";
$panel->content.="<td style=\"text-align: center;\">Ja</td>";
}else{
$panel->content.="<td align=\"center\">Nein</td>";
$panel->content.="<td style=\"text-align: center;\">Nein</td>";
}
$panel->content.="<td align=\"center\"><a onclick=\"return confirmLink(this, 'Willst du wirklich die Kategorie ".$u["categoryname"]." l&ouml;schen? ')\" href=\"".$config["path"]."/admin/index.php?panel=editcategory_news&amp;action=delete&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=editcategory_news&amp;action=edit&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/wrench.png\" /></a></td>
$panel->content.="<td style=\"text-align: center;\"><a onclick=\"return confirmLink(this, 'Willst du wirklich die Kategorie ".$u["categoryname"]." l&ouml;schen? ')\" href=\"".$config["path"]."/admin/index.php?panel=editcategory_news&amp;action=delete&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=editcategory_news&amp;action=edit&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/wrench.png\" /></a></td>
</tr>";
}
}else{
$panel->content.="<tr>
<td align=\"center\" colspan=\"5\">Keine Kategorien vorhanden.</td>
<td style=\"text-align: center;\" colspan=\"5\">Keine Kategorien vorhanden.</td>
</tr>";
}
$panel->content.="</table><br />";

View file

@ -22,7 +22,7 @@
* @author Bernhard Jaud <bernhard at becast dot at>
* @package astat core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @version $Id: b9eeb0fd7ab78feed4582e33dd2604a26281a58f $
*/
If (!defined("IN_BCWE_ADMIN")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");

View file

@ -22,7 +22,7 @@
* @author Bernhard Jaud <bernhard at becast dot at>
* @package astat core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @version $Id: ca7c3b985bdb214ce7622dc7397419774c03bace $
*/
If (!defined("IN_BCWE_ADMIN")) {

View file

@ -22,7 +22,7 @@
* @author Bernhard Jaud <bernhard at becast dot at>
* @package astat core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @version $Id: 3ab99ecb3291e81fff1273ceb58bd035ae66feb6 $
*/
If (!defined("IN_BCWE_ADMIN")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
@ -85,7 +85,7 @@ class edit_text_panel extends admin_module{
$panel->select($karray,$_POST["menue"],"menue");
$panel->content.="<br />";
$panel->content.="<h3>Kategorien:</h3>
<table width=\"100%\">
<table style='width: 100%'>
<tr>";
$resultn = $db->query("SELECT `c_id` FROM `" . $config["prefix"] . "article_category` WHERE `a_id`='".intval($_GET['id'])."'");
while($rowa=$db->fetch_array($resultn)){
@ -125,15 +125,15 @@ class edit_text_panel extends admin_module{
$panel->formClose();
}elseif($_GET["action"]=="delete" && $_GET["id"]){
$db->query("DELETE FROM `" . $config["prefix"] . "article` WHERE `id`='".intval($_GET["id"])."'");
$db->query("DELETE FROM `" . $config["prefix"] . "article_menue` where `a_id`='".$id."'");
$db->query("DELETE FROM `" . $config["prefix"] . "article_menue` where `a_id`='".intval($_GET["id"])."'");
$panel->admin_message("Artikel gel&ouml;scht!","Der Artikel wurde erfolgreich gel&ouml;scht.",True,"edit_text",3);
}
}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)){
while($row=$db->fetch_array($result)){
$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)){
if(!$row["categoryname"]){
$row["categoryname"]=$crow["categoryname"];
}else{
@ -144,15 +144,15 @@ class edit_text_panel extends admin_module{
$articles[]=$row;
}
$panel->title="Vorhandene Artikel";
$panel->content.="<table class=\"sortable\" width=\"90%\" cellspacing=\"2\">
$panel->content.="<table class=\"sortable\" style=\"width: 90%; border-spacing: 2px;\">
<tr>
<th align=\"center\">ID</th>
<th align=\"center\">Name</th>
<th align=\"center\">URL</th>
<th align=\"center\">Kategorien</th>
<th align=\"center\">Aktiv</th>
<th align=\"center\">User</th>
<th class=\"nosort sortcol\" align=\"center\" width=\"18%\">Aktionen</th>
<th style=\"text-align: center;\">ID</th>
<th style=\"text-align: center;\">Name</th>
<th style=\"text-align: center;\">URL</th>
<th style=\"text-align: center;\">Kategorien</th>
<th style=\"text-align: center;\">Aktiv</th>
<th style=\"text-align: center;\">User</th>
<th class=\"nosort sortcol\" style=\"text-align: center; width: 18%\">Aktionen</th>
</tr>";
if(!empty($articles)){
foreach($articles as $u){
@ -162,18 +162,18 @@ class edit_text_panel extends admin_module{
$u["a"]="Nein";
}
$panel->content.="<tr>
<td align=\"center\">".$u["id"]."</td>
<td align=\"center\">".$u["title"]."</td>
<td align=\"center\">".$u["url"]."</td>
<td align=\"center\">".$u["categoryname"]."</td>
<td align=\"center\">".$u["a"]."</td>
<td align=\"center\">".$u["username"]."</td>";
$panel->content.="<td align=\"center\"><a onclick=\"return confirmLink(this, 'Willst du wirklich den Artikel ".$u["title"]." l&ouml;schen? ')\" href=\"".$config["path"]."/admin/index.php?panel=edit_text&amp;action=delete&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=edit_text&amp;action=edit&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/wrench.png\" /></a></td>
<td style=\"text-align: center;\">".$u["id"]."</td>
<td style=\"text-align: center;\">".$u["title"]."</td>
<td style=\"text-align: center;\">".$u["url"]."</td>
<td style=\"text-align: center;\">".$u["categoryname"]."</td>
<td style=\"text-align: center;\">".$u["a"]."</td>
<td style=\"text-align: center;\">".$u["username"]."</td>";
$panel->content.="<td style=\"text-align: center;\"><a onclick=\"return confirmLink(this, 'Willst du wirklich den Artikel ".$u["title"]." l&ouml;schen? ')\" href=\"".$config["path"]."/admin/index.php?panel=edit_text&amp;action=delete&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=edit_text&amp;action=edit&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/wrench.png\" /></a></td>
</tr>";
}
}else{
$panel->content.="<tr>
<td align=\"center\" colspan=\"7\">Keine Artikel vorhanden.</td>
<td style=\"text-align: center;\" colspan=\"7\">Keine Artikel vorhanden.</td>
</tr>";
}
$panel->content.="</table><br />";

View file

@ -22,7 +22,7 @@
* @author Bernhard Jaud <bernhard at becast dot at>
* @package BeCast WebEngine core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @version $Id: 0a547989ebfde4dba7c560bb10b1e925117c26a9 $
*/
If (!defined("IN_BCWE_ADMIN")) {
@ -125,31 +125,31 @@ class editcategory_text_panel extends admin_module{
$articles[]=$row;
}
$panel->title="Vorhandene Kategorien";
$panel->content.="<table class=\"sortable\" width=\"90%\" cellspacing=\"2\">
$panel->content.="<table class=\"sortable\" style=\"width: 90%; border-spacing: 2px;\">
<tr>
<th align=\"center\">ID</th>
<th align=\"center\">Name</th>
<th align=\"center\">Bild</th>
<th align=\"center\">Aktiv</th>
<th class=\"nosort sortcol\" align=\"center\" width=\"18%\">Aktionen</th>
<th style=\"text-align: center;\">ID</th>
<th style=\"text-align: center;\">Name</th>
<th style=\"text-align: center;\">Bild</th>
<th style=\"text-align: center;\">Aktiv</th>
<th class=\"nosort sortcol\" style=\"text-align: center; width: 18%\">Aktionen</th>
</tr>";
if(!empty($articles)){
foreach($articles as $u){
$panel->content.="<tr>
<td align=\"center\">".$u["id"]."</td>
<td align=\"center\">".$u["categoryname"]."</td>
<td align=\"center\">".$u["picture"]."</td>";
<td style=\"text-align: center;\">".$u["id"]."</td>
<td style=\"text-align: center;\">".$u["categoryname"]."</td>
<td style=\"text-align: center;\">".$u["picture"]."</td>";
if($u["active"]=="true"){
$panel->content.="<td align=\"center\">Ja</td>";
$panel->content.="<td style=\"text-align: center;\">Ja</td>";
}else{
$panel->content.="<td align=\"center\">Nein</td>";
$panel->content.="<td style=\"text-align: center;\">Nein</td>";
}
$panel->content.="<td align=\"center\"><a onclick=\"return confirmLink(this, 'Willst du wirklich die Kategorie ".$u["categoryname"]." l&ouml;schen? ')\" href=\"".$config["path"]."/admin/index.php?panel=editcategory_text&amp;action=delete&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=editcategory_text&amp;action=edit&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/wrench.png\" /></a></td>
$panel->content.="<td style=\"text-align: center;\"><a onclick=\"return confirmLink(this, 'Willst du wirklich die Kategorie ".$u["categoryname"]." l&ouml;schen? ')\" href=\"".$config["path"]."/admin/index.php?panel=editcategory_text&amp;action=delete&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=editcategory_text&amp;action=edit&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/wrench.png\" /></a></td>
</tr>";
}
}else{
$panel->content.="<tr>
<td align=\"center\" colspan=\"5\">Keine Kategorien vorhanden.</td>
<td style=\"text-align: center;\" colspan=\"5\">Keine Kategorien vorhanden.</td>
</tr>";
}
$panel->content.="</table><br />";
@ -157,7 +157,8 @@ class editcategory_text_panel extends admin_module{
}
function meta(){
$meta.='<script type="text/javascript" src="'.$config["path"].'/js/scriptaculous/prototype.js"></script>
global $config;
$meta ='<script type="text/javascript" src="'.$config["path"].'/js/scriptaculous/prototype.js"></script>
<script src="'.$config["path"].'/js/fastinit.js" type="text/javascript">
</script>
<script src="'.$config["path"].'/js/tablesort.js" type="text/javascript">

View file

@ -1,4 +1,5 @@
<?php
global $session;
If (!defined("INBCWE")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
}
@ -15,7 +16,7 @@ class text extends ajax_module{
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);
$row = $db->fetch_array($result);
if($row["count"]==0){
echo 0;
}else{
@ -25,5 +26,4 @@ class text extends ajax_module{
}
}
}
?>
}

View file

@ -1,4 +1,4 @@
<?php
<?php global $session;
/**
* Project: BeCast WebEngine - simple site engine
* File: /modules/text/text.output.php
@ -21,7 +21,7 @@
* @author Bernhard Jaud <bernhard at becast dot at>
* @package BcWe core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @version $Id: e0a301bfd94c80b882fbaf8db054bff98be63ca5 $
*/
If (!defined("INBCWE")) {
@ -32,60 +32,59 @@ $session->page_begin("Text Module", FALSE);
class text extends module{
function output(){
global $module,$config,$db,$log,$core,$error;
$textid=0;
$url="";
if(Isset($this->get["textid"]) || Isset($this->post["textid"])){
if(Isset($this->get["textid"])){
$textid = intval($this->get["textid"]);
}else{
$textid = intval($this->post["textid"]);
function output()
{
global $module, $config, $db, $log, $core, $error;
$textid = 0;
$url = "";
if (isset($this->get["textid"]) || isset($this->post["textid"])) {
if (isset($this->get["textid"])) {
$textid = intval($this->get["textid"]);
} else {
$textid = intval($this->post["textid"]);
}
$result = $db->query("SELECT a.`id` a.`text`, a.`title`, u.`username`, eu.`username` as edituser, a.`date`, a.`edittime`, a.`eid` FROM `" . $config["prefix"] . "article` a LEFT JOIN `".$config["prefix"]."users` eu on a.`eid` = eu.`uid` LEFT JOIN `".$config["prefix"]."users` u on a.`author` = u.`uid` WHERE a.`id`='".$textid."' AND a.`active`='true'") or die($db->error());
}elseif(Isset($this->get["url"]) || Isset($this->post["url"])){
If(Isset($this->get["url"])){
$url=preg_replace( '/\.html($|\?)/i', "$1", $this->get["url"] );
}else{
$url=preg_replace( '/\.html($|\?)/i', "$1", $db->escape_string($this->post["url"]));
}
$result = $db->query("SELECT a.`id`, a.`text`, a.`title`, u.`username`, eu.`username` as edituser, a.`date`, a.`edittime`, a.`eid` FROM `" . $config["prefix"] . "article` a LEFT JOIN `".$config["prefix"]."users` eu on a.`eid` = eu.`uid` LEFT JOIN `".$config["prefix"]."users` u on a.`author` = u.`uid` WHERE a.url='".$url."' AND a.`active`='true'");
$result = $db->query("SELECT a.`id` a.`text`, a.`title`, u.`username`, eu.`username` as edituser, a.`date`, a.`edittime`, a.`eid` FROM `" . $config["prefix"] . "article` a LEFT JOIN `" . $config["prefix"] . "users` eu on a.`eid` = eu.`uid` LEFT JOIN `" . $config["prefix"] . "users` u on a.`author` = u.`uid` WHERE a.`id`='" . $textid . "' AND a.`active`='true'") or die($db->error());
} elseif (isset($this->get["url"]) || isset($this->post["url"])) {
if (isset($this->get["url"])) {
$url = preg_replace('/\.html($|\?)/i', "$1", $this->get["url"]);
} else {
$url = preg_replace('/\.html($|\?)/i', "$1", $db->escape_string($this->post["url"]));
}
$result = $db->query("SELECT a.`id`, a.`text`, a.`title`, u.`username`, eu.`username` as edituser, a.`date`, a.`edittime`, a.`eid` FROM `" . $config["prefix"] . "article` a LEFT JOIN `" . $config["prefix"] . "users` eu on a.`eid` = eu.`uid` LEFT JOIN `" . $config["prefix"] . "users` u on a.`author` = u.`uid` WHERE a.url='" . $url . "' AND a.`active`='true'");
}else{
} else {
return $error->http_error("404");
}
$fid="";
$fid.=$textid;
$fid.=$url;
if($db->num_rows($result) > 0){
if(!$this->tpl->isCached('textview.tpl',"textview".$fid)) {
$row = $db->fetch_array($result);
$cresult = $db->query("SELECT * FROM `" . $config["prefix"] . "article_categorys` c LEFT JOIN `" . $config["prefix"] . "article_category` s ON c.`id`=s.`c_id` WHERE s.`a_id`='".$row["id"]."'");
while($c=$db->fetch_array($cresult)){
if(!$cat){
$cat=$c["categoryname"];
}else{
$cat.=", ".$c["categoryname"];
}
$fid = "";
$fid .= $textid;
$fid .= $url;
if ($db->num_rows($result) > 0) {
if (!$this->tpl->isCached('textview.tpl', "textview" . $fid)) {
$row = $db->fetch_array($result);
$cresult = $db->query("SELECT * FROM `" . $config["prefix"] . "article_categories` c LEFT JOIN `" . $config["prefix"] . "article_category` s ON c.`id`=s.`c_id` WHERE s.`a_id`='" . $row["id"] . "'");
while ($c = $db->fetch_array($cresult)) {
if (!$cat) {
$cat = $c["categoryname"];
} else {
$cat .= ", " . $c["categoryname"];
}
}
$editdate = date("d.m.Y, H:i", $row["edittime"]);
$date = date("d.m.Y, H:i", $row["date"]);
$this->tpl->assign('article', $row);
$this->tpl->assign('cat', $cat);
$this->tpl->assign('editdate', $editdate);
$this->tpl->assign('date', $date);
}
$this->titleaddon=$row['title'].' - ';
$core->add_navbit($row['title']);
return $this->tpl->fetch('textview.tpl',"textview".$fid);
}else{
}
$this->titleaddon = $row['title'] . ' - ';
$core->add_navbit($row['title']);
return $this->tpl->fetch('textview.tpl', "textview" . $fid);
} else {
return $error->http_error("404");
}
}
}
?>
}