Initial commit

This commit is contained in:
genuineparts 2025-06-02 10:01:12 +02:00
commit 43ad32700c
7085 changed files with 447606 additions and 0 deletions

View file

@ -0,0 +1,142 @@
<?php
/**
* Project: astat - simple site engine
* File: /modules/news/add.apnl.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @link http://www.astat.org SVN: $URL: file:///var/local/svn/astat/trunk/modules/news/admin/add.apnl.php $
* @copyright 2009 becast.at
* @author Bernhard Jaud <bernhard at becast dot at>
* @package astat core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: add.apnl.php 96 2010-02-17 21:56:41Z genuineparts $
*/
If (!defined("in_BL_ADMIN")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
}
$session->page_begin("add News", True);
class add_news_panel extends admin_module{
function output(){
global $config, $db,$panel, $session;
$fail=FALSE;
if(isset($_POST['send'])&& $_POST['send']==1){
if(isset($_POST['text'])&& $_POST['text']!=""||isset($_POST['title'])&& $_POST['title']!=""){
$title=$db->escape($_POST['title']);
$db->query("INSERT INTO `" . $config["prefix"] . "news` (`text`,`date`,`author`,`category`,`title`,`active`) VALUES ('".$db->escape($_POST["text"])."','".time()."','".$session->userdata["uid"]."','".intval($_POST["category"])."','".$title."','".$_POST["active"]."')");
$panel->admin_message("Danke", "Die News wurden erfolgreich eingetragen!.",TRUE,"add_news");
}else{
$fail="<span style=\"text-align: center; color: red;\">Du musst alle Felder ausf&uuml;llen!</span>";
}
}elseif(!isset($_POST['send']) || $fail){
$panel->title="News schreiben";
$panel->form(array("action"=>$config["path"]."/admin/index.php?panel=add_news"));
if($fail){
$panel->content.=$fail;
}
$panel->content.="<h3>Titel:</h3>";
$panel->field(array("name"=>"title","typ"=>"text","value"=>$_POST["title"]));
$resultc=$db->query("SELECT `id`,`name` FROM `" . $config["prefix"] . "news_category` WHERE `active`='true'");
$karray["Keine"]="";
while($row=$db->fetch_array($resultc)){
$karray[$row["name"]]=$row["id"];
}
$panel->content.="<h3>Kategorie:</h3>";
$panel->select($karray,$_POST["category"],"category");
$panel->content.="<br />";
$panel->content.="<h3>Text:</h3>";
$panel->textarea(array("name"=>"text","value"=>$_POST["text"],"rows"=>"30","cols"=>"80"),"class=\"mceEditor\"");
$panel->content.="<h3>Aktiv:</h3>";
$panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active");
$panel->content.="<br />";
$panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1"));
$panel->content.="<br />";
$panel->submit();
$panel->formClose();
}
}
function meta(){
global $config;
$meta="<script type=\"text/javascript\" src=\"".$config["path"]."/js/jquery/jquery.min.js\"></script>
<script type=\"text/javascript\">
$(document).ready(function()
{
$(\"#url\").blur(function()
{
//remove all the class add the messagebox classes and start fading
$(\"#msgbox\").removeClass().addClass('messagebox').text('Warten...').fadeIn(\"slow\");
//check the username exists or not from ajax
$.post(\"ajax.php\",{ call:'url',url:$(this).val() } ,function(data)
{
if(data==1) //if username not avaiable
{
$(\"#msgbox\").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Url vergeben').addClass('messageboxerror').fadeTo(900,1);
});
}
else
{
$(\"#msgbox\").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('').removeClass().fadeTo(900,1);
});
}
});
});
});
</script>";
$meta.='<script type="text/javascript" src="'.$config["path"].'/thirdparty/tiny/tiny_mce_gzip.js"></script>
<script type="text/javascript">
tinyMCE_GZ.init({
theme : "advanced",
mode : "textareas",
language : "de",
plugins : "table,advhr,advimage,advlink,insertdatetime,searchreplace",
disk_cache : true,
debug : false
});
</script>
<script type="text/javascript" src="'.$config["path"].'/thirdparty/tiny/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
theme : "advanced",
mode : "textareas",
language : "de",
plugins : "table,advhr,advimage,advlink,insertdatetime,searchreplace",
theme_advanced_disable : "styleselect,formatselect ",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "seperator,forecolor,removeformat,advhr",
theme_advanced_buttons3 : "tablecontrols,seperator",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "center",
remove_linebreaks : false,
convert_urls : false,
editor_selector : "mceEditor",
editor_deselector : "mceNoEditor"
});
</script>';
return $meta;
}
}
?>

View file

@ -0,0 +1,81 @@
<?php
/**
* Project: astat - simple site engine
* File: /modules/news/addcategory.apnl.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @link http://www.astat.org SVN: $URL: file:///var/local/svn/astat/trunk/modules/news/admin/addcategory.apnl.php $
* @copyright 2009 becast.at
* @author Bernhard Jaud <bernhard at becast dot at>
* @package astat core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: addcategory.apnl.php 96 2010-02-17 21:56:41Z genuineparts $
*/
If (!defined("in_BL_ADMIN")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
}
$session->page_begin("add news Category", True);
class addcategory_news_panel extends admin_module{
function output(){
global $config, $db,$panel, $root, $session, $core;
$fail=FALSE;
if(isset($_POST['send'])&& $_POST['send']==1){
if(isset($_POST['name'])&& $_POST['name']!=""){
$userfile_name = $_FILES['picture']['name'];
$userfile_tmp = $_FILES['picture']['tmp_name'];
$userfile_size = $_FILES['picture']['size'];
$userfile_type = $_FILES['picture']['type'];
$filedir = $root.'/newsimages/';
$size = 120;
if (isset($_FILES['picture']['name']) && $_FILES['picture']['name']!=""){
$prod_img = $filedir.$userfile_name;
$ret=$core->upload_file($prod_img, $userfile_tmp, $size, $size, TRUE, TRUE);
if($ret!==TRUE){
$panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden <br /> Der Fehler war: ". $ret,TRUE,"addcategory_news");
}
}
$name=$db->escape($_POST['name']);
$active=$db->escape($_POST['active']);
$db->query("INSERT INTO `" . $config["prefix"]. "news_category` (`name`,`picture`,`active`) VALUES ('".$name."','".$userfile_name."','".$active."')");
$panel->admin_message("Danke", "Die Kategorie wurde erfolgreich eingetragen!.",TRUE,"addcategory_news");
}else{
$fail="<span style=\"text-align: center; color: red;\">Der Kategoriename muss angegeben werden!</span>";
}
}elseif(!isset($_POST['send']) || $fail){
$panel->title="Kategorie hinzuf&uuml;gen";
$panel->form(array("action"=>$config["path"]."/admin/index.php?panel=addcategory_news"),FALSE,"enctype=\"multipart/form-data\"");
if($fail){
$panel->content.=$fail;
}
$panel->content.="<h3>Kategoriename:</h3>";
$panel->field(array("name"=>"name","typ"=>"text","value"=>$_POST["name"]));
$panel->content.="<h3>Kategoriebild:</h3>";
$panel->field(array("name"=>"picture","typ"=>"file","value"=>$_POST["picture"]));
$panel->content.="<br />";
$panel->content.="<h3>Aktiv:</h3>";
$panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active");
$panel->content.="<br />";
$panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1"));
$panel->content.="<br />";
$panel->submit();
$panel->formClose();
}
}
}
?>

View file

@ -0,0 +1,227 @@
<?php
/**
* Project: astat - simple site engine
* File: /modules/news/edit.apnl.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @link http://www.astat.org SVN: $URL: file:///var/local/svn/astat/trunk/modules/news/admin/edit.apnl.php $
* @copyright 2009 becast.at
* @author Bernhard Jaud <bernhard at becast dot at>
* @package astat core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: edit.apnl.php 96 2010-02-17 21:56:41Z genuineparts $
*/
If (!defined('in_BL_ADMIN')) {
die('Dieses Script kann nicht ausserhalb des Frameworks laufen!');
}
$session->page_begin('edit News', True);
class edit_news_panel extends admin_module{
function output(){
global $config, $db,$panel, $session, $admin;
$fail=FALSE;
if(isset($_POST['send'])&& $_POST['send']==1){
if(isset($_POST['id'])&& $_POST['id']!=''||isset($_POST['text'])&& $_POST['text']!=''||isset($_POST['title'])&& $_POST['title']!=''){
$id=intval($_POST['id']);
$title=$db->escape($_POST['title']);
$db->query("UPDATE `" . $config['prefix'] . "news` SET `text`='".$db->escape($_POST['text'])."',`category`='".intval($_POST['category'])."',`title`='".$title."',`active`='".$_POST['active']."' WHERE `id`='".$id."'");
$panel->admin_message('Danke', 'News erfolgreich ge&auml;ndert!',TRUE,'edit_news');
}else{
$fail='<span style="text-align: center; color: red;">Du musst alle Felder ausf&uuml;llen!</span>';
}
}elseif(isset($_GET['id'])&& $_GET['id']!=''){
if($_GET['action']=='edit'){
$result = $db->query("SELECT * FROM " . $config['prefix'] . "news WHERE id='".intval($_GET['id'])."'");
$_POST=$db->fetch_array($result);
/*$resultna=$db->query("SELECT id,name FROM " . $config["prefix"] . "menue");
while($rowa=$db->fetch_array($resultna)){
$resultn = $db->query("SELECT m_id FROM " . $config["prefix"] . "article_menue WHERE a_id='".intval($_GET['id'])."' and m_id='".$rowa["id"]."'");
if($db->num_rows($resultn) >= 1){
$rowa["checked"]="checked=\"checked\"";
}
$navs[]=$rowa;
}*/
$panel->title='News editieren';
$panel->form(array('action'=>$config['path'].'/admin/index.php?panel=edit_news'));
if($fail){
$panel->content.=$fail;
}
$panel->content.='<h3>Titel:</h3>';
$panel->field(array('name'=>'title','typ'=>'text','value'=>$_POST['title']));
$panel->content.='<h3>Kategorie:</h3>';
$resultc=$db->query("SELECT `id`,`name` FROM `" . $config['prefix'] . "news_category` WHERE `active`='true'");
$karray['Keine']='';
while($row=$db->fetch_array($resultc)){
$karray[$row['name']]=$row['id'];
}
$panel->select($karray,$_POST['category'],'category');
$panel->content.='<h3>Text:</h3>';
$panel->textarea(array('name'=>'text','value'=>$_POST['text'],'rows'=>'30','cols'=>'80'),'class="mceEditor"');
$panel->content.='<h3>Aktiv:</h3>';
$panel->select(array('Nein'=>'false','Ja'=>'true'),$_POST['active'],'active');
$panel->content.='<br />';
$panel->field(array('name'=>'send','typ'=>'hidden','value'=>'1'));
$panel->field(array('name'=>'id','typ'=>'hidden','value'=>$_GET['id']));
$panel->content.='<br />';
$panel->submit();
$panel->formClose();
}elseif($_GET['action']=='delete' && $_GET['id']){
$db->query("DELETE FROM `" . $config['prefix'] . "news` WHERE `id`='".intval($_GET['id'])."'");
$panel->admin_message('News gel&ouml;scht!','Die News wurden erfolgreich gel&ouml;scht.',True,'edit_news',3);
}
}else{
$result = $db->query("SELECT a.`title`,a.`id`,a.`active`,a.`date`,c.`name`,u.`username` FROM `" . $config['prefix'] . "news` a LEFT JOIN `" . $config['prefix'] . "news_category` c ON a.`category`=c.`id` LEFT JOIN `" . $config['prefix'] . "users` u on a.`author`=u.`uid`") or die($db->error());
while($row=$db->fetch_array($result, MYSQL_ASSOC)){
$row['dates']=date('d.m.Y',$row['date']);
$news[]=$row;
}
$panel->title='Vorhandene Artikel';
$panel->content.='<table class="sortable" width="90%" cellspacing="2">
<tr>
<th align="center">ID</th>
<th align="center">Name</th>
<th align="center">Kategorien</th>
<th align="center">Aktiv</th>
<th align="center">User</th>
<th class="nosort sortcol" align="center" width="18%">Aktionen</th>
</tr>';
if(!empty($news)){
foreach($news as $u){
if($u['active']=='true'){
$u['a']='Ja';
}else{
$u['a']='Nein';
}
$panel->content.='<tr>
<td align="center">'.$u['id'].'</td>
<td align="center">'.$u['title'].'</td>
<td align="center">'.$u['name'].'</td>
<td align="center">'.$u['a'].'</td>
<td align="center">'.$u['username'].'</td>';
$panel->content.='<td align="center"><a onclick="return confirmLink(this, "Willst du wirklich den News '.$u['title'].' l&ouml;schen? ")" href="'.$config['path'].'/admin/index.php?panel=edit_news&amp;action=delete&amp;id='.$u['id'].'"><img src="'.$config['path'].'/admin/images/icons/delete.png" /></a> <a href="'.$config['path'].'/admin/index.php?panel=edit_news&amp;action=edit&amp;id='.$u['id'].'"><img src="'.$config['path'].'/admin/images/icons/wrench.png" /></a></td>
</tr>';
}
}else{
$panel->content.='<tr>
<td align="center" colspan="7">Keine News vorhanden.</td>
</tr>';
}
$panel->content.='</table><br />';
}
}
function meta(){
global $config;
$meta="<script type=\"text/javascript\" src=\"".$config["path"]."/js/jquery/jquery.min.js\"></script>
<script type=\"text/javascript\">
$(document).ready(function()
{
$(\"#url\").blur(function()
{
//remove all the class add the messagebox classes and start fading
$(\"#msgbox\").removeClass().addClass('messagebox').text('Warten...').fadeIn(\"slow\");
//check the username exists or not from ajax
$.post(\"ajax.php\",{ call:'url',url:$(this).val() } ,function(data)
{
if(data==1) //if username not avaiable
{
$(\"#msgbox\").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Url vergeben').addClass('messageboxerror').fadeTo(900,1);
});
}
else
{
$(\"#msgbox\").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('').removeClass().fadeTo(900,1);
});
}
});
});
});
</script>";
$meta.='<script type="text/javascript" src="'.$config["path"].'/js/scriptaculous/prototype.js"></script>
<script src="'.$config["path"].'/js/fastinit.js" type="text/javascript">
</script>
<script src="'.$config["path"].'/js/tablesort.js" type="text/javascript">
</script>';
$meta.='<script type="text/javascript">
function confirmLink(theLink, text)
{
// Confirmation is not required in the configuration file
// or browser is Opera (crappy js implementation)
if (typeof(window.opera) != \'undefined\') {
return true;
}
var is_confirmed = confirm(text);
if (is_confirmed) {
if ( typeof(theLink.href) != \'undefined\' ) {
theLink.href += \'&is_js_confirmed=1\';
} else if ( typeof(theLink.form) != \'undefined\' ) {
theLink.form.action += \'?is_js_confirmed=1\';
}
}
return is_confirmed;
}
</script>';
$meta.='<script type="text/javascript" src="/thirdparty/tiny/tiny_mce_gzip.js"></script>
<script type="text/javascript">
tinyMCE_GZ.init({
theme : "advanced",
mode : "textareas",
language : "de",
plugins : "table,advhr,advimage,advlink,insertdatetime,searchreplace",
disk_cache : true,
debug : false
});
</script>
<script type="text/javascript" src="/thirdparty/tiny/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
theme : "advanced",
mode : "textareas",
language : "de",
plugins : "table,advhr,advimage,advlink,insertdatetime,searchreplace",
theme_advanced_disable : "styleselect,formatselect ",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "seperator,forecolor,removeformat,advhr",
theme_advanced_buttons3 : "tablecontrols,seperator",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "center",
remove_linebreaks : false,
convert_urls : false,
editor_selector : "mceEditor",
editor_deselector : "mceNoEditor"
});
</script>';
return $meta;
}
}
?>

View file

@ -0,0 +1,190 @@
<?php
/**
* Project: astat - simple site engine
* File: /modules/news/editcategory.apnl.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @link http://www.astat.org SVN: $URL: file:///var/local/svn/astat/trunk/modules/news/admin/editcategory.apnl.php $
* @copyright 2009 becast.at
* @author Bernhard Jaud <bernhard at becast dot at>
* @package astat core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: editcategory.apnl.php 96 2010-02-17 21:56:41Z genuineparts $
*/
If (!defined("in_BL_ADMIN")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
}
$session->page_begin("edit news category", True);
class editcategory_news_panel extends admin_module{
function output(){
global $config, $db,$panel, $session, $root, $core, $admin;
$fail=FALSE;
if(isset($_POST['send'])&& $_POST['send']==1){
if(isset($_POST['name'])&& $_POST['name']!=""){
$userfile_name = $_FILES['picture']['name'];
$userfile_tmp = $_FILES['picture']['tmp_name'];
$userfile_size = $_FILES['picture']['size'];
$userfile_type = $_FILES['picture']['type'];
$filedir = $root.'/newsimages/';
$size = 120;
if (isset($_FILES['picture']['name']) && $_FILES['picture']['name']!=""){
$prod_img = $filedir.$userfile_name;
$ret=$core->upload_file($prod_img, $userfile_tmp, $size, $size, TRUE, TRUE);
if($ret!==TRUE){
$panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden <br /> Der Fehler war: ". $ret,TRUE,"editcategory_news");
}
$result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "news_category` WHERE `id`='".intval($_POST["id"])."' LIMIT 1");
$file=$db->fetch_array($result);
@unlink($filedir.$file['picture']);
$db->query("UPDATE `" . $config["prefix"]. "news_category` SET `picture`='".$userfile_name."' WHERE `id`='".intval($_POST["id"])."'");
}elseif($_POST["delimg"]==1){
$result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "news_category` WHERE `id`='".intval($_POST["id"])."' LIMIT 1");
$file=$db->fetch_array($result);
@unlink($filedir.$file['picture']);
$db->query("UPDATE `" . $config["prefix"]. "news_category` SET `picture`='' WHERE `id`='".intval($_POST["id"])."'");
}
$name=$db->escape($_POST['name']);
$active=$db->escape($_POST['active']);
$db->query("UPDATE `" . $config["prefix"]. "news_category` SET `name`='".$name."', `active`='".$active."' WHERE `id`='".intval($_POST["id"])."'") or die($db->error());
$panel->admin_message("Danke", "Die Kategorie wurde erfolgreich editiert!.",TRUE,"editcategory_news");
}else{
$fail="<span style=\"text-align: center; color: red;\">Der Kategoriename muss angegeben werden!</span>";
}
}elseif(isset($_GET['id'])&& $_GET['id']!=""){
if($_GET['action']=="edit"){
$result = $db->query("SELECT * FROM `" . $config["prefix"] . "news_category` WHERE `id`='".intval($_GET['id'])."'");
$_POST=$db->fetch_array($result);
/*$resultna=$db->query("SELECT id,name FROM " . $config["prefix"] . "menue");
while($rowa=$db->fetch_array($resultna)){
$resultn = $db->query("SELECT m_id FROM " . $config["prefix"] . "article_menue WHERE a_id='".intval($_GET['id'])."' and m_id='".$rowa["id"]."'");
if($db->num_rows($resultn) >= 1){
$rowa["checked"]="checked=\"checked\"";
}
$navs[]=$rowa;
}*/
$panel->title="Kategorie editieren";
$panel->form(array("action"=>$config["path"]."/admin/index.php?panel=editcategory_news"),FALSE,"enctype=\"multipart/form-data\"");
if($fail){
$panel->content.=$fail;
}
$panel->content.="<h3>Kategoriename:</h3>";
$panel->field(array("name"=>"name","typ"=>"text","value"=>$_POST["name"]));
if($_POST["picture"]!=""){
$panel->content.="<h3>aktuelles Kategoriebild:</h3>";
$panel->content.="<img src=\"".$config["path"]."/newsimages/".$_POST["picture"]."\" alt=\"Kategoriebild\" />";
$panel->content.="<br />";
$panel->checkbox(array("name"=>"delimg","value"=>"1"));
$panel->content.=" Bild l&ouml;schen?";
$panel->content.="<br />";
}
$panel->content.="<h3>neues Kategoriebild:</h3>";
$panel->field(array("name"=>"picture","typ"=>"file"));
$panel->content.="<br />";
$panel->content.="<h3>Aktiv:</h3>";
$panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active");
$panel->content.="<br />";
$panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1"));
$panel->field(array("name"=>"id","typ"=>"hidden","value"=>$_GET['id']));
$panel->content.="<br />";
$panel->submit();
$panel->formClose();
$panel->parse_page();
}elseif($_GET["action"]=="delete" && $_GET["id"]){
$result=$db->query("SELECT `picture` FROM `" . $config["prefix"] . "news_category` where `id`='".intval($_GET["id"])."'");
$row = $db->fetch_array($result);
@unlink($root.'/catimages/'.$row["picture"]);
$db->query("DELETE FROM `" . $config["prefix"] . "news_category` WHERE `id`='".intval($_GET["id"])."'");
$panel->admin_message("Kategorie gel&ouml;scht!","Die Kategorie wurde erfolgreich gel&ouml;scht.",True,"editcategory_news",3);
}
}else{
$result = $db->query("SELECT * FROM `" . $config["prefix"] . "news_category`");
while($row=$db->fetch_array($result, MYSQL_ASSOC)){
$articles[]=$row;
}
$panel->title="Vorhandene Kategorien";
$panel->content.="<table class=\"sortable\" width=\"90%\" cellspacing=\"2\">
<tr>
<th align=\"center\">ID</th>
<th align=\"center\">Name</th>
<th align=\"center\">Bild</th>
<th align=\"center\">Aktiv</th>
<th class=\"nosort sortcol\" align=\"center\" width=\"18%\">Aktionen</th>
</tr>";
if(!empty($articles)){
foreach($articles as $u){
$panel->content.="<tr>
<td align=\"center\">".$u["id"]."</td>
<td align=\"center\">".$u["name"]."</td>
<td align=\"center\">".$u["picture"]."</td>";
if($u["active"]=="true"){
$panel->content.="<td align=\"center\">Ja</td>";
}else{
$panel->content.="<td align=\"center\">Nein</td>";
}
$panel->content.="<td align=\"center\"><a onclick=\"return confirmLink(this, 'Willst du wirklich die Kategorie ".$u["categoryname"]." l&ouml;schen? ')\" href=\"".$config["path"]."/admin/index.php?panel=editcategory_news&amp;action=delete&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/delete.png\" /></a> <a href=\"".$config["path"]."/admin/index.php?panel=editcategory_news&amp;action=edit&amp;id=".$u["id"]."\"><img src=\"".$config["path"]."/admin/images/icons/wrench.png\" /></a></td>
</tr>";
}
}else{
$panel->content.="<tr>
<td align=\"center\" colspan=\"5\">Keine Kategorien vorhanden.</td>
</tr>";
}
$panel->content.="</table><br />";
}
}
function meta(){
$meta.='<script type="text/javascript" src="'.$config["path"].'/js/scriptaculous/prototype.js"></script>
<script src="'.$config["path"].'/js/fastinit.js" type="text/javascript">
</script>
<script src="'.$config["path"].'/js/tablesort.js" type="text/javascript">
</script>';
$meta.='<script type="text/javascript">
function confirmLink(theLink, text)
{
// Confirmation is not required in the configuration file
// or browser is Opera (crappy js implementation)
if (typeof(window.opera) != \'undefined\') {
return true;
}
var is_confirmed = confirm(text);
if (is_confirmed) {
if ( typeof(theLink.href) != \'undefined\' ) {
theLink.href += \'&is_js_confirmed=1\';
} else if ( typeof(theLink.form) != \'undefined\' ) {
theLink.form.action += \'?is_js_confirmed=1\';
}
}
return is_confirmed;
}
</script>';
return $meta;
}
}
?>

View file

@ -0,0 +1,44 @@
<?php
If (!defined("in_astat")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
}
$session->page_begin("PM Module", FALSE);
class ajaxpm extends ajax_module{
function ajax(){
global $module,$config,$db,$cache, $session;
if($session->userdata['uid']!=0){
$this->tpl= new Smarty();
$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/ajaxpm/templates/'.$config["theme"])){
$this->tpl-> template_dir = $root . '/modules/ajaxpm/templates/'.$config["theme"];
}else{
$this->tpl-> template_dir = $root . '/modules/ajaxpm/templates/default';
}
$mybb=$cache->read('mybbconfig');
$result = $db->query("SELECT `unreadpms` as `count` FROM `" . $mybb["prefix"] . "users` WHERE `uid`='".$session->userdata['fuid']."'");
$row = $db->fetch_array($result, MYSQL_ASSOC);
if($row["count"]>1){
$pmcount=$row["count"];
$s="s";
}elseif($row["count"]==1){
$pmcount="one";
$s="";
}else{
exit();
}
$this->tpl->assign('pmcount',$pmcount);
$this->tpl->assign('s',$s);
echo $this->tpl->fetch('ajaxpm.tpl');
}
}
}
?>

View file

@ -0,0 +1,29 @@
<?php
class module_ajaxpm extends admin_module{
function admin_panels(){
return "";
}
function get_info(){
$info["name"]="AJAX PM Notice";
$info["file"]="ajaxpm";
$info["author"]="astat";
$info["version"]="1.0.0";
$info["url"]="http://www.astat.org";
return $info;
}
function install(){
return TRUE;
}
function uninstall(){
return TRUE;
}
}
?>

View file

@ -0,0 +1,33 @@
<?php
If (!defined("in_astat")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
}
class plugins_ajaxpm{
function register_plugins(& $plugin){
$plugin->use_hook('frontpage_start',array($this,"pm_add"));
}
function pm_add(){
global $db, $config, $footer;
$footer .= "<script type=\"text/javascript\">
<!--
function ajaxpmnotice()
{
$.ajax({
url: \"/ajax.php?task=ajaxpm\",
timeout: 1000,
success: function(data) {
$('.pmnotice').html(data);
}
});
}
ajaxpmnotice();
setInterval(\"ajaxpmnotice()\",120000);
// -->
</script>";
}
}
?>

View file

@ -0,0 +1,23 @@
<div style="position: fixed; right: 60px; top: 40px; width: 360px; z-index: 32765;">
<span style="background-color: #ffffff; display: block; height: 1px; margin: 0 5px; opacity: 0.5;"></span>
<span style="background-color: #000000; border-right: 2px solid #ffffff; border-left: 2px solid #ffffff; display: block; height: 1px; margin: 0 3px; opacity: 0.5;"></span>
<span style="background-color: #000000; border-right: 1px solid #ffffff; border-left: 1px solid #ffffff; display: block; height: 1px; margin: 0 2px; opacity: 0.5;"></span>
<span style="background-color: #000000; border-right: 1px solid #ffffff; border-left: 1px solid #ffffff; display: block; height: 2px; margin: 0 1px; opacity: 0.5;"></span>
<div style="background-color: #000000; border-right: 1px solid #ffffff; border-left: 1px solid #ffffff; color: #ffffff; opacity: 0.5; padding: 0 5px; text-align: center;"><img src="http://forum.ponytopia.net/images/ajaxpmnotice.png" alt="" style="float: left; margin-top: -30px; border:none;" /><strong>You have {$pmcount} unread private message{$s}</strong></div>
<span style="background-color: #000000; border-right: 1px solid #ffffff; border-left: 1px solid #ffffff; display: block; height: 2px; margin: 0 1px; opacity: 0.5;"></span>
<span style="background-color: #000000; border-right: 1px solid #ffffff; border-left: 1px solid #ffffff; display: block; height: 1px; margin: 0 2px; opacity: 0.5;"></span>
<span style="background-color: #000000; border-right: 2px solid #ffffff; border-left: 2px solid #ffffff; display: block; height: 1px; margin: 0 3px; opacity: 0.5;"></span>
<span style="background-color: #ffffff; display: block; height: 1px; margin: 0 5px; opacity: 0.5;"></span>
</div>
<div style="position: fixed; right: 60px; top: 40px; width: 360px; z-index: 32766;">
<span style="background-color: #ffffff; display: block; height: 1px; margin: 0 5px"></span>
<span style="border-right: 2px solid #ffffff; border-left: 2px solid #ffffff; display: block; height: 1px; margin: 0 3px;"></span>
<span style="border-right: 1px solid #ffffff; border-left: 1px solid #ffffff; display: block; height: 1px; margin: 0 2px;"></span>
<span style="border-right: 1px solid #ffffff; border-left: 1px solid #ffffff; display: block; height: 2px; margin: 0 1px;"></span>
<div style="border-right: 1px solid #ffffff; border-left: 1px solid #ffffff; color: #ffffff; padding: 0 5px; text-align: center;"><img src="http://forum.ponytopia.net/images/ajaxpmnotice.png" alt="" style="float: left; margin-top: -30px; border: none;" /><a href="http://forum.ponytopia.net/private.php" target="_blank" style="color: #ffffff; text-decoration: none;">
<strong>You have {$pmcount} unread private message{$s}</strong></a></div>
<span style="border-right: 1px solid #ffffff; border-left: 1px solid #ffffff; display: block; height: 2px; margin: 0 1px;"></span>
<span style="border-right: 1px solid #ffffff; border-left: 1px solid #ffffff; display: block; height: 1px; margin: 0 2px;"></span>
<span style="border-right: 2px solid #ffffff; border-left: 2px solid #ffffff; display: block; height: 1px; margin: 0 3px;"></span>
<span style="background-color: #ffffff; display: block; height: 1px; margin: 0 5px;"></span>
</div>

View file

@ -0,0 +1,92 @@
<?php
class module_captcha extends admin_module{
function admin_panels(){
$panels=array(array("manage_captcha","Captcha verwalten","manage_captcha"));
return $panels;
}
function get_info(){
$info["name"]="Captcha Management";
$info["file"]="captcha";
$info["author"]="BeCast";
$info["version"]="1.0.0";
$info["url"]="http://www.becast.at";
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) NOT NULL,
`edittime` int(11) NOT 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);
}
}
?>

BIN
modules/chat/KeyStore.jks Normal file

Binary file not shown.

View file

@ -0,0 +1,126 @@
<?php
/**
* Project: astat - simple site engine
* File: /modules/mybb/admin.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 2010 becast.at
* @author Bernhard Jaud <bernhard at becast dot at>
* @package astat module
* @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("chat_admin", True);
class manage_chat_panel extends admin_module{
function output(){
global $config, $db,$panel, $cache, $session;
if(isset($_POST['start'])){
$istat = $this->get_status();
exec('/sbin/status topia|awk \'{ print $4}\'',$cat);
$cat = trim($cat[0]);
if($istat==2 && $cat!="not"){
shell_exec("kill -9 ".$cat);
sleep(5);
shell_exec("sudo /sbin/restart topia");
}else{
shell_exec("sudo /sbin/restart topia");
}
$panel->admin_message("Triggered", 'The Chatstart has been triggered. please refresh the page to see if it was successful.',TRUE,"manage_chat");
}elseif(isset($_POST['emergency'])){
$istat = $this->get_status();
if($istat==1){
shell_exec("sudo /sbin/restart topia");
}elseif($istat==2){
shell_exec("sudo /sbin/restart topia");
}
$panel->admin_message("Triggered", 'The Emergency Chatrestart has been triggered. please refresh the page to see if it was successful.',TRUE,"manage_chat");
}else{
$count=false;
$panel->title="Manage Chat";
$panel->form(array('action'=>$config['path'].'/admin/index.php?panel=manage_chat'));
$panel->content.='<h3>Status:</h3>';
$istat = $this->get_status();
$status = $this->get_readable_status($istat);
$panel->content.=$status.'<br />';
if($istat==1){
$extra='disabled="disabled"';
}
$panel->submit(array('name'=>'start'),'value="Start"'.$extra);
$panel->submit(array('name'=>'emergency'),'value="Emergency Restart"');
$panel->formClose();
}
}
function get_readable_status($status){
global $db, $config, $cache, $log;
if($status==1){
exec('/sbin/status topia|awk \'{ print $4}\'',$cat);
$cat = trim($cat[0]);
return '<span style="color:green;">OK - Running - Process ID: '.$cat.'</span>';
}elseif($status==2){
exec('/sbin/status topia|awk \'{ print $4}\'',$cat);
$cat = trim($cat[0]);
return '<span style="color:red;">ALERT - Zombie - Process ID: '.$cat.'</span>';
}else{
return '<span style="color:red;">ALERT - Stopped</span>';
}
}
function get_status(){
global $db, $config, $cache, $log;
$dat="/sbin/status topia|awk '{ print $4}'";
exec($dat,$cat);
$cat = trim($cat[0]);
if($cat!='not'){
exec("ps ax|grep ".$cat."|grep -v grep",$ps);
$psr = preg_split("/\s/", $ps[0]);
$psr = $this->removeEmptyValues($psr);
$status = $psr[2];
$status=substr($status, 0, 1);
if($status=="S"||$status=="R"){
return 1;
}elseif($status=="Z"){
return 2;
}else{
return 0;
}
}else{
return 0;
}
}
function removeEmptyValues($ar)
{
$result = array();
foreach($ar as $value){
$value = trim($value);
if (strlen($value))
$result[] = $value;
}
return $result;
}
}
?>

429
modules/chat/chat.ajax.php Normal file
View file

@ -0,0 +1,429 @@
<?php
If (!defined("in_astat")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
}
$addnav["right"]=FALSE;
$session->page_begin("Text Module", FALSE);
class chat extends ajax_module{
function ajax(){
global $session,$config,$db,$tpl,$log,$error,$ccache;
$curl='chat';
$locs=array('default'=>array(array('title'=>'N/A','name'=>'nolocation','icon'=>'nolocation.png')),'Ponyville'=>array(array('title'=>'N/A','name'=>'nolocation','icon'=>'nolocation.png'),array('title'=>'Marketplace','name'=>'marketplace','icon'=>'marketplace.png'),array('title'=>'SCC','name'=>'candycane','icon'=>'candycane.png'),array('title'=>'SAA','name'=>'apple','icon'=>'apple.png'),array('title'=>'Library','name'=>'book','icon'=>'book.png'),array('title'=>'Fountain','name'=>'fountain','icon'=>'fountain.png'),array('title'=>'Spa','name'=>'spa','icon'=>'spa.png'),array('title'=>'Hospital','name'=>'redcross','icon'=>'redcross.png'),array('title'=>'Guard-House','name'=>'shield','icon'=>'shield.png'),array('title'=>'Home','name'=>'house','icon'=>'house.png')),'Wilds'=>array(array('title'=>'N/A','name'=>'nolocation','icon'=>'nolocation.png'),array('title'=>'Everfree Forest','name'=>'everfree','icon'=>'everfree.png'),array('title'=>'Zecoras Hut','name'=>'zecora','icon'=>'zecora.png'),array('title'=>'Ghastly Gorge','name'=>'ghastlygorge','icon'=>'ghastlygorge.png'),array('title'=>'Old Castle Ruins','name'=>'castle','icon'=>'castle.png')));
$weather=array('clear'=>array('day'=>array('name'=>'Sunny Day'),'night'=>array('name'=>'Clear Night')),'cloudy'=>array('night'=>array('name'=>'Cloudy Night'),'day'=>array('name'=>'Cloudy Day')),'drizzle'=>array('name'=>'Drizzle'),'rain'=>array('name'=>'Rain'),'rainbow'=>array('name'=>'Rainbow'),'fog'=>array('name'=>'Foggy'),'thunderstorm'=>array('name'=>'Thunderstorm'),'overcast'=>array('name'=>'Overcast'),'snow'=>array('name'=>'Snowing'),'snowstorm'=>array('name'=>'Blizzard'),'winter'=>array('name'=>'Winter'),'storm'=>array('name'=>'Stormy'));
$adminweather=array('magicstorm'=>array('name'=>'Magical Storm'));
function daytime() {
$now = time();
$sunrise = date_sunrise($now, SUNFUNCS_RET_TIMESTAMP, 47.6880, 13.1344);
$sunset = date_sunset( $now, SUNFUNCS_RET_TIMESTAMP, 47.6880, 13.1344);
return ($sunrise < $now && $now < $sunset);
}
if($_POST['call']=='userlist'){
if($session->userdata['uid']!=0){
/*if (!$fh = fopen('http://'.$curl.':'.$config['SOCK_PORT'].'/room?yacsid='.$_GET['yacsid'], 'r')){
return false;
}
// Read data and close
while(!feof($fh))
$content .= fread($fh, 1024);
fclose($fh);*/
//$content = $ccache->get('userroom'.$_GET['yacsid']);
$room = json_decode($_POST['dat']);
//{"roomname":"Lounge","usercolor":"25a1ed","roomusers":[{"nick":"genuineparts","color":"25a1ed","typing":false,"notice":0}]}
foreach($room->roomusers as $user) {
if($user->notice==0){
$notice='notice_off.png';
}else{
$notice='notice_on.png';
}
$result = $db->query("SELECT * FROM `aa_v_nickpage` WHERE `username`='".$user->nick."'");
$gender = $db->fetch_array($result);
if($gender['fid3']=='m'){
$gen='male';
}elseif($gender['fid3']=='w'){
$gen='female';
}else{
$gen='na';
}
if($session->userdata['rp_admin']==1){
$js="var menu = [
{ name: \"kick\", action: function (element) { window.socket.send(\"/k \"+$(element).attr('id')); } },
{ name: \"jail\", action: function (element) { window.socket.send(\"/jail \"+$(element).attr('id')); } },
{ name: \"gag\", action: function (element) { window.socket.send(\"/gag \"+$(element).attr('id')); } },
{ name: \"toggle private\", action: function (element) { window.socket.send(\"/tpc \"+$(element).attr('id')); } },
{ name: \"ignore\", action: function (element) { window.socket.send(\"/ig \"+$(element).attr('id')); } },
{ name: \"invite\", action: function (element) { window.socket.send(\"/i \"+$(element).attr('id')); } },
{ name: \"catch\", action: function (element) { window.socket.send(\"/c \"+$(element).attr('id')); } },
{ name: \"whisperwindow\", action: function (element) { if ($('#'+$(element).attr('id')+'_whisper').length > 0){
$('#'+$(element).attr('id')+'_whisper').dialog('open');
$('#'+$(element).attr('id')+'_whisper').dialog('moveToTop');
}else{
cwhisp($(element).attr('id'),\"\");
} } },
{ name: \"report\", action: function (element) { reportwindow($(element).attr('id')); } },
{ name: \"reports\", action: function (element) { window.socket.send(\"/rel \"+$(element).attr('id')); } }
];";
}else{
$js="var menu = [
{ name: \"ignore\", action: function (element) { window.socket.send(\"/ig \"+$(element).attr('id')); } },
{ name: \"invite\", action: function (element) { window.socket.send(\"/i \"+$(element).attr('id')); } },
{ name: \"whisperwindow\", action: function (element) { if ($('#'+$(element).attr('id')+'_whisper').length > 0){
$('#'+$(element).attr('id')+'_whisper').dialog('open');
$('#'+$(element).attr('id')+'_whisper').dialog('moveToTop');
}else{
cwhisp($(element).attr('id'),\"\");
} } },
{ name: \"report\", action: function (element) { reportwindow($(element).attr('id')); } }
];";
}
$users[]=array('nick'=>$user->nick,'color'=>$user->color,'notice'=>$notice,'gender'=>$gen,'typing'=>$user->typing,'location'=>$location);
}
$tpl->assign('col',$room->usercolor);
$tpl->assign('room',$room->roomname);
$tpl->assign('users',$users);
$tpl->assign('js',$js);
return $tpl->fetch($config['fullpath'].'/modules/chat/templates/default/userlist.tpl');
}
}
if($_POST['call']=='rooms'){
if($session->userdata['uid']!=0){
$rooms = json_decode($_POST['dat']);
foreach($rooms as $room) {
if($session->userdata['allow_grimdark']==0 && $room->type=='grimdark'){
continue;
}
$userlist[$room->room]['s'] = $room->lock;
$userlist[$room->room]['g'] = $room->type;
$userlist[$room->room]['u'] = array();
$i=0;
foreach($room->users as $user) {
if($user->notice==0){
$notice='notice_off.png';
}else{
$notice='notice_on.png';
}
$result = $db->query("SELECT * FROM `aa_v_nickpage` WHERE `username`='".$nick."'");
$gender = $db->fetch_array($result);
if($gender['fid3']=='m'){
$gen='male';
}elseif($gender['fid3']=='w'){
$gen='female';
}else{
$gen='na';
}
$userlist[$room->room]['u'][$i]['c'] = $user->color;
$userlist[$room->room]['u'][$i]['n'] = $user->nick;
$userlist[$room->room]['u'][$i]['i'] = $notice;
$userlist[$room->room]['u'][$i]['g'] = $gen;
$userlist[$room->room]['u'][$i]['l'] = $location;
$i++;
}
}
if($session->userdata['rp_admin']==1){
$js="var menu = [
{ name: \"kick\", action: function (element) { window.socket.send(\"/k \"+$(element).attr('id')); } },
{ name: \"jail\", action: function (element) { window.socket.send(\"/jail \"+$(element).attr('id')); } },
{ name: \"gag\", action: function (element) { window.socket.send(\"/gag \"+$(element).attr('id')); } },
{ name: \"toggle private\", action: function (element) { window.socket.send(\"/tpc \"+$(element).attr('id')); } },
{ name: \"ignore\", action: function (element) { window.socket.send(\"/ig \"+$(element).attr('id')); } },
{ name: \"invite\", action: function (element) { window.socket.send(\"/i \"+$(element).attr('id')); } },
{ name: \"catch\", action: function (element) { window.socket.send(\"/c \"+$(element).attr('id')); } },
{ name: \"whisperwindow\", action: function (element) { if ($('#'+$(element).attr('id')+'_whisper').length > 0){
$('#'+$(element).attr('id')+'_whisper').dialog('open');
$('#'+$(element).attr('id')+'_whisper').dialog('moveToTop');
}else{
cwhisp($(element).attr('id'),\"\");
} } },
{ name: \"report\", action: function (element) { reportwindow($(element).attr('id')); } },
{ name: \"reports\", action: function (element) { window.socket.send(\"/rel \"+$(element).attr('id')); } }
];";
}else{
$js="var menu = [
{ name: \"ignore\", action: function (element) { window.socket.send(\"/ig \"+$(element).attr('id')); } },
{ name: \"invite\", action: function (element) { window.socket.send(\"/i \"+$(element).attr('id')); } },
{ name: \"report\", action: function (element) { reportwindow($(element).attr('id')); } }
];";
}
$tpl->assign('users',$userlist);
$tpl->assign('js',$js);
return $tpl->fetch($config['fullpath'].'/modules/chat/templates/default/allroomlist.tpl');
}
}
if($_GET['call']=='col'){
if(isset($_GET['yacsid']) && $_GET['yacsid']!='' && $session->userdata['uid']!=0){
if (!$fh = fopen('http://'.$curl.':'.$config['SOCK_PORT'].'/room?yacsid='.$_GET['yacsid'], 'r')){
return false;
}
// Read data and close
while(!feof($fh))
$content .= fread($fh, 1024);
fclose($fh);
$content = trim($content);
$stuff = explode('/', $content);
return $stuff[0];
}
}
if($_GET['call']=='notice'){
if(isset($_GET['yacsid']) && $_GET['yacsid']!='' && $_GET['nuser']!='' && $session->userdata['uid']!=0){
if (!$fh = fopen('http://'.$curl.':'.$config['SOCK_PORT'].'/notice?yacsid='.$_GET['yacsid'].'&nuser='.$_GET['nuser'], 'r')){
return false;
}
// Read data and close
while(!feof($fh))
$content .= fread($fh, 1024);
fclose($fh);
return trim($content);
}
}
if($_GET['call']=='groupnotice'){
if(isset($_GET['yacsid']) && $_GET['yacsid']!='' && $_GET['ngroup']!='' && $_GET['user']!='' && $session->userdata['uid']!=0){
$res = $db->query("SELECT u.`name` FROM `yac_users` c LEFT JOIN `" . $config["prefix"] . "rp_chars` u ON u.`id`=c.`uid` WHERE c.`location`='".$db->escape($_GET['ngroup'])."' AND c.`uid` <> '".intval($_GET['user'])."'");
while($dat = $db->fetch_array($res)){
if (!$fh = fopen('http://'.$curl.':'.$config['SOCK_PORT'].'/notice?yacsid='.$_GET['yacsid'].'&nuser='.$dat['name'], 'r')){
return false;
}
// Read data and close
fclose($fh);
}
return TRUE;
}
}
if($_GET['call']=='getlocations'){
if($_GET['room']!='' && $_GET['room']!='null' && $_GET['chid']!='' && $session->userdata['uid']!=0){
$locations = '<div style="padding-right:1px; width:18px; float:left;"><a class="loc" id="reset"><img title="Remove Location" alt="Remove Location" src="/modules/chat/locations/remove.png" style="border:0;"/></a></div>';
if(!is_array($locs[$_GET['room']])){
$locs[$_GET['room']]=$locs['default'];
}
$res = $db->query("SELECT `location` FROM `ptc_users` WHERE `uid`='".intval($_GET['chid'])."' LIMIT 1");
$dat = $db->fetch_array($res);
foreach($locs[$_GET['room']] as $loc){
if($dat['location'] == $loc['name']){
$locations .= '<div style="padding-right:1px; width:18px; float:left;"><a class="loc" id="'.$loc['name'].'"><img title="'.$loc['title'].'" alt="'.$loc['title'].'" src="/modules/chat/locations/'.$loc['icon'].'" style="padding:1px; border:2px solid #FFFF00;"/></a><br/><a class="setgroup" id="'.$loc['name'].'"><img title=" Toggle '.$loc['title'].' for notifications" alt="Set '.$loc['title'].' for notifications" src="/themes/ponytopia/images/notice_on.png" style="padding:2px;"/></a></div>';
}else{
$locations .= '<div style="padding-right:1px; width:18px; float:left;"><a class="loc" id="'.$loc['name'].'"><img title="'.$loc['title'].'" alt="'.$loc['title'].'" src="/modules/chat/locations/'.$loc['icon'].'" style="padding:2px; border:0;"/></a><br/><a class="setgroup" id="'.$loc['name'].'"><img title=" Set '.$loc['title'].' for notifications" alt="Toggle '.$loc['title'].' for notifications" src="/themes/ponytopia/images/notice_on.png" style="padding:2px;"/></a></div>';
}
}
if($session->userdata['uid']==1){
$locations.='<div style="padding-right:1px; width:18px; float:left;"><a class="loc" id="coding"><img title="Coding" alt="coding" src="/modules/chat/locations/coding.png" style="padding:4px; border:0;"/></a></div>';
}
return $locations.'<br style="clear:left;" />';
}
}
if($_GET['call']=='setlocation'){
if($_GET['chid']!='' && $_GET['location']!='' && $session->userdata['uid']!=0){
if($_GET['location']=='reset'){
$_GET['location']='';
}
$db->query("UPDATE `ptc_users` SET `location`='".$db->escape($_GET['location'])."' WHERE `uid`='".intval($_GET['chid'])."'");
}
}
if($_GET['call']=='getweather'){
if($session->userdata['uid']!=0 && $_GET['chid']!=''){
if($_GET['weather']=="none"){
return '<img src="/modules/chat/weather/none.png" title="None" alt="This Room has no weather enabled or does not provide Weather information" />';
}else{
$teamset='';
$lock='';
$uweather=array_merge($weather, $adminweather);
$curweather=$weather[$_GET['weather']];
//$res = $db->query("SELECT `weatherteam` FROM `" . $config["prefix"] . "rp_chars` WHERE `id`='".intval($_GET['chid'])."'");
//$team = $db->fetch_array($res);
if($_GET['can']=='true' || $session->userdata['rp_admin']=='1'){
if($config['weatherlocked']==1 && $session->userdata['weather_admin']!='1')
{
$lock=' disabled="disabled"';
}else{
$lock='';
}
$teamset = '<br /><select'.$lock.' name="setweather" onchange="setweather(this.value)">';
if($session->userdata['weather_admin']=='1')
{
$weather=array_merge($weather, $adminweather);
}
foreach($weather as $key=>$value){
if($_GET['weather']==$key){
$current=' selected="selected"';
}else{
$current='';
}
if(isset($value['day']) && isset($value['night'])){
$teamset .='<option'.$current.' value="'.$key.'">'.ucfirst($key).'</option>';
}else{
$teamset .='<option'.$current.' value="'.$key.'">'.$value['name'].'</option>';
}
}
$teamset .='</select>';
}
if($session->userdata['weather_admin']=='1'){
if($config['weatherlocked']==1){
$checked='checked="checked"';
}
$teamset .='<br /><input type="checkbox" '.$checked.' name="lockweather" onchange="setlock(this.value)" /><span style="color:#ffffff">Weatherlock</span>';
}
if(isset($curweather['day']) && isset($curweather['night'])){
$daytime=daytime();
if($daytime || $config['forceday']==1){
$wt[$_GET['weather'].'_day']=$curweather['day'];
$wt['name']=$curweather['day']['name'];
}elseif($config['forcenight']==1){
$wt[$_GET['weather'].'_night']=$curweather['night'];
$wt['name']=$curweather['night']['name'];
}else{
$wt[$_GET['weather'].'_night']=$curweather['night'];
$wt['name']=$curweather['night']['name'];
}
return '<img src="/modules/chat/weather/'.key($wt).'.png" title="'.$wt['name'].'" alt="'.$wt['name'].'" />'.$teamset;
}else{
$wt=$curweather;
}
return '<img src="/modules/chat/weather/'.$_GET['weather'].'.png" title="'.$wt['name'].'" alt="'.$wt['name'].'" />'.$teamset;
}
}
}
if($_GET['call']=='setweather'){
if($session->userdata['uid']!=0 && $_GET['chid']!='' && $_GET['weather']!=''){
if($config['weatherlocked']!=1 || $session->userdata['weather_admin']==1)
{
$teamset='';
$curweather=$weather[$config['weather']];
$res = $db->query("SELECT `weatherteam` FROM `" . $config["prefix"] . "rp_chars` WHERE `id`='".intval($_GET['chid'])."'");
$team = $db->fetch_array($res);
if($team['weatherteam']=='true' || $session->userdata['rp_admin']=='1'){
$result = $db->query("UPDATE `" . $config["prefix"] . "config` SET `value`='".$db->escape($_GET['weather'])."' WHERE `name`='weather'");
}
}
}
}
if($_GET['call']=='setlock'){
if($session->userdata['uid']!=0 && $session->userdata['weather_admin']=='1'){
if($config['weatherlocked']==1)
{
$db->query("UPDATE `" . $config["prefix"] . "config` SET `value`='0' WHERE `name`='weatherlocked'");
}else{
$db->query("UPDATE `" . $config["prefix"] . "config` SET `value`='1' WHERE `name`='weatherlocked'");
}
}
}
if($_GET['call']=='chars'){
$chars='';
$result = $db->query("SELECT `name` FROM `" . $config["prefix"] . "rp_chars` WHERE `name` LIKE '".$db->escape($_GET['term'])."%'");
while($n = $db->fetch_array($result)){
$chars[] = $n['name'];
}
if(!empty($chars)){
return '["'.join($chars,'","').'"]';
}
}
if($_GET['call']=='users'){
$chars='';
$result = $db->query("SELECT `username` FROM `" . $config["prefix"] . "users` WHERE `username` LIKE '".$db->escape($_GET['term'])."%'");
while($n = $db->fetch_array($result)){
$chars[] = $n['username'];
}
if(!empty($chars)){
return '["'.join($chars,'","').'"]';
}
}
if($_GET['call']=='adduser'){
$result = $db->query("SELECT `uid`,`username` FROM `" . $config["prefix"] . "users` WHERE `username` = '".$db->escape($_GET['user'])."'");
if($db->num_rows($result)<=0){
return false;
}else{
$dat = $db->fetch_array($result);
$results = $db->query("SELECT * FROM `" . $config["prefix"] . "conversations` WHERE `id` = '".$db->escape($_GET['cid'])."' AND `owner`='".$session->userdata['uid']."'");
$datr=$db->fetch_array($results);
if($db->num_rows($results)<=0){
return false;
}else{
$resultss = $db->query("SELECT * FROM `" . $config["prefix"] . "conversations` WHERE `room` = '".$db->escape($datr['room'])."' AND `timestamp`='".$db->escape($datr['timestamp'])."'");
while($row = $db->fetch_array($resultss)){
$users[] = $row['uid'];
}
if(!in_array($dat['uid'],$users)){
$db->query("INSERT INTO `" . $config["prefix"] . "conversations` (`uid`,`owner`,`room`,`timestamp`,`shared`) VALUES ('".$db->escape($dat['uid'])."','".$db->escape($datr['owner'])."','".$db->escape($datr['room'])."','".$db->escape($datr['timestamp'])."','')");
return $dat['uid'];
}else{
return false;
}
}
}
}
if($_GET['call']=='repdelete'){
if($session->userdata['rp_admin']=='1'){
$db->query("DELETE FROM `ptc_reports` WHERE `rid` = '".intval($_GET['id'])."'");
}
}
if($_GET['call']=='repseen'){
if($session->userdata['rp_admin']=='1'){
$db->query("UPDATE `ptc_reports` SET `seen`=1 WHERE `rid` = '".intval($_GET['id'])."'");
}
}
if($_GET['call']=='repunseen'){
if($session->userdata['rp_admin']=='1'){
$sql="UPDATE `ptc_reports` SET `seen`='0' WHERE `rid` = '".intval($_GET['id'])."'";
echo $sql;
$db->query("UPDATE `ptc_reports` SET `seen`='0' WHERE `rid` = '".intval($_GET['id'])."'");
}
}
if($_GET['call']=='deleteuser'){
$results = $db->query("SELECT `room` FROM `" . $config["prefix"] . "conversations` WHERE `id` = '".$db->escape($_GET['cid'])."' AND `owner`='".$session->userdata['uid']."'");
$datr=$db->fetch_array($results);
$db->query("DELETE FROM `" . $config["prefix"] . "conversations` WHERE `uid` = '".$db->escape($_GET['id'])."' AND `room` = '".$db->escape($datr['room'])."' AND `owner`='".$session->userdata['uid']."'");
}
if($_GET['call']=='public'){
$results = $db->query("SELECT u.`username`, c.`shared` FROM `" . $config["prefix"] . "conversations` c LEFT JOIN `" . $config["prefix"] . "users` u ON c.`uid`=u.`uid` WHERE c.`id` = '".$db->escape($_GET['id'])."' AND c.`owner`='".$session->userdata['uid']."'");
$datr=$db->fetch_array($results);
if($datr['shared']==''){
$key =$session->generate_Key();
$db->query("UPDATE `" . $config["prefix"] . "conversations` SET `shared`='".$key."' WHERE `id` = '".$db->escape($_GET['id'])."' AND `owner`='".$session->userdata['uid']."'");
return '//logs.'.$config['domain'].'/user/'.$datr['username'].'/key/'.$key;
}else{
$db->query("UPDATE `" . $config["prefix"] . "conversations` SET `shared`='' WHERE `id` = '".$db->escape($_GET['id'])."' AND `owner`='".$session->userdata['uid']."'");
return false;
}
}
if($_GET['call']=='bg_music'){
$result = $db->query("UPDATE `" . $config["prefix"] . "rp_chars` SET `bgmusic`='".$db->escape($_GET['value'])."' WHERE `id`='".$db->escape($_GET['char'])."' AND `uid`='".$session->userdata['uid']."'");
}
if($_GET['call']=='wh'){
$result = $db->query("UPDATE `ptc_users` SET `whisperwindow`='".$db->escape($_GET['value'])."' WHERE `uid`='".$session->userdata['uid']."'");
}
if($_GET['call']=='noticech'){
$result = $db->query("UPDATE `ptc_users` SET `notice`='".$db->escape($_GET['value'])."' WHERE `uid`='".$session->userdata['uid']."'");
}
if($_GET['call']=='subm'){
$result = $db->query("UPDATE `ptc_users` SET `submit`='".$db->escape($_GET['value'])."' WHERE `uid`='".$session->userdata['uid']."'");
}
}
}
?>

54
modules/chat/chat.js Normal file
View file

@ -0,0 +1,54 @@
document.domain = "ponytopia.net";
function notice() {
document.getElementById('notice').play();
}
function play(source) {
if(window.parent.bgmusic!=false){
updateSource(source);
document.getElementById('audioPlayer').play();
}
}
function changenotice(file) {
var zeit = new Date();
var ms = zeit.getMilliseconds();
var audio = $('#notice').empty();
var newSrc = $("<source>").attr("src", "//chat.ponytopia.net/modules/chat/sound/"+file+"_notice.ogg?id="+ms).appendTo(audio);
var newSrc2 = $("<source>").attr("src", "//chat.ponytopia.net/modules/chat/sound/"+file+"_notice.mp3?id="+ms).appendTo(audio);
audio[0].pause();
audio[0].load();
}
function reload_locations() {
window.parent.refresh();
}
function pause() {
document.getElementById('audioPlayer').pause();
}
var as=true;
var asoff=false;
function doscroll() {
if (as != false && asoff==false) {
window.scrollTo(1, 500000);
}
window.setTimeout("doscroll()", 200);
}
function scroll_toggle() {
if(as==false){
as=true;
window.scroll(1, 500000);
}else{
as=false;
}
}
doscroll();
function updateSource(file) {
var zeit = new Date();
var ms = zeit.getMilliseconds();
var audio = $('#audioPlayer');
$('#oggSource').attr('src',"//chat.ponytopia.net/modules/chat/sound/"+file+".ogg?id="+ms).detach().appendTo($('#audioPlayer'));
$('#mp3Source').attr('src',"//chat.ponytopia.net/modules/chat/sound/"+file+".mp3?id="+ms).detach().appendTo($('#audioPlayer'));
audio[0].pause();
audio[0].load();
}

View file

@ -0,0 +1,92 @@
<?php
class module_chat extends admin_module{
function admin_panels(){
$panels=array(array("manage_chat","Manage Chat","server_edit"));
return $panels;
}
function get_info(){
$info["name"]="PT Chat";
$info["file"]="chat";
$info["author"]="grease";
$info["version"]="1.1.0";
$info["url"]="http://www.ponytopia.net";
//$info["depends"]='mybb_bridge';
return $info;
}
function install(){
global $config, $db;
/*$db->query("CREATE TABLE IF NOT EXISTS `yac_users` (
`uid` int(11) NOT NULL,
`color` varchar(7) NOT NULL,
`lastonline` int(11) NOT NULL,
`chattime` bigint(20) NOT NULL,
`rights` smallint(6) NOT NULL,
KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
$db->query("INSERT INTO `" . $config["prefix"] . "config_categorys` (
`cid` ,
`categoryname`
)
VALUES (
NULL , 'yac Chat'
);");
$cid=$db->last_id();
$db->query("INSERT INTO `" . $config["prefix"] . "config` (`name`, `value`, `title`, `description`, `option`, `category`) VALUES
('LOGINKEY', 'zuzfshgw8qitr813841492', 'Loginkey', 'Der Secure Key des Chats.', 'text', ".$cid."),
('SOCK_PORT', '8090', 'Chatport', 'Der Port auf dem der Server läuft.', 'text', ".$cid."),
('ENABLE_WATCHSERVER', '', 'Watchserver einschalten', 'Soll der Watchserver aktiviert werden?.', 'select(Ja|true;Nein|false)', ".$cid."),
('SMILIES_URL', 'http://forum.recensio.org/', 'Smilieurl', 'Die Url zu den Smiliebildern', 'text', ".$cid.");");
$db->query("CREATE VIEW `v_yac_users` AS select `u`.`id` AS `uid`,`u`.`name` AS `name`,`c`.`color` AS `color`,`c`.`lastonline` AS `lastonline`,`c`.`rights` AS `rights`,`c`.`chattime` AS `chattime`,`u`.`bgmusic` AS `bgmusic` from `" . $config["prefix"] . "rp_chars` `u` left join `yac_users` `c` ON `u`.`id` = `c`.`uid`");
$db->query("CREATE TABLE IF NOT EXISTS `yac_chatlog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`user` varchar(50) CHARACTER SET latin1 NOT NULL,
`color` varchar(6) CHARACTER SET latin1 NOT NULL,
`room` varchar(30) CHARACTER SET latin1 NOT NULL,
`timestamp` int(11) NOT NULL,
`action` varchar(25) CHARACTER SET latin1 NOT NULL,
`text` text CHARACTER SET latin1 NOT NULL,
PRIMARY KEY (`id`),
KEY `user` (`user`),
KEY `room` (`room`),
KEY `timestamp` (`timestamp`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
/*$db->query("CREATE PROCEDURE `sp_yac_saveuserdata`(vUID INT(11), vColor VARCHAR(6), vLastonline INT(11), vChattime BIGINT(20))
BEGIN
SET @x = (SELECT COUNT(`uid`) FROM `yac_users` WHERE `uid` = vUID);
IF @x >= 1 THEN
UPDATE `yac_users` SET `color` = vColor, `lastonline` = vLastonline, `chattime` = vChattime WHERE `uid` = vUID;
ELSE
INSERT INTO `yac_users` (`uid`, `color`, `lastonline`, `chattime`) VALUES (vUID, vColor, vLastonline, vChattime);
END IF;
END");
if($db->error()!=""){
return $db->error();
}*/
return true;
}
function uninstall(){
global $config, $db;
//$db->query("DROP VIEW `v_yac_users`");
//$db->query("DROP VIEW `v_yac_smilies`");
//$db->query("DROP TABLE `yac_users`");
//$db->query("DELETE FROM `" . $config["prefix"] . "config_categorys` WHERE categoryname='yac Chat'");
//$db->query("DELETE FROM `" . $config["prefix"] . "config` WHERE name in ('LOGINKEY','SOCK_PORT','ENABLE_WATCHSERVER','SMILIES_URL')");
return TRUE;
}
}
?>

1282
modules/chat/chat.output.php Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,56 @@
<?php
If (!defined("in_astat")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
}
include dirname(__FILE__).'/chatfunctions.inc.php';
class plugins_chat{
function register_plugins(& $plugin){
$plugin->use_hook('nav_finish',array($this,"cusers"));
$plugin->use_hook('frontpage_start',array($this,"cusers_head"));
$plugin->use_hook('register_end',array($this,"register"));
$plugin->use_hook('register_openid_end',array($this,"register"));
$plugin->use_hook('admin_user_before_delete',array($this,"delete"));
$plugin->use_hook('admin_user_after_create',array($this,"register"));
}
function cusers(& $cont){
global $db, $config, $session;
$data=chat_online();
if ($data["chat_offline"]===true){
$data['usercount']='offline';
}
$cont=str_replace('[users]',$data['usercount'],$cont);
}
function cusers_head($tpl){
global $db, $config, $session, $log;
$data=chat_online();
if ($data["chat_offline"]===true){
$tpl->assign('users',"offline");
return;
}else{
$tpl->assign('users',$data['usercount']);
}
}
function userlist(){
global $db, $config, $rightnav;
$rightnav.='<div id="functions"><span id="colorSelector" style="float:left;"><div id="bgcol" style="background-color: #ffffff"></div></span></div>';
return;
}
function register($rdata){
global $db, $config, $session, $functions;
$db->query("INSERT INTO `ptc_users` (`uid`, `color`, `whisperwindow`, `submit`) VALUES ('".$rdata["uid"]."','000000','true',1)");
}
function delete($rdata){
global $db, $config, $session, $functions;
$db->query("DELETE FROM `ptc_users` WHERE `uid` = '".$rdata["uid"]."'");
}
}
?>

View file

@ -0,0 +1,46 @@
{$header}
<aside id="library" style="display:none;">
<img src="http://www.ponytopia.net/images/nightsky.png" id="nightsky" />
<img src="http://www.ponytopia.net/images/big-glow.png" id="big-glow" />
<img src="http://www.ponytopia.net/images/small-glow.png" id="small-glow" />
</aside>
<div id="chat-content-wrap">
<div id="chat-content">
<div id="chat" style="height:100%;">
<h2 class='roomname' style="color:#{$col};">{$username}</h2>
<div class="topbar"><a id="notchan">Yay!</a> | <a href="http://forum.ponytopia.net/help-8.html" target="_blank" onclick="return popup('http://forum.ponytopia.net/help-8.html','width=800, height=800, resizeable,scrollbars=yes');">Help</a> | <a href="http://forum.ponytopia.net/misc.php?action=smilies&amp;popup=true" target="_blank" onclick="return popup('http://forum.ponytopia.net/misc.php?action=smilies&amp;popup=true','width=600, height=600, resizeable,scrollbars=yes');">Smilies</a> | <a href="http://chat.ponytopia.net/logs.html" target="_blank">Logs</a> | <a id="notsw">Notice: On</a> | <a id="scrolling">Scrolling: On</a> | <a id="whwindow">{$whtext}</a> | <a id="ooc">{$ooctext}</a> | <a id="bgmusic">{$bgmusic}</a> | <a id="submit">{$submit}</a> | <a id="logout">Logout</a></div>
<div id="chatlog" style="z-index:1; height:600px; position:relative;"></div>
<span style="padding-top:3px; padding-bottom:3px;">
&nbsp;
{$simg} <textarea id="text" autocomplete="off" spellcheck="true" style="z-index:2; float: right; position: relative; background: none repeat scroll 0 0 #12120F; border: 1px solid #FFFFFF; width: 92%; height:20px; color: #{$col};" ></textarea>
</div>
<div id="rightbar">
<div class="userlist">
</div>
<div class="functions">
</div>
{$rightnav}
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
$('#chatlog').slimScroll({
color: '#00f',
size: '10px',
width: '95%',
wheelStep: 10,
height: '580px',
start: 'bottom'
});
});
</script>
<div id="whispers" style="display:none;">
</div>
<div id="repwindow" style="display:none;">
</div>

37
modules/chat/chat_ws.js Normal file
View file

@ -0,0 +1,37 @@
document.domain = "austriachat.net";
function notice() {
if(not!=false){
document.getElementById('notice').play();
}
}
function changenotice(file) {
var zeit = new Date();
var ms = zeit.getMilliseconds();
var audio = $('#notice').empty();
var newSrc = $("<source>").attr("src", "//austriachat.net/modules/chat/sound/"+file+"_notice.ogg?id="+ms).appendTo(audio);
var newSrc2 = $("<source>").attr("src", "//austriachat.net/modules/chat/sound/"+file+"_notice.mp3?id="+ms).appendTo(audio);
/****************/
audio[0].pause();
audio[0].load();
}
function play(source) {
if(window.parent.bgmusic!=false){
updateSource(source);
document.getElementById('audioPlayer').play();
}
}
function reload_locations() {
window.parent.refresh();
}
function pause() {
document.getElementById('audioPlayer').pause();
}
function updateSource(file) {
if(file!=undefined){
$('#oggSource').attr('src',"//austriachat.net/modules/chat/sound/"+file+".ogg").detach().appendTo($('#audioPlayer'));
$('#mp3Source').attr('src',"//austriachat.net/modules/chat/sound/"+file+".mp3").detach().appendTo($('#audioPlayer'));
}
}

View file

@ -0,0 +1,181 @@
<?php
If (!defined("in_astat")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
}
/**
* Case insensitive version of array_key_exists.
* Returns the matching key on success, else false.
*
* @param string $key
* @param array $search
* @return string|false
*/
function array_key_exists_chat($key, $search) {
if (array_key_exists($key, $search)) {
return $key;
}
if (!(is_string($key) && is_array($search) && count($search))) {
return false;
}
$key = strtolower($key);
foreach ($search as $k => $v) {
if (strtolower($k) == $key) {
return $k;
}
}
return false;
}
function get_user_list() {
global $config, $ccache;
// Open URL to userlist
// erzeuge einen neuen cURL-Handle
$ch = curl_init();
// setze die URL und andere Optionen
curl_setopt($ch, CURLOPT_URL, "https://chatsrv.austriachat.net/info");
//curl_setopt($ch, CURLOPT_URL, "https://46.4.58.184/info");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
// führe die Aktion aus und gebe die Daten an den Browser weiter
$fh=curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
//var_dump(curl_getinfo($ch));
// schließe den cURL-Handle und gebe die Systemresourcen frei
curl_close($ch);
if($httpCode >= 200 && $httpCode < 300){
//$content = $ccache->get('roomdata');
$content = json_decode($fh,true);
$userlist = array();
foreach($content as $room) {
$room_name = $room['room'];
$userlist[$room_name]['s'] = $room_state;
$userlist[$room_name]['u'] = array();
$userlist[$room_name]['g'] = $type;
if(!is_array($room['users'])){
unset($userlist[$room_name]);
continue;
}
foreach($room['users'] as $user) {
$userlist[$room_name]['u'][$user['nick']] = $user['color'];
}
}
// Return userlist
return $userlist;
}else{
return false;
}
}
function get_user_room($username) {
global $config;
/* Open URL to userlist
if (!$fh = @fopen("http://localhost.localdomain:".$config['SOCK_PORT']."/info/?", "r"))
return false;
// Read data and close
while(!feof($fh))
$content .= fread($fh, 1024);
fclose($fh); */
$content = $ccache->get('roomdata');
$content = trim($content);
$content = explode("\n", $content);
// Create userlist array
// Format of array:
// $userlist[$room_name]['s'] = $room_state
// $userlist[$room_name]['u'][$nick] = $color
foreach($content as $line) {
$data = explode("|", $line);
list($nick, $color) = explode(",", $data[1]);
list($room, $status,$type) = explode(",", $data[0]);
$list[$nick]['c']=$color;
$list[$nick]['r']=$room;
$list[$nick]['s']=$status;
$list[$nick]['g']=$type;
}
if(array_key_exists_chat($username,$list)){
return $list[$username];
}else{
return FALSE;
}
}
function chat_online(){
global $session, $config;
$online=get_user_list();
if($online!==FALSE){
$rooms=array_keys($online);
$i=0;
$data["usercount"]=0;
$data["gdusercount"]=0;
if(!isset($online[""])){
foreach($rooms as $room){
if(($session->userdata['allow_grimdark']==0 || $session->userdata['uid']==0) && $online[$room]['g']=='grimdark'){
continue;
}
if($online[$room]["s"]=="locked"){
$data[$i]["room"]=$room . " <span style=\"color:red;\">[abgeschlossen]</span>";
}elseif($online[$room]["s"]=="password"){
$data[$i]["room"]=$room . " <span style=\"color:red;\">[password]</span>";
}else{
$data[$i]["room"]=$room . " <span style=\"color:green;\">[offen]</span>";
}
$users=array_keys($online[$room]["u"]);
foreach($users as $user){
if($data[$i]["users"]){
$data[$i]["users"].=', ';
}
if($online[$room]['g']=='grimdark'){
$data['gdusercount']++;
}else{
$data['usercount']++;
}
$data[$i]["users"].='<a href="//'.$config['domain'].'/np/'.$user.'" target="_blank"><span style="color:#'.$online[$room]["u"][$user].'">'.$user.'</span></a>';
}
$i++;
}
}
return $data;
}else{
$data["chat_offline"]=true;
$data["usercount"]=0;
return $data;
}
}
function chat_data(){
$online=get_user_list();
if($online!==FALSE){
$rooms=array_keys($online);
$i=0;
if(!isset($online[""])){
foreach($rooms as $room){
$users=array_keys($online[$room]["u"]);
foreach($users as $user){
$data[$i]["user"]=$user;
$data[$i]["room"]=$room;
$i++;
}
}
}
foreach($data as $user){
echo "(".$user["user"].") (".$user["room"].")\n";
}
}else{
$data["chat_offline"]=true;
$data["usercount"]=0;
return $data;
}
}
?>

View file

@ -0,0 +1,507 @@
/***
Spectrum Colorpicker v1.8.0
https://github.com/bgrins/spectrum
Author: Brian Grinstead
License: MIT
***/
.sp-container {
position:absolute;
top:0;
left:0;
display:inline-block;
*display: inline;
*zoom: 1;
/* https://github.com/bgrins/spectrum/issues/40 */
z-index: 9999994;
overflow: hidden;
}
.sp-container.sp-flat {
position: relative;
}
/* Fix for * { box-sizing: border-box; } */
.sp-container,
.sp-container * {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
/* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */
.sp-top {
position:relative;
width: 100%;
display:inline-block;
}
.sp-top-inner {
position:absolute;
top:0;
left:0;
bottom:0;
right:0;
}
.sp-color {
position: absolute;
top:0;
left:0;
bottom:0;
right:20%;
}
.sp-hue {
position: absolute;
top:0;
right:0;
bottom:0;
left:84%;
height: 100%;
}
.sp-clear-enabled .sp-hue {
top:33px;
height: 77.5%;
}
.sp-fill {
padding-top: 80%;
}
.sp-sat, .sp-val {
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
}
.sp-alpha-enabled .sp-top {
margin-bottom: 18px;
}
.sp-alpha-enabled .sp-alpha {
display: block;
}
.sp-alpha-handle {
position:absolute;
top:-4px;
bottom: -4px;
width: 6px;
left: 50%;
cursor: pointer;
border: 1px solid black;
background: white;
opacity: .8;
}
.sp-alpha {
display: none;
position: absolute;
bottom: -14px;
right: 0;
left: 0;
height: 8px;
}
.sp-alpha-inner {
border: solid 1px #333;
}
.sp-clear {
display: none;
}
.sp-clear.sp-clear-display {
background-position: center;
}
.sp-clear-enabled .sp-clear {
display: block;
position:absolute;
top:0px;
right:0;
bottom:0;
left:84%;
height: 28px;
}
/* Don't allow text selection */
.sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button {
-webkit-user-select:none;
-moz-user-select: -moz-none;
-o-user-select:none;
user-select: none;
}
.sp-container.sp-input-disabled .sp-input-container {
display: none;
}
.sp-container.sp-buttons-disabled .sp-button-container {
display: none;
}
.sp-container.sp-palette-buttons-disabled .sp-palette-button-container {
display: none;
}
.sp-palette-only .sp-picker-container {
display: none;
}
.sp-palette-disabled .sp-palette-container {
display: none;
}
.sp-initial-disabled .sp-initial {
display: none;
}
/* Gradients for hue, saturation and value instead of images. Not pretty... but it works */
.sp-sat {
background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));
background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));
background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0));
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";
filter : progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81');
}
.sp-val {
background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));
background-image: -webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));
background-image: -moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
background-image: -o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0));
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";
filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000');
}
.sp-hue {
background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: -o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));
background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
}
/* IE filters do not support multiple color stops.
Generate 6 divs, line them up, and do two color gradients for each.
Yes, really.
*/
.sp-1 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00');
}
.sp-2 {
height:16%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00');
}
.sp-3 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff');
}
.sp-4 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff');
}
.sp-5 {
height:16%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff');
}
.sp-6 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000');
}
.sp-hidden {
display: none !important;
}
/* Clearfix hack */
.sp-cf:before, .sp-cf:after { content: ""; display: table; }
.sp-cf:after { clear: both; }
.sp-cf { *zoom: 1; }
/* Mobile devices, make hue slider bigger so it is easier to slide */
@media (max-device-width: 480px) {
.sp-color { right: 40%; }
.sp-hue { left: 63%; }
.sp-fill { padding-top: 60%; }
}
.sp-dragger {
border-radius: 5px;
height: 5px;
width: 5px;
border: 1px solid #fff;
background: #000;
cursor: pointer;
position:absolute;
top:0;
left: 0;
}
.sp-slider {
position: absolute;
top:0;
cursor:pointer;
height: 3px;
left: -1px;
right: -1px;
border: 1px solid #000;
background: white;
opacity: .8;
}
/*
Theme authors:
Here are the basic themeable display options (colors, fonts, global widths).
See http://bgrins.github.io/spectrum/themes/ for instructions.
*/
.sp-container {
border-radius: 0;
background-color: #ECECEC;
border: solid 1px #f0c49B;
padding: 0;
}
.sp-container, .sp-container button, .sp-container input, .sp-color, .sp-hue, .sp-clear {
font: normal 12px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.sp-top {
margin-bottom: 3px;
}
.sp-color, .sp-hue, .sp-clear {
border: solid 1px #666;
}
/* Input */
.sp-input-container {
float:right;
width: 100px;
margin-bottom: 4px;
}
.sp-initial-disabled .sp-input-container {
width: 100%;
}
.sp-input {
font-size: 12px !important;
border: 1px inset;
padding: 4px 5px;
margin: 0;
width: 100%;
background:transparent;
border-radius: 3px;
color: #222;
}
.sp-input:focus {
border: 1px solid orange;
}
.sp-input.sp-validation-error {
border: 1px solid red;
background: #fdd;
}
.sp-picker-container , .sp-palette-container {
float:left;
position: relative;
padding: 10px;
padding-bottom: 300px;
margin-bottom: -290px;
}
.sp-picker-container {
width: 172px;
border-left: solid 1px #fff;
}
/* Palettes */
.sp-palette-container {
border-right: solid 1px #ccc;
}
.sp-palette-only .sp-palette-container {
border: 0;
}
.sp-palette .sp-thumb-el {
display: block;
position:relative;
float:left;
width: 24px;
height: 15px;
margin: 3px;
cursor: pointer;
border:solid 2px transparent;
}
.sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active {
border-color: orange;
}
.sp-thumb-el {
position:relative;
}
/* Initial */
.sp-initial {
float: left;
border: solid 1px #333;
}
.sp-initial span {
width: 30px;
height: 25px;
border:none;
display:block;
float:left;
margin:0;
}
.sp-initial .sp-clear-display {
background-position: center;
}
/* Buttons */
.sp-palette-button-container,
.sp-button-container {
float: right;
}
/* Replacer (the little preview div that shows up instead of the <input>) */
.sp-replacer {
margin:0;
overflow:hidden;
cursor:pointer;
padding: 4px;
display:inline-block;
*zoom: 1;
*display: inline;
border: solid 1px #91765d;
background: #eee;
color: #333;
vertical-align: middle;
}
.sp-replacer:hover, .sp-replacer.sp-active {
border-color: #F0C49B;
color: #111;
}
.sp-replacer.sp-disabled {
cursor:default;
border-color: silver;
color: silver;
}
.sp-dd {
padding: 2px 0;
height: 16px;
line-height: 16px;
float:left;
font-size:10px;
}
.sp-preview {
position:relative;
width:25px;
height: 20px;
border: solid 1px #222;
margin-right: 5px;
float:left;
z-index: 0;
}
.sp-palette {
*width: 220px;
max-width: 220px;
}
.sp-palette .sp-thumb-el {
width:16px;
height: 16px;
margin:2px 1px;
border: solid 1px #d0d0d0;
}
.sp-container {
padding-bottom:0;
}
/* Buttons: http://hellohappy.org/css3-buttons/ */
.sp-container button {
background-color: #eeeeee;
background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
background-image: linear-gradient(to bottom, #eeeeee, #cccccc);
border: 1px solid #ccc;
border-bottom: 1px solid #bbb;
border-radius: 3px;
color: #333;
font-size: 14px;
line-height: 1;
padding: 5px 4px;
text-align: center;
text-shadow: 0 1px 0 #eee;
vertical-align: middle;
}
.sp-container button:hover {
background-color: #dddddd;
background-image: -webkit-linear-gradient(top, #dddddd, #bbbbbb);
background-image: -moz-linear-gradient(top, #dddddd, #bbbbbb);
background-image: -ms-linear-gradient(top, #dddddd, #bbbbbb);
background-image: -o-linear-gradient(top, #dddddd, #bbbbbb);
background-image: linear-gradient(to bottom, #dddddd, #bbbbbb);
border: 1px solid #bbb;
border-bottom: 1px solid #999;
cursor: pointer;
text-shadow: 0 1px 0 #ddd;
}
.sp-container button:active {
border: 1px solid #aaa;
border-bottom: 1px solid #888;
-webkit-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
-moz-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
-ms-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
-o-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
}
.sp-cancel {
font-size: 11px;
color: #d93f3f !important;
margin:0;
padding:2px;
margin-right: 5px;
vertical-align: middle;
text-decoration:none;
}
.sp-cancel:hover {
color: #d93f3f !important;
text-decoration: underline;
}
.sp-palette span:hover, .sp-palette span.sp-thumb-active {
border-color: #000;
}
.sp-preview, .sp-alpha, .sp-thumb-el {
position:relative;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
}
.sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner {
display:block;
position:absolute;
top:0;left:0;bottom:0;right:0;
}
.sp-palette .sp-thumb-inner {
background-position: 50% 50%;
background-repeat: no-repeat;
}
.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=);
}
.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=);
}
.sp-clear-display {
background-repeat:no-repeat;
background-position: center;
background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==);
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,191 @@
div.datepicker {
position: relative;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
width: 196px;
height: 147px;
position: absolute;
cursor: default;
top: 0;
left: 0;
display: none;
}
.datepickerContainer {
background: #121212;
position: absolute;
top: 10px;
left: 10px;
}
.datepickerBorderT {
position: absolute;
left: 10px;
top: 0;
right: 10px;
height: 10px;
background: url(../images/datepicker_t.png);
}
.datepickerBorderB {
position: absolute;
left: 10px;
bottom: 0;
right: 10px;
height: 10px;
background: url(../images/datepicker_b.png);
}
.datepickerBorderL {
position: absolute;
left: 0;
bottom: 10px;
top: 10px;
width: 10px;
background: url(../images/datepicker_l.png);
}
.datepickerBorderR {
position: absolute;
right: 0;
bottom: 10px;
top: 10px;
width: 10px;
background: url(../images/datepicker_r.png);
}
.datepickerBorderTL {
position: absolute;
top: 0;
left: 0;
width: 10px;
height: 10px;
background: url(../images/datepicker_tl.png);
}
.datepickerBorderTR {
position: absolute;
top: 0;
right: 0;
width: 10px;
height: 10px;
background: url(../images/datepicker_tr.png);
}
.datepickerBorderBL {
position: absolute;
bottom: 0;
left: 0;
width: 10px;
height: 10px;
background: url(../images/datepicker_bl.png);
}
.datepickerBorderBR {
position: absolute;
bottom: 0;
right: 0;
width: 10px;
height: 10px;
background: url(../images/datepicker_br.png);
}
.datepickerHidden {
display: none;
}
div.datepicker table {
border-collapse:collapse;
}
div.datepicker a {
color: #eee;
text-decoration: none;
cursor: default;
outline: none;
}
div.datepicker table td {
text-align: right;
padding: 0;
margin: 0;
}
div.datepicker th {
text-align: center;
color: #999;
font-weight: normal;
}
div.datepicker tbody th {
text-align: left;
}
div.datepicker tbody a {
display: block;
}
.datepickerDays a {
width: 20px;
line-height: 16px;
height: 16px;
padding-right: 2px;
}
.datepickerYears a,
.datepickerMonths a{
width: 44px;
line-height: 36px;
height: 36px;
text-align: center;
}
td.datepickerNotInMonth a {
color: #666;
}
tbody.datepickerDays td.datepickerSelected{
background: #136A9F;
}
tbody.datepickerDays td.datepickerNotInMonth.datepickerSelected {
background: #17384d;
}
tbody.datepickerYears td.datepickerSelected,
tbody.datepickerMonths td.datepickerSelected{
background: #17384d;
}
div.datepicker a:hover,
div.datepicker a:hover {
color: #88c5eb;
}
div.datepicker td.datepickerNotInMonth a:hover {
color: #999;
}
div.datepicker tbody th {
text-align: left;
}
.datepickerSpace div {
width: 20px;
}
.datepickerGoNext a,
.datepickerGoPrev a,
.datepickerMonth a {
text-align: center;
height: 20px;
line-height: 20px;
}
.datepickerGoNext a {
float: right;
width: 20px;
}
.datepickerGoPrev a {
float: left;
width: 20px;
}
table.datepickerViewDays tbody.datepickerMonths,
table.datepickerViewDays tbody.datepickerYears {
display: none;
}
table.datepickerViewMonths tbody.datepickerDays,
table.datepickerViewMonths tbody.datepickerYears,
table.datepickerViewMonths tr.datepickerDoW {
display: none;
}
table.datepickerViewYears tbody.datepickerDays,
table.datepickerViewYears tbody.datepickerMonths,
table.datepickerViewYears tr.datepickerDoW {
display: none;
}
td.datepickerDisabled a,
td.datepickerDisabled.datepickerNotInMonth a{
color: #333;
}
td.datepickerDisabled a:hover {
color: #333;
}
td.datepickerSpecial a {
background: #700;
}
td.datepickerSpecial.datepickerSelected a {
background: #a00;
}

View file

@ -0,0 +1,150 @@
#colorSelector {
position: relative;
width: 36px;
height: 36px;
background: url(../images/select.png);
}
#colorSelector div {
position: absolute;
top: 3px;
left: 3px;
width: 30px;
height: 30px;
background: url(../images/select.png) center;
}
#colorSelector2 {
position: absolute;
top: 0;
left: 0;
width: 36px;
height: 36px;
background: url(../images/select2.png);
}
#colorSelector2 div {
position: absolute;
top: 4px;
left: 4px;
width: 28px;
height: 28px;
background: url(../images/select2.png) center;
}
#colorpickerHolder2 {
top: 32px;
left: 0;
width: 356px;
height: 0;
overflow: hidden;
position: absolute;
}
#colorpickerHolder2 .colorpicker {
background-image: url(../images/custom_background.png);
position: absolute;
bottom: 0;
left: 0;
}
#colorpickerHolder2 .colorpicker_hue div {
background-image: url(../images/custom_indic.gif);
}
#colorpickerHolder2 .colorpicker_hex {
background-image: url(../images/custom_hex.png);
}
#colorpickerHolder2 .colorpicker_rgb_r {
background-image: url(../images/custom_rgb_r.png);
}
#colorpickerHolder2 .colorpicker_rgb_g {
background-image: url(../images/custom_rgb_g.png);
}
#colorpickerHolder2 .colorpicker_rgb_b {
background-image: url(../images/custom_rgb_b.png);
}
#colorpickerHolder2 .colorpicker_hsb_s {
background-image: url(../images/custom_hsb_s.png);
display: none;
}
#colorpickerHolder2 .colorpicker_hsb_h {
background-image: url(../images/custom_hsb_h.png);
display: none;
}
#colorpickerHolder2 .colorpicker_hsb_b {
background-image: url(../images/custom_hsb_b.png);
display: none;
}
#colorpickerHolder2 .colorpicker_submit {
background-image: url(../images/custom_submit.png);
}
#colorpickerHolder2 .colorpicker input {
color: #778398;
}
#customWidget {
position: relative;
height: 36px;
}
input.inputDate {
border: 1px solid #999;
padding: 4px;
border-bottom-color: #ddd;
border-right-color: #ddd;
width: 65px;
}
#widget {
position: relative;
}
#widgetField {
width: 290px;
height: 26px;
background: url(../images/field.png);
overflow: hidden;
position: relative;
}
#widgetField a {
display: block;
position: absolute;
width: 26px;
height: 26px;
top: 0;
right: 0;
text-decoration: none;
text-indent: -3000px;
}
#widgetField span {
font-size: 12px;
font-weight: bold;
color: #000;
position: absolute;
top: 0;
height: 26px;
line-height: 26px;
left: 5px;
width: 250px;
text-align: center;
}
#widgetCalendar {
position: absolute;
top: 26px;
left: 0;
height: 0px;
overflow: hidden;
width: 588px;
background: #B9B9B9;
}
#widgetCalendar .datepicker {
position: absolute;
bottom: 0;
top: auto;
}
#widgetCalendar .datepickerContainer,
#widgetCalendar .datepickerBorderT,
#widgetCalendar .datepickerBorderB,
#widgetCalendar .datepickerBorderL,
#widgetCalendar .datepickerBorderR,
#widgetCalendar .datepickerBorderTL,
#widgetCalendar .datepickerBorderTR,
#widgetCalendar .datepickerBorderBL,
#widgetCalendar .datepickerBorderBR {
background: transparent !important;
}
#widgetCalendar .datepicker a:hover{
color: #b6f063;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

View file

@ -0,0 +1,259 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" href="css/datepicker.css" type="text/css" />
<link rel="stylesheet" media="screen" type="text/css" href="css/layout.css" />
<title>DatePicker - jQuery plugin</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/datepicker.js"></script>
<script type="text/javascript" src="js/eye.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/layout.js?ver=1.0.2"></script>
</head>
<body>
<div class="wrapper">
<h1>Date Picker - jQuery plugin</h1>
<ul class="navigationTabs">
<li><a href="#about" rel="about">About</a></li>
<li><a href="#download" rel="download">Download</a></li>
<li><a href="#implement" rel="implement">Implement</a></li>
</ul>
<div class="tabsContent">
<div class="tab">
<h2>About</h2>
<p>Date Picker component with a lot of options and easy to fit in your web application.</p>
<h3>Last update</h3>
<p>22.05.2009 - Check Download tab</p>
<h3>Features</h3>
<ul>
<li>Flat mode - as element in page</li>
<li>Multiple calendars in the component</li>
<li>Allows single, multiple or range selection</li>
<li>Mark dates as special, weekends, special days</li>
<li>Easy to customize the look by changing CSS</li>
<li>Localiation for months' and days' names</li>
<li>Custom day to start the week</li>
<li>Fits into the viewport</li>
</ul>
<h3>License</h3>
<p>Dual licensed under the MIT and GPL licenses.</p>
<h3>Examples</h3>
<p id="date"></p>
<p>Flat mode, single selection, the week start monday.</p>
<pre>$('#date').DatePicker({
flat: true,
date: '2008-07-31',
current: '2008-07-31',
calendars: 1,
starts: 1
});</pre>
<p>Flat mode, multiple selection, disabled dates, special day, the week start sunday.</p>
<p id="date2"></p>
<pre>$('#date2').DatePicker({
flat: true,
date: ['2008-07-31', '2008-07-28'],
current: '2008-07-31',
format: 'Y-m-d',
calendars: 1,
mode: 'multiple',
onRender: function(date) {
return {
disabled: (date.valueOf() < now.valueOf()),
className: date.valueOf() == now2.valueOf() ? 'datepickerSpecial' : false
}
},
starts: 0
});</pre>
<p><a href="#" id="clearSelection">Clear selection</a></p>
<pre>$('#date3').DatePickerClear();</pre>
<p>Flat mode, range selection, 3 calendars.</p>
<p id="date3"></p>
<pre>$('#date3').DatePicker({
flat: true,
date: ['2008-07-28','2008-07-31'],
current: '2008-07-31',
calendars: 3,
mode: 'range',
starts: 1
});</pre>
<p>Attached to an text field and usign callbacks to update the date selection with the value from the field.</p>
<p>
<input class="inputDate" id="inputDate" value="06/14/2008" />
<label id="closeOnSelect"><input type="checkbox" /> Close on selection</label>
</p>
<pre>$('#inputDate').DatePicker({
format:'m/d/Y',
date: $('#inputDate').val(),
current: $('#inputDate').val(),
starts: 1,
position: 'r',
onBeforeShow: function(){
$('#inputDate').DatePickerSetDate($('#inputDate').val(), true);
},
onChange: function(formated, dates){
$('#inputDate').val(formated);
if ($('#closeOnSelect input').attr('checked')) {
$('#inputDate').DatePickerHide();
}
}
});</pre>
<p>Flat mode, inside a custom widget and with custom design.</p>
<div id="widget">
<div id="widgetField">
<span>28 July, 2008 &divide; 31 July, 2008</span>
<a href="#">Select date range</a>
</div>
<div id="widgetCalendar">
</div>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div class="tab">
<h2>Download</h2>
<p><a href="datepicker.zip">datepicker.zip (50 kb)</a>: jQuery, Javscript files, CSS files, images, examples and instructions.</p>
<h3>Changelog</h3>
<dl>
<dt>22.05.2009</dt>
<dd>added: close on selection example</dd>
<dd>added: onChange has new parameter: reference to related element</dd>
<dd>added: start view days, months, years</dd>
<dd>added: clear selection in multiple and range mode</dd>
<dd>fixed: datepicker hide and show methods</dd>
<dd>fixed: january selection (tahns to Konstantin Zavialov)</dd>
<dd>fixed: working with jQuery 1.3</dd>
<dd>fixed: deselecting a date in multiple mode (thanks to Geelen Sebastien)</dd>
<dt>22.08.2008</dt>
<dd>Fixed bug: where some events were not canceled right on Safari</dd>
<dd>Fixed bug: where teh view port was not detected right on Safari</dd>
<dt>31.07.2008</dt>
<dd>Added new method: 'DatePickerGetDate'</dd>
<dd>Minor speed improvement</dd>
<dt>30.07.2008</dt>
<dd>The first release.</dd>
</dl>
</div>
<div class="tab">
<h2>Implement</h2>
<p>Attach the Javascript and CSS files to your document. Edit CSS file and fix the paths to images and change colors to fit your site theme.</p>
<pre>
&lt;link rel="stylesheet" media="screen" type="text/css" href="css/datepicker.css" /&gt;
&lt;script type="text/javascript" src="js/datepicker.js"&gt;&lt;/script&gt;
</pre>
<h3>Invocation code</h3>
<p>All you have to do is to select the elements in a jQuery way and call the plugin.</p>
<pre>
$('input').DatePicker(options);
</pre>
<h3>Options</h3>
<p>A hash of parameters. All parameters are optional.</p>
<table>
<tr>
<td><strong>eventName</strong></td>
<td>string</td>
<td>The desired event to trigger the date picker. Default: 'click'</td>
</tr>
<tr>
<td><strong>date</strong></td>
<td>String, Date or array</td>
<td>The selected date(s) as string (will be converted to Date object based on teh format suplied) and Date object for single selection, as Array of strings or Date objects</td>
</tr>
<tr>
<td><strong>flat</strong></td>
<td>boolean</td>
<td>Whatever if the date picker is appended to the element or triggered by an event. Default false</td>
</tr>
<tr>
<td><strong>start</strong></td>
<td>integer</td>
<td>The day week start. Default 1 (monday)</td>
</tr>
<tr>
<td><strong>prev</strong></td>
<td>string</td>
<td>HTML inserted to previous links. Default '&#9664;' (UNICODE black left arrow)</td>
</tr>
<tr>
<td><strong>next</strong></td>
<td>string</td>
<td>HTML inserted to next links. Default '&#9654;' (UNICODE black right arrow)</td>
</tr>
<tr>
<td><strong>mode</strong></td>
<td>string ['single'|'multiple'|'range']</td>
<td>Date selection mode. Default 'single'</td>
</tr>
<tr>
<td><strong>view</strong></td>
<td>string ['days'|'months'|'years']</td>
<td>Start view mode. Default 'days'</td>
</tr>
<tr>
<td><strong>calendars</strong></td>
<td>integer</td>
<td>Number of calendars to render inside the date picker. Default 1</td>
</tr>
<tr>
<td><strong>format</strong></td>
<td>string</td>
<td>Date format. Default 'Y-m-d'</td>
</tr>
<tr>
<td><strong>position</strong></td>
<td>string ['top'|'left'|'right'|'bottom']</td>
<td>Date picker's position relative to the trigegr element (non flat mode only). Default 'bottom'</td>
</tr>
<tr>
<td><strong>locale</strong></td>
<td>hash</td>
<td>Location: provide a hash with keys 'days', 'daysShort', 'daysMin', 'months', 'monthsShort', 'week'. Default english</td>
</tr>
<tr>
<td><strong>onShow</strong></td>
<td>function</td>
<td>Callback function triggered when the date picker is shown</td>
</tr>
<tr>
<td><strong>onBeforeShow</strong></td>
<td>function</td>
<td>Callback function triggered before the date picker is shown</td>
</tr>
<tr>
<td><strong>onHide</strong></td>
<td>function</td>
<td>Callback function triggered when the date picker is hidden</td>
</tr>
<tr>
<td><strong>onChange</strong></td>
<td>function</td>
<td>Callback function triggered when the date is changed</td>
</tr>
<tr>
<td><strong>onRender</strong></td>
<td>function</td>
<td>Callback function triggered when the date is rendered inside a calendar. It should return and hash with keys: 'selected' to select the date, 'disabled' to disable the date, 'className' for additional CSS class</td>
</tr>
</table>
<h3>Set date</h3>
<p>If you want to set a diferent date selection.</p>
<pre>$('input').DatePickerSetDate(date, shiftTo);</pre>
<p>The 'date' argument is the same format as the option 'date' and the 'shiftTo' argument (boolean) moves the curent month view to the date selection provided.</p>
<h3>Get date</h3>
<p>Get date selection.</p>
<pre>$('input').DatePickerGetDate(formated);</pre>
<p>Set 'formated' to true if you whant to get teh selection formated.</p>
<h3>Show and hide date picker</h3>
<p>Show or hide a date picker.</p>
<pre>$('input').DatePickerShow();</pre>
<pre>$('input').DatePickerHide();</pre>
<h3>Clear multiple selection</h3>
<p>Clear selection in multiple and range mode</p>
<pre>$('#datepicker').DatePickerClear();</pre>
</div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,891 @@
/**
*
* Date picker
* Author: Stefan Petre www.eyecon.ro
*
* Dual licensed under the MIT and GPL licenses
*
*/
(function ($) {
var DatePicker = function () {
var ids = {},
views = {
years: 'datepickerViewYears',
moths: 'datepickerViewMonths',
days: 'datepickerViewDays'
},
tpl = {
wrapper: '<div class="datepicker"><div class="datepickerBorderT" /><div class="datepickerBorderB" /><div class="datepickerBorderL" /><div class="datepickerBorderR" /><div class="datepickerBorderTL" /><div class="datepickerBorderTR" /><div class="datepickerBorderBL" /><div class="datepickerBorderBR" /><div class="datepickerContainer"><table cellspacing="0" cellpadding="0"><tbody><tr></tr></tbody></table></div></div>',
head: [
'<td>',
'<table cellspacing="0" cellpadding="0">',
'<thead>',
'<tr>',
'<th class="datepickerGoPrev"><a href="#"><span><%=prev%></span></a></th>',
'<th colspan="6" class="datepickerMonth"><a href="#"><span></span></a></th>',
'<th class="datepickerGoNext"><a href="#"><span><%=next%></span></a></th>',
'</tr>',
'<tr class="datepickerDoW">',
'<th><span><%=week%></span></th>',
'<th><span><%=day1%></span></th>',
'<th><span><%=day2%></span></th>',
'<th><span><%=day3%></span></th>',
'<th><span><%=day4%></span></th>',
'<th><span><%=day5%></span></th>',
'<th><span><%=day6%></span></th>',
'<th><span><%=day7%></span></th>',
'</tr>',
'</thead>',
'</table></td>'
],
space : '<td class="datepickerSpace"><div></div></td>',
days: [
'<tbody class="datepickerDays">',
'<tr>',
'<th class="datepickerWeek"><a href="#"><span><%=weeks[0].week%></span></a></th>',
'<td class="<%=weeks[0].days[0].classname%>"><a href="#"><span><%=weeks[0].days[0].text%></span></a></td>',
'<td class="<%=weeks[0].days[1].classname%>"><a href="#"><span><%=weeks[0].days[1].text%></span></a></td>',
'<td class="<%=weeks[0].days[2].classname%>"><a href="#"><span><%=weeks[0].days[2].text%></span></a></td>',
'<td class="<%=weeks[0].days[3].classname%>"><a href="#"><span><%=weeks[0].days[3].text%></span></a></td>',
'<td class="<%=weeks[0].days[4].classname%>"><a href="#"><span><%=weeks[0].days[4].text%></span></a></td>',
'<td class="<%=weeks[0].days[5].classname%>"><a href="#"><span><%=weeks[0].days[5].text%></span></a></td>',
'<td class="<%=weeks[0].days[6].classname%>"><a href="#"><span><%=weeks[0].days[6].text%></span></a></td>',
'</tr>',
'<tr>',
'<th class="datepickerWeek"><a href="#"><span><%=weeks[1].week%></span></a></th>',
'<td class="<%=weeks[1].days[0].classname%>"><a href="#"><span><%=weeks[1].days[0].text%></span></a></td>',
'<td class="<%=weeks[1].days[1].classname%>"><a href="#"><span><%=weeks[1].days[1].text%></span></a></td>',
'<td class="<%=weeks[1].days[2].classname%>"><a href="#"><span><%=weeks[1].days[2].text%></span></a></td>',
'<td class="<%=weeks[1].days[3].classname%>"><a href="#"><span><%=weeks[1].days[3].text%></span></a></td>',
'<td class="<%=weeks[1].days[4].classname%>"><a href="#"><span><%=weeks[1].days[4].text%></span></a></td>',
'<td class="<%=weeks[1].days[5].classname%>"><a href="#"><span><%=weeks[1].days[5].text%></span></a></td>',
'<td class="<%=weeks[1].days[6].classname%>"><a href="#"><span><%=weeks[1].days[6].text%></span></a></td>',
'</tr>',
'<tr>',
'<th class="datepickerWeek"><a href="#"><span><%=weeks[2].week%></span></a></th>',
'<td class="<%=weeks[2].days[0].classname%>"><a href="#"><span><%=weeks[2].days[0].text%></span></a></td>',
'<td class="<%=weeks[2].days[1].classname%>"><a href="#"><span><%=weeks[2].days[1].text%></span></a></td>',
'<td class="<%=weeks[2].days[2].classname%>"><a href="#"><span><%=weeks[2].days[2].text%></span></a></td>',
'<td class="<%=weeks[2].days[3].classname%>"><a href="#"><span><%=weeks[2].days[3].text%></span></a></td>',
'<td class="<%=weeks[2].days[4].classname%>"><a href="#"><span><%=weeks[2].days[4].text%></span></a></td>',
'<td class="<%=weeks[2].days[5].classname%>"><a href="#"><span><%=weeks[2].days[5].text%></span></a></td>',
'<td class="<%=weeks[2].days[6].classname%>"><a href="#"><span><%=weeks[2].days[6].text%></span></a></td>',
'</tr>',
'<tr>',
'<th class="datepickerWeek"><a href="#"><span><%=weeks[3].week%></span></a></th>',
'<td class="<%=weeks[3].days[0].classname%>"><a href="#"><span><%=weeks[3].days[0].text%></span></a></td>',
'<td class="<%=weeks[3].days[1].classname%>"><a href="#"><span><%=weeks[3].days[1].text%></span></a></td>',
'<td class="<%=weeks[3].days[2].classname%>"><a href="#"><span><%=weeks[3].days[2].text%></span></a></td>',
'<td class="<%=weeks[3].days[3].classname%>"><a href="#"><span><%=weeks[3].days[3].text%></span></a></td>',
'<td class="<%=weeks[3].days[4].classname%>"><a href="#"><span><%=weeks[3].days[4].text%></span></a></td>',
'<td class="<%=weeks[3].days[5].classname%>"><a href="#"><span><%=weeks[3].days[5].text%></span></a></td>',
'<td class="<%=weeks[3].days[6].classname%>"><a href="#"><span><%=weeks[3].days[6].text%></span></a></td>',
'</tr>',
'<tr>',
'<th class="datepickerWeek"><a href="#"><span><%=weeks[4].week%></span></a></th>',
'<td class="<%=weeks[4].days[0].classname%>"><a href="#"><span><%=weeks[4].days[0].text%></span></a></td>',
'<td class="<%=weeks[4].days[1].classname%>"><a href="#"><span><%=weeks[4].days[1].text%></span></a></td>',
'<td class="<%=weeks[4].days[2].classname%>"><a href="#"><span><%=weeks[4].days[2].text%></span></a></td>',
'<td class="<%=weeks[4].days[3].classname%>"><a href="#"><span><%=weeks[4].days[3].text%></span></a></td>',
'<td class="<%=weeks[4].days[4].classname%>"><a href="#"><span><%=weeks[4].days[4].text%></span></a></td>',
'<td class="<%=weeks[4].days[5].classname%>"><a href="#"><span><%=weeks[4].days[5].text%></span></a></td>',
'<td class="<%=weeks[4].days[6].classname%>"><a href="#"><span><%=weeks[4].days[6].text%></span></a></td>',
'</tr>',
'<tr>',
'<th class="datepickerWeek"><a href="#"><span><%=weeks[5].week%></span></a></th>',
'<td class="<%=weeks[5].days[0].classname%>"><a href="#"><span><%=weeks[5].days[0].text%></span></a></td>',
'<td class="<%=weeks[5].days[1].classname%>"><a href="#"><span><%=weeks[5].days[1].text%></span></a></td>',
'<td class="<%=weeks[5].days[2].classname%>"><a href="#"><span><%=weeks[5].days[2].text%></span></a></td>',
'<td class="<%=weeks[5].days[3].classname%>"><a href="#"><span><%=weeks[5].days[3].text%></span></a></td>',
'<td class="<%=weeks[5].days[4].classname%>"><a href="#"><span><%=weeks[5].days[4].text%></span></a></td>',
'<td class="<%=weeks[5].days[5].classname%>"><a href="#"><span><%=weeks[5].days[5].text%></span></a></td>',
'<td class="<%=weeks[5].days[6].classname%>"><a href="#"><span><%=weeks[5].days[6].text%></span></a></td>',
'</tr>',
'</tbody>'
],
months: [
'<tbody class="<%=className%>">',
'<tr>',
'<td colspan="2"><a href="#"><span><%=data[0]%></span></a></td>',
'<td colspan="2"><a href="#"><span><%=data[1]%></span></a></td>',
'<td colspan="2"><a href="#"><span><%=data[2]%></span></a></td>',
'<td colspan="2"><a href="#"><span><%=data[3]%></span></a></td>',
'</tr>',
'<tr>',
'<td colspan="2"><a href="#"><span><%=data[4]%></span></a></td>',
'<td colspan="2"><a href="#"><span><%=data[5]%></span></a></td>',
'<td colspan="2"><a href="#"><span><%=data[6]%></span></a></td>',
'<td colspan="2"><a href="#"><span><%=data[7]%></span></a></td>',
'</tr>',
'<tr>',
'<td colspan="2"><a href="#"><span><%=data[8]%></span></a></td>',
'<td colspan="2"><a href="#"><span><%=data[9]%></span></a></td>',
'<td colspan="2"><a href="#"><span><%=data[10]%></span></a></td>',
'<td colspan="2"><a href="#"><span><%=data[11]%></span></a></td>',
'</tr>',
'</tbody>'
]
},
defaults = {
flat: false,
starts: 1,
prev: '&#9664;',
next: '&#9654;',
lastSel: false,
mode: 'single',
view: 'days',
calendars: 1,
format: 'Y-m-d',
position: 'bottom',
eventName: 'click',
onRender: function(){return {};},
onChange: function(){return true;},
onShow: function(){return true;},
onBeforeShow: function(){return true;},
onHide: function(){return true;},
locale: {
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
weekMin: 'wk'
}
},
fill = function(el) {
var options = $(el).data('datepicker');
var cal = $(el);
var currentCal = Math.floor(options.calendars/2), date, data, dow, month, cnt = 0, week, days, indic, indic2, html, tblCal;
cal.find('td>table tbody').remove();
for (var i = 0; i < options.calendars; i++) {
date = new Date(options.current);
date.addMonths(-currentCal + i);
tblCal = cal.find('table').eq(i+1);
switch (tblCal[0].className) {
case 'datepickerViewDays':
dow = formatDate(date, 'B, Y');
break;
case 'datepickerViewMonths':
dow = date.getFullYear();
break;
case 'datepickerViewYears':
dow = (date.getFullYear()-6) + ' - ' + (date.getFullYear()+5);
break;
}
tblCal.find('thead tr:first th:eq(1) span').text(dow);
dow = date.getFullYear()-6;
data = {
data: [],
className: 'datepickerYears'
}
for ( var j = 0; j < 12; j++) {
data.data.push(dow + j);
}
html = tmpl(tpl.months.join(''), data);
date.setDate(1);
data = {weeks:[], test: 10};
month = date.getMonth();
var dow = (date.getDay() - options.starts) % 7;
date.addDays(-(dow + (dow < 0 ? 7 : 0)));
week = -1;
cnt = 0;
while (cnt < 42) {
indic = parseInt(cnt/7,10);
indic2 = cnt%7;
if (!data.weeks[indic]) {
week = date.getWeekNumber();
data.weeks[indic] = {
week: week,
days: []
};
}
data.weeks[indic].days[indic2] = {
text: date.getDate(),
classname: []
};
if (month != date.getMonth()) {
data.weeks[indic].days[indic2].classname.push('datepickerNotInMonth');
}
if (date.getDay() == 0) {
data.weeks[indic].days[indic2].classname.push('datepickerSunday');
}
if (date.getDay() == 6) {
data.weeks[indic].days[indic2].classname.push('datepickerSaturday');
}
var fromUser = options.onRender(date);
var val = date.valueOf();
if (fromUser.selected || options.date == val || $.inArray(val, options.date) > -1 || (options.mode == 'range' && val >= options.date[0] && val <= options.date[1])) {
data.weeks[indic].days[indic2].classname.push('datepickerSelected');
}
if (fromUser.disabled) {
data.weeks[indic].days[indic2].classname.push('datepickerDisabled');
}
if (fromUser.className) {
data.weeks[indic].days[indic2].classname.push(fromUser.className);
}
data.weeks[indic].days[indic2].classname = data.weeks[indic].days[indic2].classname.join(' ');
cnt++;
date.addDays(1);
}
html = tmpl(tpl.days.join(''), data) + html;
data = {
data: options.locale.monthsShort,
className: 'datepickerMonths'
};
html = tmpl(tpl.months.join(''), data) + html;
tblCal.append(html);
}
},
parseDate = function (date, format) {
if (date.constructor == Date) {
return new Date(date);
}
var parts = date.split(/\W+/);
var against = format.split(/\W+/), d, m, y, h, min, now = new Date();
for (var i = 0; i < parts.length; i++) {
switch (against[i]) {
case 'd':
case 'e':
d = parseInt(parts[i],10);
break;
case 'm':
m = parseInt(parts[i], 10)-1;
break;
case 'Y':
case 'y':
y = parseInt(parts[i], 10);
y += y > 100 ? 0 : (y < 29 ? 2000 : 1900);
break;
case 'H':
case 'I':
case 'k':
case 'l':
h = parseInt(parts[i], 10);
break;
case 'P':
case 'p':
if (/pm/i.test(parts[i]) && h < 12) {
h += 12;
} else if (/am/i.test(parts[i]) && h >= 12) {
h -= 12;
}
break;
case 'M':
min = parseInt(parts[i], 10);
break;
}
}
return new Date(
y === undefined ? now.getFullYear() : y,
m === undefined ? now.getMonth() : m,
d === undefined ? now.getDate() : d,
h === undefined ? now.getHours() : h,
min === undefined ? now.getMinutes() : min,
0
);
},
formatDate = function(date, format) {
var m = date.getMonth();
var d = date.getDate();
var y = date.getFullYear();
var wn = date.getWeekNumber();
var w = date.getDay();
var s = {};
var hr = date.getHours();
var pm = (hr >= 12);
var ir = (pm) ? (hr - 12) : hr;
var dy = date.getDayOfYear();
if (ir == 0) {
ir = 12;
}
var min = date.getMinutes();
var sec = date.getSeconds();
var parts = format.split(''), part;
for ( var i = 0; i < parts.length; i++ ) {
part = parts[i];
switch (parts[i]) {
case 'a':
part = date.getDayName();
break;
case 'A':
part = date.getDayName(true);
break;
case 'b':
part = date.getMonthName();
break;
case 'B':
part = date.getMonthName(true);
break;
case 'C':
part = 1 + Math.floor(y / 100);
break;
case 'd':
part = (d < 10) ? ("0" + d) : d;
break;
case 'e':
part = d;
break;
case 'H':
part = (hr < 10) ? ("0" + hr) : hr;
break;
case 'I':
part = (ir < 10) ? ("0" + ir) : ir;
break;
case 'j':
part = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy;
break;
case 'k':
part = hr;
break;
case 'l':
part = ir;
break;
case 'm':
part = (m < 9) ? ("0" + (1+m)) : (1+m);
break;
case 'M':
part = (min < 10) ? ("0" + min) : min;
break;
case 'p':
case 'P':
part = pm ? "PM" : "AM";
break;
case 's':
part = Math.floor(date.getTime() / 1000);
break;
case 'S':
part = (sec < 10) ? ("0" + sec) : sec;
break;
case 'u':
part = w + 1;
break;
case 'w':
part = w;
break;
case 'y':
part = ('' + y).substr(2, 2);
break;
case 'Y':
part = y;
break;
}
parts[i] = part;
}
return parts.join('');
},
extendDate = function(options) {
if (Date.prototype.tempDate) {
return;
}
Date.prototype.tempDate = null;
Date.prototype.months = options.months;
Date.prototype.monthsShort = options.monthsShort;
Date.prototype.days = options.days;
Date.prototype.daysShort = options.daysShort;
Date.prototype.getMonthName = function(fullName) {
return this[fullName ? 'months' : 'monthsShort'][this.getMonth()];
};
Date.prototype.getDayName = function(fullName) {
return this[fullName ? 'days' : 'daysShort'][this.getDay()];
};
Date.prototype.addDays = function (n) {
this.setDate(this.getDate() + n);
this.tempDate = this.getDate();
};
Date.prototype.addMonths = function (n) {
if (this.tempDate == null) {
this.tempDate = this.getDate();
}
this.setDate(1);
this.setMonth(this.getMonth() + n);
this.setDate(Math.min(this.tempDate, this.getMaxDays()));
};
Date.prototype.addYears = function (n) {
if (this.tempDate == null) {
this.tempDate = this.getDate();
}
this.setDate(1);
this.setFullYear(this.getFullYear() + n);
this.setDate(Math.min(this.tempDate, this.getMaxDays()));
};
Date.prototype.getMaxDays = function() {
var tmpDate = new Date(Date.parse(this)),
d = 28, m;
m = tmpDate.getMonth();
d = 28;
while (tmpDate.getMonth() == m) {
d ++;
tmpDate.setDate(d);
}
return d - 1;
};
Date.prototype.getFirstDay = function() {
var tmpDate = new Date(Date.parse(this));
tmpDate.setDate(1);
return tmpDate.getDay();
};
Date.prototype.getWeekNumber = function() {
var tempDate = new Date(this);
tempDate.setDate(tempDate.getDate() - (tempDate.getDay() + 6) % 7 + 3);
var dms = tempDate.valueOf();
tempDate.setMonth(0);
tempDate.setDate(4);
return Math.round((dms - tempDate.valueOf()) / (604800000)) + 1;
};
Date.prototype.getDayOfYear = function() {
var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0);
var time = now - then;
return Math.floor(time / 24*60*60*1000);
};
},
layout = function (el) {
var options = $(el).data('datepicker');
var cal = $('#' + options.id);
if (!options.extraHeight) {
var divs = $(el).find('div');
options.extraHeight = divs.get(0).offsetHeight + divs.get(1).offsetHeight;
options.extraWidth = divs.get(2).offsetWidth + divs.get(3).offsetWidth;
}
var tbl = cal.find('table:first').get(0);
var width = tbl.offsetWidth;
var height = tbl.offsetHeight;
cal.css({
width: width + options.extraWidth + 'px',
height: height + options.extraHeight + 'px'
}).find('div.datepickerContainer').css({
width: width + 'px',
height: height + 'px'
});
},
click = function(ev) {
if ($(ev.target).is('span')) {
ev.target = ev.target.parentNode;
}
var el = $(ev.target);
if (el.is('a')) {
ev.target.blur();
if (el.hasClass('datepickerDisabled')) {
return false;
}
var options = $(this).data('datepicker');
var parentEl = el.parent();
var tblEl = parentEl.parent().parent().parent();
var tblIndex = $('table', this).index(tblEl.get(0)) - 1;
var tmp = new Date(options.current);
var changed = false;
var fillIt = false;
if (parentEl.is('th')) {
if (parentEl.hasClass('datepickerWeek') && options.mode == 'range' && !parentEl.next().hasClass('datepickerDisabled')) {
var val = parseInt(parentEl.next().text(), 10);
tmp.addMonths(tblIndex - Math.floor(options.calendars/2));
if (parentEl.next().hasClass('datepickerNotInMonth')) {
tmp.addMonths(val > 15 ? -1 : 1);
}
tmp.setDate(val);
options.date[0] = (tmp.setHours(0,0,0,0)).valueOf();
tmp.setHours(23,59,59,0);
tmp.addDays(6);
options.date[1] = tmp.valueOf();
fillIt = true;
changed = true;
options.lastSel = false;
} else if (parentEl.hasClass('datepickerMonth')) {
tmp.addMonths(tblIndex - Math.floor(options.calendars/2));
switch (tblEl.get(0).className) {
case 'datepickerViewDays':
tblEl.get(0).className = 'datepickerViewMonths';
el.find('span').text(tmp.getFullYear());
break;
case 'datepickerViewMonths':
tblEl.get(0).className = 'datepickerViewYears';
el.find('span').text((tmp.getFullYear()-6) + ' - ' + (tmp.getFullYear()+5));
break;
case 'datepickerViewYears':
tblEl.get(0).className = 'datepickerViewDays';
el.find('span').text(formatDate(tmp, 'B, Y'));
break;
}
} else if (parentEl.parent().parent().is('thead')) {
switch (tblEl.get(0).className) {
case 'datepickerViewDays':
options.current.addMonths(parentEl.hasClass('datepickerGoPrev') ? -1 : 1);
break;
case 'datepickerViewMonths':
options.current.addYears(parentEl.hasClass('datepickerGoPrev') ? -1 : 1);
break;
case 'datepickerViewYears':
options.current.addYears(parentEl.hasClass('datepickerGoPrev') ? -12 : 12);
break;
}
fillIt = true;
}
} else if (parentEl.is('td') && !parentEl.hasClass('datepickerDisabled')) {
switch (tblEl.get(0).className) {
case 'datepickerViewMonths':
options.current.setMonth(tblEl.find('tbody.datepickerMonths td').index(parentEl));
options.current.setFullYear(parseInt(tblEl.find('thead th.datepickerMonth span').text(), 10));
options.current.addMonths(Math.floor(options.calendars/2) - tblIndex);
tblEl.get(0).className = 'datepickerViewDays';
break;
case 'datepickerViewYears':
options.current.setFullYear(parseInt(el.text(), 10));
tblEl.get(0).className = 'datepickerViewMonths';
break;
default:
var val = parseInt(el.text(), 10);
tmp.addMonths(tblIndex - Math.floor(options.calendars/2));
if (parentEl.hasClass('datepickerNotInMonth')) {
tmp.addMonths(val > 15 ? -1 : 1);
}
tmp.setDate(val);
switch (options.mode) {
case 'multiple':
val = (tmp.setHours(0,0,0,0)).valueOf();
if ($.inArray(val, options.date) > -1) {
$.each(options.date, function(nr, dat){
if (dat == val) {
options.date.splice(nr,1);
return false;
}
});
} else {
options.date.push(val);
}
break;
case 'range':
if (!options.lastSel) {
options.date[0] = (tmp.setHours(0,0,0,0)).valueOf();
}
val = (tmp.setHours(23,59,59,0)).valueOf();
if (val < options.date[0]) {
options.date[1] = options.date[0] + 86399000;
options.date[0] = val - 86399000;
} else {
options.date[1] = val;
}
options.lastSel = !options.lastSel;
break;
default:
options.date = tmp.valueOf();
break;
}
break;
}
fillIt = true;
changed = true;
}
if (fillIt) {
fill(this);
}
if (changed) {
options.onChange.apply(this, prepareDate(options));
}
}
return false;
},
prepareDate = function (options) {
var tmp;
if (options.mode == 'single') {
tmp = new Date(options.date);
return [formatDate(tmp, options.format), tmp, options.el];
} else {
tmp = [[],[], options.el];
$.each(options.date, function(nr, val){
var date = new Date(val);
tmp[0].push(formatDate(date, options.format));
tmp[1].push(date);
});
return tmp;
}
},
getViewport = function () {
var m = document.compatMode == 'CSS1Compat';
return {
l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
};
},
isChildOf = function(parentEl, el, container) {
if (parentEl == el) {
return true;
}
if (parentEl.contains) {
return parentEl.contains(el);
}
if ( parentEl.compareDocumentPosition ) {
return !!(parentEl.compareDocumentPosition(el) & 16);
}
var prEl = el.parentNode;
while(prEl && prEl != container) {
if (prEl == parentEl)
return true;
prEl = prEl.parentNode;
}
return false;
},
show = function (ev) {
var cal = $('#' + $(this).data('datepickerId'));
if (!cal.is(':visible')) {
var calEl = cal.get(0);
fill(calEl);
var options = cal.data('datepicker');
options.onBeforeShow.apply(this, [cal.get(0)]);
var pos = $(this).offset();
var viewPort = getViewport();
var top = pos.top;
var left = pos.left;
var oldDisplay = $.curCSS(calEl, 'display');
cal.css({
visibility: 'hidden',
display: 'block'
});
layout(calEl);
switch (options.position){
case 'top':
top -= calEl.offsetHeight;
break;
case 'left':
left -= calEl.offsetWidth;
break;
case 'right':
left += this.offsetWidth;
break;
case 'bottom':
top += this.offsetHeight;
break;
}
if (top + calEl.offsetHeight > viewPort.t + viewPort.h) {
top = pos.top - calEl.offsetHeight;
}
if (top < viewPort.t) {
top = pos.top + this.offsetHeight + calEl.offsetHeight;
}
if (left + calEl.offsetWidth > viewPort.l + viewPort.w) {
left = pos.left - calEl.offsetWidth;
}
if (left < viewPort.l) {
left = pos.left + this.offsetWidth
}
cal.css({
visibility: 'visible',
display: 'block',
top: top + 'px',
left: left + 'px'
});
if (options.onShow.apply(this, [cal.get(0)]) != false) {
cal.show();
}
$(document).bind('mousedown', {cal: cal, trigger: this}, hide);
}
return false;
},
hide = function (ev) {
if (ev.target != ev.data.trigger && !isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
if (ev.data.cal.data('datepicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
ev.data.cal.hide();
}
$(document).unbind('mousedown', hide);
}
};
return {
init: function(options){
options = $.extend({}, defaults, options||{});
extendDate(options.locale);
options.calendars = Math.max(1, parseInt(options.calendars,10)||1);
options.mode = /single|multiple|range/.test(options.mode) ? options.mode : 'single';
return this.each(function(){
if (!$(this).data('datepicker')) {
options.el = this;
if (options.date.constructor == String) {
options.date = parseDate(options.date, options.format);
options.date.setHours(0,0,0,0);
}
if (options.mode != 'single') {
if (options.date.constructor != Array) {
options.date = [options.date.valueOf()];
if (options.mode == 'range') {
options.date.push(((new Date(options.date[0])).setHours(23,59,59,0)).valueOf());
}
} else {
for (var i = 0; i < options.date.length; i++) {
options.date[i] = (parseDate(options.date[i], options.format).setHours(0,0,0,0)).valueOf();
}
if (options.mode == 'range') {
options.date[1] = ((new Date(options.date[1])).setHours(23,59,59,0)).valueOf();
}
}
} else {
options.date = options.date.valueOf();
}
if (!options.current) {
options.current = new Date();
} else {
options.current = parseDate(options.current, options.format);
}
options.current.setDate(1);
options.current.setHours(0,0,0,0);
var id = 'datepicker_' + parseInt(Math.random() * 1000), cnt;
options.id = id;
$(this).data('datepickerId', options.id);
var cal = $(tpl.wrapper).attr('id', id).bind('click', click).data('datepicker', options);
if (options.className) {
cal.addClass(options.className);
}
var html = '';
for (var i = 0; i < options.calendars; i++) {
cnt = options.starts;
if (i > 0) {
html += tpl.space;
}
html += tmpl(tpl.head.join(''), {
week: options.locale.weekMin,
prev: options.prev,
next: options.next,
day1: options.locale.daysMin[(cnt++)%7],
day2: options.locale.daysMin[(cnt++)%7],
day3: options.locale.daysMin[(cnt++)%7],
day4: options.locale.daysMin[(cnt++)%7],
day5: options.locale.daysMin[(cnt++)%7],
day6: options.locale.daysMin[(cnt++)%7],
day7: options.locale.daysMin[(cnt++)%7]
});
}
cal
.find('tr:first').append(html)
.find('table').addClass(views[options.view]);
fill(cal.get(0));
if (options.flat) {
cal.appendTo(this).show().css('position', 'relative');
layout(cal.get(0));
} else {
cal.appendTo(document.body);
$(this).bind(options.eventName, show);
}
}
});
},
showPicker: function() {
return this.each( function () {
if ($(this).data('datepickerId')) {
show.apply(this);
}
});
},
hidePicker: function() {
return this.each( function () {
if ($(this).data('datepickerId')) {
$('#' + $(this).data('datepickerId')).hide();
}
});
},
setDate: function(date, shiftTo){
return this.each(function(){
if ($(this).data('datepickerId')) {
var cal = $('#' + $(this).data('datepickerId'));
var options = cal.data('datepicker');
options.date = date;
if (options.date.constructor == String) {
options.date = parseDate(options.date, options.format);
options.date.setHours(0,0,0,0);
}
if (options.mode != 'single') {
if (options.date.constructor != Array) {
options.date = [options.date.valueOf()];
if (options.mode == 'range') {
options.date.push(((new Date(options.date[0])).setHours(23,59,59,0)).valueOf());
}
} else {
for (var i = 0; i < options.date.length; i++) {
options.date[i] = (parseDate(options.date[i], options.format).setHours(0,0,0,0)).valueOf();
}
if (options.mode == 'range') {
options.date[1] = ((new Date(options.date[1])).setHours(23,59,59,0)).valueOf();
}
}
} else {
options.date = options.date.valueOf();
}
if (shiftTo) {
options.current = new Date (options.mode != 'single' ? options.date[0] : options.date);
}
fill(cal.get(0));
}
});
},
getDate: function(formated) {
if (this.size() > 0) {
return prepareDate($('#' + $(this).data('datepickerId')).data('datepicker'))[formated ? 0 : 1];
}
},
clear: function(){
return this.each(function(){
if ($(this).data('datepickerId')) {
var cal = $('#' + $(this).data('datepickerId'));
var options = cal.data('datepicker');
if (options.mode != 'single') {
options.date = [];
fill(cal.get(0));
}
}
});
},
fixLayout: function(){
return this.each(function(){
if ($(this).data('datepickerId')) {
var cal = $('#' + $(this).data('datepickerId'));
var options = cal.data('datepicker');
if (options.flat) {
layout(cal.get(0));
}
}
});
}
};
}();
$.fn.extend({
DatePicker: DatePicker.init,
DatePickerHide: DatePicker.hidePicker,
DatePickerShow: DatePicker.showPicker,
DatePickerSetDate: DatePicker.setDate,
DatePickerGetDate: DatePicker.getDate,
DatePickerClear: DatePicker.clear,
DatePickerLayout: DatePicker.fixLayout
});
})(jQuery);
(function(){
var cache = {};
this.tmpl = function tmpl(str, data){
// Figure out if we're getting a template, or if we need to
// load the template - and be sure to cache the result.
var fn = !/\W/.test(str) ?
cache[str] = cache[str] ||
tmpl(document.getElementById(str).innerHTML) :
// Generate a reusable function that will serve as a template
// generator (and which will be cached).
new Function("obj",
"var p=[],print=function(){p.push.apply(p,arguments);};" +
// Introduce the data as local variables using with(){}
"with(obj){p.push('" +
// Convert the template into pure JavaScript
str
.replace(/[\r\t\n]/g, " ")
.split("<%").join("\t")
.replace(/((^|%>)[^\t]*)'/g, "$1\r")
.replace(/\t=(.*?)%>/g, "',$1,'")
.split("\t").join("');")
.split("%>").join("p.push('")
.split("\r").join("\\'")
+ "');}return p.join('');");
// Provide some basic currying to the user
return data ? fn( data ) : fn;
};
})();

View file

@ -0,0 +1,34 @@
/**
*
* Zoomimage
* Author: Stefan Petre www.eyecon.ro
*
*/
(function($){
var EYE = window.EYE = function() {
var _registered = {
init: []
};
return {
init: function() {
$.each(_registered.init, function(nr, fn){
fn.call();
});
},
extend: function(prop) {
for (var i in prop) {
if (prop[i] != undefined) {
this[i] = prop[i];
}
}
},
register: function(fn, type) {
if (!_registered[type]) {
_registered[type] = [];
}
_registered[type].push(fn);
}
};
}();
$(EYE.init);
})(jQuery);

4376
modules/chat/datepicker/js/jquery.js vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,106 @@
(function($){
var initLayout = function() {
var hash = window.location.hash.replace('#', '');
var currentTab = $('ul.navigationTabs a')
.bind('click', showTab)
.filter('a[rel=' + hash + ']');
if (currentTab.size() == 0) {
currentTab = $('ul.navigationTabs a:first');
}
showTab.apply(currentTab.get(0));
$('#date').DatePicker({
flat: true,
date: '2008-07-31',
current: '2008-07-31',
calendars: 1,
starts: 1,
view: 'years'
});
var now = new Date();
now.addDays(-10);
var now2 = new Date();
now2.addDays(-5);
now2.setHours(0,0,0,0);
$('#date2').DatePicker({
flat: true,
date: ['2008-07-31', '2008-07-28'],
current: '2008-07-31',
format: 'Y-m-d',
calendars: 1,
mode: 'multiple',
onRender: function(date) {
return {
disabled: (date.valueOf() < now.valueOf()),
className: date.valueOf() == now2.valueOf() ? 'datepickerSpecial' : false
}
},
onChange: function(formated, dates) {
},
starts: 0
});
$('#clearSelection').bind('click', function(){
$('#date3').DatePickerClear();
return false;
});
$('#date3').DatePicker({
flat: true,
date: ['2009-12-28','2010-01-23'],
current: '2010-01-01',
calendars: 3,
mode: 'range',
starts: 1
});
$('.inputDate').DatePicker({
format:'m/d/Y',
date: $('#inputDate').val(),
current: $('#inputDate').val(),
starts: 1,
position: 'right',
onBeforeShow: function(){
$('#inputDate').DatePickerSetDate($('#inputDate').val(), true);
},
onChange: function(formated, dates){
$('#inputDate').val(formated);
if ($('#closeOnSelect input').attr('checked')) {
$('#inputDate').DatePickerHide();
}
}
});
var now3 = new Date();
now3.addDays(-4);
var now4 = new Date()
$('#widgetCalendar').DatePicker({
flat: true,
format: 'd B, Y',
date: [new Date(now3), new Date(now4)],
calendars: 3,
mode: 'range',
starts: 1,
onChange: function(formated) {
$('#widgetField span').get(0).innerHTML = formated.join(' &divide; ');
}
});
var state = false;
$('#widgetField>a').bind('click', function(){
$('#widgetCalendar').stop().animate({height: state ? 0 : $('#widgetCalendar div.datepicker').get(0).offsetHeight}, 500);
state = !state;
return false;
});
$('#widgetCalendar div.datepicker').css('position', 'absolute');
};
var showTab = function(e) {
var tabIndex = $('ul.navigationTabs a')
.removeClass('active')
.index(this);
$(this)
.addClass('active')
.blur();
$('div.tab')
.hide()
.eq(tabIndex)
.show();
};
EYE.register(initLayout, 'init');
})(jQuery)

View file

@ -0,0 +1,252 @@
/**
*
* Utilities
* Author: Stefan Petre www.eyecon.ro
*
*/
(function($) {
EYE.extend({
getPosition : function(e, forceIt)
{
var x = 0;
var y = 0;
var es = e.style;
var restoreStyles = false;
if (forceIt && jQuery.curCSS(e,'display') == 'none') {
var oldVisibility = es.visibility;
var oldPosition = es.position;
restoreStyles = true;
es.visibility = 'hidden';
es.display = 'block';
es.position = 'absolute';
}
var el = e;
if (el.getBoundingClientRect) { // IE
var box = el.getBoundingClientRect();
x = box.left + Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) - 2;
y = box.top + Math.max(document.documentElement.scrollTop, document.body.scrollTop) - 2;
} else {
x = el.offsetLeft;
y = el.offsetTop;
el = el.offsetParent;
if (e != el) {
while (el) {
x += el.offsetLeft;
y += el.offsetTop;
el = el.offsetParent;
}
}
if (jQuery.browser.safari && jQuery.curCSS(e, 'position') == 'absolute' ) {
x -= document.body.offsetLeft;
y -= document.body.offsetTop;
}
el = e.parentNode;
while (el && el.tagName.toUpperCase() != 'BODY' && el.tagName.toUpperCase() != 'HTML')
{
if (jQuery.curCSS(el, 'display') != 'inline') {
x -= el.scrollLeft;
y -= el.scrollTop;
}
el = el.parentNode;
}
}
if (restoreStyles == true) {
es.display = 'none';
es.position = oldPosition;
es.visibility = oldVisibility;
}
return {x:x, y:y};
},
getSize : function(e)
{
var w = parseInt(jQuery.curCSS(e,'width'), 10);
var h = parseInt(jQuery.curCSS(e,'height'), 10);
var wb = 0;
var hb = 0;
if (jQuery.curCSS(e, 'display') != 'none') {
wb = e.offsetWidth;
hb = e.offsetHeight;
} else {
var es = e.style;
var oldVisibility = es.visibility;
var oldPosition = es.position;
es.visibility = 'hidden';
es.display = 'block';
es.position = 'absolute';
wb = e.offsetWidth;
hb = e.offsetHeight;
es.display = 'none';
es.position = oldPosition;
es.visibility = oldVisibility;
}
return {w:w, h:h, wb:wb, hb:hb};
},
getClient : function(e)
{
var h, w;
if (e) {
w = e.clientWidth;
h = e.clientHeight;
} else {
var de = document.documentElement;
w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
}
return {w:w,h:h};
},
getScroll : function (e)
{
var t=0, l=0, w=0, h=0, iw=0, ih=0;
if (e && e.nodeName.toLowerCase() != 'body') {
t = e.scrollTop;
l = e.scrollLeft;
w = e.scrollWidth;
h = e.scrollHeight;
} else {
if (document.documentElement) {
t = document.documentElement.scrollTop;
l = document.documentElement.scrollLeft;
w = document.documentElement.scrollWidth;
h = document.documentElement.scrollHeight;
} else if (document.body) {
t = document.body.scrollTop;
l = document.body.scrollLeft;
w = document.body.scrollWidth;
h = document.body.scrollHeight;
}
if (typeof pageYOffset != 'undefined') {
t = pageYOffset;
l = pageXOffset;
}
iw = self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
ih = self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
}
return { t: t, l: l, w: w, h: h, iw: iw, ih: ih };
},
getMargins : function(e, toInteger)
{
var t = jQuery.curCSS(e,'marginTop') || '';
var r = jQuery.curCSS(e,'marginRight') || '';
var b = jQuery.curCSS(e,'marginBottom') || '';
var l = jQuery.curCSS(e,'marginLeft') || '';
if (toInteger)
return {
t: parseInt(t, 10)||0,
r: parseInt(r, 10)||0,
b: parseInt(b, 10)||0,
l: parseInt(l, 10)
};
else
return {t: t, r: r, b: b, l: l};
},
getPadding : function(e, toInteger)
{
var t = jQuery.curCSS(e,'paddingTop') || '';
var r = jQuery.curCSS(e,'paddingRight') || '';
var b = jQuery.curCSS(e,'paddingBottom') || '';
var l = jQuery.curCSS(e,'paddingLeft') || '';
if (toInteger)
return {
t: parseInt(t, 10)||0,
r: parseInt(r, 10)||0,
b: parseInt(b, 10)||0,
l: parseInt(l, 10)
};
else
return {t: t, r: r, b: b, l: l};
},
getBorder : function(e, toInteger)
{
var t = jQuery.curCSS(e,'borderTopWidth') || '';
var r = jQuery.curCSS(e,'borderRightWidth') || '';
var b = jQuery.curCSS(e,'borderBottomWidth') || '';
var l = jQuery.curCSS(e,'borderLeftWidth') || '';
if (toInteger)
return {
t: parseInt(t, 10)||0,
r: parseInt(r, 10)||0,
b: parseInt(b, 10)||0,
l: parseInt(l, 10)||0
};
else
return {t: t, r: r, b: b, l: l};
},
traverseDOM : function(nodeEl, func)
{
func(nodeEl);
nodeEl = nodeEl.firstChild;
while(nodeEl){
EYE.traverseDOM(nodeEl, func);
nodeEl = nodeEl.nextSibling;
}
},
getInnerWidth : function(el, scroll) {
var offsetW = el.offsetWidth;
return scroll ? Math.max(el.scrollWidth,offsetW) - offsetW + el.clientWidth:el.clientWidth;
},
getInnerHeight : function(el, scroll) {
var offsetH = el.offsetHeight;
return scroll ? Math.max(el.scrollHeight,offsetH) - offsetH + el.clientHeight:el.clientHeight;
},
getExtraWidth : function(el) {
if($.boxModel)
return (parseInt($.curCSS(el, 'paddingLeft'))||0)
+ (parseInt($.curCSS(el, 'paddingRight'))||0)
+ (parseInt($.curCSS(el, 'borderLeftWidth'))||0)
+ (parseInt($.curCSS(el, 'borderRightWidth'))||0);
return 0;
},
getExtraHeight : function(el) {
if($.boxModel)
return (parseInt($.curCSS(el, 'paddingTop'))||0)
+ (parseInt($.curCSS(el, 'paddingBottom'))||0)
+ (parseInt($.curCSS(el, 'borderTopWidth'))||0)
+ (parseInt($.curCSS(el, 'borderBottomWidth'))||0);
return 0;
},
isChildOf: function(parentEl, el, container) {
if (parentEl == el) {
return true;
}
if (!el || !el.nodeType || el.nodeType != 1) {
return false;
}
if (parentEl.contains && !$.browser.safari) {
return parentEl.contains(el);
}
if ( parentEl.compareDocumentPosition ) {
return !!(parentEl.compareDocumentPosition(el) & 16);
}
var prEl = el.parentNode;
while(prEl && prEl != container) {
if (prEl == parentEl)
return true;
prEl = prEl.parentNode;
}
return false;
},
centerEl : function(el, axis)
{
var clientScroll = EYE.getScroll();
var size = EYE.getSize(el);
if (!axis || axis == 'vertically')
$(el).css(
{
top: clientScroll.t + ((Math.min(clientScroll.h,clientScroll.ih) - size.hb)/2) + 'px'
}
);
if (!axis || axis == 'horizontally')
$(el).css(
{
left: clientScroll.l + ((Math.min(clientScroll.w,clientScroll.iw) - size.wb)/2) + 'px'
}
);
}
});
if (!$.easing.easeout) {
$.easing.easeout = function(p, n, firstNum, delta, duration) {
return -delta * ((n=n/duration-1)*n*n*n - 1) + firstNum;
};
}
})(jQuery);

View file

@ -0,0 +1,107 @@
/*
* RightClickMenu jQuery plugin
*
* Copyright (c) 2011 Evgeni Tsarovski
* http://www.etcoding.com
*
*
Generates a right-click menu.
Function takes a parameter, which is an array of objects with following properties:
name: text that will be displayed on menu
action: user-defined function, that will be executed when user clicks on the menu item. A jQuery's "$this" element will be passed as a function parameter.
Usage:
var menu = [
{ name: "make red", action: function (element) { $(element).css("color", "red"); } },
{ name: "make black", action: function (element) { $(element).css("color", "black"); } }
];
$("element").rightClickMenu(menu);
Generated menu is wrapped in div with css class 'rightClickMenu'.
*/
(function ($) {
$.fn.rightClickMenu = function (options) {
// function must receive options
if (!options || options.length == 0) {
alert("Options for rightClickMenu must be defined");
return;
}
// attach hideMenu function to a click anywhere in a document, if it wasn't attached before.
if (!$.fn.rightClickMenu.initPerformed) {
$(document).click(function () { hideMenu(); });
$.fn.rightClickMenu.initPerformed = true;
}
// stop context menu from appearing on a target element
this.bind("contextmenu", function (e) {
return false;
});
// now attach right-click to the target element
this.bind('mousedown', function (event) {
if (event.which != 3) // not right click ?
return;
// in case other menu is already opened..
hideMenu();
var menuDiv = retrieveCreateMenu(options, this);
menuDiv.css('left', event.pageX);
menuDiv.css('top', event.pageY);
menuDiv.show();
});
// Creates new menu markup, or retrieves existing one.
function retrieveCreateMenu(options, element) {
// upon creation, original element receives the menu Id. Retrieve the menu using this Id, if exists.
var menuId = $(element).attr("data-rightClickMenuId");
// if menu already created, return it
if (menuId) {
return $("div[data-rightClickMenuId='" + menuId + "']");
}
// Single page can have multiple elements with menus attached, so we need to link elements and menus.
// Lets create new menu, giving it a data-rightClickMenuId attribute with new ID.
if (!this.menuId)
this.menuId = 0;
menuId = ++this.menuId;
$(element).attr("data-rightClickMenuId", menuId);
var menuDiv = $("<div class='rightClickMenu' data-rightClickMenuId='" + menuId + "'></div>");
var menuUl = $("<ul></ul>");
menuDiv.append(menuUl);
for (var i = 0; i < options.length; i++) {
var li = $("<li>" + options[i].name + "</li>");
var func = function (uf) { return function () { uf(element); } } // change the scope
li.click(func(options[i].action));
menuUl.append(li);
};
menuDiv.hide();
menuDiv.css('position', 'absolute');
menuDiv.css('z-index', '1000');
// disable browser's context menu
menuDiv.bind("contextmenu", function (e) {
return false;
});
$('body').append(menuDiv);
return menuDiv;
}
// hides any open menu
function hideMenu() {
var menu = $('div.rightClickMenu');
if (menu.length == 0)
return;
menu.hide();
}
};
})(jQuery);

View file

@ -0,0 +1 @@
(function(e){jQuery.fn.extend({slimScroll:function(n){var r={width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:false,disableFadeOut:false,railVisible:false,railColor:"#333",railOpacity:.2,railDraggable:true,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:false,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"};var i=e.extend(r,n);this.each(function(){function x(t){if(!r){return}var t=t||window.event;var n=0;if(t.wheelDelta){n=-t.wheelDelta/120}if(t.detail){n=t.detail/3}var s=t.target||t.srcTarget||t.srcElement;if(e(s).closest("."+i.wrapperClass).is(m.parent())){T(n,true)}if(t.preventDefault&&!v){t.preventDefault()}if(!v){t.returnValue=false}}function T(e,t,n){v=false;var r=e;var s=m.outerHeight()-E.outerHeight();if(t){r=parseInt(E.css("top"))+e*parseInt(i.wheelStep)/100*E.outerHeight();r=Math.min(Math.max(r,0),s);r=e>0?Math.ceil(r):Math.floor(r);E.css({top:r+"px"})}c=parseInt(E.css("top"))/(m.outerHeight()-E.outerHeight());r=c*(m[0].scrollHeight-m.outerHeight());if(n){r=e;var u=r/m[0].scrollHeight*m.outerHeight();u=Math.min(Math.max(u,0),s);E.css({top:u+"px"})}m.scrollTop(r);m.trigger("slimscrolling",~~r);k();L()}function N(){if(window.addEventListener){this.addEventListener("DOMMouseScroll",x,false);this.addEventListener("mousewheel",x,false)}else{document.attachEvent("onmousewheel",x)}}function C(){l=Math.max(m.outerHeight()/m[0].scrollHeight*m.outerHeight(),d);E.css({height:l+"px"});var e=l==m.outerHeight()?"none":"block";E.css({display:e})}function k(){C();clearTimeout(a);if(c==~~c){v=i.allowPageScroll;if(h!=c){var e=~~c==0?"top":"bottom";m.trigger("slimscroll",e)}}else{v=false}h=c;if(l>=m.outerHeight()){v=true;return}E.stop(true,true).fadeIn("fast");if(i.railVisible){w.stop(true,true).fadeIn("fast")}}function L(){if(!i.alwaysVisible){a=setTimeout(function(){if(!(i.disableFadeOut&&r)&&!s&&!u){E.fadeOut("slow");w.fadeOut("slow")}},1e3)}}var r,s,u,a,f,l,c,h,p="<div></div>",d=30,v=false;var m=e(this);if(m.parent().hasClass(i.wrapperClass)){var g=m.scrollTop();E=m.parent().find("."+i.barClass);w=m.parent().find("."+i.railClass);C();if(e.isPlainObject(n)){if("height"in n&&n.height=="auto"){m.parent().css("height","auto");m.css("height","auto");var y=m.parent().parent().height();m.parent().css("height",y);m.css("height",y)}if("scrollTo"in n){g=parseInt(i.scrollTo)}else if("scrollBy"in n){g+=parseInt(i.scrollBy)}else if("destroy"in n){E.remove();w.remove();m.unwrap();return}T(g,false,true)}return}i.height=i.height=="auto"?m.parent().height():i.height;var b=e(p).addClass(i.wrapperClass).css({position:"relative",overflow:"hidden",width:i.width,height:i.height});m.css({overflow:"hidden",width:i.width,height:i.height});var w=e(p).addClass(i.railClass).css({width:i.size,height:"100%",position:"absolute",top:0,display:i.alwaysVisible&&i.railVisible?"block":"none","border-radius":i.railBorderRadius,background:i.railColor,opacity:i.railOpacity,zIndex:90});var E=e(p).addClass(i.barClass).css({background:i.color,width:i.size,position:"absolute",top:0,opacity:i.opacity,display:i.alwaysVisible?"block":"none","border-radius":i.borderRadius,BorderRadius:i.borderRadius,MozBorderRadius:i.borderRadius,WebkitBorderRadius:i.borderRadius,zIndex:99});var S=i.position=="right"?{right:i.distance}:{left:i.distance};w.css(S);E.css(S);m.wrap(b);m.parent().append(E);m.parent().append(w);if(i.railDraggable){E.bind("mousedown",function(n){var r=e(document);u=true;t=parseFloat(E.css("top"));pageY=n.pageY;r.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY;E.css("top",currTop);T(0,E.position().top,false)});r.bind("mouseup.slimscroll",function(e){u=false;L();r.unbind(".slimscroll")});return false}).bind("selectstart.slimscroll",function(e){e.stopPropagation();e.preventDefault();return false})}w.hover(function(){k()},function(){L()});E.hover(function(){s=true},function(){s=false});m.hover(function(){r=true;k();L()},function(){r=false;L()});m.bind("touchstart",function(e,t){if(e.originalEvent.touches.length){f=e.originalEvent.touches[0].pageY}});m.bind("touchmove",function(e){if(!v){e.originalEvent.preventDefault()}if(e.originalEvent.touches.length){var t=(f-e.originalEvent.touches[0].pageY)/i.touchScrollStep;T(t,true);f=e.originalEvent.touches[0].pageY}});C();if(i.start==="bottom"){E.css({top:m.outerHeight()-E.outerHeight()});T(0,true)}else if(i.start!=="top"){T(e(i.start).position().top,null,true);if(!i.alwaysVisible){E.hide()}}N()});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery)

232
modules/chat/js/scroll.js Normal file
View file

@ -0,0 +1,232 @@
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* Version: 0.2.5
*
*/
(function($) {
jQuery.fn.extend({
slimScroll: function(o) {
var ops = o;
//do it for every element that matches selector
this.each(function(){
var isOverPanel, isOverBar, isDragg, queueHide, barHeight,
divS = '<div></div>',
minBarHeight = 30,
wheelStep = 30,
o = ops || {},
cwidth = o.width || 'auto',
cheight = o.height || '250px',
size = o.size || '7px',
color = o.color || '#000',
position = o.position || 'right',
opacity = o.opacity || .4,
alwaysVisible = o.alwaysVisible === true;
//used in event handlers and for better minification
var me = $(this);
//wrap content
var wrapper = $(divS).css({
position: 'relative',
overflow: 'hidden',
width: cwidth,
height: cheight
}).attr({ 'class': 'slimScrollDiv' });
//update style for the div
me.css({
overflow: 'hidden',
width: cwidth,
height: cheight
});
//create scrollbar rail
var rail = $(divS).css({
width: '15px',
height: '100%',
position: 'absolute',
top: 0
});
//create scrollbar
var bar = $(divS).attr({
'class': 'slimScrollBar ',
style: 'border-radius: ' + size
}).css({
background: color,
width: size,
position: 'absolute',
top: 0,
opacity: opacity,
display: alwaysVisible ? 'block' : 'none',
BorderRadius: size,
MozBorderRadius: size,
WebkitBorderRadius: size,
zIndex: 99
});
//set position
var posCss = (position == 'right') ? { right: '1px' } : { left: '1px' };
rail.css(posCss);
bar.css(posCss);
//wrap it
me.wrap(wrapper);
//append to parent div
me.parent().append(bar);
me.parent().append(rail);
//make it draggable
bar.draggable({
axis: 'y',
containment: 'parent',
start: function() { isDragg = true; },
stop: function() { isDragg = false; hideBar(); },
drag: function(e)
{
//scroll content
scrollContent(0, $(this).position().top, false);
}
});
//on rail over
rail.hover(function(){
showBar();
}, function(){
hideBar();
});
//on bar over
bar.hover(function(){
isOverBar = true;
}, function(){
isOverBar = false;
});
//show on parent mouseover
me.hover(function(){
isOverPanel = true;
showBar();
hideBar();
}, function(){
isOverPanel = false;
hideBar();
});
var _onWheel = function(e)
{
//use mouse wheel only when mouse is over
if (!isOverPanel) { return; }
var e = e || window.event;
var delta = 0;
if (e.wheelDelta) { delta = -e.wheelDelta/120; }
if (e.detail) { delta = e.detail / 3; }
//scroll content
scrollContent(0, delta, true);
//stop window scroll
if (e.preventDefault) { e.preventDefault(); }
e.returnValue = false;
}
var scrollContent = function(x, y, isWheel)
{
var delta = y;
if (isWheel)
{
//move bar with mouse wheel
delta = bar.position().top + y * wheelStep;
//move bar, make sure it doesn't go out
delta = Math.max(delta, 0);
var maxTop = me.outerHeight() - bar.outerHeight();
delta = Math.min(delta, maxTop);
//scroll the scrollbar
bar.css({ top: delta + 'px' });
}
//calculate actual scroll amount
percentScroll = parseInt(bar.position().top) / (me.outerHeight() - bar.outerHeight());
delta = percentScroll * (me[0].scrollHeight - me.outerHeight());
//scroll content
me.scrollTop(delta);
//ensure bar is visible
showBar();
}
var attachWheel = function()
{
if (window.addEventListener)
{
this.addEventListener('DOMMouseScroll', _onWheel, false );
this.addEventListener('mousewheel', _onWheel, false );
}
else
{
document.attachEvent("onmousewheel", _onWheel)
}
}
//attach scroll events
attachWheel();
var getBarHeight = function()
{
//calculate scrollbar height and make sure it is not too small
barHeight = Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight);
bar.css({ height: barHeight + 'px' });
}
//set up initial height
getBarHeight();
var showBar = function()
{
//recalculate bar height
getBarHeight();
clearTimeout(queueHide);
//show only when required
if(barHeight >= me.outerHeight()) {
return;
}
bar.fadeIn('fast');
}
var hideBar = function()
{
//only hide when options allow it
if (!alwaysVisible)
{
queueHide = setTimeout(function(){
if (!isOverBar && !isDragg) { bar.fadeOut('slow'); }
}, 1000);
}
}
});
//maintain chainability
return this;
}
});
jQuery.fn.extend({
slimscroll: jQuery.fn.slimScroll
});
})(jQuery);

13
modules/chat/js/slimScroll.min.js vendored Normal file
View file

@ -0,0 +1,13 @@
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* Version: 0.5.0
*
*/
(function(d){jQuery.fn.extend({slimScroll:function(o){var a=ops=d.extend({wheelStep:20,width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:0.4,alwaysVisible:!1,railVisible:!1,railColor:"#333",railOpacity:"0.2",railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,scroll:0},o);this.each(function(){function h(a,d,e){var f=a;d&&(f=parseInt(c.css("top"))+a*B/100*c.outerHeight(),d=b.outerHeight()-c.outerHeight(),
f=Math.min(Math.max(f,0),d),c.css({top:f+"px"}));k=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight());f=k*(b[0].scrollHeight-b.outerHeight());e&&(f=a,a=f/b[0].scrollHeight*b.outerHeight(),c.css({top:a+"px"}));b.scrollTop(f);p();i()}function w(){q=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),o);c.css({height:q+"px"})}function p(){w();clearTimeout(x);l=C&&k==~~k;q>=b.outerHeight()?l=!0:(c.stop(!0,!0).fadeIn("fast"),y&&g.stop(!0,!0).fadeIn("fast"))}function i(){m||(x=setTimeout(function(){!r&&
!s&&(c.fadeOut("slow"),g.fadeOut("slow"))},1E3))}var t,r,s,x,q,k,o=30,l=!1,B=parseInt(a.wheelStep),j=a.width,z=a.height,e=a.size,D=a.color,E=a.position,A=a.distance,u=a.start,F=a.opacity,m=a.alwaysVisible,y=a.railVisible,G=a.railColor,H=a.railOpacity,C=a.allowPageScroll,n=a.scroll,b=d(this);if(b.parent().hasClass("slimScrollDiv"))n&&(c=b.parent().find(".slimScrollBar"),g=b.parent().find(".slimScrollRail"),h(b.scrollTop()+parseInt(n),!1,!0));else{n=d("<div></div>").addClass(a.wrapperClass).css({position:"relative",
overflow:"hidden",width:j,height:z});b.css({overflow:"hidden",width:j,height:z});var g=d("<div></div>").addClass(a.railClass).css({width:e,height:"100%",position:"absolute",top:0,display:m&&y?"block":"none","border-radius":e,background:G,opacity:H,zIndex:90}),c=d("<div></div>").addClass(a.barClass).css({background:D,width:e,position:"absolute",top:0,opacity:F,display:m?"block":"none","border-radius":e,BorderRadius:e,MozBorderRadius:e,WebkitBorderRadius:e,zIndex:99}),j="right"==E?{right:A}:{left:A};
g.css(j);c.css(j);b.wrap(n);b.parent().append(c);b.parent().append(g);c.draggable({axis:"y",containment:"parent",start:function(){s=!0},stop:function(){s=!1;i()},drag:function(){h(0,d(this).position().top,!1)}});g.hover(function(){p()},function(){i()});c.hover(function(){r=!0},function(){r=!1});b.hover(function(){t=!0;p();i()},function(){t=!1;i()});var v=function(a){if(t){var a=a||window.event,b=0;a.wheelDelta&&(b=-a.wheelDelta/120);a.detail&&(b=a.detail/3);h(b,!0);a.preventDefault&&!l&&a.preventDefault();
l||(a.returnValue=!1)}};(function(){window.addEventListener?(this.addEventListener("DOMMouseScroll",v,!1),this.addEventListener("mousewheel",v,!1)):document.attachEvent("onmousewheel",v)})();w();"bottom"==u?(c.css({top:b.outerHeight()-c.outerHeight()}),h(0,!0)):"object"==typeof u&&(h(d(u).position().top,null,!0),m||c.hide())}});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery);

1
modules/chat/js/tab.min.js vendored Normal file
View file

@ -0,0 +1 @@
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 q=r(a){2.5=a};q.t={5:8,k:l,m:8,9:-1,4:-1,u:8,d:l,v:r(){2.k=l;2.m=8;2.u=8;2.9=-1;2.4=-1;2.d=l}};q.t.w=r w(){7 a=2.5.e;3(!(2.k)){7 b;2.4=a.z(" ");3(a.f<1){o}6 3(2.4<0){b=a}6 3(++(2.4)>=a.f){o}6{b=a.s(2.4)}3(b.x(0,1)=="/"){2.d=p;b=b.x(1)}2.m=b.y();2.k=p}7 c=$("a.A",B.C.D);3(2.9>=c.f){2.v();o}E(7 n=0;n<c.f;n++){i=(n+2.9+1)%c.f;3(c.g(i).h(\'j\').y().F(2.m)==0){3(2.4>=1){3(2.d==p){2.5.e="/"+a.s(0,2.4)+c.g(i).h(\'j\')}6{2.5.e=a.s(0,2.4)+c.g(i).h(\'j\')}}6{3(2.d==p){2.5.e="/"+c.g(i).h(\'j\')}6{2.5.e=c.g(i).h(\'j\')}}2.9=i;o}}};',42,42,'||this|if|lastSpace|input|else|var|null|lastHitIdx||||whisper|value|length|eq|attr||id|tabInProgress|false|tabBase||return|true|TabCompleter|function|substring|prototype|matches|reset|complete|substr|toLowerCase|lastIndexOf|notice|window|parent|document|for|indexOf'.split('|'),0,{}))

73
modules/chat/js/tab.src Normal file
View file

@ -0,0 +1,73 @@
var TabCompleter = function(element) {
this.input = element;
};
TabCompleter.prototype = {
input : null,
tabInProgress : false,
tabBase : null,
lastHitIdx : -1,
lastSpace : -1,
matches: null,
reset : function () {
this.tabInProgress = false;
this.tabBase = null;
this.matches = null;
this.lastHitIdx = -1;
this.lastSpace = -1;
}
};
TabCompleter.prototype.complete = function complete()
{
var text = this.input.value;
if (!(this.tabInProgress))
{
var lastWord;
this.lastSpace = text.lastIndexOf(" ");
if (text.length < 1) {
return;
}
else if (this.lastSpace < 0) {
lastWord = text;
}
else if (++(this.lastSpace) >= text.length) {
return;
}
else {
lastWord = text.substring(this.lastSpace);
}
if(lastWord.substr(0,1)=="/"){
lastWord=lastWord.substr(1);
}
this.tabBase = lastWord.toLowerCase();
this.tabInProgress = true;
}
var users = $("a.notice",window.parent.document);
if (this.lastHitIdx >= users.length) {
this.reset();
return;
}
for (var n = 0; n < users.length; n++)
{
i = (n + this.lastHitIdx + 1) % users.length;
if (users.eq(i).attr('id').toLowerCase().indexOf(this.tabBase) == 0)
{
if (this.lastSpace >= 1) {
this.input.value = text.substring(0, this.lastSpace) + users.eq(i).attr('id');
}
else {
this.input.value = users.eq(i).attr('id');
}
this.lastHitIdx = i;
return;
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

34
modules/chat/mobile.css Normal file
View file

@ -0,0 +1,34 @@
@import url(https://fonts.googleapis.com/css?family=Arimo&subset=latin,latin-ext);
#copyrightline{
color: #FFFFFF;
font-size: small;
}
body{
color: #ffffff;
font-family: 'Arimo' !important;
font-style: normal;
font-size: 13px;
font: 13px 'Arimo',verdana,tahoma,sans-serif;
}
.info{
color: #FFFFFF;
}
.time{
color: #FFFFFF;
font-size: 13px;
}
.ooc{
font-size: 13px;
}
.me{
font-size: 13px;
}
.user_whisper {
cursor: pointer;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

45
modules/chat/style.css Normal file
View file

@ -0,0 +1,45 @@
#copyrightline{
color: #FFFFFF;
font-size: small;
}
body{
color: #FFFFFF;
font-family: 'Rubik', sans-serif !important;
font-style: normal;
font: 'Cuprum',verdana,tahoma,sans-serif;
}
b{
font-family: 'Rubik', !important;
font-weight: 700;
}
.narrator{
font-family: 'Rubik', italic !important;
font: 14px 'Coda';
color: #FFFFFF;
font-weight: bold !important;
}
.info{
color: #FFFFFF;
font-weight: bold !important;
font-style: italic !important;
}
.time{
color: #FFFFFF;
font-size: 15px;
}
.ooc{
font-size: 15px;
}
.me{
font-size: 15px;
}
.user_whisper {
cursor: pointer;
}

View file

@ -0,0 +1,25 @@
<h4>Raumliste</h4><a id="userlist" style="font-size:8px;">(schlie&szlig;en)</a><br />
{if $users==""}
<p>
No users.
</p>
{else}
<div style="padding:5px;">
{foreach from=$users key=key item=user}
{if $user.s == false}
<strong><a id="{$key}" class="room">{$key}</a></strong> <img src="/themes/austria/images/unlocked.png" style="border:none;" /><br />
{else}
<strong><a>{$key}</a></strong> <img src="/themes/austria/images/locked.png" style="border:none;" /><br />
{/if}
{foreach from=$user.u item=i}
<a id="{$i.n}" class="notice"><img src="/themes/austria/images/{$i.i}" style="border:none;" /></a>{$i.l}<a href="/np/{$i.n}" target="_blank" style="color:#{$i.c}; margin-left: 8px;">{$i.n}</a></span>&nbsp;<img src="/themes/archer/images/{$i.g}.png" style="border:none;" /><br />
{/foreach}
{/foreach}
{/if}
</div>
{if $js!=""}
<script type="text/javascript">
{$js}
$(".notice").rightClickMenu(menu);
</script>
{/if}

View file

@ -0,0 +1,22 @@
<div class="twelve columns">
<h2>Chat:</h2>
<form name="form" id="chatform" action="chat/in.html" method="post">
Raum: <select name="room">
{foreach from=$options item=option}
<option value="{if $option.value==''}{$option.room}{else}{$option.value}{/if}" {$option.selected}>{$option.room}</option>
{/foreach}
</select>
<a href="//austriachat.net/chat/online.html" target="_blank">Es {$befinden} {$usercount} User im Chat.</a>
<br /><br />
<input type="submit" value="Eintreten" /><br />
<br /><br />
</form>
<h1 class="block">Derzeit Online</h1>
<div class="online">
{foreach from=$user item=i}
<strong>Raum:</strong> {$i.room}<br /><hr />
{$i.users}<br /><br />
{foreachelse}
Sorry, niemand online:-(
{/foreach}
</div>

View file

@ -0,0 +1,48 @@
<div class="pmnotice"></div>
<footer>
<div class="row">
<div class="twelve columns">
<ul class="social-links">
<li><a href="https://twitter.com/austriachatnet"><i class="fa fa-twitter"></i></a></li>
</ul>
</div>
<div class="six columns info">
{if $user.is_admin==1}
mySQL Queries: {$queries} | Memory usage: {$memory}
{/if}
</div>
<div class="two columns">
<h3 class="social">Navigation</h3>
<ul class="navigate group">
<li><a href="/index.php">Home</a></li>
<li><a href="/impressum.html">Impressum</a></li>
</ul>
</div>
<p class="copyright">&copy; Copyright 2017 AustriaChat.net. &nbsp; Design by <a title="Styleshout" href="http://www.styleshout.com/">Styleshout</a>.</p>
</div> <!-- End row -->
<div id="go-top"><a class="smoothscroll" title="Back to Top" href="#top"><i class="fa fa-chevron-up"></i></a></div>
</footer> <!-- End Footer-->
{literal}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-96528626-1', 'auto');
ga('send', 'pageview');
</script>
{/literal}
<script src="/js/odo/odometer.min.js"></script>
{$footer}
</body>
</html>

View file

@ -0,0 +1,22 @@
{$header}
<div id="chat-content-wrap">
<div id="chat-content">
<div id="chat" style="height:100%;">
<h2 class='roomname' style="color:#{$col};">{$username}</h2>
<a id="notchan">Yay!</a> | <a href="http://forum.ponytopia.net/help-8.html" target="_blank" onclick="return popup('http://forum.ponytopia.net/help-8.html','width=800, height=800, resizeable,scrollbars=yes');">Help</a> | <a href="http://forum.ponytopia.net/misc.php?action=smilies&amp;popup=true" target="_blank" onclick="return popup('http://forum.ponytopia.net/misc.php?action=smilies&amp;popup=true','width=600, height=600, resizeable,scrollbars=yes');">Smilies</a> | <a href="http://chat.ponytopia.net/logs.html" target="_blank">Logs</a> | <a id="notsw">Notice: On</a> | <a id="scrolling">Scrolling: On</a> | <a id="bgmusic">{$bgmusic}</a> | <a id="submit">{$submit}</a> | <a id="logout">Logout</a>
<div style="z-index:1; height:600px; position:relative;">
<iframe name="output" id="output" style="width:100%; height:100%;" src="http://chat.ponytopia.net:{$port}/out?yacsid={$cookie}" scrolling="auto" noresize frameborder="0" framespacing="0"></iframe>
</div>
<div style="z-index: 1; position:relative;"><iframe name="input" id="input" src="/modules/input.php?cookie={$cookie}&amp;iss={$iss}&amp;col={$col}&amp;id={$id}&amp;username={$username}&amp;subm={$subm}" scrolling="no" style="width:100%;" noresize frameborder="0" framespacing="0" height="60"></iframe>
</div>
</div>
<div id="rightbar">
<div class="userlist">
</div>
<div class="functions">
</div>
{$rightnav}
</div>
</div>
</div>

View file

@ -0,0 +1,39 @@
{$header}
<div id="content-wrap">
<div class="chatrow">
<div id="main" class="nine columns">
<div id="chat" style="height:100%;">
<div class="topbar"><a id="notchan">Ding</a> | <a href="//austriachat.net/forum/help-8.html" target="_blank" onclick="return popup('//austriachat.net/forum/help-8.html','width=800, height=800, resizeable,scrollbars=yes');">Hilfe</a> | <a href="//austriachat.net/forum/misc.php?action=smilies&amp;popup=true" target="_blank" onclick="return popup('//austriachat.net/forum/misc.php?action=smilies&amp;popup=true','width=600, height=600, resizeable,scrollbars=yes');">Smilies</a> | <a id="notsw">Benachrichtigung: An</a> | <a id="scrolling">Scrolling: An</a> | <a id="whwindow">{$whtext}</a> | <a id="submit">{$submit}</a> | <a id="logout">Logout</a></div>
<div id="chatlog" style="z-index:1; height:600px; position:relative;"></div>
<textarea id="text" autocomplete="off" spellcheck="true" style="z-index:2; float: right; position: relative; background: none repeat scroll 0 0 #FFFFFF; border: 1px solid #000000; width: 92%; height:20px; color: #{$col};" ></textarea>
</div>
</div> <!-- end main -->
<div id="sidebar" class="three columns">
<div class="userlist">
</div>
<div class="functions">
</div>
{$rightnav}
</div> <!-- end sidebar -->
</div> <!-- end row -->
</div>
<script type="text/javascript">
$(function(){
$('#chatlog').slimScroll({
color: '#00f',
size: '10px',
width: '95%',
wheelStep: 10,
height: '580px',
start: 'bottom'
});
});
</script>
<div id="whispers" style="display:none;">
</div>
<div id="repwindow" style="display:none;">
</div>

View file

@ -0,0 +1,72 @@
<!DOCTYPE html>
<!--[if lt IE 8 ]><html class="no-js ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="no-js ie ie8" lang="en"> <![endif]-->
<!--[if IE 9 ]><html class="no-js ie ie9" lang="en"> <![endif]-->
<!--[if (gte IE 8)|!(IE)]><!--><html class="no-js" lang="de"> <!--<![endif]-->
<head>
<!--- Basic Page Needs
================================================== -->
<meta charset="utf-8">
<title>AustriaChat.net - Die &Ouml;sterreichische Chatcommunity</title>
<meta content="AustriaChat.net - Die &Ouml;sterreichische Chatcommunity" property="og:title" />
<meta name="keywords" content="oe3 &Ouml;3 chat sms.at uboot.com chatcommunity webchat austria oesterreich forum" />
<meta name="author" content="AustriaChat.net" />
<meta name="description" content="Die kostenlose und werbefreie &Ouml;sterreichische Chatcommunity. Endlich wieder Chatten wie im Uboot, sms.at, Orf Chat, usw. Wir sehen uns!" />
<link href="https://austriachat.net/chat" rel="Chat"/>
<link href="https://austriachat.net/forum" rel="Forum"/>
{$meta}
<!-- mobile specific metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<!-- CSS
================================================== -->
<link rel="stylesheet" href="{$themepath}/css/default.css" />
<link rel="stylesheet" href="{$themepath}/css/layout.css" />
<link rel="stylesheet" href="{$themepath}/css/media-queries.css" />
<link rel="stylesheet" href="{$themepath}/css/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="/js/odo/odometer-theme-minmal.css" />
<!-- Script
================================================== -->
<script src="js/modernizr.js"></script>
<!-- Favicons
================================================== -->
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
</head>
<body>
<!-- Header
================================================== -->
<header id="chattop">
<nav id="nav-wrap">
<a class="mobile-btn" href="#nav-wrap" title="Navigation zeigen">Zeige Men&uuml;</a>
<a class="mobile-btn" href="#" title="Navigation verstecken">Verstecke Men&uuml;</a>
<div class="row">
<ul id="nav" class="nav">
<li><a href="/">Home</a></li>
<li class="current"><a href="/chat">Chat<span class="odometer">{$users}</span></a></li>
<li class="has-children"><a href="/forum">Forum</a>
<ul>
{foreach from=$forum item=f}
<li><a href="{$f.link}">{$f.name}</a></li>
{/foreach}
</ul>
</li>
<li><a href="archives.html">Archives</a></li>
</ul> <!-- end #nav -->
</div>
</nav> <!-- end #nav-wrap -->
</header> <!-- Header End -->

View file

@ -0,0 +1,31 @@
<div id="posts-list" class="page-content-half">
<div class="entry-content cf">
<h2>Chatlogs</h2>
<form class="logform" name="form" action="#" method="post">
Room: <select name="room">
{$rooms}
</select>
Date: <input name="date" class="inputdate" id="inputdate" value="{$date}" size="10" /><br /><br />
Nicks: <input name="nicks" id="chars" value="{$nicks}" size="30" /><br />
<input class="button" align="right" type="submit" value="Go!" />
</form>
{if $logs!=""}
{if $extrareason!=""}
<span style="font-size:15px; color:red;">The logs here are highlighted because of following event: {$extrareason}</span>
{/if}
<div {$divextra}>
{foreach from=$logs item=log}
{if $log.action=="txtNarr"}
({$log.date}) <span style="color: #FFFFFF">{if $log.img!=""}{$log.img}{/if}{$log.line}</span><br />
{else}
({$log.date}) <span style="color: #{$log.color}">{if $log.img!=""}{$log.img}{/if}{$log.line}</span><br />
{/if}
{/foreach}
</div>
{/if}
</div>
<div class="c-1"></div>
<div class="c-2"></div>
<div class="c-3"></div>
<div class="c-4"></div>
</div>

View file

@ -0,0 +1,31 @@
<div id="maincol_top_invisible">
</div>
<div class="maincol_review_header">
<h2><span>Edit Log</span></h2><br />
</div>
<div class="maincol_box_empty">
<div class="content_page">
<span style="color:red; font-weight:bold;">{$emsg}</span>
<form name="form" action="{$path}index.php?task=chat&amp;sub=editlog&amp;id={$id}" method="post">
<input type="checkbox" {$checked} onchange="public({$id})" name="share" /> Make log public?
<div id="publ">
{$pupl}
</div>
</form>
<label for="typ" class="left">Users you share this log with:</label><br />
<form name="form" action="/private.html" method="post">
<div id="users">
{foreach from=$share item=s}
<div id="id_{$s.uid}" class="useritem"><a onclick="return deleteItem('{$s.uid}');" href="index.php?task=chat&amp;sub=deluser&amp;id={$s.uid}"><img style="border:none; float:right;" src="/themes/ponytopia/images/icons/cross.png" /></a>{$s.username}</div>
{/foreach}
</div><br />
Add user: <input name="shareusers" id="userlist" size="30" /><input class="button" align="right" onclick="adduser()" type="button" value="Add" /><br /><br />
<input type="hidden" name="send" value="1" />
<input type="hidden" name="id" value="{$id}" />
<input class="button" align="right" type="submit" value="Back" />
</form>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,28 @@
<h2>Join the dark side of Equestria:</h2>
Here you can join our Grimdark Chat! Beware that this is way more mature then our normal chat which is located <a href="http://chat.ponytopia.net">here</a>.<br />
Please see our <a href="http://chat.ponytopia.net/text/rules.html" target="_blank">Rules</a> first. You can find a manual for our Chat <a href="http://chat.ponytopia.net/text/chatmanual.html" target="_blank">here</a>.<br />
<form name="form" action="in.html" method="post">
Room: <select name="room">
{foreach from=$options item=option}
<option value="{$option.room}" {$option.selected}>{$option.room}</option>
{/foreach}
</select><br />
Nickname: <select name="nick">
{$nicks}
</select><br />
<input type="checkbox" value="1" id="sock" name="websock" /> Use new interface?
<br />
<a href="http://chat.ponytopia.net/online.html" target="_blank">There {$befinden} {$usercount} User in our Chat.</a>
<br /><br />
<input type="submit" value="Join" /><br />
<br /><br />
</form>
<h1 class="block">Online Users</h1>
<div class="online">
{foreach from=$user item=i}
<strong>Room:</strong> {$i.room}<br /><hr />
{$i.users}<br /><br />
{foreachelse}
Sorry, nopony online :(
{/foreach}

View file

@ -0,0 +1,15 @@
<h2 class='roomname'>{$users} Chatlog - {$date} - {$room}</h2>
{if $logs!=""}
<div {$divextra}>
{foreach from=$logs item=log}
{if $log.action=="txtNarr"}
({$log.date}) <span style="color: #FFFFFF">{if $log.img!=""}{$log.img}{/if}{$log.line}</span><br />
{else}
({$log.date}) <span style="color: #{$log.color}">{if $log.img!=""}{$log.img}{/if}{$log.line}</span><br />
{/if}
{/foreach}
</div>
{else}
Sorry, this log does not exist or you have not been granted the rights to view it.
{/if}

View file

@ -0,0 +1,11 @@
<div class="twelve columns">
<h2>Derzeit Online</h2>
<div class="online">
{foreach from=$data item=dat}
<strong>Raum:</strong> {$dat.room}<br /><hr />
{$dat.users}<br /><br />
{foreachelse}
Sorry, niemand online:-(
{/foreach}
</div>
</div>

View file

@ -0,0 +1,15 @@
<h2 style="color: white;" class='roomname'>{$users} Chatlog - {$date} - {$room}</h2>
{if $logs!=""}
<div {$divextra}>
{foreach from=$logs item=log}
{if $log.action=="txtNarr"}
<span style="color: white;">({$log.date})</span> <span style="color: #FFFFFF">{if $log.img!=""}{$log.img}{/if}{$log.line}</span><br />
{else}
<span style="color: white;">({$log.date})</span> <span style="color: #{$log.color}">{if $log.img!=""}{$log.img}{/if}{$log.line}</span><br />
{/if}
{/foreach}
</div>
{else}
Sorry, this log does not exist or you have not been granted the rights to view it.
{/if}

View file

@ -0,0 +1,35 @@
<div id="maincol_top_invisible">
</div>
<div class="maincol_review_header">
<h2><span>Private Chatlogs</span></h2><br />
</div>
<div class="maincol_box_empty">
<div class="content_page">
{if $convos==""}
No private logs yet.
{else}
<table width="600px">
<tr>
<th>ID</th>
<th>Date - Room</th>
<th>Owner / Shared by</th>
<th>Actions</th>
</tr>
{foreach from=$convos item=con}
<tr>
<td width="10%">{$con.id}</td>
<td><a href="http://logs.ponytopia.net/id/{$con.id}" target="_blank">{$con.date} - {$con.room}</a></td>
<td><a href="http://forum.ponytopia.net/user-{$con.owner}.html" target="_blank">{$con.sname}</a></td>
<td width="16%"><a href="http://logs.ponytopia.net/pdf/{$con.id}"><img src="/themes/ponytopia/images/icons/pdf.png" style="border:none;"/></a>
<a onclick="return confirmLink(this, 'Are you sure to delete the Log? It will be gone for good.')" href="/index.php?task=chat&sub=deletelog&id={$con.id}"><img src="/themes/ponytopia/images/icons/delete.png" style="border:none;" /></a>{if $con.owner==$con.uid}<a href="/index.php?task=chat&amp;sub=editlog&amp;id={$con.id}"><img src="/themes/ponytopia/images/icons/wrench.png" style="border:none;"/></a>
{/if}
</td>
</tr>
{/foreach}
</table>
{/if}
</div>
{if $pagination!=""}
<div align="center">{$pagination}</div>
{/if}
</div>

View file

@ -0,0 +1,51 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="coppertopia.net - A Steampunk Chat RP Website" />
<meta content="coppertopia.net - A Steampunk Chat RP Website" property="og:title" />
<meta name="keywords" content="steampunk roleplay rp chat vintage cyo choose your own freeflow" />
<meta name="author" content="becast.at" />
<meta content="coppertopia.net" property="og:site_name" />
<link rel="icon" type="image/png" href="/favicon-196x196.png" sizes="196x196">
<link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160">
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
<link type="text/css" rel="stylesheet" href="{$path}themes/coppertopia/css/style.css?id=914127384" media="screen,projection" />
<link rel="stylesheet" href="/js/odo/odometer-theme-minmal.css" />
<link href="//chat.coppertopia.net/" rel="Chat"/>
<link href="//forum.coppertopia.net/" rel="Forum"/>
<script src="/js/odo/odometer.min.js"></script>
{$meta}
<title>{$titleaddon}{$sitetitle}</title>
</head>
<body id="body_1" style="background: #F3E4C8;">
{if $nrep!="" || $rep!=""}
<div id="accordion">
{foreach from=$nrep item=nrp}
<h5 style="background:none;background-color:#810000;">{$nrp.date} - <a class="user" href="//chat.coppertopia.net/profile/{$nrp.name}">{$nrp.name}</a> (<a class="user" href="//forum.coppertopia.net/user-{$nrp.cpid}.html">{$nrp.cname}</a>) by <a class="user" href="//forum.coppertopia.net/user-{$nrp.fuid}.html">{$nrp.username}</a></h5>
<div>
<p>
{$nrp.reason}
</p>
<span style="float:left"><a id="{$nrp.rid}" class="seen"><img style="border:none;" src="/themes/coppertopia/images/icons/eye.png"></a>
<a id="{$nrp.rid}" class="delete" ><img style="border:none;" src="/themes/coppertopia/images/icons/delete.png"></a>
</span>
</div>
{/foreach}
{foreach from=$rep item=rp}
<h5 style="background:none;background-color:#80CB80;">{$rp.date} - <a class="user" href="//chat.coppertopia.net/profile/{$rp.name}">{$rp.name}</a> (<a class="user" href="//forum.coppertopia.net/user-{$rp.cpid}.html">{$rp.cname}</a>) by <a class="user" href="//forum.coppertopia.net/user-{$rp.fuid}.html">{$rp.username}</a></h5>
<div>
<p>
{$rp.reason}
</p>
<span style="float:left"><a id="{$rp.rid}" class="unseen"><img style="border:none;" src="/themes/coppertopia/images/icons/tick.png"></a>
<a id="{$rp.rid}" class="delete" ><img style="border:none;" src="/themes/coppertopia/images/icons/delete.png"></a>
</span>
</div>
{/foreach}
</div>
{else}
No reports for this user.
{/if}

View file

@ -0,0 +1,27 @@
<h4>Userliste</h4>
<span id="curroom" style="font-weight:bold;">{$room}</span> <a id="allrooms" style="font-size:8px;">(Raumliste)</a>
<div id="users" class="mousescroll" style="padding:5px; height: 250px;">
{if $users==""}
<p>
No users.
</p>
{else}
{foreach from=$users item=user}
<a id="{$user.nick}" class="notice"><img src="/themes/austria/images/{$user.notice}" title="Toggle notice for {$user.nick}" style="border:none;" /></a><a href="/np/{$user.nick}" target="_blank" style="color:#{$user.color}; margin-left: 8px;">{$user.nick}</a>{if $user.typing=="true"}<i class="fa fa-comment" style="color:#{$user.color}" aria-hidden="true"></i>{/if}</span>&nbsp;<img src="/themes/austria/images/{$user.gender}.png" style="border:none;" /><br />
{/foreach}
{/if}
&nbsp;
&nbsp;
</div>
<script type="text/javascript">
$('#users').slimscroll({
color: '#00f',
size: '10px',
width: '220px',
height: '300px'
});
{if $js!=""}
{$js}
$(".notice").rightClickMenu(menu);
{/if}
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Some files were not shown because too many files have changed in this diff Show more