Initial checkin
This commit is contained in:
commit
d75eb444fc
4304 changed files with 369634 additions and 0 deletions
17
modules/contact/.svn/all-wcprops
Normal file
17
modules/contact/.svn/all-wcprops
Normal file
|
@ -0,0 +1,17 @@
|
|||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 40
|
||||
/astat/!svn/ver/69/trunk/modules/contact
|
||||
END
|
||||
contact.output.php
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 59
|
||||
/astat/!svn/ver/69/trunk/modules/contact/contact.output.php
|
||||
END
|
||||
contact.module.php
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 59
|
||||
/astat/!svn/ver/69/trunk/modules/contact/contact.module.php
|
||||
END
|
106
modules/contact/.svn/entries
Normal file
106
modules/contact/.svn/entries
Normal file
|
@ -0,0 +1,106 @@
|
|||
9
|
||||
|
||||
dir
|
||||
69
|
||||
http://svn.astat.org/astat/trunk/modules/contact
|
||||
http://svn.astat.org/astat
|
||||
|
||||
|
||||
|
||||
2009-10-10T17:35:03.895480Z
|
||||
69
|
||||
genuineparts
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
0
|
||||
|
||||
contact.output.php
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2009-10-10T17:32:51.000000Z
|
||||
4e9c64ab0cff2c58d91082a33ac83851
|
||||
2009-10-10T17:35:03.895480Z
|
||||
69
|
||||
genuineparts
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
3382
|
||||
|
||||
contact.module.php
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2009-10-10T17:14:15.000000Z
|
||||
cd8f1c2ddfb4b2ccd79c0a24bca98c87
|
||||
2009-10-10T17:35:03.895480Z
|
||||
69
|
||||
genuineparts
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1585
|
||||
|
||||
templates
|
||||
dir
|
||||
|
1
modules/contact/.svn/format
Normal file
1
modules/contact/.svn/format
Normal file
|
@ -0,0 +1 @@
|
|||
9
|
44
modules/contact/.svn/text-base/contact.module.php.svn-base
Normal file
44
modules/contact/.svn/text-base/contact.module.php.svn-base
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
class module_contact 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;
|
||||
}
|
||||
|
||||
function get_info(){
|
||||
$info["name"]="Kontaktformular";
|
||||
$info["file"]="contact";
|
||||
$info["author"]="astat";
|
||||
$info["version"]="1.0.0";
|
||||
$info["url"]="http://www.astat.org";
|
||||
return $info;
|
||||
}
|
||||
|
||||
function install(){
|
||||
global $config, $db;
|
||||
$db->query("INSERT INTO `" . $config["prefix"] . "config_categorys` (
|
||||
`cid` ,
|
||||
`categoryname`
|
||||
)
|
||||
VALUES (
|
||||
NULL , 'Kontaktformular'
|
||||
);");
|
||||
$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_captcha', '1', 'Captcha verwenden?', 'Soll bei der Kontaktaufnahme ein Captcha angezeigt werden?', 'yesno', ".$cid.");");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function uninstall(){
|
||||
global $config, $db;
|
||||
$db->query("DELETE FROM `" . $config["prefix"] . "config_categorys` WHERE categoryname='Kontaktformular'");
|
||||
$db->query("DELETE FROM `" . $config["prefix"] . "config` WHERE name in ('contact_email','contact_captcha')");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
76
modules/contact/.svn/text-base/contact.output.php.svn-base
Normal file
76
modules/contact/.svn/text-base/contact.output.php.svn-base
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* File: /modules/contact/contact.output.php
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program 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 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$
|
||||
* @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$
|
||||
*/
|
||||
|
||||
If (!defined("in_astat")) {
|
||||
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
|
||||
}
|
||||
$session->page_begin("Contactform", FALSE);
|
||||
|
||||
class contact extends module{
|
||||
|
||||
function output(){
|
||||
global $module,$config,$db,$log,$core,$error;
|
||||
$emsg=FALSE;
|
||||
if(isset($_POST['submit'])){
|
||||
if(!isset($_POST['name']) || $_POST['name']==""){
|
||||
$emsg.='<span style="color:red; font-weight:bold">Du musst deinen Namen eingeben!</span><br />';
|
||||
}elseif(!isset($_POST['email']) || $_POST['email']==""){
|
||||
$emsg.='<span style="color:red; font-weight:bold">Du musst deine E-Mailadresse eingeben!</span><br />';
|
||||
}elseif(!isset($_POST['subject']) || $_POST['subject']==""){
|
||||
$emsg.='<span style="color:red; font-weight:bold">Du musst einen Betreff eingeben!</span><br />';
|
||||
}elseif(!isset($_POST['message']) || $_POST['message']==""){
|
||||
$emsg.='<span style="color:red; font-weight:bold">Du musst eine Nachricht eingeben!</span><br />';
|
||||
}
|
||||
if(!preg_match("/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$/",$_POST['email'])){
|
||||
$emsg.='<span style="color:red; font-weight:bold">Deine E-Mail ist ungültig!</span><br />';
|
||||
}
|
||||
if($config['contact_captcha']==1){
|
||||
include ('thirdparty/securimage/securimage.php');
|
||||
$img = new Securimage();
|
||||
if(!$img->check($_POST['captcha'])){
|
||||
$emsg.='<span style="color:red; font-weight:bold">Das CAPTCHA ist ungültig!</span><br />';
|
||||
}
|
||||
}
|
||||
if(!$emsg){
|
||||
$mail=new mail();
|
||||
$mail->set_header("From",$config["sitetitle"]." <".$config["siteemail"].">");
|
||||
$this->tpl->assign('post',$_POST);
|
||||
$this->tpl->assign("sitename",$config["sitetitle"]);
|
||||
$mailbody=$this->tpl->fetch('contact_mail.tpl');
|
||||
$mail->bodytext($mailbody);
|
||||
$mail->sendmail($config["contact_email"],"Kontakt von ".$_POST["name"]);
|
||||
$core->message("Danke","Deine Nachricht wurde versendet.<br />Wir werden so schnell wie möglich Kontakt mit Dir aufnehmen.",TRUE,$config["path"]."/index.php",3);
|
||||
}
|
||||
}
|
||||
$this->tpl->assign('post',$_POST);
|
||||
$this->tpl->assign('emsg',$emsg);
|
||||
$this->tpl->assign('captcha',$config['contact_captcha']);
|
||||
$this->tpl->assign('sid',md5(uniqid(time())));
|
||||
return $this->tpl->fetch('contactform.tpl', 'contactform');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
44
modules/contact/contact.module.php
Normal file
44
modules/contact/contact.module.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
class module_contact 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;
|
||||
}
|
||||
|
||||
function get_info(){
|
||||
$info["name"]="Kontaktformular";
|
||||
$info["file"]="contact";
|
||||
$info["author"]="astat";
|
||||
$info["version"]="1.0.0";
|
||||
$info["url"]="http://www.astat.org";
|
||||
return $info;
|
||||
}
|
||||
|
||||
function install(){
|
||||
global $config, $db;
|
||||
$db->query("INSERT INTO `" . $config["prefix"] . "config_categorys` (
|
||||
`cid` ,
|
||||
`categoryname`
|
||||
)
|
||||
VALUES (
|
||||
NULL , 'Kontaktformular'
|
||||
);");
|
||||
$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_captcha', '1', 'Captcha verwenden?', 'Soll bei der Kontaktaufnahme ein Captcha angezeigt werden?', 'yesno', ".$cid.");");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function uninstall(){
|
||||
global $config, $db;
|
||||
$db->query("DELETE FROM `" . $config["prefix"] . "config_categorys` WHERE categoryname='Kontaktformular'");
|
||||
$db->query("DELETE FROM `" . $config["prefix"] . "config` WHERE name in ('contact_email','contact_captcha')");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
76
modules/contact/contact.output.php
Normal file
76
modules/contact/contact.output.php
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* File: /modules/contact/contact.output.php
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program 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 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$
|
||||
* @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$
|
||||
*/
|
||||
|
||||
If (!defined("in_astat")) {
|
||||
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
|
||||
}
|
||||
$session->page_begin("Contactform", FALSE);
|
||||
|
||||
class contact extends module{
|
||||
|
||||
function output(){
|
||||
global $module,$config,$db,$log,$core,$error;
|
||||
$emsg=FALSE;
|
||||
if(isset($_POST['submit'])){
|
||||
if(!isset($_POST['name']) || $_POST['name']==""){
|
||||
$emsg.='<span style="color:red; font-weight:bold">Du musst deinen Namen eingeben!</span><br />';
|
||||
}elseif(!isset($_POST['email']) || $_POST['email']==""){
|
||||
$emsg.='<span style="color:red; font-weight:bold">Du musst deine E-Mailadresse eingeben!</span><br />';
|
||||
}elseif(!isset($_POST['subject']) || $_POST['subject']==""){
|
||||
$emsg.='<span style="color:red; font-weight:bold">Du musst einen Betreff eingeben!</span><br />';
|
||||
}elseif(!isset($_POST['message']) || $_POST['message']==""){
|
||||
$emsg.='<span style="color:red; font-weight:bold">Du musst eine Nachricht eingeben!</span><br />';
|
||||
}
|
||||
if(!preg_match("/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$/",$_POST['email'])){
|
||||
$emsg.='<span style="color:red; font-weight:bold">Deine E-Mail ist ungültig!</span><br />';
|
||||
}
|
||||
if($config['contact_captcha']==1){
|
||||
include ('thirdparty/securimage/securimage.php');
|
||||
$img = new Securimage();
|
||||
if(!$img->check($_POST['captcha'])){
|
||||
$emsg.='<span style="color:red; font-weight:bold">Das CAPTCHA ist ungültig!</span><br />';
|
||||
}
|
||||
}
|
||||
if(!$emsg){
|
||||
$mail=new mail();
|
||||
$mail->set_header("From",$config["sitetitle"]." <".$config["siteemail"].">");
|
||||
$this->tpl->assign('post',$_POST);
|
||||
$this->tpl->assign("sitename",$config["sitetitle"]);
|
||||
$mailbody=$this->tpl->fetch('contact_mail.tpl');
|
||||
$mail->bodytext($mailbody);
|
||||
$mail->sendmail($config["contact_email"],"Kontakt von ".$_POST["name"]);
|
||||
$core->message("Danke","Deine Nachricht wurde versendet.<br />Wir werden so schnell wie möglich Kontakt mit Dir aufnehmen.",TRUE,$config["path"]."/index.php",3);
|
||||
}
|
||||
}
|
||||
$this->tpl->assign('post',$_POST);
|
||||
$this->tpl->assign('emsg',$emsg);
|
||||
$this->tpl->assign('captcha',$config['contact_captcha']);
|
||||
$this->tpl->assign('sid',md5(uniqid(time())));
|
||||
return $this->tpl->fetch('contactform.tpl', 'contactform');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
5
modules/contact/templates/.svn/all-wcprops
Normal file
5
modules/contact/templates/.svn/all-wcprops
Normal file
|
@ -0,0 +1,5 @@
|
|||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 50
|
||||
/astat/!svn/ver/69/trunk/modules/contact/templates
|
||||
END
|
38
modules/contact/templates/.svn/entries
Normal file
38
modules/contact/templates/.svn/entries
Normal file
|
@ -0,0 +1,38 @@
|
|||
9
|
||||
|
||||
dir
|
||||
69
|
||||
http://svn.astat.org/astat/trunk/modules/contact/templates
|
||||
http://svn.astat.org/astat
|
||||
|
||||
|
||||
|
||||
2009-10-10T17:35:03.895480Z
|
||||
69
|
||||
genuineparts
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
0
|
||||
|
||||
default
|
||||
dir
|
||||
|
1
modules/contact/templates/.svn/format
Normal file
1
modules/contact/templates/.svn/format
Normal file
|
@ -0,0 +1 @@
|
|||
9
|
17
modules/contact/templates/default/.svn/all-wcprops
Normal file
17
modules/contact/templates/default/.svn/all-wcprops
Normal file
|
@ -0,0 +1,17 @@
|
|||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 58
|
||||
/astat/!svn/ver/69/trunk/modules/contact/templates/default
|
||||
END
|
||||
contact_mail.tpl
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 75
|
||||
/astat/!svn/ver/69/trunk/modules/contact/templates/default/contact_mail.tpl
|
||||
END
|
||||
contactform.tpl
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 74
|
||||
/astat/!svn/ver/69/trunk/modules/contact/templates/default/contactform.tpl
|
||||
END
|
103
modules/contact/templates/default/.svn/entries
Normal file
103
modules/contact/templates/default/.svn/entries
Normal file
|
@ -0,0 +1,103 @@
|
|||
9
|
||||
|
||||
dir
|
||||
69
|
||||
http://svn.astat.org/astat/trunk/modules/contact/templates/default
|
||||
http://svn.astat.org/astat
|
||||
|
||||
|
||||
|
||||
2009-10-10T17:35:03.895480Z
|
||||
69
|
||||
genuineparts
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
0
|
||||
|
||||
contact_mail.tpl
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2009-10-10T17:29:38.000000Z
|
||||
86f998db070b9b0b66eb88fe226d05fe
|
||||
2009-10-10T17:35:03.895480Z
|
||||
69
|
||||
genuineparts
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
164
|
||||
|
||||
contactform.tpl
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2009-10-10T17:26:12.000000Z
|
||||
cfefcc99aa476b7778f8c5722d29ea4a
|
||||
2009-10-10T17:35:03.895480Z
|
||||
69
|
||||
genuineparts
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2084
|
||||
|
1
modules/contact/templates/default/.svn/format
Normal file
1
modules/contact/templates/default/.svn/format
Normal file
|
@ -0,0 +1 @@
|
|||
9
|
|
@ -0,0 +1,8 @@
|
|||
Jemand hat Kontakt über das {$sitename}-Kontaktformular aufgenommen.
|
||||
|
||||
Name: {$post.name}
|
||||
E-Mail: {$post.email}
|
||||
Betreff: {$post.subject}
|
||||
|
||||
Nachricht:
|
||||
{$post.message}
|
|
@ -0,0 +1,38 @@
|
|||
<h1>Kontaktformular</h1>
|
||||
{$emsg}
<form action="/index.php?task=contact" method="post">
|
||||
<table border="0" align="center" width="450">
|
||||
<tr>
|
||||
<td align="left">Name:</td>
|
||||
<td align="right"><input type="text" value="{$post.name}" name="name" size="35" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">Email:</td>
|
||||
<td align="right"><input type="text" value="{$post.email}" name="email" size="35" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">Betreff:</td>
|
||||
<td align="right"><input type="text" value="{$post.subject}" name="subject" size="35" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">Nachricht:</td>
|
||||
<td align="right"><textarea name="message" cols="40" rows="12">{$post.message}</textarea></td>
|
||||
</tr>
|
||||
{if $captcha==1}
|
||||
<tr>
|
||||
<td align="left" valign="top">Captcha:</td>
|
||||
<td align="right"><img src="{$path}thirdparty/securimage/securimage_show.php?sid={$sid}" id="image" align="absmiddle" /><br /><a href="#" onclick="document.getElementById('image').src = '{$path}thirdparty/securimage/securimage_show.php?sid=' + Math.random(); return false"><img src="{$path}themes/default/images/icons/arrow_refresh.png" alt="Refresh" /></a> <a href="{$path}thirdparty/securimage/securimage_play.php" style="font-size: 13px"><img src="{$path}themes/default/images/icons/sound.png" alt="Sound" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">Captcha eingeben:</td>
|
||||
<td align="right"><input type="text" name="captcha" size="15" maxlength="15" /></td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<td align="center" colspan="2">
|
||||
<input type="submit" name="submit" value="Senden" />
|
||||
<input type="reset" value="Löschen" /><br />
|
||||
Alle Felder sind Pflichtfelder!
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
8
modules/contact/templates/default/contact_mail.tpl
Normal file
8
modules/contact/templates/default/contact_mail.tpl
Normal file
|
@ -0,0 +1,8 @@
|
|||
Jemand hat Kontakt über das {$sitename}-Kontaktformular aufgenommen.
|
||||
|
||||
Name: {$post.name}
|
||||
E-Mail: {$post.email}
|
||||
Betreff: {$post.subject}
|
||||
|
||||
Nachricht:
|
||||
{$post.message}
|
32
modules/contact/templates/default/contactform.tpl
Normal file
32
modules/contact/templates/default/contactform.tpl
Normal file
|
@ -0,0 +1,32 @@
|
|||
<div id="maincol_top_invisible">
|
||||
</div>
|
||||
<div class="maincol_review_header">
|
||||
<h2><span>Kontaktformular</span></h2><br />
|
||||
</div>
|
||||
<div class="maincol_box_empty">
|
||||
<div class="content_page">
|
||||
{$emsg}
<form action="/index.php?task=contact" method="post">
|
||||
<label for="name" class="left">* Name:</label><br />
|
||||
<input name="name" id="name" value="{$post.name}" size="38" /><br /><br />
|
||||
|
||||
<label for="email" class="left">* E-mail:</label><br />
|
||||
<input name="email" id="email" value="{$post.email}" size="38" /><br /><br />
|
||||
|
||||
<label for="subject" class="left">* Betreff:</label><br />
|
||||
<input name="subject" id="subject" value="{$post.subject}" size="38" /><br /><br />
|
||||
|
||||
<label for="subject" class="left">* Nachricht:</label><br />
|
||||
<textarea name="message" cols="40" rows="12">{$post.message}</textarea><br /><br />
|
||||
|
||||
{if $captcha==1}
|
||||
<label for="subject" class="left">* Captcha:</label><br />
|
||||
<img src="{$path}thirdparty/securimage/securimage_show.php?sid={$sid}" id="image" align="absmiddle" /><br /><a href="#" onclick="document.getElementById('image').src = '{$path}thirdparty/securimage/securimage_show.php?sid=' + Math.random(); return false"><img src="{$path}themes/default/images/icons/arrow_refresh.png" alt="Refresh" /></a> <a href="{$path}thirdparty/securimage/securimage_play.php" style="font-size: 13px"><img src="{$path}themes/default/images/icons/sound.png" alt="Sound" /></a><br /><br />
|
||||
<input type="text" name="captcha" size="15" maxlength="15" /><br /><br />
|
||||
{/if}
|
||||
Alle Felder mit * sind Pflichtfelder!<br /><br />
|
||||
<input class="button" align="right" type="submit" value="Absenden" /><input class="button" align="right" type="reset" value="Löschen" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
1
modules/index.html
Normal file
1
modules/index.html
Normal file
|
@ -0,0 +1 @@
|
|||
|
142
modules/news/admin/add.apnl.php
Normal file
142
modules/news/admin/add.apnl.php
Normal 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ü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;
|
||||
}
|
||||
}
|
||||
?>
|
81
modules/news/admin/addcategory.apnl.php
Normal file
81
modules/news/admin/addcategory.apnl.php
Normal 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 = 700;
|
||||
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ü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();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
227
modules/news/admin/edit.apnl.php
Normal file
227
modules/news/admin/edit.apnl.php
Normal file
|
@ -0,0 +1,227 @@
|
|||
<?php
|
||||
/**
|
||||
* Project: BeCast WebEngine - 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.becast.at
|
||||
* @copyright 2009 becast.at
|
||||
* @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 $
|
||||
*/
|
||||
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='<span style="text-align: center; color: red;">Du musst alle Felder ausfü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ö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, $db->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öschen? ")" href="'.$config['path'].'/admin/index.php?panel=edit_news&action=delete&id='.$u['id'].'"><img src="'.$config['path'].'/admin/images/icons/delete.png" /></a> <a href="'.$config['path'].'/admin/index.php?panel=edit_news&action=edit&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;
|
||||
}
|
||||
}
|
||||
?>
|
190
modules/news/admin/editcategory.apnl.php
Normal file
190
modules/news/admin/editcategory.apnl.php
Normal file
|
@ -0,0 +1,190 @@
|
|||
<?php
|
||||
/**
|
||||
* Project: BeCast WebEngine - 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.becast.at
|
||||
* @copyright 2009 becast.at
|
||||
* @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 $
|
||||
*/
|
||||
|
||||
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 = 700;
|
||||
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ö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ö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, $db->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öschen? ')\" href=\"".$config["path"]."/admin/index.php?panel=editcategory_news&action=delete&id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=editcategory_news&action=edit&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;
|
||||
}
|
||||
}
|
||||
?>
|
69
modules/news/news.module.php
Normal file
69
modules/news/news.module.php
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
class module_news extends admin_module{
|
||||
|
||||
function admin_panels(){
|
||||
$panels=array(array("add_news","News schreiben","newspaper_add"),array("edit_news","News editieren","newspaper_go"),array("group_only","Newskategorien"),array("addcategory_news","Newskategorie hinzufügen","tag_blue_add"),array("editcategory_news","Newskategorie editieren","tag_blue_edit"));
|
||||
return $panels;
|
||||
}
|
||||
|
||||
function get_info(){
|
||||
$info["name"]="Newsmodul";
|
||||
$info["file"]="news";
|
||||
$info["author"]="astat";
|
||||
$info["version"]="1.0.0";
|
||||
$info["url"]="http://www.astat.org";
|
||||
return $info;
|
||||
}
|
||||
|
||||
function install(){
|
||||
global $config, $db;
|
||||
$db->query("CREATE TABLE `" . $config['prefix'] . "news` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`title` varchar(60) NOT NULL default '',
|
||||
`text` text NOT NULL,
|
||||
`author` int(11) NOT NULL default '0',
|
||||
`date` int(11) NOT NULL default '0',
|
||||
`category` mediumint(9) NOT NULL default '0',
|
||||
`active` enum('false','true') NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM");
|
||||
|
||||
$db->query("CREATE TABLE `" . $config['prefix'] . "news_category` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`name` varchar(60) NOT NULL default '',
|
||||
`picture` varchar(60) NOT NULL,
|
||||
`active` enum('false','true') NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM");
|
||||
|
||||
|
||||
mkdir ($_SERVER["DOCUMENT_ROOT"] . $config['path']."/newsimages", 0777);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function uninstall(){
|
||||
global $config, $db;
|
||||
$db->query("DELETE FROM `" . $config["prefix"] . "navigation` WHERE file='frontpage_news'");
|
||||
$db->query("DROP TABLE `" . $config["prefix"] . "news`");
|
||||
$db->query("DROP TABLE `" . $config["prefix"] . "news_category`");
|
||||
@$this->recursive($_SERVER["DOCUMENT_ROOT"]. $config['path']."/newsimages");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function recursive($dest){
|
||||
$list = array_diff(scandir($dest), array('.', '..'));
|
||||
foreach ($list as $value) {
|
||||
$file = $dest.'/'.$value;
|
||||
if (is_dir($file)) {
|
||||
recursive($file);
|
||||
}else{
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
return rmdir($dest);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
49
modules/news/news.plugins.php
Normal file
49
modules/news/news.plugins.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
If (!defined("in_astat")) {
|
||||
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
|
||||
}
|
||||
class plugins_mybbnews{
|
||||
|
||||
function register_plugins(& $plugin){
|
||||
$plugin->use_hook('frontpage_news',array($this,"newsview"));
|
||||
$plugin->use_hook('navigation_mainmodule',array($this,"frontpage_nav"));
|
||||
}
|
||||
|
||||
function newsview(){
|
||||
global $db, $config;
|
||||
$this->tpl= new Smarty();
|
||||
$parser=new textparser(true);
|
||||
$root = $_SERVER['DOCUMENT_ROOT'] . $config["path"];
|
||||
$this->tpl->compile_dir = $root . '/core/template/templates_c';
|
||||
$this->tpl->cache_dir = $root . '/core/template/cache';
|
||||
$this->tpl->config_dir = $root . '/core/template/config';
|
||||
$this->tpl->caching = $config["caching"];
|
||||
$this->tpl->assign("path",$config["path"]."/");
|
||||
if(isset($config["theme"]) && is_dir($root . '/modules/news/templates/'.$config["theme"])){
|
||||
$this->tpl-> template_dir = $root . '/modules/news/templates/'.$config["theme"];
|
||||
}else{
|
||||
$this->tpl-> template_dir = $root . '/modules/news/templates/default';
|
||||
}
|
||||
$result=$db->query("SELECT u.`username`, n.`title`, n.`date`, n.`text`, c.`name`,c.`picture` FROM `" . $config["prefix"] . "news` n LEFT JOIN `" . $config["prefix"] . "news_category` c ON n.`category`=c.`id` LEFT JOIN `" . $config["prefix"] . "users` u ON u.`uid`=n.`author` WHERE n.`active`='true' ORDER BY n.`date` DESC LIMIT 10");
|
||||
while($row=$db->fetch_array($result)){
|
||||
$row["year"]=date("Y",$row["dateline"]);
|
||||
$row["month"]=date("M",$row["dateline"]);
|
||||
$row["day"]=date("d",$row["dateline"]);
|
||||
$row["time"]=date("h:i",$row["dateline"]);
|
||||
$row["date"]=date("d.m.Y",$row["dateline"]);
|
||||
$row["text"]=$parser->parse($row["message"]);
|
||||
$news[]=$row;
|
||||
}
|
||||
$this->tpl->assign('news', $news);
|
||||
return $this->tpl->fetch('news.tpl',"news");
|
||||
}
|
||||
|
||||
function frontpage_nav($mainmodule){
|
||||
global $db, $config,$mainmodule;
|
||||
$mainmodule.="<div id=\"frontpage_mybbnews\" class=\"lineitem\">News</div>";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
25
modules/news/templates/coppertopia/news.tpl
Normal file
25
modules/news/templates/coppertopia/news.tpl
Normal file
|
@ -0,0 +1,25 @@
|
|||
<div id="posts-list" class="cf">
|
||||
<h2>News</h2>
|
||||
{foreach from=$news item=n}
|
||||
<article>
|
||||
<div class="feature-image">
|
||||
{if $n.picture!=""}<img src="/newsimages/{$n.picture}" alt="{$n.name}"/>{/if}
|
||||
<div class="entry-date">
|
||||
<div class="month">{$n.month}</div>
|
||||
<div class="number">{$n.day}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="excerpt">
|
||||
<a class="post-heading">{$n.title}</a>
|
||||
<p> {$n.text} </p>
|
||||
</div>
|
||||
<div class="meta">
|
||||
<span class="user">
|
||||
by {$n.username} on {$n.date}
|
||||
</span>
|
||||
</div>
|
||||
<i class="tape"></i>
|
||||
</article>
|
||||
{foreachelse}
|
||||
{/foreach}
|
||||
</div>
|
9
modules/news/templates/default/news.tpl
Normal file
9
modules/news/templates/default/news.tpl
Normal file
|
@ -0,0 +1,9 @@
|
|||
<h2>News</h2>
|
||||
{foreach from=$news item=n}
|
||||
<h3>{$n.title}</h3>
|
||||
<p class="post-by">Written by {$n.username} on {$n.date}</p>
|
||||
{if $n.picture!=""}<div class="newsimage"><img class="newsimage" src="/newsimages/{$n.picture}" alt="{$n.name}"/></div>{/if}
|
||||
{$n.text}
|
||||
{if $edituser!=""}<br /><font size="1pt">(zuletzt editiert am {$editdate}, von {$edituser})</font><br />{/if}
|
||||
{foreachelse}
|
||||
{/foreach}
|
184
modules/text/admin/add.apnl.php
Normal file
184
modules/text/admin/add.apnl.php
Normal file
|
@ -0,0 +1,184 @@
|
|||
<?php
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* File: /modules/text/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$
|
||||
* @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$
|
||||
*/
|
||||
If (!defined("in_BL_ADMIN")) {
|
||||
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
|
||||
}
|
||||
$session->page_begin("add Text", True);
|
||||
|
||||
class add_text_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['url'])&& $_POST['url']!=""||isset($_POST['title'])&& $_POST['title']!=""){
|
||||
$url=$db->escape($_POST['url']);
|
||||
$title=$db->escape($_POST['title']);
|
||||
$mid=intval($_POST['menue']);
|
||||
$result = $db->query("SELECT count(id) as count FROM `" . $config["prefix"] . "article` WHERE `url`='".$url."'");
|
||||
$row = $db->fetch_array($result);
|
||||
if($row["count"]==0){
|
||||
$db->query("BEGIN");
|
||||
$db->query("INSERT INTO `" . $config["prefix"] . "article` (`text`,`date`,`author`,`menue`,`title`,`url`,`active`) VALUES ('".$db->escape($_POST["text"])."','".time()."','".$session->userdata["uid"]."','".$mid."','".$title."','".$url."','".$_POST["active"]."')");
|
||||
$aid=$db->last_id();
|
||||
if($_POST["cats"]!=""){
|
||||
foreach($_POST["cats"] as $nid){
|
||||
$db->query("INSERT INTO `" . $config["prefix"] . "article_category` (`a_id`,`c_id`) VALUES ('".$aid."','".$nid."')");
|
||||
}
|
||||
}
|
||||
$db->query("COMMIT");
|
||||
$panel->admin_message("Danke", "Der Artikel wurde erfolgreich eingetragen!.",TRUE,"add_text");
|
||||
}else{
|
||||
$fail="<span style=\"text-align: center; color: red;\">Diese URL ist vergeben!</span>";
|
||||
}
|
||||
}else{
|
||||
$fail="<span style=\"text-align: center; color: red;\">Du musst alle Felder ausfüllen!</span>";
|
||||
}
|
||||
}elseif(!isset($_POST['send']) || $fail){
|
||||
$panel->title="Text hinzufügen";
|
||||
$panel->form(array("action"=>$config["path"]."/admin/index.php?panel=add_text"));
|
||||
if($fail){
|
||||
$panel->content.=$fail;
|
||||
}
|
||||
$panel->content.="<h3>Titel:</h3>";
|
||||
$panel->field(array("name"=>"title","typ"=>"text","value"=>$_POST["title"]));
|
||||
$panel->content.="<h3>Url:</h3>";
|
||||
$panel->field(array("name"=>"url","typ"=>"text","value"=>$_POST["url"]),"id=\"url\"");
|
||||
$panel->content.=".html";
|
||||
$panel->content.=" <span id=\"msgbox\" style=\"display:none\"></span><br />";
|
||||
$resultc=$db->query("SELECT `id`,`name` FROM `" . $config["prefix"] . "article_menue`") or die($db->error());
|
||||
$karray["Keines"]="";
|
||||
while($row=$db->fetch_array($resultc)){
|
||||
$karray[$row["name"]]=$row["id"];
|
||||
}
|
||||
$panel->content.="<h3>Menü:</h3>";
|
||||
$panel->select($karray,$_POST["menue"],"menue");
|
||||
$panel->content.="<br />";
|
||||
$panel->content.="<h3>Kategorien:</h3>
|
||||
<table width=\"100%\">
|
||||
<tr>";
|
||||
$resultk=$db->query("SELECT `id`,`categoryname` FROM `" . $config["prefix"] . "article_categorys` WHERE `active`='true'") or die($db->error());
|
||||
while($row=$db->fetch_array($resultk)){
|
||||
$navs[]=$row;
|
||||
}
|
||||
$i=0;
|
||||
if(is_array($navs)){
|
||||
foreach($navs as $n){
|
||||
if($i % 5==0){
|
||||
$panel->content.="</tr><tr>";
|
||||
}
|
||||
$panel->checkbox(array("name"=>"cats[]","value"=>$n["id"]));
|
||||
$panel->content.=$n["categoryname"];
|
||||
$i++;
|
||||
}
|
||||
}else{
|
||||
$panel->content.="Keine Kategorien angelegt.";
|
||||
}
|
||||
$panel->content.="</tr>
|
||||
</table></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(\"".$config["path"]."/ajax.php\",{ task:'text',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;
|
||||
}
|
||||
}
|
||||
?>
|
81
modules/text/admin/addcategory.apnl.php
Normal file
81
modules/text/admin/addcategory.apnl.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* File: /modules/text/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$
|
||||
* @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$
|
||||
*/
|
||||
|
||||
If (!defined("in_BL_ADMIN")) {
|
||||
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
|
||||
}
|
||||
$session->page_begin("add Category", True);
|
||||
|
||||
class addcategory_text_panel extends admin_module{
|
||||
|
||||
function output(){
|
||||
global $config, $db,$panel, $root, $core, $session;
|
||||
$fail=FALSE;
|
||||
if(isset($_POST['send'])&& $_POST['send']==1){
|
||||
if(isset($_POST['categoryname'])&& $_POST['categoryname']!=""){
|
||||
$userfile_name = $_FILES['picture']['name'];
|
||||
$userfile_tmp = $_FILES['picture']['tmp_name'];
|
||||
$userfile_size = $_FILES['picture']['size'];
|
||||
$userfile_type = $_FILES['picture']['type'];
|
||||
$filedir = $root.'/catimages/';
|
||||
$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_text");
|
||||
}
|
||||
}
|
||||
$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());
|
||||
$panel->admin_message("Danke", "Die Kategorie wurde erfolgreich eingetragen!.",TRUE,"addcategory_text");
|
||||
}else{
|
||||
$fail="<span style=\"text-align: center; color: red;\">Der Kategoriename muss angegeben werden!</span>";
|
||||
}
|
||||
}elseif(!isset($_POST['send']) || $fail){
|
||||
$panel->title="Kategorie hinzufügen";
|
||||
$panel->form(array("action"=>$config["path"]."/admin/index.php?panel=addcategory_text"),FALSE,"enctype=\"multipart/form-data\"");
|
||||
if($fail){
|
||||
$panel->content.=$fail;
|
||||
}
|
||||
$panel->content.="<h3>Kategoriename:</h3>";
|
||||
$panel->field(array("name"=>"categoryname","typ"=>"text","value"=>$_POST["categoryname"]));
|
||||
$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();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
278
modules/text/admin/edit.apnl.php
Normal file
278
modules/text/admin/edit.apnl.php
Normal file
|
@ -0,0 +1,278 @@
|
|||
<?php
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* File: /modules/text/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$
|
||||
* @copyright 2025 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$
|
||||
*/
|
||||
If (!defined("in_BL_ADMIN")) {
|
||||
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
|
||||
}
|
||||
$session->page_begin("edit Text", True);
|
||||
|
||||
class edit_text_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['url'])&& $_POST['url']!=""||isset($_POST['title'])&& $_POST['title']!=""){
|
||||
$id=intval($_POST['id']);
|
||||
$url=$db->escape($_POST['url']);
|
||||
$title=$db->escape($_POST['title']);
|
||||
$mid=intval($_POST['menue']);
|
||||
$result = $db->query("SELECT count(`id`) as `count` FROM `" . $config["prefix"] . "article` WHERE `url`='".$url."' AND `id`<>'".$id."'");
|
||||
$row = $db->fetch_array($result);
|
||||
|
||||
if($row["count"]==0){
|
||||
$db->query("UPDATE `" . $config["prefix"] . "article` SET `text`='".$db->escape($_POST["text"])."',`menue`='".$mid."',`title`='".$title."',`url`='".$url."',`active`='".$_POST["active"]."',`eid`='".$session->userdata["uid"]."',`edittime`='".time()."' WHERE `id`='".$id."'");
|
||||
$db->query("DELETE FROM `" . $config["prefix"] . "article_category` where `a_id`='".$id."'");
|
||||
if($_POST["cats"]!=""){
|
||||
foreach($_POST["cats"] as $nid){
|
||||
$db->query("INSERT INTO `" . $config["prefix"] . "article_category` (`a_id`,`c_id`) VALUES ('".$id."','".$nid."')");
|
||||
}
|
||||
}
|
||||
$panel->admin_message("Danke", "Artikel erfolgreich geändert!",TRUE,"edit_text");
|
||||
}else{
|
||||
$fail="<span style=\"text-align: center; color: red;\">Diese URL ist vergeben!</span>";
|
||||
}
|
||||
}else{
|
||||
$fail="<span style=\"text-align: center; color: red;\">Du musst alle Felder ausfüllen!</span>";
|
||||
}
|
||||
|
||||
}elseif(isset($_GET['id'])&& $_GET['id']!=""){
|
||||
if($_GET['action']=="edit"){
|
||||
$result = $db->query("SELECT * FROM " . $config["prefix"] . "article WHERE id='".intval($_GET['id'])."'");
|
||||
$_POST=$db->fetch_array($result);
|
||||
|
||||
|
||||
$panel->title="Text editieren";
|
||||
$panel->form(array("action"=>$config["path"]."/admin/index.php?panel=edit_text"));
|
||||
if($fail){
|
||||
$panel->content.=$fail;
|
||||
}
|
||||
$panel->content.="<h3>Titel:</h3>";
|
||||
$panel->field(array("name"=>"title","typ"=>"text","value"=>$_POST["title"]));
|
||||
$panel->content.="<h3>Url:</h3>";
|
||||
$panel->field(array("name"=>"url","typ"=>"text","value"=>$_POST["url"]));
|
||||
$panel->content.=".html";
|
||||
$resultc=$db->query("SELECT `id`,`name` FROM `" . $config["prefix"] . "article_menue`") or die($db->error());
|
||||
$karray["Keines"]="";
|
||||
while($row=$db->fetch_array($resultc)){
|
||||
$karray[$row["name"]]=$row["id"];
|
||||
}
|
||||
$panel->content.="<h3>Menü:</h3>";
|
||||
$panel->select($karray,$_POST["menue"],"menue");
|
||||
$panel->content.="<br />";
|
||||
$panel->content.="<h3>Kategorien:</h3>
|
||||
<table 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)){
|
||||
$cat[$rowa["c_id"]]=TRUE;
|
||||
}
|
||||
$resultk=$db->query("SELECT `id`,`categoryname` FROM `" . $config["prefix"] . "article_categorys` WHERE `active`='true'");
|
||||
while($row=$db->fetch_array($resultk)){
|
||||
if($cat[$row["id"]]==TRUE){
|
||||
$row["checked"]="checked=\"checked\"";
|
||||
}
|
||||
$navs[]=$row;
|
||||
}
|
||||
$i=0;
|
||||
if(is_array($navs)){
|
||||
foreach($navs as $n){
|
||||
if($i % 5==0){
|
||||
$panel->content.="</tr><tr>";
|
||||
}
|
||||
$panel->checkbox(array("name"=>"cats[]","value"=>$n["id"]),$n["checked"]);
|
||||
$panel->content.=$n["categoryname"];
|
||||
$i++;
|
||||
}
|
||||
}else{
|
||||
$panel->content.="Keine Kategorien angelegt.";
|
||||
}
|
||||
$panel->content.="</tr>
|
||||
</table></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->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"] . "article` WHERE `id`='".intval($_GET["id"])."'");
|
||||
$db->query("DELETE FROM `" . $config["prefix"] . "article_menue` where `a_id`='".$id."'");
|
||||
$panel->admin_message("Artikel gelöscht!","Der Artikel wurde erfolgreich gelö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)){
|
||||
$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"]."'");
|
||||
while($crow=$db->fetch_array($cresult, $db->ASSOC)){
|
||||
if(!$row["categoryname"]){
|
||||
$row["categoryname"]=$crow["categoryname"];
|
||||
}else{
|
||||
$row["categoryname"].="<br />".$crow["categoryname"];
|
||||
}
|
||||
}
|
||||
$row["dates"]=date("d.m.Y",$row["date"]);
|
||||
$articles[]=$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\">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>
|
||||
</tr>";
|
||||
if(!empty($articles)){
|
||||
foreach($articles 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["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öschen? ')\" href=\"".$config["path"]."/admin/index.php?panel=edit_text&action=delete&id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=edit_text&action=edit&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>
|
||||
</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;
|
||||
}
|
||||
}
|
||||
?>
|
190
modules/text/admin/editcategory.apnl.php
Normal file
190
modules/text/admin/editcategory.apnl.php
Normal file
|
@ -0,0 +1,190 @@
|
|||
<?php
|
||||
/**
|
||||
* Project: BeCast WebEngine - simple site engine
|
||||
* File: /modules/text/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.becast.at
|
||||
* @copyright 2009 becast.at
|
||||
* @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$
|
||||
*/
|
||||
|
||||
If (!defined("in_BL_ADMIN")) {
|
||||
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
|
||||
}
|
||||
$session->page_begin("edit category", True);
|
||||
|
||||
class editcategory_text_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['categoryname'])&& $_POST['categoryname']!=""){
|
||||
$userfile_name = $_FILES['picture']['name'];
|
||||
$userfile_tmp = $_FILES['picture']['tmp_name'];
|
||||
$userfile_size = $_FILES['picture']['size'];
|
||||
$userfile_type = $_FILES['picture']['type'];
|
||||
$filedir = $root.'/catimages/';
|
||||
$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_text");
|
||||
}
|
||||
$result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "article_categorys` 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");
|
||||
$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());
|
||||
}
|
||||
|
||||
$categoryname=$db->escape($_POST['categoryname']);
|
||||
$active=$db->escape($_POST['active']);
|
||||
$db->query("UPDATE `" . $config["prefix"]. "article_categorys` SET `categoryname`='".$categoryname."', `active`='".$active."' WHERE `id`='".intval($_POST["id"])."'") or die($db->error());
|
||||
$panel->admin_message("Danke", "Die Kategorie wurde erfolgreich editiert!.",TRUE,"editcategory_text");
|
||||
}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"] . "article_categorys` 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_text"),FALSE,"enctype=\"multipart/form-data\"");
|
||||
if($fail){
|
||||
$panel->content.=$fail;
|
||||
}
|
||||
$panel->content.="<h3>Kategoriename:</h3>";
|
||||
$panel->field(array("name"=>"categoryname","typ"=>"text","value"=>$_POST["categoryname"]));
|
||||
if($_POST["picture"]!=""){
|
||||
$panel->content.="<h3>aktuelles Kategoriebild:</h3>";
|
||||
$panel->content.="<img src=\"".$config["path"]."/catimages/".$_POST["picture"]."\" alt=\"Kategoriebild\" />";
|
||||
$panel->content.="<br />";
|
||||
$panel->checkbox(array("name"=>"delimg","value"=>"1"));
|
||||
$panel->content.=" Bild lö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"] . "article_categorys` 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"])."'");
|
||||
$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`");
|
||||
while($row=$db->fetch_array($result, $db->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["categoryname"]."</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öschen? ')\" href=\"".$config["path"]."/admin/index.php?panel=editcategory_text&action=delete&id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=editcategory_text&action=edit&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;
|
||||
}
|
||||
}
|
||||
?>
|
5
modules/text/templates/.svn/all-wcprops
Normal file
5
modules/text/templates/.svn/all-wcprops
Normal file
|
@ -0,0 +1,5 @@
|
|||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 46
|
||||
/astat/!svn/ver/1/trunk/modules/text/templates
|
||||
END
|
31
modules/text/templates/.svn/entries
Normal file
31
modules/text/templates/.svn/entries
Normal file
|
@ -0,0 +1,31 @@
|
|||
9
|
||||
|
||||
dir
|
||||
34
|
||||
http://svn.astat.org/astat/trunk/modules/text/templates
|
||||
http://svn.astat.org/astat
|
||||
|
||||
|
||||
|
||||
2009-06-07T19:12:55.973801Z
|
||||
1
|
||||
genuineparts
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bb7ccd2a-c66b-0410-9765-967ca6f03dfc
|
||||
|
||||
default
|
||||
dir
|
||||
|
1
modules/text/templates/.svn/format
Normal file
1
modules/text/templates/.svn/format
Normal file
|
@ -0,0 +1 @@
|
|||
9
|
11
modules/text/templates/default/.svn/all-wcprops
Normal file
11
modules/text/templates/default/.svn/all-wcprops
Normal file
|
@ -0,0 +1,11 @@
|
|||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 54
|
||||
/astat/!svn/ver/1/trunk/modules/text/templates/default
|
||||
END
|
||||
textview.tpl
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 67
|
||||
/astat/!svn/ver/1/trunk/modules/text/templates/default/textview.tpl
|
||||
END
|
62
modules/text/templates/default/.svn/entries
Normal file
62
modules/text/templates/default/.svn/entries
Normal file
|
@ -0,0 +1,62 @@
|
|||
9
|
||||
|
||||
dir
|
||||
34
|
||||
http://svn.astat.org/astat/trunk/modules/text/templates/default
|
||||
http://svn.astat.org/astat
|
||||
|
||||
|
||||
|
||||
2009-06-07T19:12:55.973801Z
|
||||
1
|
||||
genuineparts
|
||||
|
||||
|
||||
svn:special svn:externals svn:needs-lock
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bb7ccd2a-c66b-0410-9765-967ca6f03dfc
|
||||
|
||||
textview.tpl
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2009-06-08T19:44:32.000000Z
|
||||
c9914ec8546b33d929da6e52c51919ed
|
||||
2009-06-07T19:12:55.973801Z
|
||||
1
|
||||
genuineparts
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
331
|
||||
|
1
modules/text/templates/default/.svn/format
Normal file
1
modules/text/templates/default/.svn/format
Normal file
|
@ -0,0 +1 @@
|
|||
9
|
|
@ -0,0 +1,6 @@
|
|||
<h1>{$article.title}</h1>
<p>
{$article.text}
|
||||
{if $article.edituser!=""}<br /><font size="1pt">(zuletzt editiert am {$editdate}, von {$article.edituser})</font><br />{/if}
|
||||
</p>
|
||||
<p class="meta"><span class="date">{$date} </span> Geschrieben von {$article.username} | Abgelegt in: {if $cat!=""}{$cat}{else}nirgendwo{/if} </p>
|
||||
|
||||
|
14
modules/text/templates/default/textview.tpl
Normal file
14
modules/text/templates/default/textview.tpl
Normal file
|
@ -0,0 +1,14 @@
|
|||
<div id="posts-list" class="page-content-half">
|
||||
<div class="entry-content cf">
|
||||
<h2>{$article.title}</h2>
|
||||
<p>
|
||||
{$article.text}
|
||||
{if $article.edituser!=""}<br /><font size="1pt">(last edit at {$editdate}, by {$article.edituser})</font><br />{/if}
|
||||
</p>
|
||||
<p class="meta"><span class="date">{$date} </span>written by {$article.username}</p>
|
||||
</div>
|
||||
<div class="c-1"></div>
|
||||
<div class="c-2"></div>
|
||||
<div class="c-3"></div>
|
||||
<div class="c-4"></div>
|
||||
</div>
|
29
modules/text/text.ajax.php
Normal file
29
modules/text/text.ajax.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
If (!defined("in_astat")) {
|
||||
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
|
||||
}
|
||||
$addnav["right"]=FALSE;
|
||||
$session->page_begin("Text Module", FALSE);
|
||||
|
||||
$topnav_home="<li><a href=\"/index.php\">Home</a></li>";
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
92
modules/text/text.module.php
Normal file
92
modules/text/text.module.php
Normal file
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
|
||||
class module_text 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;
|
||||
}
|
||||
|
||||
function get_info(){
|
||||
$info["name"]="Textverwaltung";
|
||||
$info["file"]="text";
|
||||
$info["author"]="astat";
|
||||
$info["version"]="1.0.1";
|
||||
$info["url"]="http://www.astat.org";
|
||||
return $info;
|
||||
}
|
||||
|
||||
function install(){
|
||||
global $config, $db;
|
||||
$db->query("CREATE TABLE IF NOT EXISTS `" . $config["prefix"] . "article` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`text` text NOT NULL,
|
||||
`date` int(11) NOT NULL default '0',
|
||||
`author` int(11) NOT NULL default '0',
|
||||
`eid` int(11) NULL default NULL,
|
||||
`edittime` int(11) NULL default NULL,
|
||||
`menue` int(11) NOT NULL default '0',
|
||||
`title` varchar(80) NOT NULL default '',
|
||||
`url` varchar(120) NOT NULL,
|
||||
`rightnavi` enum('false','true') NOT NULL,
|
||||
`active` enum('true','false') NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `author` (`author`),
|
||||
KEY `menue` (`menue`),
|
||||
KEY `eid` (`eid`)
|
||||
) ENGINE=MyISAM");
|
||||
|
||||
$db->query("CREATE TABLE IF NOT EXISTS `" . $config["prefix"] . "article_categorys` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`categoryname` varchar(80) NOT NULL default '',
|
||||
`picture` varchar(80) NOT NULL default '',
|
||||
`active` enum('true','false') NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `active` (`active`)
|
||||
) ENGINE=MyISAM");
|
||||
|
||||
|
||||
$db->query("CREATE TABLE `" . $config["prefix"] . "article_category` (
|
||||
`a_id` int(11) NOT NULL,
|
||||
`c_id` int(11) NOT NULL,
|
||||
KEY `a_id` (`a_id`),
|
||||
KEY `c_id` (`c_id`)
|
||||
) ENGINE=MyISAM");
|
||||
|
||||
$db->query("CREATE TABLE `" . $config["prefix"] . "article_menue` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`sort` int(11) NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `sort` (`sort`)
|
||||
) ENGINE=MyISAM");
|
||||
|
||||
mkdir ($_SERVER["DOCUMENT_ROOT"]."/catimages", 0777);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
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_category`");
|
||||
$db->query("DROP TABLE `" . $config["prefix"] . "article_menue`");
|
||||
@$this->recursive($_SERVER["DOCUMENT_ROOT"]."/catimages");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function recursive($dest){
|
||||
$list = array_diff(scandir($dest), array('.', '..'));
|
||||
foreach ($list as $value) {
|
||||
$file = $dest.'/'.$value;
|
||||
if (is_dir($file)) {
|
||||
recursive($file);
|
||||
}else{
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
return rmdir($dest);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
91
modules/text/text.output.php
Normal file
91
modules/text/text.output.php
Normal file
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* File: /modules/text/text.output.php
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program 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 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$
|
||||
* @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$
|
||||
*/
|
||||
|
||||
If (!defined("in_astat")) {
|
||||
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
|
||||
}
|
||||
|
||||
$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"]);
|
||||
}
|
||||
$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{
|
||||
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"];
|
||||
}
|
||||
}
|
||||
|
||||
$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{
|
||||
return $error->http_error("404");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue