1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-28 16:50:07 +02:00

new module creation

This commit is contained in:
mcfly
2006-12-02 04:36:16 +00:00
commit e149b35fcc
2196 changed files with 182987 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/admin_menu/admin_menu.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:43 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
global $tp;
if (ADMIN == TRUE) {
@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php");
@include_once(e_LANGUAGEDIR."English/admin/lan_admin.php");
require_once(e_HANDLER."userclass_class.php");
require_once(e_ADMIN."ad_links.php");
require_once(e_HANDLER.'admin_handler.php');
$array_functions[] = array(e_ADMIN."plugin.php", ADLAN_98, "Z");
if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
while ($row = $sql->db_Fetch()) {
include(e_PLUGIN.$row['plugin_path']."/plugin.php");
if ($eplug_conffile) {
$array_functions[] = array(e_PLUGIN.$row['plugin_path']."/".$eplug_conffile, $tp->toHtml($eplug_name,"","defs,emotes_off, no_make_clickable"), "P".$row['plugin_id']);
}
unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
}
}
$array_functions = asortbyindex($array_functions, 1);
$amtext = "<div style='text-align:center'>
<select name='activate' onchange='urljump(this.options[selectedIndex].value)' class='tbox'>
<option>".LAN_SELECT."</option>\n";
foreach ($array_functions as $link_value) {
$amtext .= render_admin_links($link_value[0], $link_value[1], $link_value[2]);
}
$amtext .= "</select>
</div>";
$ns->tablerender(LAN_ADMIN, $amtext, 'admin_menu');
}
function render_admin_links($link, $title, $perms) {
if (getperms($perms)) {
return "<option value='".$link."'>".$title."</option>";
}
}
?>

View File

@@ -0,0 +1,42 @@
<?php
function alt_auth_get_authlist()
{
$authlist = array("e107");
$handle=opendir(e_PLUGIN."alt_auth");
while ($file = readdir($handle))
{
if(preg_match("/^(.*)_auth\.php/",$file,$match))
{
$authlist[] = $match[1];
}
}
closedir($handle);
return $authlist;
}
function alt_auth_adminmenu()
{
global $authlist;
echo " ";
if(!is_array($authlist))
{
$authlist = alt_auth_get_authlist();
}
define("ALT_AUTH_ACTION", "main");
$var['main']['text'] = "Main config";
$var['main']['link'] = e_PLUGIN."alt_auth/alt_auth_conf.php";
show_admin_menu("alt auth", ALT_AUTH_ACTION, $var);
$var = array();
foreach($authlist as $a)
{
if($a != 'e107')
{
$var[$a]['text'] = "Config {$a}";
$var[$a]['link'] = e_PLUGIN."alt_auth/{$a}_conf.php";
}
}
show_admin_menu("Auth methods", ALT_AUTH_ACTION, $var);
}
?>

View File

@@ -0,0 +1,115 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/alt_auth_conf.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:43 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
$eplug_admin = true;
require_once("../../class2.php");
if(!getperms("P")){header("location:".e_BASE."index.php"); exit; }
require_once(e_HANDLER."form_handler.php");
require_once(e_ADMIN."auth.php");
include_lan(e_PLUGIN."alt_auth/languages/".e_LANGUAGE."/lan_alt_auth_conf.php");
define("ALT_AUTH_ACTION", "main");
require_once(e_PLUGIN."alt_auth/alt_auth_adminmenu.php");
if(isset($_POST['updateprefs']))
{
$pref['auth_method'] = $_POST['auth_method'];
$pref['auth_noconn'] = intval($_POST['auth_noconn']);
$pref['auth_nouser'] = intval($_POST['auth_nouser']);
save_prefs();
header("location:".e_SELF);
exit;
}
$authlist = alt_auth_get_authlist();
$auth_dropdown = "<select class='tbox' name='auth_method'>\n";
foreach($authlist as $a)
{
$s = ($pref['auth_method'] == $a) ? "selected='selected'" : "";
$auth_dropdown .= "<option value='{$a}' {$s}>".$a."</option>\n";
}
$auth_dropdown .= "</select>\n";
if(isset($message))
{
$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
$text = "
<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='width:95%' class='fborder' cellspacing='1' cellpadding='0'>
<tr>
<td style='width:70%' class='forumheader3'>".LAN_ALT_1.": </td>
<td style='width:30%; text-align:right;' class='forumheader3'>".
$auth_dropdown."
</td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>".LAN_ALT_6.":<br />
<div class='smalltext'>".LAN_ALT_7."</div>
</td>
<td style='width:30%; text-align:right;' class='forumheader3'>
<select class='tbox' name='auth_noconn'>";
$sel = (isset($pref['auth_noconn']) && $pref['auth_noconn'] ? "" : " selected = 'selected' ");
$text .= "<option value='0' {$sel} >".LAN_ALT_FAIL."</option>";
$sel = (isset($pref['auth_noconn']) && $pref['auth_noconn'] ? " selected = 'selected' " : "");
$text .= "<option value='1' {$sel} >".LAN_ALT_FALLBACK."</option>
</select>
</td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>".LAN_ALT_8.":<br />
<div class='smalltext'>".LAN_ALT_9."</div>
</td>
<td style='width:30%; text-align:right;' class='forumheader3'>
<select class='tbox' name='auth_nouser'>";
$sel = (isset($pref['auth_nouser']) && $pref['auth_nouser'] ? "" : " selected = 'selected' ");
$text .= "<option value='0' {$sel} >".LAN_ALT_FAIL."</option>";
$sel = (isset($pref['auth_nouser']) && $pref['auth_nouser'] ? " selected = 'selected' " : "");
$text .= "<option value='1' {$sel} >".LAN_ALT_FALLBACK."</option>
</select>
</td>
</tr>
<tr style='vertical-align:top'>
<td colspan='2' style='text-align:center' class='forumheader3'>
<br />
<input class='button' type='submit' name='updateprefs' value='".LAN_ALT_2."' />
</td>
</tr>
</table>
</form>
</div>";
$ns -> tablerender("<div style='text-align:center'>".LAN_ALT_3."</div>", $text);
require_once(e_ADMIN."footer.php");
function alt_auth_conf_adminmenu()
{
alt_auth_adminmenu();
}
?>

View File

@@ -0,0 +1,80 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/alt_auth_login_class.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:43 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
class alt_login
{
function alt_login($method, &$username, &$userpass)
{
global $pref;
$newvals=array();
define("AUTH_SUCCESS", -1);
define("AUTH_NOUSER", 1);
define("AUTH_BADPASSWORD", 2);
define("AUTH_NOCONNECT", 3);
require_once(e_PLUGIN."alt_auth/".$method."_auth.php");
$_login = new auth_login;
if($_login->Available === FALSE)
{
return false;
}
$login_result = $_login -> login($username, $userpass, $newvals);
if($login_result === AUTH_SUCCESS )
{
$sql = new db;
if(!$sql -> db_Select("user","*","user_loginname='{$username}' "))
{
// User not found in e107 database - add it now.
$qry = "INSERT INTO #user (user_id, user_loginname, user_name, user_join) VALUES ('0','{$username}','{$username}',".time().")";
$sql -> db_Select_gen($qry);
}
// Set password and any other applicable fields
$qry="user_password='".md5($userpass)."'";
foreach($newvals as $key => $val)
{
$qry .= " ,user_{$key}='{$val}' ";
}
$qry.=" WHERE user_loginname='{$username}' ";
$sql -> db_Update("user", $qry);
}
else
{
switch($login_result)
{
case AUTH_NOUSER:
if(!isset($pref['auth_nouser']) || !$pref['auth_nouser'])
{
$username=md5("xx_nouser_xx");
}
break;
case AUTH_NOCONNECT:
if(!isset($pref['auth_noconn']) || !$pref['auth_noconn'])
{
$username=md5("xx_noconn_xx");
}
break;
case AUTH_BADPASSWORD:
$userpass=md5("xx_badpassword_xx");
break;
}
}
}
}
?>

View File

@@ -0,0 +1,52 @@
/*
| Copyright (C) 2003 Thom Michelbrink
|
| Author: Thom Michelbrink mcfly@e107.org
|
*/
Purpose:
This is a plugin for the E107 CMS system (e107.org).
This plugin will enable Alternate authorization functionality to your site.
Requirements:
This plugin requires e107 Verion 0.600+
############## INSTALLATION #######################
1) Upload all files to your e107_plugins directory on your server, retaining directory structure.
2) Go to the admin section of the website, go the to plugin manager and install the Alt auth.
3) Go to the admin section of the website and configure the Alternate Authorization setting.
Until this is integrated into the e107 core. the following lines need to be added to the e107_handlers\login.php file. They need to be inserted into the userlogin() function, just after the 'global $pref;' line:
if($pref['auth_method'] && $pref['auth_method'] != "e107"){
$auth_file=e_PLUGIN."alt_auth/".$pref['auth_method']."_auth.php";
if(file_exists($auth_file)){
require_once(e_PLUGIN."alt_auth/alt_auth_login_class.php");
$result = new alt_login($pref['auth_method'],$username, $userpass);
}
}
--- AUTHORIZATION TYPES --
This version currently supports Active Directory and LDAP authorization types. Others could easily
be added though.
The requirements to add a new auth type are:
xxx_auth.php - Actual file the performs the authorization based on user input of uname / passwd.
xxx_conf.php - The file used to edit any configuration option for your auth type.
The xxx_auth.php must contain a class named auth_login(), the class must contain a function named login($uname,$passwd). The login() function must return values of:
AUTH_SUCCESS - valid login
AUTH_NOUSER - User not found
AUTH_BADPASSWORD - Password is incorrect
-----------------------------------------------------------------------------
Version history:
11/11/2003 - Initial beta release

View File

@@ -0,0 +1,56 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/alt_login_class.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:43 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
class alt_login{
function alt_login($method,&$username,&$userpass){
$newvals=array();
define("AUTH_SUCCESS",-1);
define("AUTH_NOUSER",1);
define("AUTH_BADPASSWORD",2);
require_once(e_PLUGIN."auth_".$method."/auth_".$method.".php");
$xx = new auth_login;
$login_result = $xx -> login($username,$userpass,$newvals);
if($login_result === AUTH_SUCCESS ){
$sql = new db;
if(!$sql -> db_Select("user","*","user_loginname='{$username}' ")){
// User not found in e107 database - add it now.
$qry = "INSERT INTO ".MPREFIX."user (user_id, user_loginname, user_name, user_join) VALUES ('0', '{$username}', '{$username}', ".time().")";
$sql -> db_Select_gen($qry);
}
// Set password and any other applicable fields
$qry="user_password='".md5($userpass)."'";
foreach($newvals as $key => $val){
$qry .= " ,user_{$key}='{$val}' ";
}
$qry.=" WHERE user_loginname='{$username}' ";
$sql -> db_Update("user",$qry);
} else {
switch($login_result){
case AUTH_NOUSER:
$username=md5("xx_nouser_xx");
break;
case AUTH_BADPASSWORD:
$userpass=md5("xx_badpassword_xx");
break;
}
}
}
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,15 @@
<?php
define("LAN_ALT_1", "Current authorization type");
define("LAN_ALT_2", "Update settings");
define("LAN_ALT_3", "Choose Alternate Authorization Type");
define("LAN_ALT_4", "Configure parameters for");
define("LAN_ALT_5", "Configure authorization parameters");
define("LAN_ALT_6", "Failed connection action");
define("LAN_ALT_7", "If connection to the alternate method fails, how should that be handled?");
define("LAN_ALT_8", "User not found action");
define("LAN_ALT_9", "If username is not found using alternate method, how should that be handled?");
define("LAN_ALT_FALLBACK", "Use e107 user table");
define("LAN_ALT_FAIL", "Failed login");
?>

View File

@@ -0,0 +1,15 @@
<?php
define("LDAPLAN_1", "Server address");
define("LDAPLAN_2", "Base DN or Domain<br />If LDAP - Enter BaseDN<br />If AD - Enter domain");
define("LDAPLAN_3", "LDAP Browsing user<br />Full context of the user who is able to search the directory.");
define("LDAPLAN_4", "LDAP Browsing password<br />Password for the LDAP Browsing user.");
define("LDAPLAN_5", "LDAP Version");
define("LDAPLAN_6", "Configure LDAP auth");
define("LDAPLAN_7", "eDirectory search filter:");
define("LDAPLAN_8", "This will be used to ensure the username is in the correct tree, <br />ie '(objectclass=inetOrgPerson)'");
define("LDAPLAN_9", "Current search filter will be:");
define("LDAPLAN_10", "Settings Updated");
define("LDAPLAN_11", "WARNING: It appears as if the ldap module is not currently available, setting your auth method to LDAP will probably not work!");
define("LDAPLAN_12", "Server Type");
define("LDAPLAN_13", "Update settings");
?>

View File

@@ -0,0 +1,14 @@
<?php
define("OTHERDB_LAN_1", "Database Type:");
define("OTHERDB_LAN_2", "Server:");
define("OTHERDB_LAN_3", "Username:");
define("OTHERDB_LAN_4", "Password:");
define("OTHERDB_LAN_5", "Database");
define("OTHERDB_LAN_6", "Table");
define("OTHERDB_LAN_7", "Username Field:");
define("OTHERDB_LAN_8", "Password Field:");
define("OTHERDB_LAN_9", "Password Method:");
define("OTHERDB_LAN_10", "Configure otherdb auth");
define("OTHERDB_LAN_11", "** The following fields are not required if using an e107 database");
?>

View File

@@ -0,0 +1,186 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/ldap_auth.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:43 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
class auth_login
{
var $server;
var $dn;
var $usr;
var $pwd;
var $serverType;
var $ldapErrorCode;
var $ldapErrorText;
var $connection;
var $result;
var $ldapVersion;
var $Available;
var $filter;
function auth_login()
{
$sql = new db;
$sql -> db_Select("alt_auth", "*", "auth_type = 'ldap' ");
while($row = $sql -> db_Fetch())
{
$ldap[$row['auth_parmname']]=$row['auth_parmval'];
}
$this->server = explode(",", $ldap['ldap_server']);
$this->serverType = $ldap['ldap_servertype'];
$this->dn = $ldap['ldap_basedn'];
$this->usr = $ldap['ldap_user'];
$this->pwd = $ldap['ldap_passwd'];
$this->ldapVersion = $ldap['ldap_version'];
$this->filter = (isset($ldap['ldap_edirfilter']) ? $ldap['ldap_edirfilter'] : "");
if(!function_exists('ldap_connect'))
{
$this->Available = FALSE;
return false;
}
if(!$this -> connect())
{
return AUTH_NOCONNECT;
}
}
function connect()
{
foreach ($this->server as $key => $host)
{
$this->connection = ldap_connect($host);
if ( $this->connection) {
if($this -> ldapVersion == 3 || $this->serverType == "ActiveDirectory")
{
@ldap_set_option( $this -> connection, LDAP_OPT_PROTOCOL_VERSION, 3 );
}
return true;
}
}
$this->ldapErrorCode = -1;
$this->ldapErrorText = "Unable to connect to any server";
return false;
}
function close()
{
if ( !@ldap_close( $this->connection))
{
$this->ldapErrorCode = ldap_errno( $this->connection);
$this->ldapErrorText = ldap_error( $this->connection);
return false;
}
else
{
return true;
}
}
function login($uname, $pass)
{
/* Construct the full DN, eg:-
** "uid=username, ou=People, dc=orgname,dc=com"
*/
if ($this->serverType == "ActiveDirectory")
{
$checkDn = "$uname@$this->dn";
}
else
{
if ($this -> usr != '' && $this -> pwd != '')
{
$this -> result = ldap_bind($this -> connection, $this -> usr, $this -> pwd);
}
else
{
$this -> result = ldap_bind($this -> connection);
}
// In ldap_auth.php, should look like this instead for eDirectory
// $query = ldap_search($this -> connection, $this -> dn, "cn=".$uname);
if($this->serverType == "eDirectory")
{
$_filter = (isset($ldap['ldap_edirfilter']) ? $ldap['ldap_edirfilter'] : "");
$current_filter = "(&(cn={$uname})".$this->filter.")";
$query = ldap_search($this->connection, $this->dn, $current_filter);
}
else
{
$query = ldap_search($this->connection, $this->dn, "uid=".$uname);
}
if ($query == false)
{
// Could not perform query to LDAP directory
return AUTH_NOCONNECT;
}
else
{
$query_result = ldap_get_entries($this -> connection, $query);
if ($query_result["count"] != 1)
{
return AUTH_NOUSER;
}
else
{
$checkDn = $query_result[0]["dn"];
$this -> close();
$this -> connect();
}
}
}
// Try and connect...
$this->result = ldap_bind($this -> connection, $checkDn, $pass);
if ( $this->result)
{
// Connected OK - login credentials are fine!
return AUTH_SUCCESS;
}
else
{
/* Login failed. Return false, together with the error code and text from
** the LDAP server. The common error codes and reasons are listed below :
** (for iPlanet, other servers may differ)
** 19 - Account locked out (too many invalid login attempts)
** 32 - User does not exist
** 49 - Wrong password
** 53 - Account inactive (manually locked out by administrator)
*/
$this->ldapErrorCode = ldap_errno( $this->connection);
$this->ldapErrorText = ldap_error( $this->connection);
if($this -> ldapErrorCode == 32)
{
return AUTH_NOUSER;
}
if($this -> ldapErrorCode == 49)
{
return AUTH_BADPASSWORD;
}
// return error code as if it never connected, maybe change that in the future
return AUTH_NOCONNECT;
}
}
}
?>

View File

@@ -0,0 +1,133 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/ldap_conf.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:43 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
$eplug_admin = true;
require_once("../../class2.php");
require_once(e_ADMIN."auth.php");
require_once(e_HANDLER."form_handler.php");
include_lan("languages/".e_LANGUAGE."/lan_ldap_auth.php");
define("ALT_AUTH_ACTION", "ldap");
require_once(e_PLUGIN."alt_auth/alt_auth_adminmenu.php");
$server_types[1]="LDAP";
$server_types[2]="ActiveDirectory";
$server_types[3]="eDirectory";
$ldap_ver[1]="2";
$ldap_ver[2]="3";
if($_POST['update'])
{
foreach($_POST as $k => $v)
{
if(preg_match("/ldap_/", $k))
{
if($sql -> db_Select("alt_auth", "*", "auth_type='ldap' AND auth_parmname='{$k}' "))
{
$sql -> db_Update("alt_auth", "auth_parmval='{$v}' WHERE auth_type='ldap' AND auth_parmname='{$k}' ");
}
else
{
$sql -> db_Insert("alt_auth", "'ldap','{$k}','{$v}' ");
}
}
}
$message = LDAPLAN_10;
}
if(!function_exists('ldap_connect'))
{
$message = "<div style='color:#f00; font-weight:bold'>".LDAPLAN_11."</div>";
}
if($message)
{
$ns->tablerender("","<div style='text-align:center;'>".$message."</div>");
}
$ldap['ldap_edirfilter'] == "";
$sql -> db_Select("alt_auth", "*", "auth_type = 'ldap' ");
while($row = $sql->db_Fetch())
{
$ldap[$row['auth_parmname']] = $row['auth_parmval'];
}
$current_filter = "(&(cn=[USERNAME]){$ldap['ldap_edirfilter']})";
$frm = new form;
$text = $frm -> form_open("POST",e_SELF);
$text .= "<table style='width:96%'>";
$text .= "<tr><td class='forumheader3'>".LDAPLAN_12."</td><td class='forumheader3'>";
$text .= $frm -> form_select_open("ldap_servertype");
foreach($server_types as $v)
{
$sel = ($ldap['ldap_servertype'] == $v) ? " Selected" : "";
$text .= $frm -> form_option($v, $sel, $v);
}
$text .= $frm -> form_select_close();
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".LDAPLAN_1."</td><td class='forumheader3'>";
$text .= $frm -> form_text("ldap_server", 35, $ldap['ldap_server'], 120);
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".LDAPLAN_2."</td><td class='forumheader3'>";
$text .= $frm -> form_text("ldap_basedn", 35, $ldap['ldap_basedn'], 120);
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".LDAPLAN_3."</td><td class='forumheader3'>";
$text .= $frm -> form_text("ldap_user", 35, $ldap['ldap_user'], 120);
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".LDAPLAN_4."</td><td class='forumheader3'>";
$text .= $frm -> form_text("ldap_passwd", 35, $ldap['ldap_passwd'], 120);
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".LDAPLAN_5."</td><td class='forumheader3'>";
$text .= $frm -> form_select_open("ldap_version");
foreach($ldap_ver as $v)
{
$sel = ($ldap['ldap_version'] == $v) ? " Selected" : "";
$text .= $frm -> form_option($v, $sel, $v);
}
$text .= $frm -> form_select_close();
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".LDAPLAN_7."<br /><span class='smalltext'>".LDAPLAN_8."</span></td><td class='forumheader3'>";
$text .= $frm -> form_text("ldap_edirfilter", 35, $ldap['ldap_edirfilter'], 120);
$text .= "<br /><span class='smalltext'>".LDAPLAN_9."<br />{$current_filter}</span></td></tr>";
$text .= "<tr><td class='forumheader' colspan='2' style='text-align:center;'>";
$text .= $frm -> form_button("submit", "update", LDAPLAN_13);
$text .= "</td></tr>";
$text .= "</table>";
$text .= $frm -> form_close();
$ns -> tablerender(LDAPLAN_6,$text);
require_once(e_ADMIN."footer.php");
function ldap_conf_adminmenu()
{
alt_auth_adminmenu();
}
?>

View File

@@ -0,0 +1,147 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/otherdb_auth.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:43 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
/*
return values
AUTH_NOCONNECT = unable to connect to db
AUTH_NOUSER = user not found
AUTH_BADPASSWORD = supplied password incorrect
AUTH_SUCCESS = valid login
*/
class auth_login
{
var $od;
function auth_login()
{
global $otherdb_conf, $sql;
$sql -> db_Select("alt_auth", "*", "auth_type = 'otherdb' ");
while($row = $sql -> db_Fetch())
{
$otherdb_conf[$row['auth_parmname']] = base64_decode(base64_decode($row['auth_parmval']));
}
$class_name = "otherdb_".$otherdb_conf['otherdb_dbtype']."_class";
if($otherdb_conf['otherdb_dbtype'] == 'e107')
{
$class_name = "otherdb_mysql_class";
}
if(class_exists($class_name))
{
$this->od = new $class_name;
}
else
{
return AUTH_NOCONNECT;
}
}
function login($uname, $pword, &$newvals)
{
global $mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb, $sql;
$ret = $this->od->login($uname, $pword, $newvals);
$sql->db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);
return $ret;
}
}
class otherdb_mysql_class
{
var $conf;
function otherdb_mysql_class()
{
global $otherdb_conf;
$this->conf = $otherdb_conf;
}
function login($uname, $pword, &$newvals)
{
//Attempt to open connection to sql database
if(!$res = mysql_connect($this->conf['otherdb_server'], $this->conf['otherdb_username'], $this->conf['otherdb_password']))
{
return AUTH_NOCONNECT;
}
//Select correct db
if(!mysql_select_db($this->conf['otherdb_database'], $res))
{
mysql_close($res);
return AUTH_NOCONNECT;
}
if($this->conf['otherdb_dbtype'] == 'mysql')
{
$sel_fields = $this->conf['otherdb_password_field'];
$user_field = $this->conf['otherdb_user_field'];
}
else
{
$sel_fields = 'user_password, user_email, user_join';
$user_field = "user_loginname";
}
//Get record containing supplied login name
$qry = "SELECT {$sel_fields} FROM {$this->conf['otherdb_table']} WHERE {$user_field} = '{$uname}'";
if(!$r1 = mysql_query($qry))
{
mysql_close($res);
return AUTH_NOCONNECT;
}
if(!$row = mysql_fetch_array($r1))
{
mysql_close($res);
return AUTH_NOUSER;
}
//Compare password in db to supplied password
if($this->conf['otherdb_password_method'] == 'md5' || $this->conf['otherdb_dbtype'] == 'e107')
{
$goodpw = md5($pword) == $row[0];
}
else
{
$goodpw = $pword == $row[0];
}
if($goodpw)
{
//Close newly opened mysql connection
mysql_close($res);
if($this->conf['otherdb_dbtype'] == 'e107')
{
$newvals['email'] = $row[1];
$newvals['join'] = $row[2];
}
return AUTH_SUCCESS;
}
mysql_close($res);
return AUTH_BADPASSWORD;
}
}
?>

View File

@@ -0,0 +1,143 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
+----------------------------------------------------------------------------+
*/
$eplug_admin = true;
require_once("../../class2.php");
require_once(e_ADMIN."auth.php");
require_once(e_HANDLER."form_handler.php");
include_lan("languages/".e_LANGUAGE."/lan_otherdb_auth.php");
define("ALT_AUTH_ACTION", "otherdb");
require_once(e_PLUGIN."alt_auth/alt_auth_adminmenu.php");
if($_POST['update'])
{
$message = update_otherdb_prefs();
}
if($message)
{
$ns->tablerender("","<div style='text-align:center;'>".$message."</div>");
}
show_otherdb_form();
function show_otherdb_form()
{
global $sql, $tp, $ns;
$password_methods = array("md5", "plaintext");
$db_types = array("e107" => "mysql - e107 database", "mysql" => "mysql - generic database");
$sql -> db_Select("alt_auth", "*", "auth_type = 'otherdb' ");
$parm = array();
while($row = $sql->db_Fetch())
{
$parm[$row['auth_parmname']] = base64_decode(base64_decode($row['auth_parmval']));
}
$frm = new form;
$text = $frm -> form_open("POST", e_SELF);
$text .= "<table style='width:96%'>";
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_1."</td><td class='forumheader3'>";
$text .= $frm -> form_select_open("otherdb_dbtype");
foreach($db_types as $k => $v)
{
$sel = ($parm['otherdb_dbtype'] == $k) ? " Selected" : "";
$text .= $frm -> form_option($v, $sel, $k);
}
$text .= $frm -> form_select_close();
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_2."</td><td class='forumheader3'>";
$text .= $frm -> form_text("otherdb_server", 35, $parm['otherdb_server'], 120);
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_3."</td><td class='forumheader3'>";
$text .= $frm -> form_text("otherdb_username", 35, $parm['otherdb_username'], 120);
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_4."</td><td class='forumheader3'>";
$text .= $frm -> form_text("otherdb_password", 35, $parm['otherdb_password'], 120);
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_5."</td><td class='forumheader3'>";
$text .= $frm -> form_text("otherdb_database", 35, $parm['otherdb_database'], 120);
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_6."</td><td class='forumheader3'>";
$text .= $frm -> form_text("otherdb_table", 35, $parm['otherdb_table'], 120);
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader2' colspan='2'>".OTHERDB_LAN_11."</td></tr>";
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_7."</td><td class='forumheader3'>";
$text .= $frm -> form_text("otherdb_user_field", 35, $parm['otherdb_user_field'], 120);
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_8."</td><td class='forumheader3'>";
$text .= $frm -> form_text("otherdb_password_field", 35, $parm['otherdb_password_field'], 120);
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_9."</td><td class='forumheader3'>";
$text .= $frm -> form_select_open("otherdb_password_method");
foreach($password_methods as $v)
{
$sel = ($parm['otherdb_password_method'] == $v) ? " Selected" : "";
$text .= $frm -> form_option($v, $sel, $v);
}
$text .= $frm -> form_select_close();
$text .= "</td></tr>";
$text .= "<tr><td class='forumheader' colspan='2' style='text-align:center;'>";
$text .= $frm -> form_button("submit", "update", "Update settings");
$text .= "</td></tr>";
$text .= "</table>";
$text .= $frm -> form_close();
$ns -> tablerender(OTHERDB_LAN_10, $text);
}
require_once(e_ADMIN."footer.php");
function update_otherdb_prefs()
{
global $sql;
foreach($_POST as $k => $v)
{
$v = base64_encode(base64_encode($v));
if(preg_match("/otherdb_/", $k))
{
if($sql -> db_Select("alt_auth", "*", "auth_type='otherdb' AND auth_parmname='{$k}' "))
{
$sql -> db_Update("alt_auth", "auth_parmval='{$v}' WHERE auth_type='otherdb' AND auth_parmname='{$k}' ");
}
else
{
$sql -> db_Insert("alt_auth", "'otherdb','{$k}','{$v}' ");
}
}
}
return "Settings Updated";
}
function otherdb_conf_adminmenu()
{
alt_auth_adminmenu();
}
?>

View File

@@ -0,0 +1,74 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/plugin.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:44 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
// Plugin info -------------------------------------------------------------------------------------------------------
$eplug_name = "Alternate Authentication";
$eplug_version = "0.3";
$eplug_author = "McFly";
$eplug_logo = "/images/icon_ldap.png";
$eplug_url = "";
$eplug_email = "mcfly@e107.org";
$eplug_description = "This plugin allows for alternate authentication methods.";
$eplug_compatible = "e107v7+";
$eplug_readme = ""; // leave blank if no readme file
// Name of the plugin's folder -------------------------------------------------------------------------------------
$eplug_folder = "alt_auth";
// Mane of menu item for plugin ----------------------------------------------------------------------------------
$eplug_menu_name = "alt_auth";
// Name of the admin configuration file --------------------------------------------------------------------------
$eplug_conffile = "alt_auth_conf.php";
// Icon image and caption text ------------------------------------------------------------------------------------
$eplug_icon = $eplug_folder."/images/icon_ldap.png";
$eplug_caption = "Configure Alt auth";
// List of preferences -----------------------------------------------------------------------------------------------
$eplug_prefs = "";
// List of table names -----------------------------------------------------------------------------------------------
$eplug_table_names = array(
"alt_auth"
);
// List of sql requests to create tables -----------------------------------------------------------------------------
$eplug_tables = array(
"CREATE TABLE ".MPREFIX."alt_auth (
auth_type varchar(20) NOT NULL default '',
auth_parmname varchar(30) NOT NULL default '',
auth_parmval varchar(120) NOT NULL default ''
) TYPE=MyISAM;");
// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
$eplug_link = FALSE;
$eplug_link_name = "";
$eplug_link_url = "";
// Text to display after plugin successfully installed ------------------------------------------------------------------
$eplug_done = "Alt auth service is now set up. You will now need to configure your preferred method.";
?>

View File

@@ -0,0 +1,118 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/alt_news/alt_news.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:44 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
require_once(e_HANDLER."news_class.php");
function alt_news($news_category) {
global $ml, $sql, $aj, $ns;
$ix = new news;
if (strstr(e_QUERY, "cat")) {
$category = $news_category;
if ($category != 0) {
$gen = new convert;
$sql2 = new db;
$sql->db_Select("news_category", "*", "category_id='".intval($category)."'");
list($category_id, $category_name, $category_icon) = $sql->db_Fetch();
$category_name = $aj->tpa($category_name);
if (strstr($category_icon, "../")) {
$category_icon = str_replace("../", "", e_BASE.$category_icon);
} else {
$category_icon = THEME.$category_icon;
}
if ($count = $sql->db_Select("news", "*", "news_category='".intval($category)."' ORDER BY news_datestamp DESC")) {
while ($row = $sql->db_Fetch()) {
extract($row);
if ($news_title == "") {
$news_title = "Untitled";
}
$datestamp = $gen->convert_date($news_datestamp, "short");
$news_body = strip_tags(substr($news_body, 0, 100))." ...";
$comment_total = $sql2->db_Count("comments", "(*)", "WHERE comment_item_id='".intval($news_id)."' AND comment_type='0' ");
$text .= "<div class='mediumtext'>
<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='bullet' /> ";
if ($news_allow_comments) {
$text .= "<a href='news.php?extend.".$news_id."'>".$news_title."</a>";
} else {
$text .= "<a href='comment.php?comment.news.".$news_id."'>".$news_title."</a>";
}
$text .= "<br />
".LAN_NEWS_100." ".$datestamp." (".LAN_NEWS_99.": ";
if ($news_allow_comments) {
$text .= COMMENTOFFSTRING.")";
} else {
$text .= $comment_total.")";
}
$text .= "</div>
".$news_body."
<br /><br />\n";
}
$text = "<img src='$category_icon' alt='' /><br />". LAN_NEWS_307.$count."
<br /><br />".$text;
$ns->tablerender(LAN_NEWS_82." '".$category_name."'", $text, 'alt_news');
}
}
return TRUE;
}
if ($sql->db_Select("news", "*", "news_class<255 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") AND news_category='".intval($news_category)."' ORDER BY news_datestamp DESC LIMIT 0,".ITEMVIEW)) {
$sql2 = new db;
while (list($news['news_id'], $news['news_title'], $news['data'], $news['news_extended'], $news['news_datestamp'], $news['admin_id'], $news_category, $news['news_allow_comments'], $news['news_start'], $news['news_end'], $news['news_class']) = $sql->db_Fetch()) {
if (check_class($news['news_class']) || !$news['news_class']) {
if ($news['admin_id'] == 1 && $pref['siteadmin']) {
$news['admin_name'] = $pref['siteadmin'];
}
else if(!$news['admin_name'] = getcachedvars($news['admin_id'])) {
$sql2->db_Select("user", "user_name", "user_id='".intval($news['admin_id'])."' ");
list($news['admin_name']) = $sql2->db_Fetch();
cachevars($news['admin_id'], $news['admin_name']);
}
$sql2->db_Select("news_category", "*", "category_id='".intval($news_category)."' ");
list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql2->db_Fetch();
$news['comment_total'] = $sql2->db_Count("comments", "(*)", "WHERE comment_item_id='".intval($news['news_id'])."' AND comment_type='0' ");
$ix->render_newsitem($news);
} else {
if ($pref['subnews_hide_news'] == 1) {
if ($news['admin_id'] == 1 && $pref['siteadmin']) {
$news['admin_name'] = $pref['siteadmin'];
}
else if(!$news['admin_name'] = getcachedvars($news['admin_id'])) {
$sql2->db_Select("user", "user_name", "user_id='".intval($news['admin_id'])."' ");
list($news['admin_name']) = $sql2->db_Fetch();
cachevars($news['admin_id'], $news['admin_name']);
}
$sql2->db_Select("news_category", "*", "category_id='".intval($news_category)."' ");
list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql2->db_Fetch();
$ix->render_newsitem($news, "", "userclass");
}
}
}
}
}
?>

View File

@@ -0,0 +1,89 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/banner_menu/banner_menu.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:44 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
/*
To define your own banner to use here ...
1. Go to admin -> banners and create a campaign, then add your banner to it
2. Add this line to this file ...
$campaign = NAME_OF_YOUR_CAMPAIGN
3. Save file
*/
global $THEMES_DIRECTORY;
if (file_exists(THEME."banner_template.php")) {
require_once(THEME."banner_template.php");
} else {
require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
}
if(isset($campaign)){
$parm = (isset($campaign) ? $campaign : "");
$bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
$BANNER = eval($bannersccode);
$txt = $BANNER_MENU_START;
$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
$txt .= $BANNER_MENU_END;
}else{
if (isset($menu_pref['banner_campaign']) && $menu_pref['banner_campaign'])
{
if(strstr($menu_pref['banner_campaign'], "|"))
{
$campaignlist = explode("|", $menu_pref['banner_campaign']);
$amount = ($menu_pref['banner_amount']<1 ? '1' : $menu_pref['banner_amount']);
$amount = ($amount > count($campaignlist) ? count($campaignlist) : $amount);
$keys = array_rand($campaignlist, $amount);
$parms = array();
foreach($keys as $k=>$v){
$parms[] = $campaignlist[$v];
}
}
else
{
$parms[] = $menu_pref['banner_campaign'];
}
}
$txt = $BANNER_MENU_START;
foreach($parms as $parm){
$bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
$BANNER = eval($bannersccode);
$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
}
$txt .= $BANNER_MENU_END;
}
$text = $txt;
if (isset($menu_pref['banner_rendertype']) && $menu_pref['banner_rendertype'] == 2)
{
$ns->tablerender($menu_pref['banner_caption'], $text);
}
else
{
echo $text;
}
?>

View File

@@ -0,0 +1,259 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/banner_menu/config.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:44 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
$eplug_admin = TRUE;
require_once("../../class2.php");
if (!getperms("1")) {
header("location:".e_BASE."index.php");
exit ;
}
require_once(e_ADMIN."auth.php");
require_once(e_HANDLER."form_handler.php");
$rs = new form;
@include_once(e_PLUGIN."banner_menu/languages/".e_LANGUAGE.".php");
@include_once(e_PLUGIN."banner_menu/languages/English.php");
$lan_file = e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php";
include(file_exists($lan_file) ? $lan_file : e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php");
if (e_QUERY) {
$tmp = explode(".", e_QUERY);
$action = $tmp[0];
$sub_action = $tmp[1];
$id = $tmp[2];
unset($tmp);
}
if (isset($_POST['update_menu'])) {
foreach($_POST as $k => $v) {
if (strpos($k, "banner_") === 0) {
$menu_pref[$k] = $v;
}
}
if (isset($_POST['catid'])) {
$array_cat = explode("-", $_POST['catid']);
for($i = 0; $i < count($array_cat); $i++) {
$cat .= $array_cat[$i]."|";
}
$cat = substr($cat, 0, -1);
$menu_pref['banner_campaign'] = $cat;
}
$sysprefs->setArray('menu_pref');
$ns->tablerender("", "<div style='text-align:center'><b>".BANNER_MENU_L2."</b></div>");
}
if (!$menu_pref['banner_caption']) {
$menu_pref['banner2_caption'] = BANNER_MENU_L1;
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."' name='menu_conf_form'>
<table style='width:85%' class='fborder' >
<tr>
<td style='width:40%' class='forumheader3'>".BANNER_MENU_L3.": </td>
<td style='width:60%' class='forumheader3'>
<input class='tbox' type='text' name='banner_caption' size='20' value='".$menu_pref['banner_caption']."' maxlength='100' />
</td>
</tr>";
$array_cat_in = explode("|", $menu_pref['banner_campaign']);
$c = 0;
$d = 0;
$sql2 = new db;
$category_total = $sql2->db_Select("banner", "DISTINCT(SUBSTRING_INDEX(banner_campaign, '^', 1)) as banner_campaign", "ORDER BY banner_campaign", "mode=no_where");
while ($row = $sql2->db_Fetch()) {
extract($row);
if (in_array($banner_campaign, $array_cat_in)) {
$in_catname[$c] = $banner_campaign;
$c++;
} else {
$out_catname[$d] = $banner_campaign;
$d++;
}
}
$text .= "
<tr>
<td style='width:40%' class='forumheader3'>".BANNER_MENU_L6."</td>
<td style='width:60%' class='forumheader3'>
<table style='width:90%'>
<tr>
<td style='width:45%; vertical-align:top'>".BANNER_MENU_L7."<br />
<select class='tbox' id='catout' name='catout' size='10' style='width:180px' multiple='multiple' onchange='moveOver();'>";
for($a = 0; $a <= ($d-1); $a++) {
$text .= "<option value='".$out_catname[$a]."'>".$out_catname[$a]."</option>";
}
$text .= "</select>
</td>
<td style='width:45%; vertical-align:top'>".BANNER_MENU_L8."<br />
<select class='tbox' id='catin' name='catin' size='10' style='width:180px' multiple='multiple'>";
for($a = 0; $a <= ($c-1); $a++) {
$catidvalues .= $in_catname[$a]."-";
$text .= "<option value='".$in_catname[$a]."'>".$in_catname[$a]."</option>";
}
$catidvalues = substr($catidvalues, 0, -1);
$text .= "</select><br /><br />
<input class='button' type='button' value='".BANNER_MENU_L9."' onclick='removeMe();' />
<input type='hidden' name='catid' id='catid' value='".$catidvalues."' />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style='width:40%' class='forumheader3'>".BANNER_MENU_L10."</td>
<td style='width:60%' class='forumheader3'>
<select class='tbox' id='banner_rendertype' name='banner_rendertype' size='1' >
".$rs->form_option(BANNER_MENU_L11, (!$menu_pref['banner_rendertype'] || $menu_pref['banner_rendertype'] == "0" ? "1" : "0"), 0)."
".$rs->form_option("1 - ".BANNER_MENU_L12."", ($menu_pref['banner_rendertype'] == "1" ? "1" : "0"), 1)."
".$rs->form_option("2 - ".BANNER_MENU_L13."", ($menu_pref['banner_rendertype'] == "2" ? "1" : "0"), 2)."
".$rs->form_option("3 - ".BANNER_MENU_L14."", ($menu_pref['banner_rendertype'] == "3" ? "1" : "0"), 3)."
".$rs->form_select_close()."
</td>
</tr>
<tr>
<td style='width:40%' class='forumheader3'>".BANNER_MENU_L15."<br /><span class='smalltext' style='font-style:italic;'>".BANNER_MENU_L16."</span></td>
<td style='width:60%' class='forumheader3'>
<select class='tbox' id='banner_amount' name='banner_amount' size='1' >
".$rs->form_option(BANNER_MENU_L17, (!$menu_pref['banner_amount'] ? "1" : "0"), 0);
for($b = 1; $b < 6; $b++) {
$text .= $rs->form_option($b, ($menu_pref['banner_amount'] == $b ? "1" : "0"), $b);
}
$text .= $rs->form_select_close()."
</td>
</tr>
<tr>
<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='update_menu' value='".BANNER_MENU_L18."' /></td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(BANNER_MENU_L5, $text);
require_once(e_ADMIN."footer.php");
function headerjs() {
$script_js = "<script type=\"text/javascript\">
//<!--
//<!-- Adapted from original: Kathi O'Shea (Kathi.O'Shea@internet.com) -->
function moveOver(){
var boxLength = document.getElementById('catin').length;
var selectedItem = document.getElementById('catout').selectedIndex;
var selectedText = document.getElementById('catout').options[selectedItem].text;
var selectedValue = document.getElementById('catout').options[selectedItem].value;
var i;
var isNew = true;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
thisitem = document.getElementById('catin').options[i].text;
if (thisitem == selectedText) {
isNew = false;
break;
}
}
}
if (isNew) {
newoption = new Option(selectedText, selectedValue, false, false);
document.getElementById('catin').options[boxLength] = newoption;
document.getElementById('catout').options[selectedItem].text = '';
}
document.getElementById('catout').selectedIndex=-1;
saveMe();
}
function removeMe() {
var boxLength = document.getElementById('catin').length;
var boxLength2 = document.getElementById('catout').length;
arrSelected = new Array();
var count = 0;
for (i = 0; i < boxLength; i++) {
if (document.getElementById('catin').options[i].selected) {
arrSelected[count] = document.getElementById('catin').options[i].value;
var valname = document.getElementById('catin').options[i].text;
for (j = 0; j < boxLength2; j++) {
if (document.getElementById('catout').options[j].value == arrSelected[count]){
document.getElementById('catout').options[j].text = valname;
}
}
}
count++;
}
var x;
for (i = 0; i < boxLength; i++) {
for (x = 0; x < arrSelected.length; x++) {
if (document.getElementById('catin').options[i].value == arrSelected[x]) {
document.getElementById('catin').options[i] = null;
}
}
boxLength = document.getElementById('catin').length;
}
saveMe();
}
//function clearMe(clid){
// location.href = document.location + \"?clear.\" + clid;
//}
function saveMe(clid) {
var strValues = \"\";
var boxLength = document.getElementById('catin').length;
var count = 0;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
if (count == 0) {
strValues = document.getElementById('catin').options[i].value;
}
else {
strValues = strValues + \"-\" + document.getElementById('catin').options[i].value;
}
count++;
}
}
if (strValues.length == 0) {
//alert(\"You have not made any selections\");
document.getElementById('catid').value = \"\";
}
else {
document.getElementById('catid').value = strValues;
}
}
// -->
</script>\n";
return $script_js;
}
?>

View File

@@ -0,0 +1,34 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/banner_menu/languages/English.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:44 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
define("BANNER_MENU_L1", "Advertisement");
define("BANNER_MENU_L2", "Banner menu configuration saved");
//v.617
define("BANNER_MENU_L3", "Caption");
define("BANNER_MENU_L4", "Campaign");
define("BANNER_MENU_L5", "Banner Menu Configuration");
define("BANNER_MENU_L6", "choose campaigns to show in menu");
define("BANNER_MENU_L7", "available campaigns");
define("BANNER_MENU_L8", "selected campaigns");
define("BANNER_MENU_L9", "remove selection");
define("BANNER_MENU_L10", "how should the selected campaigns be shown ?");
define("BANNER_MENU_L11", "choose render type ...");
define("BANNER_MENU_L12", "one campaign in single menu");
define("BANNER_MENU_L13", "all selected campaigns in single menu");
define("BANNER_MENU_L14", "all selected campaigns in separate menus");
define("BANNER_MENU_L15", "how many banners should be shown ?");
define("BANNER_MENU_L16", "this setting will only be used with options 2 and 3.<br />if less banners are present the maximum available amount will be used.");
define("BANNER_MENU_L17", "set amount ...");
define("BANNER_MENU_L18", "Update Menu Settings");
?>

View File

@@ -0,0 +1,134 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/blogcalendar_menu/archive.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:44 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
| Based on code by: Thomas Bouve (crahan@gmx.net)
*/
require_once("../../class2.php");
require_once(e_HANDLER."userclass_class.php");
$lan_file = e_PLUGIN."blogcalendar_menu/languages/".e_LANGUAGE.".php";
if (file_exists($lan_file)) {
require_once($lan_file);
} else {
require_once(e_PLUGIN."blogcalendar_menu/languages/English.php");
};
require_once("calendar.php");
require_once("functions.php");
require_once(HEADERF);
// ---------------------
// initialize some cruft
// ---------------------
$sql = new db;
$prefix = e_PLUGIN."blogcalendar_menu";
$marray = array(BLOGCAL_M1, BLOGCAL_M2, BLOGCAL_M3, BLOGCAL_M4,
BLOGCAL_M5, BLOGCAL_M6, BLOGCAL_M7, BLOGCAL_M8,
BLOGCAL_M9, BLOGCAL_M10, BLOGCAL_M11, BLOGCAL_M12);
// if nr of rows per month is not set, default to 3
$months_per_row = $pref['blogcal_mpr']?$pref['blogcal_mpr']:
"3";
$pref['blogcal_ws'] = "monday";
// -------------------------------------
// what year are we supposed to display?
// -------------------------------------
$cur_year = date("Y");
$cur_month = date("n");
$cur_day = date("j");
if (strstr(e_QUERY, "year")) {
$tmp = explode(".", e_QUERY);
$req_year = $tmp[1];
} else {
$req_year = $cur_year;
}
// --------------------------------
// look for the first and last year
// --------------------------------
$sql->db_Select_gen("SELECT news_id, news_datestamp from ".MPREFIX."news ORDER BY news_datestamp LIMIT 0,1");
$first_post = $sql->db_Fetch();
$start_year = date("Y", $first_post['news_datestamp']);
$end_year = $cur_year;
// ----------------------
// build the yearselector
// ----------------------
$year_selector = "<div class='forumheader' style='text-align: center; margin-bottom: 2px;'>";
$year_selector .= "".BLOGCAL_ARCHIV1.": <select name='activate' onChange='urljump(this.options[selectedIndex].value)' class='tbox'>";
for($i = $start_year; $i <= $end_year; $i++) {
$start = mktime(0, 0, 0, 1, 1, intval($req_year));
$end = mktime(23, 59, 59, 12, 31, intval($req_year));
// create the option entry
$year_link = $prefix."/archive.php?year.".$i;
$year_selector .= "<option value='".$year_link."'";
if ($i == $req_year) {
$year_selector .= " selected";
}
if ($sql->db_Select("news", "news_id, news_datestamp, news_class", "news_datestamp > $start AND news_datestamp < $end")) {
while ($news = $sql->db_Fetch()) {
if (check_class($news['news_class'])) {
list($xmonth, $xday) = explode(" ", date("n j", $news['news_datestamp']));
if (!$day_links[$xmonth][$xday]) {
$day_links[$xmonth][$xday] = e_BASE."news.php?day.".formatdate($req_year, $xmonth, $xday);
}
}
}
}
$year_selector .= ">".$i."</option>";
}
$year_selector .= "</select>";
// --------------------------
// create the archive display
// --------------------------
$newline = 0;
$archive = "<div style='text-align:center'><table border='0' cellspacing='7'><tr>";
$archive .= "<td colspan='$months_per_row'><div>$year_selector</div></td></tr><tr>";
for($i = 1; $i <= 12; $i++) {
if (++$newline == $months_per_row+1) {
$archive .= "</tr><tr>";
$newline = 1;
}
$archive .= "<td style='vertical-align:top'>";
$archive .= "<div class='fcaption' style='text-align:center; margin-bottom:2px;'>";
// href the current month regardless of newsposts or any month with news
if (($req_year == $cur_year && $i == $cur_month) || $day_links[$i]) {
$archive .= "<a class='forumlink' href='".e_BASE."news.php?month.".formatDate($req_year, $i)."'>".$marray[$i-1]."</a>";
} else {
$archive .= $marray[$i-1];
}
$archive .= "</div>";
if (($req_year == $cur_year) && ($i == $cur_month)) {
$req_day = $cur_day;
} else {
$req_day = "";
}
$archive .= "<div>".calendar($req_day, $i, $req_year, $day_links[$i], $pref['blogcal_ws'])."</div></td>\n";
}
$archive .= "</tr></table></div>";
$ns->tablerender(BLOGCAL_L2 ."&nbsp;$req_year", $archive);
require_once(FOOTERF);
?>

View File

@@ -0,0 +1,131 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/blogcalendar_menu/blogcalendar_menu.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:44 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
| Based on code by: Thomas Bouve (crahan@gmx.net)
*/
if (!defined('e107_INIT')) { exit; }
require_once(e_PLUGIN."blogcalendar_menu/calendar.php");
require_once(e_PLUGIN."blogcalendar_menu/functions.php");
// ------------------------------
// initialization + fetch options
// ------------------------------
$prefix = e_PLUGIN."blogcalendar_menu";
$marray = array(BLOGCAL_M1, BLOGCAL_M2, BLOGCAL_M3, BLOGCAL_M4,
BLOGCAL_M5, BLOGCAL_M6, BLOGCAL_M7, BLOGCAL_M8,
BLOGCAL_M9, BLOGCAL_M10, BLOGCAL_M11, BLOGCAL_M12);
$pref['blogcal_ws'] = "monday";
// ----------------------------------------------
// get the requested and current date information
// ----------------------------------------------
list($cur_year, $cur_month, $cur_day) = explode(" ", date("Y n j"));
if (strstr(e_QUERY, "day")) {
$tmp = explode(".", e_QUERY);
$item = $tmp[1];
$req_year = substr($item, 0, 4);
$req_month = substr($item, 4, 2);
// decide on the behaviour here, do we highlight
// the day being viewed? or only 'today'?
//$req_day = substr($item, 6, 2);
// if the requested year and month are the current, then add
// the current day to the mix so the calendar highlights it
if (($req_year == $cur_year) && ($req_month == $cur_month)) {
$req_day = $cur_day;
} else {
$req_day = "";
}
}
else if(strstr(e_QUERY, "month")) {
$tmp = explode(".", e_QUERY);
$item = $tmp[1];
$req_year = substr($item, 0, 4);
$req_month = substr($item, 4, 2);
// if the requested year and month are the current, then add
// the current day to the mix so the calendar highlights it
if (($req_year == $cur_year) && ($req_month == $cur_month)) {
$req_day = $cur_day;
} else {
$req_day = "";
}
} else {
$req_year = $cur_year;
$req_month = $cur_month;
$req_day = $cur_day;
}
// -------------------------------
// create the month selection item
// -------------------------------
$month_selector = "<div class='forumheader' style='text-align: center; margin-bottom: 2px;'>";
$month_selector .= "<select name='activate' onchange='urljump(this.options[selectedIndex].value)' class='tbox'>";
// get all newsposts since the beginning of the year till now
// -------------------------------------------
// get links to all newsitems in current month
// -------------------------------------------
$month_start = mktime(0, 0, 0, $req_month, 1, $req_year);
$lastday = date("t", $month_start);
$month_end = mktime(23, 59, 59, $req_month, $lastday, $req_year);
$start = mktime(0, 0, 0, 1, 1, $req_year);
$end = time();
$sql->db_Select("news", "news_id, news_datestamp", "news_class IN (".USERCLASS_LIST.") AND news_datestamp > ".intval($start)." AND news_datestamp < ".intval($end));
while ($news = $sql->db_Fetch())
{
$xmonth = date("n", $news['news_datestamp']);
if (!isset($month_links[$xmonth]) || !$month_links[$xmonth])
{
$month_links[$xmonth] = e_BASE."news.php?month.".formatDate($req_year, $xmonth);
}
if($news['news_datestamp'] >= $month_start AND $news['news_datestamp'] <= $month_end)
{
$xday = date("j", $news['news_datestamp']);
if (!isset($day_links[$xday]) || !$day_links[$xday])
{
$day_links[$xday] = e_BASE."news.php?day.".formatDate($req_year, $req_month, $xday);
}
}
}
// if we're listing the current year, add the current month to the list regardless of posts
if ($req_year == $cur_year) {
$month_links[$cur_month] = e_BASE."news.php?month.".formatDate($cur_year, $cur_month);
}
// go over the link array and create the option fields
foreach($month_links as $index => $val) {
$month_selector .= "<option value='".$val."'";
$month_selector .= ($index == $req_month)?" selected='selected'":
"";
$month_selector .= ">".$marray[$index-1]."</option>";
}
// close the select item
$month_selector .= "</select></div>";
// ------------------------
// create and show calendar
// ------------------------
$menu = "<div style='text-align: center;'><table border='0' cellspacing='7'>";
$menu .= "<tr><td>$month_selector";
$menu .= "<div style='text-align:center'>".calendar($req_day, $req_month, $req_year, $day_links, $pref['blogcal_ws'])."</div>";
$menu .= "<div class='forumheader' style='text-align: center; margin-top:2px;'><span class='smalltext'><a href='$prefix/archive.php'>".BLOGCAL_L2."</a></span></div></td></tr>";
$menu .= "</table></div>";
$ns->tablerender(BLOGCAL_L1." ".$req_year, $menu, 'blog_calender');
?>

View File

@@ -0,0 +1,102 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/blogcalendar_menu/calendar.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:45 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
| Based on code by: Thomas Bouve (crahan@gmx.net) and
| and Based on: PHP Calendar by Keith Devens http://www.keithdevens.com/software/php_calendar/
*/
if (!defined('e107_INIT')) { exit; }
function calendar($req_day, $req_month, $req_year, $links = NULL, $ws = "sunday") {
// get access to the preferences
global $pref;
// prepare the day array
$darray = array(BLOGCAL_D1, BLOGCAL_D2, BLOGCAL_D3, BLOGCAL_D4,
BLOGCAL_D5, BLOGCAL_D6, BLOGCAL_D7);
// what day does the week start on?
switch($ws) {
case "monday":
$ws = "1";
break;
case "sunday":
array_unshift($darray, array_pop($darray));
$ws = "0";
}
// what's the padding we should use for the cells?
$padding = (isset($pref['blogcal_padding']) && $pref['blogcal_padding']) ? $pref['blogcal_padding']: "2";
$date = mktime(0, 0, 0, $req_month, 1, $req_year);
$last_day = date('t', $date);
$date_info = getdate($date);
$day_of_week = $date_info['wday'];
if ($ws && $day_of_week == 0) $day_of_week = 7;
// print the daynames
$calendar = "<table class='fborder'>";
$calendar .= '<tr>';
foreach($darray as $dheader) {
$calendar .= "<td class='forumheader' style='padding: ".$padding."px;'><span class='smalltext'>$dheader</span></td>";
}
$calendar .= "</tr>";
$calendar .= '<tr>';
$day_of_month = 1;
$tablerow = 1;
// take care of the first "empty" days of the month
if ($day_of_week-$ws > 0) {
$calendar .= "<td colspan='";
$calendar .= $day_of_week-$ws;
$calendar .= "'>&nbsp;</td>";
}
// print the days of the month (take the $ws into account)
while ($day_of_month <= $last_day) {
if ($day_of_week-$ws == 7) {
#start a new week
$calendar .= "</tr><tr>";
$day_of_week = 0+$ws;
$tablerow++;
}
if ($day_of_month == $req_day) {
$day_style = isset($links[$day_of_month]) ? "indent" : "forumheader3";
} else {
$day_style = isset($links[$day_of_month]) ? "indent" : "forumheader3";
}
$calendar .= "<td class='$day_style' style='padding: ".$padding."px;'><span class='smalltext'>";
$calendar .= isset($links[$day_of_month]) ? "<a href='".$links[$day_of_month]."'>":"";
$calendar .= $day_of_month;
$calendar .= isset($links[$day_of_month]) ? "</a>" : "";
$calendar .= "</span></td>";
$day_of_month++;
$day_of_week++;
}
if ($day_of_week-$ws != 7) {
$calendar .= '<td colspan="' . (7 - $day_of_week+$ws) . '">&nbsp;</td>';
}
$calendar .= "</tr>";
if ($tablerow != 6) {
$calendar .= "<tr><td style='padding: ".$padding."px;' colspan='6'>&nbsp;</td></tr>";
}
$calendar .= "</table>";
return $calendar;
}
?>

View File

@@ -0,0 +1,91 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/blogcalendar_menu/config.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:45 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
$eplug_admin = TRUE;
require_once("../../class2.php");
require_once(e_HANDLER."userclass_class.php");
$lan_file = e_PLUGIN."blogcalendar_menu/languages/".e_LANGUAGE.".php";
if (file_exists($lan_file)) {
require_once($lan_file);
} else {
require_once(e_PLUGIN."blogcalendar_menu/languages/English.php");
}
if (!getperms("1")) {
header("location:".e_BASE."index.php");
exit ;
}
require_once(e_ADMIN."auth.php");
if (isset($_POST['update_menu'])) {
while (list($key, $value) = each($_POST)) {
if ($value != BLOGCAL_CONF3) {
$pref[$key] = $value;
}
}
save_prefs();
$ns->tablerender("", "<div style='text-align:center'><b>".BLOGCAL_CONF5."</b></div>");
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?".e_QUERY."' name='menu_conf_form'>
<table style='width:85%' class='fborder' >
<tr>
<td style='width:40%' class='forumheader3'>".BLOGCAL_CONF1.": </td>
<td style='width:60%' class='forumheader3'>
<select class='tbox' name='blogcal_mpr'>";
// if the nr of months per row is undefined, default to 3
$months_per_row = $pref['blogcal_mpr']?$pref['blogcal_mpr']:
"3";
for($i = 1; $i <= 12; $i++) {
$text .= "<option value='$i'";
$text .= $months_per_row == $i?"selected":
"";
$text .= ">$i</option>";
}
$text .= "</select>
</td>
</tr>
<tr>
<td style='width:40%' class='forumheader3'>".BLOGCAL_CONF2.": </td>
<td style='width:60%' class='forumheader3'>
<input class='tbox' type='text' name='blogcal_padding' size='20' value='";
// if the cellpadding isn't defined
$padding = $pref['blogcal_padding']?$pref['blogcal_padding']:
"2";
$text .= $padding;
$text .= "' maxlength='100' />
</td>
</tr>
<tr>
<td colspan='2' class='forumheader' style='text-align:center'>
<input class='button' type='submit' name='update_menu' value='".BLOGCAL_CONF3."' />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(BLOGCAL_CONF4, $text);
require_once(e_ADMIN."footer.php");
?>

View File

@@ -0,0 +1,31 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/blogcalendar_menu/functions.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:45 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
// format a date as yyyymmdd
function formatDate($year, $month, $day = "") {
$date = $year;
$date .= (strlen($month) < 2)?"0".$month:
$month;
$date .= (strlen($day) < 2 && $day != "")?"0".$day:
$day;
return $date;
}
?>

View File

@@ -0,0 +1,49 @@
<?php
/*
+---------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
+---------------------------------------------------------------+
*/
define("BLOGCAL_L1", "News for ");
define("BLOGCAL_L2", "Archive");
define("BLOGCAL_D1", "Mo");
define("BLOGCAL_D2", "Tu");
define("BLOGCAL_D3", "We");
define("BLOGCAL_D4", "Th");
define("BLOGCAL_D5", "Fr");
define("BLOGCAL_D6", "Sa");
define("BLOGCAL_D7", "Su");
define("BLOGCAL_M1", "January");
define("BLOGCAL_M2", "February");
define("BLOGCAL_M3", "March");
define("BLOGCAL_M4", "April");
define("BLOGCAL_M5", "May");
define("BLOGCAL_M6", "June");
define("BLOGCAL_M7", "July");
define("BLOGCAL_M8", "August");
define("BLOGCAL_M9", "September");
define("BLOGCAL_M10", "October");
define("BLOGCAL_M11", "November");
define("BLOGCAL_M12", "December");
define("BLOGCAL_1", "News Items");
define("BLOGCAL_CONF1", "Months/row");
define("BLOGCAL_CONF2", "Cellpadding");
define("BLOGCAL_CONF3", "Update Menu Settings");
define("BLOGCAL_CONF4", "BlogCal Menu Configuration");
define("BLOGCAL_CONF5", "BlogCal menu configuration saved");
define("BLOGCAL_ARCHIV1", "Select Archive");
?>

View File

@@ -0,0 +1,50 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/blogcalendar_menu/styles.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:45 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
// -----------------------
// blogcal menu style vars
// -----------------------
$bc_menu_wrapper = "";
$menu_header = "";
$menu_body = "";
$menu_footer = "";
// --------------------------
// calendar object style vars
// --------------------------
$cal_header_cell = "";
$cal_blank_cell = "";
$cal_cell = "";
$cal_linked_cell = "";
$cal_hl_cell = "";
$cal_hl_linked_cell = "";
// --------------------------
// archive section style vars
// --------------------------
$arch_wrapper = "";
$arch_header = "";
$arch_cell = "";
$arch_cell_header = "";
$arch_cell_body = "";
?>

View File

@@ -0,0 +1,830 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/admin_config.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:45 $
| $Author: mcfly_e107 $
|
| 02.11.06 - Cache clear option added
| 10.11.06 - Support for updated templates etc
|
+----------------------------------------------------------------------------+
*/
$eplug_admin = true; // Make sure we show admin theme
require_once("../../class2.php");
require_once(e_HANDLER."userclass_class.php");
if (!getperms("P")) {
header("location:".e_BASE."index.php");
}
include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
$message = "";
$calendarmenu_text = ''; // Notice removal
$calendarmenu_msg = ''; // Notice removal
if (isset($_POST['updatesettings'])) {
$pref['eventpost_admin'] = $_POST['eventpost_admin'];
$pref['eventpost_adminlog'] = $_POST['eventpost_adminlog'];
$pref['eventpost_showeventcount'] = $_POST['eventpost_showeventcount'];
$pref['eventpost_forum'] = $_POST['eventpost_forum'];
$pref['eventpost_recentshow'] = $_POST['eventpost_recentshow'];
$pref['eventpost_super'] = $_POST['eventpost_super'];
$pref['eventpost_menulink'] = $_POST['eventpost_menulink'];
$pref['eventpost_dateformat'] = $_POST['eventpost_dateformat'];
$pref['eventpost_fivemins'] = $_POST['eventpost_fivemins'];
$pref['eventpost_weekstart'] = $_POST['eventpost_weekstart'];
$pref['eventpost_lenday'] = $_POST['eventpost_lenday'];
$pref['eventpost_caltime'] = $_POST['eventpost_caltime'];
$pref['eventpost_datedisplay'] = $_POST['eventpost_datedisplay'];
$pref['eventpost_timedisplay'] = $_POST['eventpost_timedisplay'];
$pref['eventpost_timecustom'] = $_POST['eventpost_timecustom'];
$pref['eventpost_dateevent'] = $_POST['eventpost_dateevent'];
$pref['eventpost_datenext'] = $_POST['eventpost_datenext'];
$pref['eventpost_eventdatecustom'] = $_POST['eventpost_eventdatecustom'];
$pref['eventpost_nextdatecustom'] = $_POST['eventpost_nextdatecustom'];
$pref['eventpost_mailsubject'] = $_POST['eventpost_mailsubject'];
$pref['eventpost_mailfrom'] = $_POST['eventpost_mailfrom'];
$pref['eventpost_mailaddress'] = $_POST['eventpost_mailaddress'];
$pref['eventpost_asubs'] = $_POST['eventpost_asubs'];
$pref['eventpost_emaillog'] = $_POST['eventpost_emaillog'];
save_prefs();
$e107cache->clear('nq_event_cal'); // Clear cache as well, in case displays changed
$message = EC_LAN_75; // "Calendar settings updated.";
}
// ****************** FORTHCOMING EVENTS ******************
if (isset($_POST['updateforthcoming']))
{
$pref['eventpost_menuheading'] = $_POST['eventpost_fe_menuheading'];
$pref['eventpost_daysforward'] = $_POST['eventpost_fe_daysforward'];
$pref['eventpost_numevents'] = $_POST['eventpost_fe_numevents'];
$pref['eventpost_checkrecur'] = $_POST['eventpost_fe_checkrecur'];
$pref['eventpost_linkheader'] = $_POST['eventpost_fe_linkheader'];
$pref['eventpost_fe_set'] = implode(",", $_POST['fe_eventclass']);
$pref['eventpost_showcaticon'] = $_POST['eventpost_showcaticon'];
$pref['eventpost_namelink'] = $_POST['eventpost_namelink'];
save_prefs();
$e107cache->clear('nq_event_cal'); // Clear cache as well, in case displays changed
$message = EC_ADLAN_A109; // "Forthcoming Events settings updated.";
}
if (e_QUERY)
{
$qs = explode(".", e_QUERY);
}
require_once('ecal_class.php');
$ecal_class = new ecal_class;
// ****************** MAINTENANCE ******************
if (isset($_POST['deleteold']) && isset($_POST['eventpost_deleteoldmonths']))
{
$back_count = $_POST['eventpost_deleteoldmonths'];
if (($back_count >= 1) && ($back_count <= 12))
{
$old_date = intval(mktime(0,0,0,$ecal_class->now_date['mon']-$back_count,1,$ecal_class->now_date['year']));
$old_string = strftime("%d %B %Y",$old_date);
// $message = "Back delete {$back_count} months. Oldest date = {$old_string}";
$qs[0] = "confdel";
$qs[1] = $old_date;
}
else
$message = EC_ADLAN_A148;
}
if (isset($_POST['cache_clear']))
{
$qs[0] = "confcache";
}
require_once(e_ADMIN."auth.php");
// Actually delete back events
if (isset($_POST['confirmdeleteold']) && isset($qs[0]) && ($qs[0] == "backdel"))
{
$old_date = $qs[1];
$old_string = strftime("%d %B %Y",$old_date);
// Check both start and end dates to avoid problems with events originally entered under 0.617
$qry = "event_start < {$old_date} AND event_end < {$old_date} AND event_recurring = 0";
// $message = "Back delete {$back_count} months. Oldest date = {$old_string} Query = {$qry}";
if ($sql -> db_Delete("event",$qry))
{
// Add in a log event
$ecal_class->cal_log(4,'db_Delete - earlier than {$old_string} (past {$back_count} months)',$qry);
$message = EC_ADLAN_A146.$old_string.EC_ADLAN_A147;
}
else
{
$message = EC_ADLAN_A149." : ".$sql->mySQLresult;
}
$qs[0] = "maint";
}
// Actually empty cache
if (isset($_POST['confirmdelcache']) && isset($qs[0]) &&($qs[0] == "cachedel"))
{
$e107cache->clear('nq_event_cal');
$message = EC_ADLAN_A163;
$qs[0] = "maint"; // Re-display maintenance menu
}
// Prompt to delete back events
if(isset($qs[0]) && ($qs[0] == "confdel"))
{
$old_string = strftime("%d %B %Y",$qs[1]);
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?backdel.{$qs[1]}'>
<table style='width:97%' class='fborder'>
<tr>
<td class='forumheader3' style='width:100%;vertical-align:top;rext-align:center;'>".EC_ADLAN_A150.$old_string." </td>
</tr>
<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='confirmdeleteold' value='".EC_LAN_50."' /></td></tr>
</table></form></div>";
$ns->tablerender("<div style='text-align:center'>".EC_LAN_50."</div>", $text);
}
// Prompt to clear cache
if (isset($qs[0]) && ($qs[0] == "confcache"))
{
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?cachedel'>
<table style='width:97%' class='fborder'>
<tr>
<td class='forumheader3' style='width:100%;vertical-align:top;rext-align:center;'>".EC_ADLAN_A162." </td>
</tr>
<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='confirmdelcache' value='".EC_LAN_50."' /></td></tr>
</table></form></div>";
$ns->tablerender("<div style='text-align:center'>".EC_LAN_50."</div>", $text);
}
if (isset($message))
{
$ns->tablerender("", "<div style='text-align:center'><b>$message</b></div>");
}
//category
if(isset($qs[0]) && $qs[0] == "cat")
{
$calendarmenu_db = new DB;
$calendarmenu_action = '';
if (isset($_POST['calendarmenu_action'])) $calendarmenu_action = $_POST['calendarmenu_action'];
$calendarmenu_edit = FALSE;
// * If we are updating then update or insert the record
if ($calendarmenu_action == 'update')
{
$calendarmenu_id = $_POST['calendarmenu_id'];
if ($calendarmenu_id == 0)
{
// New record so add it
// Enumerate fields so it doesn't matter if they're in the wrong order.
// db_Insert can take an array of key => value pairs
$calendarmenu_args = array (
'event_cat_id' => 0,
'event_cat_name' => $_POST['event_cat_name'],
'event_cat_description' => $_POST['event_cat_description'],
'event_cat_icon' => $_POST['ne_new_category_icon'],
'event_cat_class' => intval($_POST['event_cat_class']),
'event_cat_subs' => intval($_POST['event_cat_subs']),
'event_cat_force_class' => intval($_POST['event_cat_force_class']),
'event_cat_ahead' => intval($_POST['event_cat_ahead']),
'event_cat_msg1' => $_POST['event_cat_msg1'],
'event_cat_msg2' => $_POST['event_cat_msg2'],
'event_cat_notify' => intval($_POST['event_cat_notify']),
'event_cat_lastupdate' => intval(time()),
'event_cat_addclass' => intval($_POST['event_cat_addclass'])
);
if ($calendarmenu_db->db_Insert("event_cat", $calendarmenu_args))
{
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A26."</strong></td></tr>";
}
else
{
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A27."</strong></td></tr>";
}
}
else
{
// Update existing
$calendarmenu_args = "
event_cat_name='".$_POST['event_cat_name']."',
event_cat_description='".$_POST['event_cat_description']."',
event_cat_class='".intval($_POST['event_cat_class'])."',
event_cat_icon='".$_POST['ne_new_category_icon']."',
event_cat_subs='".intval($_POST['event_cat_subs'])."',
event_cat_force_class='".intval($_POST['event_cat_force_class'])."',
event_cat_ahead='".intval($_POST['event_cat_ahead'])."',
event_cat_msg1='".$_POST['event_cat_msg1']."',
event_cat_msg2='".$_POST['event_cat_msg2']."',
event_cat_notify='".intval($_POST['event_cat_notify'])."',
event_cat_addclass='".intval($_POST['event_cat_addclass'])."',
event_cat_lastupdate='".time()."'
where event_cat_id='$calendarmenu_id'";
if ($calendarmenu_db->db_Update("event_cat", $calendarmenu_args)){
// Changes saved
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><b>".EC_ADLAN_A28."</b></td></tr>";
}else{
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><b>".EC_ADLAN_A29."</b></td></tr>";
}
}
}
// We are creating, editing or deleting a record
if ($calendarmenu_action == 'dothings')
{
$calendarmenu_id = $_POST['calendarmenu_selcat'];
$calendarmenu_do = $_POST['calendarmenu_recdel'];
$calendarmenu_dodel = false;
switch ($calendarmenu_do)
{
case '1': // Edit existing record
{
// We edit the record
$calendarmenu_db->db_Select("event_cat", "*", "event_cat_id='$calendarmenu_id'");
$calendarmenu_row = $calendarmenu_db->db_Fetch() ;
extract($calendarmenu_row);
$calendarmenu_cap1 = EC_ADLAN_A24;
$calendarmenu_edit = TRUE;
break;
}
case '2': // New category
{
// Create new record
$calendarmenu_id = 0;
// set all fields to zero/blank
$calendar_category_name = "";
$calendar_category_description = "";
$calendarmenu_cap1 = EC_ADLAN_A23;
$calendarmenu_edit = TRUE;
break;
}
case '3':
{
// delete the record
if ($_POST['calendarmenu_okdel'] == '1'){
if ($calendarmenu_db->db_Select("event", "event_id", " where event_category='$calendarmenu_id'", "nowhere")){
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A59."</strong></td></tr>";
}else{
if ($calendarmenu_db->db_Delete("event_cat", " event_cat_id='$calendarmenu_id'")){
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A30."</strong></td></tr>";
}else{
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A32."</strong></td></tr>";
}
}
}else{
$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A31."</strong></td></tr>";
}
$calendarmenu_dodel = TRUE;
$calendarmenu_edit = FALSE;
}
}
if (!$calendarmenu_dodel)
{
require_once(e_HANDLER."file_class.php");
$calendarmenu_text .= "
<form id='calformupdate' method='post' action='".e_SELF."?cat'>
<table style='width:97%;' class='fborder'>
<tr>
<td colspan='2' class='fcaption'>{$calendarmenu_cap1}
<input type='hidden' value='{$calendarmenu_id}' name='calendarmenu_id' />
<input type='hidden' value='update' name='calendarmenu_action' />
</td>
</tr>
{$calendarmenu_msg}
<tr>
<td style='width:20%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A21."</td>
<td class='forumheader3'><input type='text' style='width:150px' class='tbox' name='event_cat_name' value='{$event_cat_name}' /></td>
</tr>
<tr>
<td style='width:20%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A121."</td>
<td class='forumheader3'><textarea rows='5' cols='60' class='tbox' name='event_cat_description' >".$event_cat_description."</textarea></td>
</tr>
<tr>
<td style='width:20%' class='forumheader3'>".EC_ADLAN_A80."</td>
<td style='width:80%' class='forumheader3'>".r_userclass("event_cat_class", $event_cat_class, "off", 'public, nobody, member, admin, classes')."</td>
</tr>
<tr>
<td style='width:20%' class='forumheader3'>".EC_ADLAN_A94."</td>
<td style='width:80%' class='forumheader3'>".r_userclass("event_cat_addclass", $event_cat_addclass, "off", 'public, nobody, member, admin, classes')."</td>
</tr>
<tr>
<td class='forumheader3' style='width:20%'>".EC_LAN_55."</td><td class='forumheader3' >
<input class='tbox' style='width:150px' id='caticon' type='text' name='ne_new_category_icon' value='".$event_cat_icon."' />
<input class='button' type='button' style='width: 45px; cursor:hand;' value='".EC_LAN_90."' onclick='expandit(\"cat_icons\")' />
<div style='display:none' id='cat_icons'>";
$fi = new e_file;
$imagelist = $fi->get_files(e_PLUGIN."calendar_menu/images", "\.\w{3}$");
foreach($imagelist as $img){
if ($img['fname']){
$calendarmenu_text .= "<a href='javascript:insertext(\"{$img['fname']}\", \"caticon\", \"cat_icons\")'><img src='".e_PLUGIN."calendar_menu/images/".$img['fname']."' style='border:0px' alt='' /></a> ";
}
}
$calendarmenu_text .= "
</div>
</td>
</tr>
<tr>
<td class='forumheader3' style='width:20%'>".EC_ADLAN_A81."</td>
<td class='forumheader3'><input type='checkbox' class='tbox' name='event_cat_subs' value='1' ".($event_cat_subs > 0?"checked='checked'":"")." /></td>
</tr>
<tr>
<td class='forumheader3' style='width:20%'>".EC_ADLAN_A86."</td>
<td class='forumheader3'><select class='tbox' name='event_cat_notify'>
<option value='0' ".($event_cat_notify == 0?" selected='selected'":"")." >".EC_ADLAN_A87."</option>
<option value='1' ".($event_cat_notify == 1?" selected='selected'":"")." >".EC_ADLAN_A88."</option>
<option value='2' ".($event_cat_notify == 2?" selected='selected'":"")." >".EC_ADLAN_A89."</option>
<option value='3' ".($event_cat_notify == 3?" selected='selected'":"")." >".EC_ADLAN_A90."</option>
<option value='4' ".($event_cat_notify == 4?" selected='selected'":"")." >".EC_ADLAN_A110."</option>
<option value='5' ".($event_cat_notify == 5?" selected='selected'":"")." >".EC_ADLAN_A111."</option>
</select>
</td>
</tr>
<tr>
<td style='width:20%' class='forumheader3'>".EC_ADLAN_A82."</td>
<td style='width:80%' class='forumheader3'>".r_userclass("event_cat_force_class", $event_cat_force_class, "off", 'nobody, member, admin, classes')."</td>
</tr>
<tr>
<td class='forumheader3' style='width:20%'>".EC_ADLAN_A83."</td>
<td class='forumheader3'><input type='text' size='4' maxlength='5' class='tbox' name='event_cat_ahead' value='$event_cat_ahead' /></td>
</tr>
<tr>
<td class='forumheader3' style='width:20%;vertical-align:top;'>".EC_ADLAN_A84."</td>
<td class='forumheader3'><textarea rows='5' cols='80' class='tbox' name='event_cat_msg1' >".$event_cat_msg1."</textarea></td>
</tr>
<tr>
<td class='forumheader3' style='width:20%;vertical-align:top;'>".EC_ADLAN_A117."</td>
<td class='forumheader3'><textarea rows='5' cols='80' class='tbox' name='event_cat_msg2' >".$event_cat_msg2."</textarea></td>
</tr>
<tr><td colspan='2' style='text-align:center' class='fcaption'><input type='submit' name='submits' value='".EC_LAN_77."' class='tbox' /></td></tr>
</table>
</form>";
}
}
if (!$calendarmenu_edit)
{
// Get the category names to display in combo box then display actions available
$calendarmenu2_db = new DB;
$calendarmenu_catopt = '';
if (!isset($calendarmenu_id)) $calendarmenu_id = -1;
if ($calendarmenu2_db->db_Select("event_cat", "event_cat_id,event_cat_name", " order by event_cat_name", "nowhere"))
{
while ($row = $calendarmenu2_db->db_Fetch()){
//extract($calendarmenu_row);
$calendarmenu_catopt .= "<option value='".$row['event_cat_id']."' ".($calendarmenu_id == $row['event_cat_id'] ?" selected='selected'":"")." >".$row['event_cat_name']."</option>";
}
}
else
{
$calendarmenu_catopt .= "<option value=0'>".EC_ADLAN_A33."</option>";
}
$calendarmenu_text .= "
<form id='calform' method='post' action='".e_SELF."?cat'>
<table width='97%' class='fborder'>
<tr>
<td colspan='2' class='fcaption'>".EC_ADLAN_A11."<input type='hidden' value='dothings' name='calendarmenu_action' /></td>
</tr>
{$calendarmenu_msg}
<tr>
<td style='width:20%' class='forumheader3'>".EC_ADLAN_A11."</td>
<td class='forumheader3'><select name='calendarmenu_selcat' class='tbox'>{$calendarmenu_catopt}</select></td>
</tr>
<tr>
<td style='width:20%' class='forumheader3'>".EC_ADLAN_A18."</td>
<td class='forumheader3'>
<input type='radio' name='calendarmenu_recdel' value='1' checked='checked' /> ".EC_ADLAN_A13."<br />
<input type='radio' name='calendarmenu_recdel' value='2' /> ".EC_ADLAN_A14."<br />
<input type='radio' name='calendarmenu_recdel' value='3' /> ".EC_ADLAN_A15."
<input type='checkbox' name='calendarmenu_okdel' value='1' />".EC_ADLAN_A16."
</td>
</tr>
<tr>
<td colspan='2' class='fcaption'><input type='submit' name='submits' value='".EC_ADLAN_A17."' class='tbox' /></td>
</tr>
</table>
</form>";
}
if(isset($calendarmenu_text))
{
$ns->tablerender(EC_ADLAN_A19, $calendarmenu_text);
}
}
// ====================================================
// FORTHCOMING EVENTS OPTIONS
// ====================================================
if((isset($qs[0]) && $qs[0] == "forthcoming"))
{
if (!isset($pref['eventpost_menuheading'])) $pref['eventpost_menuheading'] = EC_ADLAN_A100;
if (!isset($pref['eventpost_daysforward'])) $pref['eventpost_daysforward'] = 30;
if (!isset($pref['eventpost_numevents'])) $pref['eventpost_numevents'] = 3;
if (!isset($pref['eventpost_checkrecur'])) $pref['eventpost_checkrecur'] = '1';
if (!isset($pref['eventpost_linkheader'])) $pref['eventpost_linkheader'] = '0';
if (!isset($pref['eventpost_namelink'])) $pref['eventpost_namelink'] = '1';
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?forthcoming'>
<table style='width:97%' class='fborder'>
<tr><td style='vertical-align:top;' colspan='2' class='fcaption'>".EC_ADLAN_A100." </td></tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A108."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_fe_menuheading' size='35' value='".$pref['eventpost_menuheading']."' maxlength='30' />
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A101."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_fe_daysforward' size='20' value='".$pref['eventpost_daysforward']."' maxlength='10' />
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A102."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_fe_numevents' size='20' value='".$pref['eventpost_numevents']."' maxlength='10' />
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A103."<br /><span class='smalltext'><em>".EC_ADLAN_A107."</em></span></td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fe_checkrecur' value='1' ".($pref['eventpost_checkrecur']==1?" checked='checked' ":"")." /></td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A130."<br /></td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_namelink' class='tbox'>
<option value='1' ".($pref['eventpost_namelink']=='1'?" selected='selected' ":"")." > ".EC_ADLAN_A131." </option>
<option value='2' ".($pref['eventpost_namelink']=='2'?" selected='selected' ":"")." > ".EC_ADLAN_A132." </option>
</select>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A104."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fe_linkheader' value='1' ".($pref['eventpost_linkheader']==1?" checked='checked' ":"")." />
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A120."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_showcaticon' value='1' ".($pref['eventpost_showcaticon']==1?" checked='checked' ":"")." />
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A118."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>";
// Now display all the current categories as checkboxes
$cal_fe_prefs = array();
if (isset($pref['eventpost_fe_set'])) $cal_fe_prefs = array_flip(explode(",",$pref['eventpost_fe_set']));
if (!is_object($calendarmenu2_db)) $calendarmenu2_db = new DB; // Possible notice here
if ($calendarmenu2_db->db_Select("event_cat", "event_cat_id,event_cat_name", " order by event_cat_name", "nowhere"))
{
while ($row = $calendarmenu2_db->db_Fetch())
{
$selected = isset($cal_fe_prefs[$row['event_cat_id']]);
$text .= "<input type='checkbox' name='fe_eventclass[]' value='".$row['event_cat_id'].($selected == 1?"' checked='checked'":"'")." />".$row['event_cat_name']."<br /> ";
}
}
else
{
$text .= EC_ADLAN_A119; // No categories, or error
}
$text .= "</td>
</tr>
<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='updateforthcoming' value='".EC_LAN_77."' /></td></tr>
</table>
</form>
</div>";
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_A100."</div>", $text);
} // End of Forthcoming Events Menu Options
// ====================================================
// MAINTENANCE OPTIONS
// ====================================================
if((isset($qs[0]) && $qs[0] == "maint"))
{
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?maint'>
<table style='width:97%' class='fborder'>
<tr><td style='vertical-align:top;' colspan='2' class='fcaption'>".EC_ADLAN_A144." </td></tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A142." </td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_deleteoldmonths' class='tbox'>
<option value='12' selected='selected'>12</option>
<option value='11'>11</option>
<option value='10'>10</option>
<option value='9'>9</option>
<option value='8'>8</option>
<option value='7'>7</option>
<option value='6'>6</option>
<option value='5'>5</option>
<option value='4'>4</option>
<option value='3'>3</option>
<option value='2'>2</option>
<option value='1'>1</option>
</select>
<span class='smalltext'><em>".EC_ADLAN_A143."</em></span>
</td>
</tr>
<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='deleteold' value='".EC_ADLAN_A145."' /></td></tr>
</table></form></div><br /><br />";
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_A144."</div>", $text);
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?maint'>
<table style='width:97%' class='fborder'>
<tr><td style='vertical-align:top; text-align:center;' colspan='2' class='smalltext'><em>".EC_ADLAN_A160."</em> </td></tr>
<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='cache_clear' value='".EC_ADLAN_A161."' /></td></tr>
</table></form></div>";
$ns->tablerender("<div style='text-align:center'>".EC_ADLAN_A159."</div>", $text);
}
// ========================================================
// MAIN OPTIONS MENU
// ========================================================
if(!isset($qs[0]) || (isset($qs[0]) && $qs[0] == "config")){
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='width:97%' class='fborder'>
<tr><td style='vertical-align:top;' colspan='2' class='fcaption'>".EC_LAN_78." </td></tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_76." </td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>". r_userclass("eventpost_admin", $pref['eventpost_admin'], "off", 'public, nobody, member, admin, classes')."
</td>
</tr>
";
$text .= "
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_104." </td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>". r_userclass("eventpost_super", $pref['eventpost_super'], "off", 'public, nobody, member, admin, classes')."
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A134."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_adminlog' class='tbox'>
<option value='0' ".($pref['eventpost_adminlog']=='0'?" selected='selected' ":"")." >". EC_ADLAN_A87." </option>
<option value='1' ".($pref['eventpost_adminlog']=='1'?" selected='selected' ":"")." >".EC_ADLAN_A135." </option>
<option value='2' ".($pref['eventpost_adminlog']=='2'?" selected='selected' ":"")." >".EC_ADLAN_A136." </option>
</select>
<span class='smalltext'><em>".EC_ADLAN_A137."</em></span>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A165."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_menulink' class='tbox'>
<option value='0' ".($pref['eventpost_menulink']=='0'?" selected='selected' ":"")." >".EC_LAN_80." </option>
<option value='1' ".($pref['eventpost_menulink']=='1'?" selected='selected' ":"")." >".EC_LAN_83." </option>
</select>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A140."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_showeventcount' value='1' ".($pref['eventpost_showeventcount']==1?" checked='checked' ":"")." /></td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_102."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_forum' value='1' ".($pref['eventpost_forum']==1?" checked='checked' ":"")." /></td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A171."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_recentshow' size='10' value='".$pref['eventpost_recentshow']."' maxlength='5' />
<span class='smalltext'><em>".EC_ADLAN_A172."</em></span>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_114."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_weekstart' class='tbox'>
<option value='sun' ".($pref['eventpost_weekstart']=='sun'?" selected='selected' ":"")." >".EC_LAN_115."</option>
<option value='mon' ".($pref['eventpost_weekstart']=='mon'?" selected='selected' ":"")." >".EC_LAN_116."</option>
</select>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_117."<br /></td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_lenday' class='tbox'>
<option value='1' ".($pref['eventpost_lenday']=='1'?" selected='selected' ":"")." > 1 </option>
<option value='2' ".($pref['eventpost_lenday']=='2'?" selected='selected' ":"")." > 2 </option>
<option value='3' ".($pref['eventpost_lenday']=='3'?" selected='selected' ":"")." > 3 </option>
</select>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_118."<br /></td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_dateformat' class='tbox'>
<option value='my' ".($pref['eventpost_dateformat']=='my'?" selected='selected' ":"")." >".EC_LAN_119."</option>
<option value='ym' ".($pref['eventpost_dateformat']=='ym'?" selected='selected' ":"")." >".EC_LAN_120."</option>
</select>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A133."<br /></td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_datedisplay' class='tbox'>
<option value='1' ".($pref['eventpost_datedisplay']=='1'?" selected='selected' ":"")." > yyyy-mm-dd </option>
<option value='2' ".($pref['eventpost_datedisplay']=='2'?" selected='selected' ":"")." > dd-mm-yyyy</option>
<option value='3' ".($pref['eventpost_datedisplay']=='3'?" selected='selected' ":"")." > mm-dd-yyyy</option>
</select>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A138."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_fivemins' value='1' ".($pref['eventpost_fivemins']==1?" checked='checked' ":"")." />&nbsp;&nbsp;<span class='smalltext'><em>".EC_ADLAN_A139."</em></span>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A122."<br />
<span class='smalltext'><em>".EC_ADLAN_A124."</em></span>".$ecal_class->time_string($ecal_class->time_now)."<br />
<span class='smalltext'><em>".EC_ADLAN_A125."</em></span>".$ecal_class->time_string($ecal_class->site_timedate)."<br />
<span class='smalltext'><em>".EC_ADLAN_A126."</em></span>".$ecal_class->time_string($ecal_class->user_timedate)."
</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_caltime' class='tbox'>
<option value='1' ".($pref['eventpost_caltime']=='1'?" selected='selected' ":"")." > Server </option>
<option value='2' ".($pref['eventpost_caltime']=='2'?" selected='selected' ":"")." > Site </option>
<option value='3' ".($pref['eventpost_caltime']=='3'?" selected='selected' ":"")." > User </option>
</select><br /><span class='smalltext'><em>".EC_ADLAN_A129."</em></span>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A123."<br />
<span class='smalltext'><em>".EC_ADLAN_A127."</em></span>
</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_timedisplay' class='tbox'>
<option value='1' ".($pref['eventpost_timedisplay']=='1'?" selected='selected' ":"")." > 24-hour </option>
<option value='2' ".($pref['eventpost_timedisplay']=='2'?" selected='selected' ":"")." > 12-hour </option>
<option value='3' ".($pref['eventpost_timedisplay']=='3'?" selected='selected' ":"")." > Custom </option>
</select>
<input class='tbox' type='text' name='eventpost_timecustom' size='20' value='".$pref['eventpost_timecustom']."' maxlength='30' />
<br /><span class='smalltext'><em>".EC_ADLAN_A128."</em></span>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A166."<br />
<span class='smalltext'><em>".EC_ADLAN_A169."</em></span>
</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_dateevent' class='tbox'>
<option value='1' ".($pref['eventpost_dateevent']=='1'?" selected='selected' ":"")." > dayofweek day month yyyy </option>
<option value='2' ".($pref['eventpost_dateevent']=='2'?" selected='selected' ":"")." > dyofwk day mon yyyy </option>
<option value='3' ".($pref['eventpost_dateevent']=='3'?" selected='selected' ":"")." > dyofwk dd-mm-yy </option>
<option value='0' ".($pref['eventpost_dateevent']=='0'?" selected='selected' ":"")." > Custom </option>
</select>
<input class='tbox' type='text' name='eventpost_eventdatecustom' size='20' value='".$pref['eventpost_eventdatecustom']."' maxlength='30' />
<br /><span class='smalltext'><em>".EC_ADLAN_A168."</em></span>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A167."<br />
<span class='smalltext'><em>".EC_ADLAN_A170."</em></span>
</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_datenext' class='tbox'>
<option value='1' ".($pref['eventpost_datenext']=='1'?" selected='selected' ":"")." > dd month </option>
<option value='2' ".($pref['eventpost_datenext']=='2'?" selected='selected' ":"")." > dd mon </option>
<option value='3' ".($pref['eventpost_datenext']=='3'?" selected='selected' ":"")." > month dd </option>
<option value='4' ".($pref['eventpost_datenext']=='4'?" selected='selected' ":"")." > mon dd </option>
<option value='0' ".($pref['eventpost_datenext']=='0'?" selected='selected' ":"")." > Custom </option>
</select>
<input class='tbox' type='text' name='eventpost_nextdatecustom' size='20' value='".$pref['eventpost_nextdatecustom']."' maxlength='30' />
<br /><span class='smalltext'><em>".EC_ADLAN_A168."</em></span>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A95."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_asubs' value='1' ".($pref['eventpost_asubs']==1?" checked='checked' ":"")." />&nbsp;&nbsp;<span class='smalltext'><em>".EC_ADLAN_A96."</em></span>
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A92."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_mailfrom' size='60' value='".$pref['eventpost_mailfrom']."' maxlength='100' />
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A91."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_mailsubject' size='60' value='".$pref['eventpost_mailsubject']."' maxlength='100' />
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A93."</td>
<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_mailaddress' size='60' value='".$pref['eventpost_mailaddress']."' maxlength='100' />
</td>
</tr>
<tr>
<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A114."<br /></td>
<td style='width:60%;vertical-align:top;' class='forumheader3'>
<select name='eventpost_emaillog' class='tbox'>
<option value='0' ".($pref['eventpost_emaillog']=='0'?" selected='selected' ":"")." >". EC_ADLAN_A87." </option>
<option value='1' ".($pref['eventpost_emaillog']=='1'?" selected='selected' ":"")." >".EC_ADLAN_A115." </option>
<option value='2' ".($pref['eventpost_emaillog']=='2'?" selected='selected' ":"")." >".EC_ADLAN_A116." </option>
</select>
</td>
</tr>
<tr><td colspan='2' style='text-align:center' class='fcaption'><input class='button' type='submit' name='updatesettings' value='".EC_LAN_77."' /></td></tr>
</table>
</form>
</div>";
$ns->tablerender("<div style='text-align:center'>".EC_LAN_78."</div>", $text);
}
function admin_config_adminmenu()
{
if (e_QUERY) {
$tmp = explode(".", e_QUERY);
$action = $tmp[0];
}
if (!isset($action) || ($action == ""))
{
$action = "config";
}
$var['config']['text'] = EC_ADLAN_A10;
$var['config']['link'] = "admin_config.php";
$var['cat']['text'] = EC_ADLAN_A11;
$var['cat']['link'] ="admin_config.php?cat";
$var['forthcoming']['text'] = EC_ADLAN_A100;
$var['forthcoming']['link'] ="admin_config.php?forthcoming";
$var['maint']['text'] = EC_ADLAN_A141;
$var['maint']['link'] ="admin_config.php?maint";
show_admin_menu(EC_ADLAN_A12, $action, $var);
}
require_once(e_ADMIN."footer.php");
?>

View File

@@ -0,0 +1,319 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:46 $
| $Author: mcfly_e107 $
|
| 11.11.06 - steved - mods for next CVS release
|
+----------------------------------------------------------------------------+
*/
require_once("../../class2.php");
require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
if (isset($_POST['viewallevents']))
{
Header("Location: " . e_PLUGIN . "calendar_menu/event.php?" . $_POST['enter_new_val']);
}
if (isset($_POST['doit']))
{
Header("Location: " . e_PLUGIN . "calendar_menu/event.php?ne." . $_POST['enter_new_val']);
}
if (isset($_POST['subs']))
{
Header("Location: " . e_PLUGIN . "calendar_menu/subscribe.php");
}
@include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
define("PAGE_NAME", EC_LAN_121);
require_once('ecal_class.php');
$ecal_class = new ecal_class;
if (is_readable(THEME."calendar_template.php"))
{
require(THEME."calendar_template.php");
}
else
{
require(e_PLUGIN."calendar_menu/calendar_template.php");
}
$num = (isset($_POST['num']) && $_POST['num'] ? $_POST['num'] : "");
$category_filter = "";
if ((isset($_POST['event_cat_ids']) && $_POST['event_cat_ids'] != "all"))
{
$category_filter = " AND (e.event_category = '".$_POST['event_cat_ids']."') ";
}
require_once(HEADERF);
// get current date information ---------------------------------------------------------------------
$qs = explode(".", e_QUERY);
if($qs[0] == "")
{ // Show current month
$datearray = $ecal_class->cal_date;
}
else
{ // Get date from query
$datearray = getdate($qs[0]);
}
$month = $datearray['mon'];
$year = $datearray['year'];
// set up arrays for calender display ------------------------------------------------------------------
if($pref['eventpost_weekstart'] == 'sun') {
$week = Array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24);
} else {
$week = Array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25);
}
$months = Array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11);
$monthabb = Array(EC_LAN_JAN, EC_LAN_FEB, EC_LAN_MAR, EC_LAN_APR, EC_LAN_MAY, EC_LAN_JUN, EC_LAN_JUL, EC_LAN_AUG, EC_LAN_SEP, EC_LAN_OCT, EC_LAN_NOV, EC_LAN_DEC);
$days = array(EC_LAN_DAY_1, EC_LAN_DAY_2, EC_LAN_DAY_3, EC_LAN_DAY_4, EC_LAN_DAY_5, EC_LAN_DAY_6, EC_LAN_DAY_7, EC_LAN_DAY_8, EC_LAN_DAY_9, EC_LAN_DAY_10, EC_LAN_DAY_11, EC_LAN_DAY_12, EC_LAN_DAY_13, EC_LAN_DAY_14, EC_LAN_DAY_15, EC_LAN_DAY_16, EC_LAN_DAY_17, EC_LAN_DAY_18, EC_LAN_DAY_19, EC_LAN_DAY_20, EC_LAN_DAY_21, EC_LAN_DAY_22, EC_LAN_DAY_23, EC_LAN_DAY_24, EC_LAN_DAY_25, EC_LAN_DAY_26, EC_LAN_DAY_27, EC_LAN_DAY_28, EC_LAN_DAY_29, EC_LAN_DAY_30, EC_LAN_DAY_31);
// show events-------------------------------------------------------------------------------------------
$monthstart = mktime(0, 0, 0, $month, 1, $year); // Start of month to be shown
$firstdayarray = getdate($monthstart);
$monthend = mktime(0, 0, 0, $month + 1, 1, $year) - 1; // End of month to be shown
$prevmonth = ($month-1);
$prevyear = $year;
if ($prevmonth == 0)
{
$prevmonth = 12;
$prevyear = ($year-1);
}
$previous = mktime(0, 0, 0, $prevmonth, 1, $prevyear); // Used by nav
$nextmonth = ($month + 1);
$nextyear = $year;
if ($nextmonth == 13)
{
$nextmonth = 1;
$nextyear = ($year + 1);
}
$next = mktime(0, 0, 0, $nextmonth, 1, $nextyear);
$py = $year-1;
$prevlink = mktime(0, 0, 0, $month, 1, $py);
$ny = $year + 1;
$nextlink = mktime(0, 0, 0, $month, 1, $ny);
$prop = mktime(0, 0, 0, $month, 1, $year); // Sets start date for new event entry
$nowmonth = $ecal_class->cal_date['mon'];
$nowyear = $ecal_class->cal_date['year'];
$nowday = $ecal_class->cal_date['mday'];
// time switch buttons
$cal_text = $tp -> parseTemplate($CALENDAR_TIME_TABLE, FALSE, $calendar_shortcodes);
// navigation buttons
$nav_text = $tp -> parseTemplate($CALENDAR_NAVIGATION_TABLE, FALSE, $calendar_shortcodes);
// get events from selected
$qry = "SELECT e.*, ec.*
FROM #event as e
LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
WHERE e.event_id != ''
AND ((e.event_start >= ".intval($monthstart)." AND e.event_start <= ".intval($monthend).")
OR (e.event_end >= ".intval($monthstart)." AND e.event_end <= ".intval($monthend).")
OR (e.event_start <= ".intval($monthstart)." AND e.event_end >= ".intval($monthend).")
OR (e.event_recurring = '1' AND e.event_rec_y = ".intval($month).")) {$category_filter}
{$ecal_class->extra_query}
ORDER BY e.event_start";
if ($sql->db_Select_gen($qry))
{
while ($row = $sql->db_Fetch())
{
// check for recurring events in this month
if($row['event_recurring']=='1')
{
if ($month == $row['event_rec_y'])
{ // Change it into an event that happens today
$row['event_start'] = mktime(0,0,0,$row['event_rec_y'],$row['event_rec_m'],$year);
$row['event_end'] = $row['event_start'];
}
else
{ // Effectively create a null event
$row['event_start'] = 0;
$row['event_end'] = 0;
}
}
$evf = getdate($row['event_start']);
$tmp = $evf['mday']; // Day of month for start
$eve = getdate($row['event_end']);
$tmp2 = $eve['mday']; // Day of month for end
$tmp3 = date("t", $monthstart); // number of days in this month
if ((($ecal_class->max_recent_show != 0) && (time() - $row['event_datestamp']) <= $ecal_class->max_recent_show)) $row['is_recent'] = TRUE;
//1) start in month, end in month
if(($row['event_start']>=$monthstart && $row['event_start']<=$monthend) && $row['event_end']<=$monthend)
{
$events[$tmp][] = $row;
for ($c=($tmp+1); $c<($tmp2+1); $c++)
{
$row['event_true_end'][$c] = ($c!=$tmp2 ? 1 : 2);
$events[$c][] = $row;
}
//2) start in month, end after month
}
elseif(($row['event_start']>=$monthstart && $row['event_start']<=$monthend) && $row['event_end']>=$monthend)
{
$events[$tmp][] = $row;
for ($c=($tmp+1); $c<=$tmp3; $c++)
{
$row['event_true_end'][$c] = 1;
$events[$c][] = $row;
}
//3) start before month, end in month
}
elseif($row['event_start']<=$monthstart && ($row['event_end']>=$monthstart && $row['event_end']<=$monthend))
{
for ($c=1; $c<=$tmp2; $c++)
{
$row['event_true_end'][$c] = ($c!=$tmp2 ? 1 : 2);
$events[$c][] = $row;
}
//4) start before month, end after month
}
elseif($row['event_start']<=$monthstart && $row['event_end']>=$monthend)
{
for ($c=1; $c<=$tmp3; $c++){
$row['event_true_end'][$c] = 1;
$events[$c][] = $row;
}
}
}
}
// ****** CAUTION - the category dropdown also used $sql object - take care to avoid interference!
$start = $monthstart;
$numberdays = date("t", $start); // number of days in this month
$text = "";
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_START, FALSE, $calendar_shortcodes);
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER_START, FALSE, $calendar_shortcodes);
foreach($week as $day)
{
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER, FALSE, $calendar_shortcodes);
}
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER_END, FALSE, $calendar_shortcodes);
$calmonth = $datearray['mon'];
$calday = $datearray['mday'];
$calyear = $datearray['year'];
if ($pref['eventpost_weekstart'] == 'mon')
{
$firstdayoffset = ($firstdayarray['wday'] == 0 ? $firstdayarray['wday']+6 : $firstdayarray['wday']-1);
}
else
{
$firstdayoffset = $firstdayarray['wday'] ;
}
for ($c=0; $c<$firstdayoffset; $c++)
{
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_NON, FALSE, $calendar_shortcodes);
}
$loop = $firstdayoffset;
for ($c = 1; $c <= $numberdays; $c++)
{
$dayarray = getdate($start + (($c-1) * 86400));
$stopp = mktime(24, 0, 0, $calmonth, $c, $calyear);
$startt = mktime(0, 0, 0, $calmonth, $c, $calyear);
// Highlight the current day.
if ($dayarray['mon'] == $calmonth)
{
if ($nowday == $c && $calmonth == $nowmonth && $calyear == $nowyear)
{
//today
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_TODAY, FALSE, $calendar_shortcodes);
}
elseif(isset($events[$c]) && is_array($events[$c]) && !empty($events[$c]) && count($events[$c]) > 0)
{
//day has events
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_EVENT, FALSE, $calendar_shortcodes);
}
else
{
// no events and not today
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_EMPTY, FALSE, $calendar_shortcodes);
}
// if there are events then list them
if (array_key_exists($c, $events))
{
foreach($events[$c] as $ev)
{
//if ($event_true_end[$c][$a]){
if(isset($ev['event_true_end']) && $ev['event_true_end'])
{
//$ev['indicat'] = ($ev['event_true_end']==1 ? "->" : "|");
$ev['indicat'] = "";
$ev['imagesize'] = "4";
$ev['fulltopic'] = FALSE;
$ev['startofevent'] = FALSE;
}
else
{
$ev['indicat'] = "";
$ev['imagesize'] = "8";
$ev['fulltopic'] = TRUE;
$ev['startofevent'] = TRUE;
}
$text .= $tp -> parseTemplate($CALENDAR_SHOWEVENT, FALSE, $calendar_shortcodes);
}
}
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_END, FALSE, $calendar_shortcodes);
}
$loop++;
if ($loop == 7)
{
$loop = 0;
if($c != $numberdays)
{
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_WEEKSWITCH, FALSE, $calendar_shortcodes);
}
}
}
//remainder cells to end the row properly with empty cells
if($loop!=0)
{
$remainder = 7-$loop;
for ($c=0; $c<$remainder; $c++)
{
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_NON, FALSE, $calendar_shortcodes);
}
}
$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_END, FALSE, $calendar_shortcodes);
$caption = EC_LAN_79; // "Calendar View";
$nav = $cal_text . $nav_text . $text;
$ns->tablerender($caption, $nav);
require_once(FOOTERF);
?>

View File

@@ -0,0 +1,257 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar_menu.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:46 $
| $Author: mcfly_e107 $
|
| 22.10.06 steved - Various tidying up, additional options supported
| 24.10.06 steved - templated, various cleaning up
| 06.11.06 steved - template file integrated with other calendar files
| 09.11.06 steved - Caching added, other mods to templates etc
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
$ecal_dir = e_PLUGIN . "calendar_menu/";
require_once($ecal_dir.'ecal_class.php');
$ecal_class = new ecal_class;
$cache_tag = "nq_event_cal_cal";
// See if the page is already in the cache
if($cacheData = $e107cache->retrieve($cache_tag, $ecal_class->max_cache_time))
{
echo $cacheData;
return;
}
include_lan($ecal_dir."languages/".e_LANGUAGE.".php");
global $ecal_dir, $tp;
if (is_readable(THEME."calendar_template.php"))
{
require(THEME."calendar_template.php");
}
else
{ // Needs to be require - otherwise not loaded if two menus use it
require($ecal_dir."calendar_template.php");
}
$cal_datearray = $ecal_class->cal_date;
$cal_current_month = $cal_datearray['mon'];
$cal_current_year = $cal_datearray['year'];
$numberdays = date("t", $ecal_class->cal_date); // number of days in this month
$cal_monthstart = mktime(0, 0, 0, $cal_current_month, 1, $cal_current_year); // Time stamp for first day of month
$cal_firstdayarray = getdate($cal_monthstart);
$cal_monthend = mktime(0, 0, 0, $cal_current_month + 1, 1, $cal_current_year) -1; // Time stamp for last day of month
$cal_qry = "SELECT e.event_rec_m, e.event_rec_y, e.event_start, e.event_end, e.event_datestamp, ec.*
FROM #event as e LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
WHERE ((e.event_start >= {$cal_monthstart} AND e.event_start <= {$cal_monthend}) OR (e.event_rec_y = {$cal_current_month}))
{$ecal_class->extra_query} order by e.event_start";
$cal_events = array();
$cal_totev = 0;
if ($cal_totev = $sql->db_Select_gen($cal_qry))
{
while ($cal_row = $sql->db_Fetch())
{
if ($cal_row['event_rec_y'] == $cal_current_month)
{ // Recurring events
$cal_start_day = $cal_row['event_rec_m'];
}
else
{ // 'normal' events
$cal_tmp = getdate($cal_row['event_start']);
if ($cal_tmp['mon'] == $cal_current_month)
{
$cal_start_day = $cal_tmp['mday'];
}
else
{
$cal_start_day = 1;
}
}
// Mark start day of each event
$cal_events[$cal_start_day][] = $cal_row['event_cat_icon']; // Will be overwritten if several events on same day
if ((($ecal_class->max_recent_show != 0) && (time() - $cal_row['event_datestamp']) <= $ecal_class->max_recent_show)) $cal_events[$cal_start_day]['is_recent'] = TRUE;
}
}
if ($pref['eventpost_weekstart'] == 'sun')
{
$cal_week = array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24);
}
else
{
$cal_week = array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25);
}
$cal_months = array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11);
$calendar_title = "<a class='forumlink' href='".e_PLUGIN."calendar_menu/";
if ($pref['eventpost_menulink'] == 1)
{
$calendar_title .= "calendar.php' >";
}
else
{
$calendar_title .= "event.php' >";
}
if ($pref['eventpost_dateformat'] == 'my')
{
$calendar_title .= $cal_months[$cal_datearray['mon']-1] ." ". $cal_current_year . "</a>";
}
else
{
$calendar_title .= $cal_current_year ." ". $cal_months[$cal_datearray['mon']-1] . "</a>";
}
$cal_text = $CALENDAR_MENU_START;
if ($pref['eventpost_showeventcount']=='1')
{
if ($cal_totev)
{
$cal_text .= EC_LAN_26 . ": " . $cal_totev;
}
else
{
$cal_text .= EC_LAN_27;
}
$cal_text .= "<br /><br />";
}
$cal_start = $cal_monthstart; // First day of month as time stamp
// Start the table
$cal_text .= $CALENDAR_MENU_TABLE_START;
// Open header row
$cal_text .= $CALENDAR_MENU_HEADER_START;
// Now do the headings
foreach($cal_week as $cal_day)
{
$cal_text .= $CALENDAR_MENU_HEADER_FRONT;
$cal_text .= substr($cal_day, 0, $pref['eventpost_lenday']);
$cal_text .= $CALENDAR_MENU_HEADER_BACK;
}
$cal_text .= $CALENDAR_MENU_HEADER_END; // Close off header row, open first date row
$cal_thismonth = $cal_datearray['mon'];
$cal_thisday = $cal_datearray['mday']; // Today
if ($pref['eventpost_weekstart'] == 'mon')
{
$firstdayoffset = ($cal_firstdayarray['wday'] == 0 ? $cal_firstdayarray['wday'] + 6 : $cal_firstdayarray['wday']-1);
}
else
{
$firstdayoffset = $cal_firstdayarray['wday'];
}
for ($cal_c = 0; $cal_c < $firstdayoffset; $cal_c++)
{
$cal_text .= $CALENDAR_MENU_DAY_NON;
}
$cal_loop = $firstdayoffset;
// Now do the days of the month
for($cal_c = 1; $cal_c <= 31; $cal_c++)
{ // Four cases to decode:
// 1 - Today, no events
// 2 - Some other day, no events (or no icon defined)
// 3 - Today with events (and icon defined)
// 4 - Some other day with events (and icon defined)
$cal_dayarray = getdate($cal_start + (($cal_c-1) * 86400));
$cal_css = 2; // The default - not today, no events
if ($cal_dayarray['mon'] == $cal_thismonth)
{ // Dates match for this month
$cal_img = $cal_c; // Default 'image' is the day of the month
$cal_event_count = 0;
$title = "";
if ($cal_thisday == $cal_c) $cal_css = 1;
$cal_linkut = mktime(0 , 0 , 0 , $cal_dayarray['mon'], $cal_c, $cal_datearray['year']).".one"; // ALways need "one"
if (array_key_exists($cal_c, $cal_events))
{
$cal_event_icon = e_PLUGIN . "calendar_menu/images/" . $cal_events[$cal_c]['0'];
$cal_event_count = count($cal_events[$cal_c]); // See how many events today
if (!empty($cal_events[$cal_c]) && is_file($cal_event_icon))
{ // Show icon if it exists
$cal_css += 2; // Gives 3 for today, 4 for other day
if ($cal_event_count == 1)
{
$title = " title='1 ".EC_LAN_135."' ";
}
else
{
$title = " title='{$cal_event_count} " . EC_LAN_106 . "' ";
}
$cal_img = "<img style='border:0' src='{$cal_event_icon}' alt='' />";
//height='10' width='10'
if (isset($cal_events[$cal_c]['is_recent']) && $cal_events[$cal_c]['is_recent'])
{
$cal_css += 2;
}
}
}
$cal_text .= $CALENDAR_MENU_DAY_START[$cal_css]."<a {$title} href='" . e_PLUGIN . "calendar_menu/event.php?{$cal_linkut}'>{$cal_img}</a>";
$cal_text .= $CALENDAR_MENU_DAY_END[$cal_css];
$cal_loop++;
if ($cal_loop == 7)
{ // Start next row
$cal_loop = 0;
if ($cal_c != $numberdays)
{
$cal_text .= $CALENDAR_MENU_WEEKSWITCH;
}
}
}
}
if ($cal_loop != 0)
{
for($cal_a = ($cal_loop + 1); $cal_a <= 7; $cal_a++)
{
$cal_text .= $CALENDAR_MENU_DAY_NON;
}
}
// Close table
$cal_text .= $CALENDAR_MENU_END;
// Now handle the data, cache as well
ob_start(); // Set up a new output buffer
$ns->tablerender($calendar_title, $cal_text, 'calendar_menu');
$cache_data = ob_get_flush(); // Get the page content, and display it
$e107cache->set($cache_tag, $cache_data); // Save to cache
?>

View File

@@ -0,0 +1,477 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar_shortcodes.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:46 $
| $Author: mcfly_e107 $
|
| 10.11.06 - mods for next CVS release
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
include_once(e_HANDLER.'shortcode_handler.php');
$calendar_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
/*
// TIME SWITCH BUTTONS ------------------------------------------------
SC_BEGIN PREV_MONTH
global $PREV_MONTH, $previous, $months, $prevmonth;
return "<a href='".e_SELF."?".$previous."'>&lt;&lt; ".$months[($prevmonth-1)]."</a>";
SC_END
SC_BEGIN NEXT_MONTH
global $NEXT_MONTH, $next, $months, $nextmonth;
return "<a href='".e_SELF."?".$next."'> ".$months[($nextmonth-1)]." &gt;&gt;</a>";
SC_END
SC_BEGIN CURRENT_MONTH
global $CURRENT_MONTH, $pref, $months, $month, $year;
if($pref['eventpost_dateformat'] == 'my') {
$CURRENT_MONTH = $months[($month-1)]." ".$year;
} else {
$CURRENT_MONTH = $year." ".$months[($month-1)];
}
return $CURRENT_MONTH;
SC_END
SC_BEGIN PREV_YEAR
global $PREV_YEAR, $prevlink, $py;
return "<a href='".e_SELF."?".$prevlink."'>&lt;&lt; ".$py."</a>";
SC_END
SC_BEGIN NEXT_YEAR
global $NEXT_YEAR, $nextlink, $ny;
return "<a href='".e_SELF."?".$nextlink."'>".$ny." &gt;&gt;</a>";
SC_END
SC_BEGIN MONTH_LIST
global $MONTH_LIST, $year, $monthjump, $monthabb;
$MONTH_LIST = "";
for ($ii = 0; $ii < 12; $ii++)
{
$m = $ii + 1;
$monthjump = mktime(0, 0, 0, $m, 1, $year);
$MONTH_LIST .= "<a href='".e_SELF."?".$monthjump."'>".$monthabb[$ii]."</a> &nbsp;";
}
return $MONTH_LIST;
SC_END
// NAVIGATION BUTTONS ------------------------------------------------
SC_BEGIN NAV_BUT_ALLEVENTS
global $NAV_BUT_ALLEVENTS;
$allevents = (e_PAGE == "event.php" ? EC_LAN_96 : EC_LAN_93);
return "<input class='button' type='submit' style='width:140px;' name='viewallevents' value='".$allevents."' title='".$allevents."' />";
SC_END
SC_BEGIN NAV_BUT_VIEWCAT
global $NAV_BUT_VIEWCAT;
//return "<input type='hidden' name='do' value='vc' /><input class='button' type='submit' style='width:140px;' name='viewcat' value='".EC_LAN_92."' />";
return "<input type='hidden' name='do' value='vc' />";
SC_END
SC_BEGIN NAV_BUT_SUBSCRIPTION
global $NAV_BUT_SUBSCRIPTION, $pref;
if (($pref['eventpost_asubs']>0) && USER)
{
$NAV_BUT_SUBSCRIPTION = "<input class='button' type='submit' style='width:140px;' name='subs' value='".EC_LAN_123."' />";
}
return $NAV_BUT_SUBSCRIPTION;
SC_END
SC_BEGIN NAV_BUT_ENTEREVENT
global $NAV_BUT_ENTEREVENT, $pref, $prop;
$NAV_BUT_ENTEREVENT = "<input type='hidden' name='enter_new_val' value='".$prop."' />";
if (check_class($pref['eventpost_admin']) || getperms('0')){
// start no admin preference
$NAV_BUT_ENTEREVENT .= "<input class='button' type='submit' style='width:140px;' name='doit' value='".EC_LAN_94."' />";
}
return $NAV_BUT_ENTEREVENT;
SC_END
SC_BEGIN NAV_LINKCURRENTMONTH
global $NAV_LINKCURRENTMONTH, $month, $nowmonth, $year, $nowyear, $current, $ds;
$NAV_LINKCURRENTMONTH = "";
if ($month != $nowmonth || $year != $nowyear || $ds == 'one'){
$NAV_LINKCURRENTMONTH = "<input class='button' type='button' style='width:140px;' name='cur' value='".EC_LAN_40."' onclick=\"javascript:document.location='".e_SELF."?$current'\" />";
}
return $NAV_LINKCURRENTMONTH;
SC_END
SC_BEGIN NAV_CATEGORIES
global $NAV_CATEGORIES, $sql, $pref, $_POST, $cal_super;
$NAV_CATEGORIES = "<select name='event_cat_ids' class='tbox' style='width:140px;' onchange='this.form.submit()' ><option class='tbox' value='all'>".EC_LAN_97."</option>";
$event_cat_id = ( isset($_POST['event_cat_ids']) && $_POST['event_cat_ids'] ? $_POST['event_cat_ids'] : null);
$cal_arg = ($cal_super ? "" : " find_in_set(event_cat_class,'".USERCLASS_LIST."') ");
$sql->db_Select("event_cat", "*", $cal_arg);
while ($row = $sql->db_Fetch()){
if ($row['event_cat_id'] == $event_cat_id){
$NAV_CATEGORIES .= "<option class='tbox' value='".$row['event_cat_id']."' selected='selected'>".$row['event_cat_name']."</option>";
}else{
$NAV_CATEGORIES .= "<option value='".$row['event_cat_id']."'>".$row['event_cat_name']."</option>";
}
}
$NAV_CATEGORIES .= "</select>";
return $NAV_CATEGORIES;
SC_END
// CALENDAR SHOWEVENT ------------------------------------------------------------
SC_BEGIN SHOWEVENT_IMAGE
global $SHOWEVENT_IMAGE, $ev;
if($ev['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon'])){
$img = "<img style='border:0' src='".e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon']."' alt='' height='".$ev['imagesize']."' width='".$ev['imagesize']."' />";
}else{
$img = "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' style='border:0; vertical-align:middle;' />";
}
return $img;
//return "<img style='border:0' src='".e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon']."' alt='' height='".$ev['imagesize']."' width='".$ev['imagesize']."' />";
SC_END
SC_BEGIN SHOWEVENT_INDICAT
global $SHOWEVENT_INDICAT, $ev;
return $ev['indicat'];
SC_END
SC_BEGIN SHOWEVENT_HEADING
global $SHOWEVENT_HEADING, $ev, $datearray, $c;
$linkut = mktime(0 , 0 , 0 , $datearray['mon'], $c, $datearray['year']);
if(isset($ev['fulltopic']) && $ev['fulltopic'])
{ // Used on first day
$show_title = $ev['event_title'];
}
else
{
if (strlen($ev['event_title']) > 10)
{
$show_title = substr($ev['event_title'], 0, 10) . "...";
}
else
{
$show_title = $ev['event_title'];
}
}
if($ev['startofevent'])
{
if (isset($ev['is_recent']))
{
return "<b><a title='{$ev['event_title']}' href='".e_PLUGIN."calendar_menu/event.php?".$linkut.".event.".$ev['event_id']."'><span class='mediumtext'>".$show_title."</span></a></b>";
}
else
{
return "<b><a title='{$ev['event_title']}' href='".e_PLUGIN."calendar_menu/event.php?".$linkut.".event.".$ev['event_id']."'><span class='mediumtext'>".$show_title."</span></a></b>";
}
}
else
{
return "<a title='{$ev['event_title']}' href='".e_PLUGIN."calendar_menu/event.php?".$linkut.".event.".$ev['event_id']."'><span class='smalltext'>".$show_title."</span></a>";
}
SC_END
SC_BEGIN CALENDAR_CALENDAR_RECENT_ICON
global $ev;
if (!isset($ev['is_recent'])) return "";
// $recent_icon = e_PLUGIN."calendar_menu/images/recent_icon.png";
$recent_icon = e_IMAGE."generic/".IMODE."/new.png";
if (file_exists($recent_icon))
{
return "<img style='border:0' src='".$recent_icon."' alt='' /> ";
}
return "R";
SC_END
// CALENDAR CALENDAR ------------------------------------------------------------
SC_BEGIN CALENDAR_CALENDAR_HEADER_DAY
global $CALENDAR_CALENDAR_HEADER_DAY, $day, $pref, $week;
if(isset($pref['eventpost_lenday']) && $pref['eventpost_lenday'])
{
return "<strong>".substr($day,0,$pref['eventpost_lenday'])."</strong>";
}
else
{
return "<strong>".$day."</strong>";
}
SC_END
SC_BEGIN CALENDAR_CALENDAR_DAY_TODAY_HEADING
global $CALENDAR_CALENDAR_DAY_TODAY_HEADING, $startt, $c, $days;
return "<b><a href='".e_PLUGIN."calendar_menu/event.php?".$startt."'>".$days[($c-1)]."</a></b> <span class='smalltext'>[".EC_LAN_TODAY."]</span>";
SC_END
SC_BEGIN CALENDAR_CALENDAR_DAY_EVENT_HEADING
global $CALENDAR_CALENDAR_DAY_EVENT_HEADING, $startt, $c, $days;
return "<a href='".e_PLUGIN."calendar_menu/event.php?".$startt.".one'>".$days[($c-1)]."</a>";
SC_END
SC_BEGIN CALENDAR_CALENDAR_DAY_EMPTY_HEADING
global $CALENDAR_CALENDAR_DAY_EMPTY_HEADING, $startt, $c, $days;
return "<a href='".e_PLUGIN."calendar_menu/event.php?".$startt."'>".$days[($c-1)]."</a>";
SC_END
// EVENT LIST ------------------------------------------------
SC_BEGIN EVENTLIST_CAPTION
global $EVENTLIST_CAPTION, $ds, $months, $selected_mon, $dayslo, $selected_day, $monthstart;
if ($ds == 'one')
{
$EVENTLIST_CAPTION = EC_LAN_111.$months[$selected_mon-1]." ".$selected_day;
}
elseif ($ds != 'event')
{
$EVENTLIST_CAPTION = EC_LAN_112.$months[date("m", $monthstart)-1];
}
return $EVENTLIST_CAPTION;
SC_END
// EVENT ARCHIVE ------------------------------------------------------------
SC_BEGIN EVENTARCHIVE_CAPTION
global $EVENTARCHIVE_CAPTION, $num;
if ($num == 0)
{
$EVENTARCHIVE_CAPTION = EC_LAN_137;
}
else
{
$EVENTARCHIVE_CAPTION = str_replace("-NUM-", $num, EC_LAN_62);
}
return $EVENTARCHIVE_CAPTION;
SC_END
SC_BEGIN EVENTARCHIVE_DATE
global $EVENTARCHIVE_DATE, $thisevent, $ecal_class;
$startds = $ecal_class->event_date_string($thisevent['event_start']);
$EVENTARCHIVE_DATE = "<a href='event.php?".$thisevent['event_start'].".event.".$thisevent['event_id']."'>".$startds."</a>";
return $EVENTARCHIVE_DATE;
SC_END
SC_BEGIN EVENTARCHIVE_DETAILS
global $EVENTARCHIVE_DETAILS, $thisevent, $tp;
$number = 40;
$rowtext = $tp->toHTML($thisevent['event_details'], TRUE, "nobreak");
$rowtext = strip_tags($rowtext);
$words = explode(" ", $rowtext);
$EVENTARCHIVE_DETAILS = implode(" ", array_slice($words, 0, $number));
if(count($words) > $number){
$EVENTARCHIVE_DETAILS .= " ".EC_LAN_133." ";
}
return $EVENTARCHIVE_DETAILS;
SC_END
SC_BEGIN EVENTARCHIVE_EMPTY
global $EVENTARCHIVE_EMPTY;
return EC_LAN_37;
SC_END
SC_BEGIN EVENTARCHIVE_HEADING
global $EVENTARCHIVE_HEADING, $thisevent;
$EVENTARCHIVE_HEADING = $thisevent['event_title'];
return $EVENTARCHIVE_HEADING;
SC_END
// EVENT SHOWEVENT ------------------------------------------------------------
SC_BEGIN EVENT_RECENT_ICON
global $thisevent, $ecal_class;
if (($ecal_class->max_recent_show == 0) || (time() - $thisevent['event_datestamp']) > $ecal_class->max_recent_show) return "";
// Can use the generic icon, or a calendar-specific one
$recent_icon = e_IMAGE."generic/".IMODE."/new.png";
// $recent_icon = e_PLUGIN."calendar_menu/images/recent_icon.png";
if (file_exists($recent_icon))
{
return "<img style='border:0' src='".$recent_icon."' alt='' /> ";
}
return "";
SC_END
SC_BEGIN EVENT_HEADING_DATE
global $thisevent, $ecal_class;
$startds = $ecal_class->event_date_string($thisevent['event_start']);
return $startds;
SC_END
SC_BEGIN EVENT_DATE_START
global $thisevent, $ecal_class;
$startds = $ecal_class->event_date_string($thisevent['event_start']);
return $startds;
SC_END
SC_BEGIN EVENT_TIME_START
global $thisevent, $ecal_class;
if ($thisevent['event_allday'] == 1) return "";
$startds = $ecal_class->time_string($thisevent['event_start']);
return $startds;
SC_END
SC_BEGIN EVENT_DATE_END
global $thisevent, $ecal_class;
if ($thisevent['event_allday'] ||($thisevent['event_end'] == $thisevent['event_start'])) return "";
$endds = $ecal_class->event_date_string($thisevent['event_end']);
return $endds;
SC_END
SC_BEGIN EVENT_TIME_END
global $thisevent, $ecal_class;
if ($thisevent['event_allday'] ||($thisevent['event_end'] == $thisevent['event_start'])) return "";
$endds = $ecal_class->time_string($thisevent['event_end']);
return $endds;
SC_END
SC_BEGIN EVENT_TITLE
global $thisevent;
return $thisevent['event_title'];
SC_END
SC_BEGIN EVENT_CAT_ICON
global $thisevent;
if ($thisevent['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$thisevent['event_cat_icon']))
{
return "<img style='border:0' src='".e_PLUGIN."calendar_menu/images/".$thisevent['event_cat_icon']."' alt='' /> ";
}
else
{
return "";
}
SC_END
SC_BEGIN EVENT_ID
global $thisevent;
return "calevent".$thisevent['event_id'];
SC_END
SC_BEGIN EVENT_DISPLAYSTYLE
global $EVENT_DISPLAYSTYLE, $ds;
if (($ds=="event") || ($ds=="one")){
$EVENT_DISPLAYSTYLE = "show";
}else{
$EVENT_DISPLAYSTYLE = "none";
}
return $EVENT_DISPLAYSTYLE;
SC_END
SC_BEGIN EVENT_DETAILS
global $EVENT_DETAILS, $thisevent, $tp;
return $tp->toHTML($thisevent['event_details'], TRUE);
SC_END
SC_BEGIN EVENT_CATEGORY
global $EVENT_CATEGORY, $thisevent;
$EVENT_CATEGORY = $thisevent['event_cat_name'];
return $EVENT_CATEGORY;
SC_END
SC_BEGIN EVENT_LOCATION
global $EVENT_LOCATION, $thisevent;
if ($thisevent['event_location'] == ""){
$EVENT_LOCATION = "";
}else{
$EVENT_LOCATION = $thisevent['event_location'];
}
return $EVENT_LOCATION;
SC_END
SC_BEGIN EVENT_AUTHOR
global $EVENT_AUTHOR, $event_author_id, $event_author_name;
if(USER){
$EVENT_AUTHOR = "<a href='".e_BASE."user.php?id.".$event_author_id."'>".$event_author_name."</a>";
}else{
$EVENT_AUTHOR = $event_author_name;
}
return $EVENT_AUTHOR;
SC_END
SC_BEGIN EVENT_CONTACT
global $EVENT_CONTACT, $thisevent,$tp;
if ($thisevent['event_contact'] == ""){
//$EVENT_CONTACT = EC_LAN_38; // Not Specified ;
$EVENT_CONTACT = "";
}else{
$EVENT_CONTACT = $tp->toHTML($thisevent['event_contact'],TRUE);
}
return $EVENT_CONTACT;
SC_END
SC_BEGIN EVENT_THREAD
global $EVENT_THREAD, $thisevent;
return (isset($thisevent['event_thread']) && ($thisevent['event_thread'] != "")) ? "<a href='{$thisevent['event_thread']}'><img src='".e_PLUGIN."forum/images/".IMODE."/e.png' alt='' style='border:0; vertical-align:middle;' width='16' height='16' /></a> <a href='{$thisevent['event_thread']}'>".EC_LAN_39."</a>" : "";
SC_END
SC_BEGIN EVENT_OPTIONS
global $EVENT_OPTIONS, $thisevent, $event_author_name, $cal_super;
if (USERNAME == $event_author_name || $cal_super){
$EVENT_OPTIONS = "<a href='event.php?ed.".$thisevent['event_id']."'><img style='border:0;' src='".e_IMAGE."admin_images/edit_16.png' title='".EC_LAN_35."' alt='".EC_LAN_35 . "'/></a>&nbsp;&nbsp;<a href='".e_PLUGIN."calendar_menu/event.php?de.".$thisevent['event_id']."'><img style='border:0;' src='".e_IMAGE."admin_images/delete_16.png' title='".EC_LAN_36."' alt='".EC_LAN_36."'/></a>";
}
return $EVENT_OPTIONS;
SC_END
SC_BEGIN NEXT_EVENT_TIME
global $cal_row, $ecal_class;
if ($cal_row['event_allday'] != 1) return $ecal_class->time_string($cal_row['event_start']); else return '';
SC_END
SC_BEGIN NEXT_EVENT_DATE
global $cal_row, $ecal_class;
return $ecal_class->next_date_string($cal_row['event_start']);
SC_END
SC_BEGIN NEXT_EVENT_TITLE
global $pref, $cal_row;
if (isset($pref['eventpost_namelink']) && ($pref['eventpost_namelink'] == '2') && (isset($cal_row['event_thread']) && ($cal_row['event_thread'] != "")))
{
$fe_event_title = "<a href='".$cal_row['event_thread']."'>";
}
else
{
$fe_event_title = "<a href='".e_PLUGIN."calendar_menu/event.php?".$cal_row['event_start'].".event.".$cal_row['event_id']."'>";
}
$fe_event_title .= $cal_row['event_title']."</a>";
return $fe_event_title;
SC_END
SC_BEGIN NEXT_EVENT_ICON
global $pref, $cal_row, $ecal_dir;
$fe_icon_file = "";
if ($pref['eventpost_showcaticon'] == 1)
{
if($cal_row['event_cat_icon'] && file_exists($ecal_dir."images/".$cal_row['event_cat_icon']))
{
$fe_icon_file = $ecal_dir."images/".$cal_row['event_cat_icon'];
}
else
{
$fe_icon_file = THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif");
}
}
return $fe_icon_file;
SC_END
SC_BEGIN NEXT_EVENT_GAP
global $cal_totev;
if ($cal_totev) return "<br /><br />"; else return "";
SC_END
*/
?>

View File

@@ -0,0 +1,42 @@
CREATE TABLE event (
event_id int(11) unsigned NOT NULL auto_increment,
event_start int(10) NOT NULL default '0',
event_end int(10) NOT NULL default '0',
event_allday tinyint(1) unsigned NOT NULL default '0',
event_recurring tinyint(1) unsigned NOT NULL default '0',
event_datestamp int(10) unsigned NOT NULL default '0',
event_title varchar(200) NOT NULL default '',
event_location text NOT NULL,
event_details text NOT NULL,
event_author varchar(100) NOT NULL default '',
event_contact varchar(200) NOT NULL default '',
event_category smallint(5) unsigned NOT NULL default '0',
event_thread varchar(100) NOT NULL default '',
event_rec_m tinyint(2) unsigned NOT NULL default '0',
event_rec_y tinyint(2) unsigned NOT NULL default '0',
PRIMARY KEY (event_id)
) TYPE=MyISAM;,
CREATE TABLE event_cat (
event_cat_id smallint(5) unsigned NOT NULL auto_increment,
event_cat_name varchar(100) NOT NULL default '',
event_cat_icon varchar(100) NOT NULL default '',
event_cat_class int(10) unsigned NOT NULL default '0',
event_cat_subs tinyint(3) unsigned NOT NULL default '0',
event_cat_ahead tinyint(3) unsigned NOT NULL default '0',
event_cat_msg1 text,
event_cat_msg2 text,
event_cat_notify tinyint(3) unsigned NOT NULL default '0',
event_cat_last int(10) unsigned NOT NULL default '0',
event_cat_today int(10) unsigned NOT NULL default '0',
event_cat_lastupdate int(10) unsigned NOT NULL default '0',
event_cat_addclass int(10) unsigned NOT NULL default '0',
event_cat_description text,
event_cat_force_class int(10) unsigned NOT NULL default '0',
PRIMARY KEY (event_cat_id)
) TYPE=MyISAM;,
CREATE TABLE event_subs (
event_subid int(10) unsigned NOT NULL auto_increment,
event_userid int(10) unsigned NOT NULL default '0',
event_cat int(10) unsigned NOT NULL default '0',
PRIMARY KEY (event_subid)
) TYPE=MyISAM;

View File

@@ -0,0 +1,269 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/calendar_template.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:46 $
| $Author: mcfly_e107 $
|
| 10.11.06 steved - mods for next CVS release
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
// TIME SWITCH BUTTONS ------------------------------------------------------------
$sc_style['PREV_MONTH']['pre'] = "<span class='defaulttext'>";
$sc_style['PREV_MONTH']['post'] = "</span>";
$sc_style['CURRENT_MONTH']['pre'] = "<b>";
$sc_style['CURRENT_MONTH']['post'] = "</b>";
$sc_style['NEXT_MONTH']['pre'] = "<span class='defaulttext'>";
$sc_style['NEXT_MONTH']['post'] = "</span>";
$sc_style['PREV_YEAR']['pre'] = "";
$sc_style['PREV_YEAR']['post'] = "";
$sc_style['MONTH_LIST']['pre'] = "";
$sc_style['MONTH_LIST']['post'] = "";
$sc_style['NEXT_YEAR']['pre'] = "";
$sc_style['NEXT_YEAR']['post'] = "";
//<table style='width:98%;' class='fborder'>
$CALENDAR_TIME_TABLE = "
<table cellpadding='0' cellspacing='1' class='fborder' style='width:100%'>
<tr>
<td class='forumheader' style='width:18%; text-align:left'>{PREV_MONTH}</td>
<td class='fcaption' style='width:64%; text-align:center'>{CURRENT_MONTH}</td>
<td class='forumheader' style='width:18%; text-align:right'>{NEXT_MONTH}</td>
</tr>\n
<tr>
<td class='forumheader3' style='text-align:left'>{PREV_YEAR}</td>
<td class='fcaption' style='text-align:center; vertical-align:middle'>{MONTH_LIST}</td>
<td class='forumheader3' style='text-align:right'>{NEXT_YEAR}</td>
</tr>\n
</table>";
// NAVIGATION BUTTONS ------------------------------------------------------------
//$sc_style['NAV_LINKCURRENTMONTH']['pre'] = "<span class='button' style='width:120px; '>";
//$sc_style['NAV_LINKCURRENTMONTH']['post'] = "</span>";
$sc_style['NAV_LINKCURRENTMONTH']['pre'] = "";
$sc_style['NAV_LINKCURRENTMONTH']['post'] = "";
$CALENDAR_NAVIGATION_TABLE = "
<div style='text-align:center; margin-bottom:20px;'>
<form method='post' action='" . e_SELF . "?" . e_QUERY . "' id='calform'>
<table border='0' cellpadding='0' cellspacing='0' style='width:100%;'>
<tr>
<td style='text-align:center;'>{NAV_CATEGORIES} {NAV_BUT_ALLEVENTS} {NAV_BUT_VIEWCAT} {NAV_BUT_ENTEREVENT} {NAV_BUT_SUBSCRIPTION} {NAV_LINKCURRENTMONTH}</td>
</tr>\n
</table>
</form>
</div>";
// EVENT LIST ------------------------------------------------------------
$sc_style['EVENTLIST_CAPTION']['pre'] = "<tr><td class='fcaption' colspan='2'>";
$sc_style['EVENTLIST_CAPTION']['post'] = ":<br /><br /></td></tr>\n";
$EVENT_EVENTLIST_TABLE_START = "<table style='width:100%' class='fborder'>{EVENTLIST_CAPTION}";
$EVENT_EVENTLIST_TABLE_END = "</table>";
// EVENT ARCHIVE ------------------------------------------------------------
$sc_style['EVENTARCHIVE_CAPTION']['pre'] = "<tr><td colspan='2' class='fcaption'>";
$sc_style['EVENTARCHIVE_CAPTION']['post'] = "</td></tr>\n";
$EVENT_ARCHIVE_TABLE_START = "<br /><table style='width:100%' class='fborder'>{EVENTARCHIVE_CAPTION}";
$EVENT_ARCHIVE_TABLE = "
<tr>
<td style='width:35%; vertical-align:top' class='forumheader3'>{EVENT_RECENT_ICON}{EVENTARCHIVE_DATE}</td>
<td style='width:65%' class='forumheader3'>{EVENTARCHIVE_HEADING}</td>
</tr>\n";
//<br />{EVENTARCHIVE_DETAILS}
$EVENT_ARCHIVE_TABLE_EMPTY = "<tr><td colspan='2' class='forumheader3'>{EVENTARCHIVE_EMPTY}</td></tr>\n";
$EVENT_ARCHIVE_TABLE_END = "</table>";
// EVENT SHOW EVENT ------------------------------------------------------------
$EVENT_EVENT_TABLE_START = "<table style='width:100%' class='fborder' cellspacing='0' cellpadding='0'>";
$EVENT_EVENT_TABLE_END = "</table>";
$sc_style['EVENT_HEADING_DATE']['pre'] = "";
$sc_style['EVENT_HEADING_DATE']['post'] = "";
$sc_style['EVENT_DETAILS']['pre'] = "<tr><td colspan='2' class='forumheader3'>";
$sc_style['EVENT_DETAILS']['post'] = "</td></tr>\n";
$sc_style['EVENT_LOCATION']['pre'] = "<b>".EC_LAN_32."</b> ";
$sc_style['EVENT_LOCATION']['post'] = "";
$sc_style['EVENT_AUTHOR']['pre'] = "<b>".EC_LAN_31."</b> ";
$sc_style['EVENT_AUTHOR']['post'] = "&nbsp;";
$sc_style['EVENT_CONTACT']['pre'] = "<b>".EC_LAN_33."</b> ";
$sc_style['EVENT_CONTACT']['post'] = "&nbsp;";
$sc_style['EVENT_THREAD']['pre'] = "<tr><td colspan='2' class='forumheader3'><span class='smalltext'>";
$sc_style['EVENT_THREAD']['post'] = "</span></td></tr>\n";
$sc_style['EVENT_CATEGORY']['pre'] = "<b>".EC_LAN_30."</b> ";
$sc_style['EVENT_CATEGORY']['post'] = "&nbsp;";
$sc_style['EVENT_DATE_START']['pre'] = (isset($thisevent['event_allday']) && $thisevent['event_allday']) ? "<b>".EC_LAN_68."</b> " : "<b>".EC_LAN_29."</b> ";
$sc_style['EVENT_DATE_START']['post'] = "";
$sc_style['EVENT_TIME_START']['pre'] = EC_LAN_144;
$sc_style['EVENT_TIME_START']['post'] = "";
$sc_style['EVENT_DATE_END']['pre'] = "<b>".EC_LAN_69."</b> ";
$sc_style['EVENT_DATE_END']['post'] = "";
$sc_style['EVENT_TIME_END']['pre'] = EC_LAN_144;
$sc_style['EVENT_TIME_END']['post'] = "";
$EVENT_EVENT_TABLE = "
<tr>
<td >
<div title='".EC_LAN_132."' class='fcaption' style='cursor:pointer; text-align:left; border:0px solid #000;' onclick=\"expandit('{EVENT_ID}')\">{EVENT_RECENT_ICON}{EVENT_CAT_ICON}{EVENT_HEADING_DATE}{EVENT_TIME_START}&nbsp;-&nbsp;{EVENT_TITLE}</div>
<div id='{EVENT_ID}' style='display:{EVENT_DISPLAYSTYLE}; padding-top:10px; padding-bottom:10px; text-align:left;'>
<table style='width:100%;' cellspacing='0' cellpadding='0'>
<tr><td colspan='2' class='forumheader3'>{EVENT_AUTHOR} {EVENT_CAT_ICON} {EVENT_CATEGORY} {EVENT_CONTACT} {EVENT_OPTIONS}</td></tr>
<tr><td colspan='2' class='forumheader3'>{EVENT_DATE_START}{EVENT_TIME_START} {EVENT_DATE_END}{EVENT_TIME_END}</td></tr>\n
<tr><td colspan='2' class='forumheader3'>{EVENT_LOCATION}</td></tr>
{EVENT_DETAILS}
{EVENT_THREAD}
</table>
</div>
</td>
</tr>\n
";
// CALENDAR SHOW EVENT ------------------------------------------------------------
$sc_style['CALENDAR_CALENDAR_RECENT_ICON']['pre'] = "<td style='vertical-align:top; color: #0; background-color: #ff00; width:10px;'>";
$sc_style['CALENDAR_CALENDAR_RECENT_ICON']['post'] = "</td>";
$CALENDAR_SHOWEVENT = "<table cellspacing='0' cellpadding='0' style='width:100%;'><tr>{CALENDAR_CALENDAR_RECENT_ICON}<td style='vertical-align:top; width:10px;'>{SHOWEVENT_IMAGE}</td><td style='vertical-align:top; width:2%;'>{SHOWEVENT_INDICAT}</td><td style='vertical-align:top;'>{SHOWEVENT_HEADING}</td></tr>\n</table>";
// CALENDAR CALENDAR ------------------------------------------------------------
$CALENDAR_CALENDAR_START = "
<div style='text-align:center'>
<table cellpadding='0' cellspacing='1' class='fborder' style='background-color:#DDDDDD; width:100%'>";
$CALENDAR_CALENDAR_END = "
</tr>\n</table></div>";
$CALENDAR_CALENDAR_DAY_NON = "<td style='width:12%;height:60px;'></td>";
//header row
$CALENDAR_CALENDAR_HEADER_START = "<tr>";
$CALENDAR_CALENDAR_HEADER = "<td class='fcaption' style='z-index: -1; background-color:#000; color:#FFF; width:90px; height:20px; text-align:center; vertical-align:middle;'>{CALENDAR_CALENDAR_HEADER_DAY}</td>";
$CALENDAR_CALENDAR_HEADER_END = "</tr>\n<tr>";
$CALENDAR_CALENDAR_WEEKSWITCH = "</tr>\n<tr>";
//today
$CALENDAR_CALENDAR_DAY_TODAY = "
<td class='forumheader3' style='vertical-align:top; width:14%; height:90px; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;'>
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'>{CALENDAR_CALENDAR_DAY_TODAY_HEADING}</span>";
//day has events
$CALENDAR_CALENDAR_DAY_EVENT = "
<td class='forumheader3' style='z-index: 1;vertical-align:top; width:14%; height:90px; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;'>
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{CALENDAR_CALENDAR_DAY_EVENT_HEADING}</b></span>";
// no events and not today
$CALENDAR_CALENDAR_DAY_EMPTY = "
<td class='forumheader2' style='z-index: 1;vertical-align:top; width:14%; height:90px;padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;'>
<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{CALENDAR_CALENDAR_DAY_EMPTY_HEADING}</b></span>";
$CALENDAR_CALENDAR_DAY_END = "</td>";
//====================================================================
// Calendar menu templates
$CALENDAR_MENU_START = "<div style='text-align:center'>";
$CALENDAR_MENU_TABLE_START = "<table cellpadding='0' cellspacing='1' style='width:100%' class='fborder'>";
$CALENDAR_MENU_END = "</tr></table></div>";
// Blank cells at beginning and end
$CALENDAR_MENU_DAY_NON = "<td class='forumheader3' style='padding:1px; text-align:center'><br /></td>";
//header row
$CALENDAR_MENU_HEADER_START = "<tr>\n";
$CALENDAR_MENU_HEADER_FRONT = "<td class='forumheader' style='text-align:center; vertical-align:middle;'><span class='smalltext'>";
$CALENDAR_MENU_HEADER_BACK = "</span></td>";
$CALENDAR_MENU_HEADER_END = "</tr>\n<tr>";
$CALENDAR_MENU_WEEKSWITCH = "</tr>\n<tr>";
// Start and end CSS for date cells - six cases to decode, determined by array index:
// 1 - Today, no events
// 2 - Some other day, no events (or no icon defined)
// 3 - Today with events (and icon defined)
// 4 - Some other day with events (and icon defined)
// 5 - today with events, one or more of which has recently been added/updated (and icon defined)
// 6 - Some other day with events, one or more of which has recently been added/updated (and icon defined)
//today, no events
$CALENDAR_MENU_DAY_START['1'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
// no events and not today
$CALENDAR_MENU_DAY_START['2'] = "<td class='forumheader3' style='width:14.28%; padding:1px; text-align:center; '>";
//day has events - same whether its today or not
$CALENDAR_MENU_DAY_START['3'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
$CALENDAR_MENU_DAY_START['4'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center;'>";
// day has events, one which is recently added/updated
$CALENDAR_MENU_DAY_START['5'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; '>";
$CALENDAR_MENU_DAY_START['6'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center;'>";
// Example highlight using background colour:
//$CALENDAR_MENU_DAY_START['5'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; background-color: #FF8000;'>";
//$CALENDAR_MENU_DAY_START['6'] = "<td class='indent' style='width:14.28%; padding:1px; text-align:center; background-color: #FF0000; '>";
$CALENDAR_MENU_DAY_END['1'] = "</td>";
$CALENDAR_MENU_DAY_END['2'] = "</td>";
$CALENDAR_MENU_DAY_END['3'] = "</td>";
$CALENDAR_MENU_DAY_END['4'] = "</td>";
$CALENDAR_MENU_DAY_END['5'] = "</td>";
$CALENDAR_MENU_DAY_END['6'] = "</td>";
//============================================================================
// Next event menu template
$sc_style['NEXT_EVENT_TIME']['pre'] = EC_LAN_144;
$sc_style['NEXT_EVENT_TIME']['post'] = "";
// Following are original styles
//$sc_style['NEXT_EVENT_ICON']['pre'] = "<img style='border:0px' src='";
//$sc_style['NEXT_EVENT_ICON']['post'] = "' alt='' />&nbsp;";
// Following to 'float right' on a larger icon
$sc_style['NEXT_EVENT_ICON']['pre'] = "<img style='clear: right; float: left; margin: 0px 3px 0px 0px; padding:1px; border: 0px;' src='";
$sc_style['NEXT_EVENT_ICON']['post'] = "' alt='' />";
if (!isset($EVENT_CAL_FE_LINE))
{
$EVENT_CAL_FE_LINE = "{NEXT_EVENT_ICON}{NEXT_EVENT_DATE}{NEXT_EVENT_TIME}<br /><strong>{NEXT_EVENT_TITLE}</strong>{NEXT_EVENT_GAP}";
}
?>

View File

@@ -0,0 +1,62 @@
<?php
if (!defined('e107_INIT')) { exit; }
if(!$calendar_install = $sql -> db_Select("plugin", "*", "plugin_path = 'calendar_menu' AND plugin_installflag = '1' "))
{
return;
}
$LIST_CAPTION = $arr[0];
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
require_once('ecal_class.php');
$ecal_class = new ecal_class;
$current_day = $ecal_class->cal_date['mday'];
$current_month = $ecal_class->cal_date['mon'];
$current_year = $ecal_class->cal_date['year'];
$current = mktime(0,0,0,$current_month, $current_day, $current_year);
if($mode == "new_page" || $mode == "new_menu" ){
$lvisit = $this -> getlvisit();
$qry = " event_datestamp>".intval($lvisit)." AND ";
}else{
$qry = "";
}
$bullet = $this -> getBullet($arr[6], $mode);
$qry = "
SELECT e.*, c.event_cat_name
FROM #event AS e
LEFT JOIN #event_cat AS c ON c.event_cat_id = e.event_category
WHERE ".$qry." e.event_start>='$current' AND c.event_cat_class REGEXP '".e_CLASS_REGEXP."'
ORDER BY e.event_start ASC LIMIT 0,".intval($arr[7]);
if(!$event_items = $sql->db_Select_gen($qry)){
$LIST_DATA = LIST_CALENDAR_2;
}else{
while($row = $sql -> db_Fetch()){
$tmp = explode(".", $row['event_author']);
if($tmp[0] == "0"){
$AUTHOR = $tmp[1];
}elseif(is_numeric($tmp[0]) && $tmp[0] != "0"){
$AUTHOR = (USER ? "<a href='".e_BASE."user.php?id.".$tmp[0]."'>".$tmp[1]."</a>" : $tmp[1]);
}else{
$AUTHOR = "";
}
$rowheading = $this -> parse_heading($row['event_title'], $mode);
$ICON = $bullet;
$HEADING = "<a href='".e_PLUGIN."calendar_menu/event.php?".$row['event_start'].".event.".$row['event_id']."' title='".$row['event_title']."'>".$rowheading."</a>";
$CATEGORY = $row['event_cat_name'];
$DATE = ($arr[5] ? ($row['event_start'] ? $this -> getListDate($row['event_start'], $mode) : "") : "");
$INFO = "";
$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
}
}
?>

View File

@@ -0,0 +1,53 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_notify.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:46 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
if(defined('ADMIN_PAGE') && ADMIN_PAGE === true)
{
include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
$config_category = NT_LAN_EC_1;
$config_events = array('ecalnew' => NT_LAN_EC_7, 'ecaledit' => NT_LAN_EC_2);
}
if (!function_exists('notify_ecalnew'))
{
function notify_ecalnew($data) {
global $nt;
include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
$message = NT_LAN_EC_3.': '.USERNAME.' ('.NT_LAN_EC_4.': '.$data['ip'].' )<br />';
$message .= NT_LAN_EC_5.':<br />'.$data['cmessage'].'<br /><br />';
$nt -> send('ecaledit', NT_LAN_EC_6, $message);
}
}
if (!function_exists('notify_ecaledit')) {
function notify_ecaledit($data) {
global $nt;
include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
$message = NT_LAN_EC_3.': '.USERNAME.' ('.NT_LAN_EC_4.': '.$data['ip'].' )<br />';
$message .= NT_LAN_EC_5.':<br />'.$data['cmessage'].'<br /><br />';
$nt -> send('ecaledit', NT_LAN_EC_8, $message);
}
}
?>

View File

@@ -0,0 +1,59 @@
<?php
// Reflects updates to CVS version 1.3 made 29.10.2006
if (!defined('e107_INIT')) { exit; }
//##### create feed for admin, return array $eplug_rss_feed --------------------------------
$feed['name'] = EC_ADLAN_A12;
$feed['url'] = 'calendar'; //the identifier for the rss feed url
$feed['topic_id'] = ''; //the topic_id, empty on default (to select a certain category)
$feed['path'] = 'calendar_menu'; //this is the plugin path location
$feed['text'] = EC_ADLAN_A157;
$feed['class'] = '0';
$feed['limit'] = '9';
//##### ------------------------------------------------------------------------------------
require_once('ecal_class.php');
$ecal_class = new ecal_class;
//##### create rss data, return as array $eplug_rss_data -----------------------------------
$current_day = $ecal_class->cal_date['mday'];
$current_month = $ecal_class->cal_date['mon'];
$current_year = $ecal_class->cal_date['year'];
$current = mktime(0,0,0,$current_month, $current_day, $current_year);
$qry = "
SELECT e.*, c.event_cat_name
FROM #event AS e
LEFT JOIN #event_cat AS c ON c.event_cat_id = e.event_category
WHERE e.event_start>='$current' AND c.event_cat_class REGEXP '".e_CLASS_REGEXP."'
ORDER BY e.event_start ASC LIMIT 0,".$this->limit;
$rss = array();
$sqlrss = new db;
if($items = $sqlrss->db_Select_gen($qry)){
$i=0;
while($rowrss = $sqlrss -> db_Fetch()){
$tmp = explode(".", $rowrss['event_author']);
$rss[$i]['author'] = $tmp[1];
$rss[$i]['author_email'] = '';
$rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."calendar_menu/event.php?".$rowrss['event_start'].".event.".$rowrss['event_id'];
$rss[$i]['linkid'] = $rowrss['event_id'];
$rss[$i]['title'] = $rowrss['event_title'];
$rss[$i]['description'] = '';
$rss[$i]['category_name'] = $rowrss['event_cat_name'];
$rss[$i]['category_link'] = '';
$rss[$i]['datestamp'] = $rowrss['event_start'];
$rss[$i]['enc_url'] = "";
$rss[$i]['enc_leng'] = "";
$rss[$i]['enc_type'] = "";
$i++;
}
}
//##### ------------------------------------------------------------------------------------
$eplug_rss_feed[] = $feed;
$eplug_rss_data[] = $rss;
?>

View File

@@ -0,0 +1,11 @@
<?php
if (!defined('e107_INIT')) { exit; }
if (file_exists(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE."_search.php")) {
include_once(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE."_search.php");
} else {
include_once(e_PLUGIN."calendar_menu/languages/English_search.php");
}
$search_info[] = array('sfile' => e_PLUGIN.'calendar_menu/search/search_parser.php', 'qtype' => CM_SCH_LAN_1, 'refpage' => 'calendar.php');
?>

View File

@@ -0,0 +1,245 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/ecal_class.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:47 $
| $Author: mcfly_e107 $
|
| Event calendar class for gradual enhancement
| (Some bits may be usefully transferred to common code later)
|
| 11.11.06 - Add date formatting options
| - Add notify
|
+----------------------------------------------------------------------------+
*/
/*
Preferences used:
eventpost_caltime 1 = server, 2 = site, 3 = user
eventpost_timedisplay 1 = 24 hour, 2 = 12 hour default, 3 = custom
eventpost_timecustom String for custom time display
date() returns formatted date/time string
*/
class ecal_class
{
// Useful time/date variables - set up on creation, and available externally
// (All the times and dates are consistent, being derived from $time_now, which is the time the constructor was
// called - probably doesn't matter, but may help someone.
var $time_now; // Current time/date stamp
var $site_timedate; // Site time/date stamp - adjusted for time zone
var $user_timedate; // Time/date based on user's time zone
var $cal_timedate; // Time/date stamp used by event calendar (user set)
var $now_date; // Time/date array from $time_now
var $site_date; // Time/date array from $site_timedate
var $cal_date ; // Time/date array from $cal_timedate
var $cal_super; // True if current user is a calendar supervisor
var $extra_query; // Extra bit of mysql query used for non-supervisor (read) queries
var $time_format_string; // String to format times on the site
var $cal_format_string; // String to format the displayed date on event entry ("Y-m-d" or "d-m-Y")
var $dcal_format_string; // Format string to pass to DHTML calendar
var $java_format_code; // Code to pass to Javascript re date format
var $event_date_format_string; // String to format the date in the event calendar
var $next_date_format_string; // String to format the date in the 'forthcoming event' menu
var $max_cache_time; // Oldest permissible age of any cached pages relating to event calendar
var $max_recent_show; // Time in seconds for showing 'recent events'
function ecal_class()
{ // Constructor
global $pref;
$this->time_now = time();
$this->site_timedate = $this->time_now + ($pref['time_offset'] * 3600); // Check sign of offset
$this->user_timedate = $this->time_now + TIMEOFFSET;
switch ($pref['eventpost_caltime'])
{
case 1 :
$this->cal_timedate = $this->site_timedate; // Site time
break;
case 2 :
$this->cal_timedate = $this->user_timedate; // User
break;
default :
$this->cal_timedate = $this->time_now; // Server time - default
}
$this->now_date = getdate($this->time_now);
$this->site_date = getdate($this->site_timedate); // Array with h,m,s, day, month year etc
$this->cal_date = getdate($this->cal_timedate);
$this->max_cache_time = $this->site_date['minutes'] + 60*$this->site_date['hours'];
$this->cal_super = check_class($pref['eventpost_super']);
if ($this->cal_super) $this->extra_query = ""; else $this->extra_query = " AND find_in_set(event_cat_class,'".USERCLASS_LIST."')";
if (isset($pref['eventpost_recentshow']) && ($pref['eventpost_recentshow'] != 0))
{
$this->max_recent_show = 3600 * $pref['eventpost_recentshow'];
}
else
{
$this->max_recent_show = 0;
}
switch ($pref['eventpost_timedisplay'])
{
case 2 :
$this->time_format_string = "%I:%M %p"; // 12-hour display
break;
case 3 :
$this->time_format_string = $pref['eventpost_timecustom']; // custom display
if (isset($this->time_format_string)) break;
default :
$this->time_format_string = "%H%M"; // default to 24-hour display
}
switch ($pref['eventpost_datedisplay'])
{ // Event entry calendar
case 2 :
$this->cal_format_string = "d-m-Y";
$this->dcal_format_string = "%d-%m-%Y";
$this->java_format_code = 2;
break;
case 3 :
$this->cal_format_string = "m-d-Y";
$this->dcal_format_string = "%m-%d-%Y";
$this->java_format_code = 3;
break;
default : // 'original' defaults
$this->cal_format_string = "Y-m-d";
$this->dcal_format_string = "%Y-%m-%d";
$this->java_format_code = 1;
}
switch ($pref['eventpost_dateevent'])
{ // Event list date display
case 0 :
$this->event_date_format_string = $pref['eventpost_eventdatecustom'];
break;
case 2 :
$this->event_date_format_string = "%a %d %b %Y";
break;
case 3 :
$this->event_date_format_string = "%a %d-%m-%y";
break;
default :
$this->event_date_format_string = "%A %d %B %Y";
}
switch ($pref['eventpost_datenext'])
{ // Forthcoming event date display
case 0 :
$this->next_date_format_string = $pref['eventpost_nextdatecustom'];
break;
case 2 :
$this->next_date_format_string = "%d %b";
break;
case 3 :
$this->next_date_format_string = "%B %d";
break;
case 4 :
$this->next_date_format_string = "%b %d";
break;
default :
$this->next_date_format_string = "%d %B";
}
}
function time_string($convtime)
{ // Returns a time string from a time stamp, formatted as 24-hour, 12-hour or custom as set in prefs
return strftime($this->time_format_string, $convtime);
}
function event_date_string($convdate)
{ // Returns a date string from a date stamp, formatted for display in event list
return strftime($this->event_date_format_string,$convdate);
}
function next_date_string($convdate)
{ // Returns a date string from a date stamp, formatted for display in forthcoming event menu
return strftime($this->next_date_format_string,$convdate);
}
function full_date($convdate)
{ // Returns a date as dd-mm-yyyy or yyyy-mm-dd according to prefs (for event entry)
return date($this->cal_format_string, $convdate);
}
function make_date($new_hour, $new_minute, $date_string)
{ // Turns a date as entered in the calendar into a time stamp (for event entry)
global $pref;
$tmp = explode("-", $date_string);
switch ($pref['eventpost_datedisplay'])
{
case 2 :
return mktime($new_hour, $new_minute, 0, $tmp[1], $tmp[0], $tmp[2]); // dd-mm-yyyy
case 3 :
return mktime($new_hour, $new_minute, 0, $tmp[0], $tmp[1], $tmp[2]); // mm-dd-yyyy
default :
return mktime($new_hour, $new_minute, 0, $tmp[1], $tmp[2], $tmp[0]); // yyyy-mm-dd
}
}
function cal_log($event_type, $event_title = '', $event_string='', $event_start=0)
{ // All calendar-related logging intentionally passed through a single point to maintain control
// (so we could also add other info if we wanted)
// Event types:
// 1 - add event
// 2 - edit event
// 3 - delete event
// 4 - Bulk delete
global $pref, $admin_log, $e_event;
$log_titles = array( '1' => 'Event Calendar - add event',
'2' => 'Event Calendar - edit event',
'3' => 'Event Calendar - delete event',
'4' => 'Event Calendar - Bulk Delete'
);
// Do the notifies first
$cmessage = $log_titles[$event_type]."<br />";
if ($event_start > 0)
$cmessage .= "Event Start: ".strftime("%d-%B-%Y",$event_start)."<br />";
else
$cmessage .= "Event Start unknown<br />";
$edata_ec = array("cmessage" => $cmessage, "ip" => getip());
switch ($event_type)
{
case 1 : $e_event -> trigger("ecalnew", $edata_ec);
break;
case 2 :
case 3 :
case 4 : $e_event -> trigger("ecaledit", $edata_ec);
break;
}
switch ($pref['eventpost_adminlog'])
{
case 1 : if ($event_type == '1') return;
case 2 : break; // Continue
default : return; // Invalid or undefined option
}
$log_titles = array( '1' => 'Event Calendar - add event',
'2' => 'Event Calendar - edit event',
'3' => 'Event Calendar - delete event',
'4' => 'Event Calendar - Bulk Delete'
);
$admin_log->log_event($log_titles[$event_type],$event_title."&nbsp;\n".$event_string,4);
}
}
?>

View File

@@ -0,0 +1,854 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jali.@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/event.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:47 $
| $Author: mcfly_e107 $
|
| 09.11.06 - Started next batch of mods
+----------------------------------------------------------------------------+
*/
require_once("../../class2.php");
require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
if (isset($_POST['viewallevents']))
{ // Triggered from NAV_BUT_ALLEVENTS
Header("Location: ".e_PLUGIN."calendar_menu/calendar.php?".$_POST['enter_new_val']);
}
if (isset($_POST['doit']))
{ // Triggered from NAV_BUT_ENTEREVENT
Header("Location: ".e_PLUGIN."calendar_menu/event.php?ne.".$_POST['enter_new_val']);
}
if (isset($_POST['subs']))
{
Header("Location: ".e_PLUGIN."calendar_menu/subscribe.php");
}
@include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
define("PAGE_NAME", EC_LAN_80);
require_once(e_PLUGIN.'calendar_menu/ecal_class.php');
global $ecal_class;
$ecal_class = new ecal_class;
$cal_super = $ecal_class->cal_super;
require_once(e_HANDLER."calendar/calendar_class.php");
$cal = new DHTML_Calendar(true);
$category_filter = "";
if ((isset($_POST['event_cat_ids']) && $_POST['event_cat_ids'] != "all"))
{
$category_filter = " AND (e.event_category = '".$_POST['event_cat_ids']."') ";
}
/*
// enter new category into db
if (isset($_POST['ne_cat_create']))
{
if ($_POST['ne_new_category'] != "")
{
$sql->db_Insert("event_cat", "0, '".$tp->toDB($_POST['ne_new_category'])."', '".$tp->toDB($_POST['ne_new_category_icon'])."', '0', '0', '0', '0', '', '', '0', '0', '0', '".time()."', '0' ");
header("location:event.php?".$_POST['qs'].".m1");
}
else
{
header("location:event.php?".$_POST['qs'].".m3");
}
}
*/
// Event to add or update
if ((isset($_POST['ne_insert']) || isset($_POST['ne_update'])) && USER == true)
{
if (($_POST['ne_event'] == "") || !isset($_POST['qs']))
{ // Problem - tell user to go away
header("location:event.php?".$ev_start.".m3");
}
else
{
$ev_start = $ecal_class->make_date($_POST['ne_hour'], $_POST['ne_minute'],$_POST['start_date']);
$ev_end = $ecal_class->make_date($_POST['end_hour'], $_POST['end_minute'],$_POST['end_date']);
$ev_title = $tp->toDB($_POST['ne_title']);
$ev_location = $tp->toDB($_POST['ne_location']);
$ev_event = $tp->toDB($_POST['ne_event']);
$temp_date = getdate($ecal_class->make_date(0,0,$_POST['start_date']));
if ($_POST['recurring'] == 1)
{
$rec_m = $temp_date['mday']; // Day of month
$rec_y = $temp_date['mon']; // Month number
}
else
{
$rec_m = "";
$rec_y = "";
}
$report_msg = '.m3';
if (isset($_POST['ne_insert']))
{ // Bits specific to inserting a new event
$qry = " 0, '".intval($ev_start)."', '".intval($ev_end)."', '".intval($_POST['allday'])."', '".intval($_POST['recurring'])."', '".time()."', '$ev_title', '$ev_location', '$ev_event', '".USERID.".".USERNAME."', '".$tp -> toDB($_POST['ne_email'])."', '".intval($_POST['ne_category'])."', '".$tp -> toDB($_POST['ne_thread'])."', '".intval($rec_m)."', '".intval($rec_y)."' ";
$sql->db_Insert("event", $qry);
$ecal_class->cal_log(1,'db_Insert',$qry, $ev_start);
$qs = preg_replace("/ne./i", "", $_POST['qs']);
$report_msg = '.m4';
}
if (isset($_POST['ne_update']))
{ // Bits specific to updating an existing event
$qry = "event_start='".intval($ev_start)."', event_end='".intval($ev_end)."', event_allday='".intval($_POST['allday'])."', event_recurring='".intval($_POST['recurring'])."', event_datestamp= '".time()."', event_title= '$ev_title', event_location='$ev_location', event_details='$ev_event', event_contact='".$tp -> toDB($_POST['ne_email'])."', event_category='".intval($_POST['ne_category'])."', event_thread='".$tp -> toDB($_POST['ne_thread'])."', event_rec_m='".intval($rec_m)."', event_rec_y='".intval($rec_y)."' WHERE event_id='".intval($_POST['id'])."' ";
$sql->db_Update("event", $qry);
$ecal_class->cal_log(2,'db_Update',$qry, $ev_start);
$qs = preg_replace("/ed./i", "", $_POST['qs']);
$report_msg = '.m5';
}
// Now clear cache - just do the lot for now - get clever later
$e107cache->clear('nq_event_cal');
header("location:event.php?".$ev_start.".".$qs.$report_msg);
}
}
$action = ""; // Remove notice
require_once(HEADERF);
if (isset($_POST['jump']))
{
$smarray = getdate(mktime(0, 0, 0, $_POST['jumpmonth'], 1, $_POST['jumpyear']));
$month = $smarray['mon'];
$year = $smarray['year'];
}
else
{
if(e_QUERY)
{
$qs = explode(".", e_QUERY);
$action = $qs[0]; // Often a date if just viewing
$ds = (isset($qs[1]) ? $qs[1] : "");
$eveid = (isset($qs[2]) ? $qs[2] : "");
}
if ($action == "")
{
$month = $ecal_class->cal_date['mon'];
$year = $ecal_class->cal_date['year'];
}
else
{
$smarray = getdate($action);
$month = $smarray['mon'];
$year = $smarray['year'];
}
}
if (isset($_POST['confirm']))
{
$qry = "event_id='".intval($_POST['existing'])."' ";
if ($sql->db_Delete("event", $qry))
{
$message = EC_LAN_51; //Event Deleted
$ecal_class->cal_log(3,'db_Delete',$qry,$ev_start);
}
else
{
$message = EC_LAN_109; //Unable to Delete event for some mysterious reason
}
}
if ($action == "de")
{ // Delete event - show confirmation form
$text = "<div style='text-align:center'>
<b>".EC_LAN_48."</b>
<br /><br />
<form method='post' action='".e_SELF."' id='calformz' >
<input class='button' type='submit' name='cancel' value='".EC_LAN_49."' />
<input class='button' type='submit' name='confirm' value='".EC_LAN_50."' />
<input type='hidden' name='existing' value='".$qs[1]."' />
<input type='hidden' name='subbed' value='no' />
</form>
</div>";
$ns->tablerender(EC_LAN_46, $text); // Confirm Delete Event
require_once(FOOTERF);
exit;
}
if (isset($_POST['cancel']))
{ // Delete Cancelled
$message = EC_LAN_47;
}
// set up data arrays ----------------------------------------------------------------------------------
// (some of these are only used in the shortcodes)
if ($pref['eventpost_weekstart'] == 'sun')
{
$days = Array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24);
}
else
{
$days = Array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25);
}
$dayslo = array('1.', '2.', '3.', '4.', '5.', '6.', '7.', '8.', '9.', '10.', '11.', '12.', '13.', '14.', '15.', '16.', '17.', '18.', '19.', '20.', '21.', '22.', '23.', '24.', '25.', '26.', '27.', '28.', '29.', '30.', '31.');
$monthabb = Array(EC_LAN_JAN, EC_LAN_FEB, EC_LAN_MAR, EC_LAN_APR, EC_LAN_MAY, EC_LAN_JUN, EC_LAN_JUL, EC_LAN_AUG, EC_LAN_SEP, EC_LAN_OCT, EC_LAN_NOV, EC_LAN_DEC);
$months = array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11);
// ----------------------------------------------------------------------------------------------------------
// Messages acknowledging actions
$poss_message = array('m1' => EC_LAN_41, 'm2' => EC_LAN_42, 'm3' => EC_LAN_43, 'm4' => EC_LAN_44, 'm5' => EC_LAN_45);
if (isset($qs[2])) if (isset($poss_message[$qs[2]])) $message = $poss_message[$qs[2]];
if (isset($message))
{
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
// enter new event form
if ($action == "ne" || $action == "ed")
{
if ($ecal_class->cal_super || check_class($pref['eventpost_admin']))
{
function make_calendar($boxname, $boxvalue)
{
global $ecal_class, $cal;
unset($cal_options);
unset($cal_attrib);
$cal_options['firstDay'] = 0;
$cal_options['showsTime'] = false;
$cal_options['showOthers'] = true;
$cal_options['weekNumbers'] = false;
$cal_options['ifFormat'] = $ecal_class->dcal_format_string;
$cal_attrib['class'] = "tbox";
$cal_attrib['size'] = "12";
$cal_attrib['name'] = $boxname;
$cal_attrib['value'] = $boxvalue;
return $cal->make_input_field($cal_options, $cal_attrib);
}
function make_hourmin($boxname,$cur_hour,$cur_minute)
{
global $pref;
if (isset($pref['eventpost_fivemins'])) $incval = 5; else $incval = 1;
$retval = " <select name='{$boxname}hour' id='{$boxname}hour' class='tbox'>\n";
for($count = "00"; $count <= "23"; $count++)
{
$val = sprintf("%02d", $count);
$retval .= "<option value='{$val}' ".(isset($cur_hour) && $count == $cur_hour ? "selected='selected'" :"")." >".$val."</option>\n";
}
$retval .= "</select>\n
<select name='{$boxname}minute' class='tbox'>\n";
for($count = "00"; $count <= "59"; $count+= $incval)
{
$val = sprintf("%02d", $count);
$retval .= "<option ".(isset($cur_minute) && $count == $cur_minute ? "selected='selected'" :"")." value='{$val}'>".$val."</option>\n";
}
$retval .= "</select>\n";
return $retval;
}
if ($action == "ed")
{ // Editing existing event - read from database
$sql->db_Select("event", "*", "event_id='".intval($qs[1])."' ");
list($null, $ne_start, $ne_end, $allday, $recurring, $ne_datestamp, $ne_title, $ne_location, $ne_event, $ne_author, $ne_email, $ne_category, $ne_thread) = $sql->db_Fetch();
$smarray = getdate($ne_start);
$ne_hour = $smarray['hours'];
$ne_minute = $smarray['minutes'];
$ne_startdate = $ecal_class->full_date($ne_start);
$smarray = getdate($ne_end);
$end_hour = $smarray['hours'];
$end_minute = $smarray['minutes'];
$ne_enddate = $ecal_class->full_date($ne_end);
}
else
{ // New event - initialise everything
$smarray = getdate($qs[1]);
$month = $smarray['mon'];
$year = $smarray['year'];
$ne_startdate = $ecal_class->full_date($qs[1]);
$ne_hour = $smarray['hours'];
$ne_minute = $smarray['minutes'];
$end_hour = $smarray['hours'];
$end_minute = $smarray['minutes'];
$ne_enddate = $ecal_class->full_date($qs[1]);
}
$text = "
<script type=\"text/javascript\">
<!--
function calcheckform(thisform, submitted,arrstr)
{
var testresults=true;
//category create check
if(submitted == 'ne_cat_create'){
if(thisform.ne_new_category.value == ''){
alert('".EC_LAN_134."');
return FALSE;
}else{
return TRUE;
}
}
function calcdate(thisval)
{
var temp1;
temp1 = thisval.split(\"-\");
switch (arrstr)
{
case 2 : return temp1[2]+temp1[1]+temp1[0];
case 3 : return temp1[2]+temp1[0]+temp1[1];
default : return temp1[0]+temp1[1]+temp1[2];
}
return 'Error';
}
//event check - dates are text strings
var sdate = calcdate(thisform.start_date.value);
var edate = calcdate(thisform.end_date.value);
if (edate < sdate)
{ // Update end date if its before start date
thisform.end_date.value = thisform.start_date.value;
// alert('End date changed');
}
sdate = calcdate(thisform.start_date.value) + thisform.ne_hour.options[thisform.ne_hour.selectedIndex].value + thisform.ne_minute.options[thisform.ne_minute.selectedIndex].value;
edate = calcdate(thisform.end_date.value) + thisform.end_hour.options[thisform.end_hour.selectedIndex].value + thisform.end_minute.options[thisform.end_minute.selectedIndex].value;
// alert('Format: ' + arrstr + ' Start date: '+ sdate + ' End date: ' + edate);
testresults=true;
if (edate <= sdate && !thisform.allday.checked && testresults )
{
alert('".EC_LAN_99."');
testresults=false;
}
if ((thisform.ne_title.value=='' || thisform.ne_event.value=='') && testresults)
{
alert('".EC_LAN_98."');
testresults=false;
}
if (testresults)
{
if (thisform.subbed.value=='no')
{
thisform.subbed.value='yes';
testresults=true;
}
else
{
alert('".EC_LAN_113."');
return false;
}
}
return testresults;
}
-->
</script>";
$text .= "
<form method='post' action='".e_SELF."' id='linkform' onsubmit='return calcheckform(this, submitted,{$ecal_class->java_format_code})'>
<table style='width:98%' class='fborder' >";
if ($action == "ed")
{
$caption = EC_LAN_66; // edit Event
} elseif ($action == "ne")
{
$caption = EC_LAN_28; // Enter New Event
}
else
{
$caption = EC_LAN_83;
}
$text .= "
<tr>
<td class='forumheader3' style='width:20%'>".EC_LAN_72." </td>
<td class='forumheader3' style='width:80%'> ".EC_LAN_67." ";
$text .= make_calendar("start_date",$ne_startdate)."&nbsp;&nbsp;&nbsp;".EC_LAN_73." ".make_calendar("end_date",$ne_enddate);
$text .= "
</td>
</tr>
<tr>
<td class='forumheader3' style='width:20%'>".EC_LAN_71." </td>
<td class='forumheader3' style='width:80%'>
".EC_LAN_67;
$text .= make_hourmin("ne_",$ne_hour,$ne_minute)."&nbsp;&nbsp;".EC_LAN_73.make_hourmin('end_',$end_hour,$end_minute);
$text .= "<br /><input type='checkbox' name='allday' value='1' ".(isset($allday) && $allday == 1 ? "checked='checked'" :"")." />";
$text .= EC_LAN_64."
</td>
</tr>
<tr>
<td class='forumheader3' style='width:20%'>".EC_LAN_65."</td>
<td class='forumheader3' style='width:80%'>";
$text .= "<input type='checkbox' name='recurring' value='1' ".(isset($recurring) && $recurring == 1 ? "checked='checked'" : "")." />";
$text .= EC_LAN_63."
</td>
</tr>
<tr>
<td class='forumheader3' style='width:20%'>".EC_LAN_70." *</td>
<td class='forumheader3' style='width:80%'>
<input class='tbox' type='text' name='ne_title' size='75' value='".(isset($ne_title) ? $ne_title : "")."' maxlength='200' style='width:95%' />
</td>
</tr>
<tr>
<td class='forumheader3' style='width:20%'>".EC_LAN_52." </td>
<td class='forumheader3' style='width:80%'>
<select name='ne_category' class='tbox'>";
// Check if supervisor, if so get all categories, otherwise just get those the user is allowed to see
$cal_arg = ($ecal_class->cal_super ? "" : "find_in_set(event_cat_addclass,'".USERCLASS_LIST."')");
if ($sql->db_Select("event_cat", "*", $cal_arg))
{
while ($row = $sql->db_Fetch())
{
$text .= "<option value='{$row['event_cat_id']}' ".(isset($ne_category) && $ne_category == $row['event_cat_id'] ? "selected='selected'" :"")." >".$row['event_cat_name']."</option>";
}
}
else
{
$text .= "<option value=''>".EC_LAN_91."</option>";
}
$text .= "</select>
</td>
</tr>";
// * *BK* Check if the add class is appropriate for adding new categories
// * *BK* It will default to everybody class when created. Need to go in to admin categories if
// * *BK* you want to change read class.
if (FALSE && check_class($pref['eventpost_addcat']) && $action != "ed")
{
require_once(e_HANDLER."file_class.php");
$fi = new e_file;
$imagelist = $fi->get_files(e_PLUGIN."calendar_menu/images", "\.\w{3}$");
$text .= "<tr>
<td class='forumheader3' style='width:20%' rowspan='2'>".EC_LAN_53." </td>
<td class='forumheader3' style='width:80%'>".EC_LAN_54."
<input class='tbox' type='text' name='ne_new_category' size='30' value='".(isset($ne_new_category) ? $ne_new_category : "")."' maxlength='100' style='width:95%' /> ";
$text .= "</td></tr>
<tr><td class='forumheader3' style='width:80%'>".EC_LAN_55;
$text .= " <input class='tbox' style='width:150px' type='text' id='ne_new_category_icon' name='ne_new_category_icon' />";
$text .= " <input class='button' type='button' style='width: 45px; cursor:hand;' value='".EC_LAN_90."' onclick='expandit(\"cat_icons\")' />";
$text .= "<div style='display:none' id='cat_icons'>";
foreach($imagelist as $img){
if ($img['fname']){
$text .= "<a href=\"javascript:insertext('".$img['fname']."','ne_new_category_icon','cat_icons')\"><img src='".e_PLUGIN."calendar_menu/images/".$img['fname']."' style='border:0px' alt='' /></a> ";
}
}
$text .= "</div>";
$text .= "<div style='text-align:center'>
<input class='button' type='submit' name='ne_cat_create' value='".EC_LAN_56."' onclick='submitted=this.name' /></div>
</td>
</tr>";
}
$text .= "
<tr>
<td class='forumheader3' style='width:20%'>".EC_LAN_32." </td>
<td class='forumheader3' style='width:80%'>
<input class='tbox' type='text' name='ne_location' size='60' value='".(isset($ne_location) ? $ne_location : "")."' maxlength='200' style='width:95%' />
</td>
</tr>
<tr>
<td class='forumheader3' style='width:20%'>".EC_LAN_57." *</td>
<td class='forumheader3' style='width:80%'>
<textarea class='tbox' name='ne_event' cols='59' rows='8' style='width:95%'>".(isset($ne_event) ? $ne_event : "")."</textarea>
</td>
</tr>";
// * *BK*
// * *BK* Only display for forum thread if it is required. No point in being in if not wanted
// * *BK* or if forums are inactive
// * *BK*
if (isset($pref['eventpost_forum']) && $pref['eventpost_forum'] == 1)
{
$text .= "
<tr>
<td class='forumheader3' style='width:20%'>".EC_LAN_58." </td>
<td class='forumheader3' style='width:80%'>
<input class='tbox' type='text' name='ne_thread' size='60' value='".(isset($ne_thread) ? $ne_thread : "")."' maxlength='100' style='width:95%' />
</td>
</tr>";
}
// * *BK*
// * *BK* If the user is logged in and has their email set plus the field is empty then put in
// * *BK* their email address. They can always take it out if they want, its not a required field
if (empty($ne_email) && ($action == "ne") && defined('USEREMAIL'))
{
$ne_email = USEREMAIL;
}
$text .= "
<tr>
<td class='forumheader3' style='width:20%'>".EC_LAN_59." </td>
<td class='forumheader3' style='width:80%'>
<input class='tbox' type='text' name='ne_email' size='60' value='$ne_email' maxlength='150' style='width:95%' />
</td></tr>
<tr>
<td class='forumheader3' colspan='2' >".EC_LAN_105." </td>
</tr>
<tr>
<td class='forumheader' colspan='2' style='text-align:center'>";
if ($action == "ed")
{
$text .= "<input class='button' type='submit' name='ne_update' value='".EC_LAN_60."' onclick='submitted=this.name' />
<input type='hidden' name='id' value='".$qs[1]."' />";
}
else
{
$text .= "<input class='button' type='submit' name='ne_insert' value='".EC_LAN_28."' onclick='submitted=this.name' />";
}
$text .= "<input type='hidden' name='qs' value='".e_QUERY."' /></td>
</tr>
</table>
</form>";
$ns->tablerender($caption, $text);
require_once(FOOTERF);
exit;
}
else
{
header("location:".e_PLUGIN."calendar_menu/event.php");
exit;
}
} // End of "Enter New Event
//-----------------------------------------------
// show events
// $month, $year have the month required
//-----------------------------------------------
$monthstart = mktime(0, 0, 0, $month, 1, $year);
$firstdayarray = getdate($monthstart);
$monthend = mktime(0, 0, 0, $month + 1, 1, $year) -1 ;
$lastdayarray = getdate($monthend);
$prevmonth = ($month-1);
$prevyear = $year;
if ($prevmonth == 0)
{
$prevmonth = 12;
$prevyear = ($year-1);
}
$previous = mktime(0, 0, 0, $prevmonth, 1, $prevyear);
$nextmonth = ($month + 1);
$nextyear = $year;
if ($nextmonth == 13)
{
$nextmonth = 1;
$nextyear = ($year + 1);
}
$prop = mktime(0, 0, 0, $month, 1, $year); // Sets start date for new event entry
$next = mktime(0, 0, 0, $nextmonth, 1, $nextyear); // Used by nav buttons
$nowmonth = $ecal_class->cal_date['mon'];
$nowyear = $ecal_class->cal_date['year'];
$py = $year-1;
$prevlink = mktime(0, 0, 0, $month, 1, $py);
$ny = $year + 1;
$nextlink = mktime(0, 0, 0, $month, 1, $ny);
if (is_readable(THEME."calendar_template.php"))
{ // Has to be require
require(THEME."calendar_template.php");
}
else
{
require(e_PLUGIN."calendar_menu/calendar_template.php");
}
$text2 = "";
// time switch buttons
$text2 .= $tp -> parseTemplate($CALENDAR_TIME_TABLE, FALSE, $calendar_shortcodes);
// navigation buttons
$text2 .= $tp -> parseTemplate($CALENDAR_NAVIGATION_TABLE, FALSE, $calendar_shortcodes);
// ****** CAUTION - the category dropdown also used $sql object - take care to avoid interference!
$event = array();
$extra = '';
if ($ds == "event")
{ // Show single event
$qry = "
SELECT e.*, ec.*
FROM #event as e
LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
WHERE e.event_id='".intval($eveid)."'
{$ecal_class->extra_query}
";
$sql2->db_Select_gen($qry);
$row = $sql2->db_Fetch();
if ($row['event_recurring']=='1') // Single event, selected by ID. So day/month must match
{
$row['event_start'] = mktime(0,0,0,$row['event_rec_y'],$row['event_rec_m'],$year);
$row['event_end'] = $row['event_start'];
}
$event[] = $row;
$next10_start = $event[0]['event_start'];
$text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE_START, FALSE, $calendar_shortcodes);
$text2 .= show_event($event);
$text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE_END, FALSE, $calendar_shortcodes);
}
else
{
if ($ds == 'one')
{ // Show events from one day
$tmp = getdate($action);
$selected_day = $tmp['mday'];
$selected_mon = $tmp['mon'];
$start_time = $action;
$end_time = $action + 86399;
$next10_start = $end_time + 1;
$cap_title = " - ".$months[$selected_mon-1]." ".$selected_day;
$extra = " OR (e.event_rec_y = ".intval($selected_mon)." AND e.event_rec_m = ".intval($selected_day).") ";
}
else
{ // Display whole of selected month
$start_time = $monthstart;
$end_time = $monthend;
$next10_start = $end_time + 1;
$cap_title = '';
$extra = " OR e.event_rec_y = ".intval($month)." ";
}
$qry = "
SELECT e.*, ec.*
FROM #event as e
LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id WHERE (e.event_recurring = '0' AND
((e.event_start >= ".intval($start_time)." AND e.event_start <= ".intval($end_time).")
OR (e.event_end >= ".intval($start_time)." AND e.event_end <= ".intval($end_time).")
OR (e.event_start <= ".intval($start_time)." AND e.event_end >= ".intval($end_time).") )
{$extra})
{$category_filter}
{$ecal_class->extra_query}
ORDER BY e.event_start ASC
";
// Query generates a list of event IDs in $idarray which meet the criteria.
// $idarray has one primary index location for each day of month, then secondary for events.
if ($cal_count=$sql->db_Select_gen($qry))
{
while ($row = $sql->db_Fetch())
{
if ($row['event_recurring']=='1') // Recurring events
{
if (($row['event_rec_y'] == $month) && (!in_array($row['event_id'], $idArray))) // Only allow one instance of each recurring event
{
$tmp = getdate($row['event_start']);
$row['event_start'] = mktime($tmp['hours'],$tmp['minutes'],0,$row['event_rec_y'],$row['event_rec_m'],$year);
$row['event_end'] = $row['event_start'];
$events[$row['event_rec_m']][] = $row;
$idArray[] = $row['event_id'];
}
}
else
{
if ($ds == 'one')
{
if (!isset($idArray) || !is_array($idArray) || !in_array($row['event_id'], $idArray))
{
$events[$selected_day][] = $row;
$idArray[] = $row['event_id'];
}
}
else
{ // Multiple events
if ($row['event_start'] < intval($start_time))
{
$start_day = "1"; // Event starts before this month
}
else
{
$tmp = getdate($row['event_start']);
$start_day = $tmp['mday'];
}
if ($row['event_end'] < $row['event_start'])
{ // End date before start date
$end_day = $start_day;
}
else
{
if ($row['event_end'] > intval($end_time))
{
$end_day = "31"; // Event ends after this month
}
else
{
$tmp = getdate($row['event_end']);
$end_day = $tmp['mday'];
}
}
for ($i = $start_day; $i <= $end_day; $i++)
{
if (!isset($idArray) || !is_array($idArray) || !in_array($row['event_id'], $idArray))
{
$events[$i][] = $row;
$idArray[] = $row['event_id'];
}
}
}
}
}
}
}
// event list
if(isset($events) && is_array($events))
{
$text2 .= $tp -> parseTemplate($EVENT_EVENTLIST_TABLE_START, FALSE, $calendar_shortcodes);
foreach ($events as $dom => $event){
$text2 .= show_event($event);
}
$text2 .= $tp -> parseTemplate($EVENT_EVENTLIST_TABLE_END, FALSE, $calendar_shortcodes);
}
/*
$nextmonth = mktime(0, 0, 0, $month + 1, 1, $year)-1;
if (!isset($next10_start))
{
$next10_start = $nextmonth;
}
*/
// Show next 10 events after current event/day/month (doesn't show recurring events)
$qry = "
SELECT e.* FROM #event AS e
LEFT JOIN #event_cat AS ec ON e.event_category = ec.event_cat_id
WHERE e.event_start > '".intval($next10_start)."' {$ecal_class->extra_query} {$category_filter}
ORDER BY e.event_start ASC
LIMIT 0, 10
";
$num = $sql->db_Select_gen($qry);
if ($num != 0)
{
$gen = new convert;
$archive_events = "";
// while ($events = $sql->db_Fetch())
while ($thisevent = $sql->db_Fetch())
{
$archive_events .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE, FALSE, $calendar_shortcodes);
}
}
else
{
$archive_events = $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_EMPTY, FALSE, $calendar_shortcodes);
}
$text2 .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_START, FALSE, $calendar_shortcodes);
$text2 .= $archive_events;
$text2 .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_END, FALSE, $calendar_shortcodes);
$caption = EC_LAN_80; // "Event List";
$ns->tablerender($caption.(isset($cap_title) ? $cap_title : ""), $text2);
require_once(FOOTERF);
// Display one event in a form which can be expanded.
function show_event($day_events)
{
global $tp, $cal_super, $_POST, $ds, $thisevent, $EVENT_ID, $EVENT_EVENT_TABLE, $calendar_shortcodes, $event_author_id, $event_author_name;
$text2 = "";
foreach($day_events as $event)
{
$thisevent = $event;
$gen = new convert;
$lp = explode(".", $thisevent['event_author'],2);
if (preg_match("/[0-9]+/", $lp[0]))
{
$event_author_id = $lp[0];
$event_author_name = $lp[1];
}
$text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE, FALSE, $calendar_shortcodes);
}
return $text2;
}
function headerjs()
{
global $cal;
$script = $cal->load_files();
/*
$script .= "
<script type=\"text/javascript\">
<!--
function calcheckform(thisform)
{
var testresults=true;
var temp;
temp = thisform.start_date.value.split(\"-\");
var sdate = temp[0] + temp[1] + temp[2] + thisform.ne_hour.options[thisform.ne_hour.selectedIndex].value + thisform.ne_minute.options[thisform.ne_minute.selectedIndex].value
temp = thisform.end_date.value.split(\"-\");
var edate = temp[0] + temp[1] + temp[2] + thisform.end_hour.options[thisform.end_hour.selectedIndex].value + thisform.end_minute.options[thisform.end_minute.selectedIndex].value
testresults=true;
if (edate <= sdate && !thisform.allday.checked && testresults )
{
alert('".EC_LAN_99."');
testresults=false;
}
if ((thisform.ne_title.value=='' || thisform.ne_event.value=='') && testresults)
{
alert('".EC_LAN_98."');
testresults=false;
}
if (testresults)
{
if (thisform.subbed.value=='no')
{
thisformm.subbed.value='yes';
testresults=true;
}
else
{
alert('".EC_LAN_113."');
return false;
}
}
return testresults;
}
-->
</script>";
*/
return $script;
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

View File

@@ -0,0 +1,380 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| ?Steve Dun.an 2001-2002
| http://e107.org
| jali.@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/languages/English.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:50 $
| $Author: mcfly_e107 $
|
| Various mods by steved:
| a) To reflect updates
| b) To reflect CVS update to version 1.14 made 29.10.06
+----------------------------------------------------------------------------+
*/
define('EC_ADLAN_1', "Event Calendar");
define('EC_ADLAN_2', "Configure Event Calendar");
define('EC_INSTALL', "Install Event Calendar");
define('EC_UNINSTALL', "Uninstall Event Calendar");
define('EC_LAN_TODAY', "today");
define('EC_LAN_DAY_1', "1");
define('EC_LAN_DAY_2', "2");
define('EC_LAN_DAY_3', "3");
define('EC_LAN_DAY_4', "4");
define('EC_LAN_DAY_5', "5");
define('EC_LAN_DAY_6', "6");
define('EC_LAN_DAY_7', "7");
define('EC_LAN_DAY_8', "8");
define('EC_LAN_DAY_9', "9");
define('EC_LAN_DAY_10', "10");
define('EC_LAN_DAY_11', "11");
define('EC_LAN_DAY_12', "12");
define('EC_LAN_DAY_13', "13");
define('EC_LAN_DAY_14', "14");
define('EC_LAN_DAY_15', "15");
define('EC_LAN_DAY_16', "16");
define('EC_LAN_DAY_17', "17");
define('EC_LAN_DAY_18', "18");
define('EC_LAN_DAY_19', "19");
define('EC_LAN_DAY_20', "20");
define('EC_LAN_DAY_21', "21");
define('EC_LAN_DAY_22', "22");
define('EC_LAN_DAY_23', "23");
define('EC_LAN_DAY_24', "24");
define('EC_LAN_DAY_25', "25");
define('EC_LAN_DAY_26', "26");
define('EC_LAN_DAY_27', "27");
define('EC_LAN_DAY_28', "28");
define('EC_LAN_DAY_29', "29");
define('EC_LAN_DAY_30', "30");
define('EC_LAN_DAY_31', "31");
define('EC_LAN_0', "January");
define('EC_LAN_1', "February");
define('EC_LAN_2', "March");
define('EC_LAN_3', "April");
define('EC_LAN_4', "May");
define('EC_LAN_5', "June");
define('EC_LAN_6', "July");
define('EC_LAN_7', "August");
define('EC_LAN_8', "September");
define('EC_LAN_9', "October");
define('EC_LAN_10', "November");
define('EC_LAN_11', "December");
define('EC_LAN_JAN', "Jan");
define('EC_LAN_FEB', "Feb");
define('EC_LAN_MAR', "Mar");
define('EC_LAN_APR', "Apr");
define('EC_LAN_MAY', "May");
define('EC_LAN_JUN', "Jun");
define('EC_LAN_JUL', "Jul");
define('EC_LAN_AUG', "Aug");
define('EC_LAN_SEP', "Sep");
define('EC_LAN_OCT', "Oct");
define('EC_LAN_NOV', "Nov");
define('EC_LAN_DEC', "Dec");
define('EC_LAN_12', "Monday");
define('EC_LAN_13', "Tuesday");
define('EC_LAN_14', "Wednesday");
define('EC_LAN_15', "Thursday");
define('EC_LAN_16', "Friday");
define('EC_LAN_17', "Saturday");
define('EC_LAN_18', "Sunday");
define('EC_LAN_19', "Mon");
define('EC_LAN_20', "Tue");
define('EC_LAN_21', "Wed");
define('EC_LAN_22', "Thu");
define('EC_LAN_23', "Fri");
define('EC_LAN_24', "Sat");
define('EC_LAN_25', "Sun");
define('EC_LAN_26', "Events this Month");
define('EC_LAN_27', "No events for this month.");
define('EC_LAN_28', "Enter New Event");
define('EC_LAN_29', "When:");
define('EC_LAN_30', "Category:");
define('EC_LAN_31', "Posted by:");
define('EC_LAN_32', "Location:");
define('EC_LAN_33', "Contact:");
define('EC_LAN_34', "Jump to");
define('EC_LAN_35', "Edit");
define('EC_LAN_36', "Delete");
define('EC_LAN_37', "None Listed.");
define('EC_LAN_38', "Not specified");
define('EC_LAN_39', "Click here for more information");
define('EC_LAN_40', "Current Month");
define('EC_LAN_41', "New category created.");
define('EC_LAN_42', "Event cannot end before it starts.");
define('EC_LAN_43', "You left required field(s) blank.");
define('EC_LAN_44', "New event created and entered into database.");
define('EC_LAN_45', "Event updated in database.");
define('EC_LAN_46', "Confirm Delete Event");
define('EC_LAN_47', "Delete cancelled.");
define('EC_LAN_48', "Please confirm you wish to delete this event - once deleted it cannot be retrieved");
define('EC_LAN_49', "Cancel");
define('EC_LAN_50', "Confirm Delete");
define('EC_LAN_51', "Event deleted.");
define('EC_LAN_52', "Event Category:");
define('EC_LAN_53', "Create new category?:");
define('EC_LAN_54', "Name:");
define('EC_LAN_55', "Icon:");
define('EC_LAN_56', "Create");
define('EC_LAN_57', "Event:");
define('EC_LAN_58', "source info URL:");
define('EC_LAN_59', "Contact email:");
define('EC_LAN_60', "Update Event");
define('EC_LAN_61', "Go");
define('EC_LAN_62', "Next -NUM- Events ...");
define('EC_LAN_63', "Check this if event happens on same day every year, e.g. birthday");
define('EC_LAN_64', "Check for an all-day event");
define('EC_LAN_65', "Recurring:");
define('EC_LAN_66', "Edit Event");
define('EC_LAN_67', "Start:");
define('EC_LAN_68', "All day event:");
define('EC_LAN_69', "Ends:");
define('EC_LAN_70', "Event Title:");
define('EC_LAN_71', "Event Time:");
define('EC_LAN_72', "Event Date:");
define('EC_LAN_73', "End:");
//define('edesc_LAN_0', "Count Down");
//define('edesc_LAN_1', "Still ");
//define('edesc_LAN_2', "before event on ".SITENAME);
//define('edesc_LAN_3', "sec");
//define('edesc_LAN_4', "secs");
//define('edesc_LAN_5', "min");
//define('edesc_LAN_6', "mins");
//define('edesc_LAN_7', "h");
//define('edesc_LAN_8', "h");
//define('edesc_LAN_9', "day");
//define('edesc_LAN_10', "days");
define('EC_LAN_VIEWCALENDAR', "View Calendar");
define('EC_LAN_VIEWALLEVENTS', "View all events");
define('EC_LAN_ALLEVENTS', "All events");
define('EC_LAN_74', "View Category");
// ADMIN
define('EC_LAN_75', "Calendar settings updated.");
define('EC_LAN_76', "Events can be added by:");
define('EC_LAN_77', "Update Settings");
define('EC_LAN_78', "Calendar Settings");
define('EC_LAN_79', "Calendar View");
define('EC_LAN_80', "Event List");
define('EC_LAN_81', "Configure Event Calendar");
define('EC_LAN_82', "To activate please go to your menus screen and select the calendar_menu into one of your menu areas.");
define('EC_LAN_83', "Calendar");
//define('EC_LAN_84', "Css element to use for day header");
//define('EC_LAN_85', "Default is 'forumheader'");
//define('EC_LAN_86', "Css element to use for day list");
//define('EC_LAN_87', "Default is 'forumheader3'");
//define('EC_LAN_88', "Css element to use for selected day");
//define('EC_LAN_89', "Default is 'indent'");
// *BK* Corrections to hard coding by Barry
define('EC_LAN_90', "Choose");
define('EC_LAN_91', "None defined");
define('EC_LAN_92', "View Category");
define('EC_LAN_93', "View Events List");
define('EC_LAN_94', "Enter New Event");
define('EC_LAN_95', "Today");
define('EC_LAN_96', "View Calendar");
define('EC_LAN_97', "All");
define('EC_LAN_98', "Required fields left blank");
define('EC_LAN_99', "Event must either be an all day event or finish after it starts");
//define('EC_LAN_100', "Categories can be added by");
//define('EC_LAN_101', "Set to inactive to disable on the new event form.");
define('EC_LAN_102', "Show link to 'more information' with events");
//define('EC_LAN_103', "On new event entry form.");
define('EC_LAN_104', "Calendar Administrator Class");
define('EC_LAN_105', "* Required Field");
define('EC_LAN_106', "Events");
define('EC_LAN_107', "This plugin is a fully featured event calendar with calendar menu.");
define('EC_LAN_108', "Event Calendar Upgraded. See the 'readme.pdf' file for detailed information.");
define('EC_LAN_109', "Unable to delete this event.");
define('EC_LAN_110', "Event Number ");
define('EC_LAN_111', "All the events on ");
define('EC_LAN_112', "All the Events in ");
define('EC_LAN_113', "Event form already submitted.");
define('EC_LAN_114', "Week starts with:");
define('EC_LAN_115', "Sunday");
define('EC_LAN_116', "Monday");
define('EC_LAN_117', "Length of daynames (characters)");
define('EC_LAN_118', "Date format in calendar header:");
define('EC_LAN_119', "month/year");
define('EC_LAN_120', "year/month");
define('EC_LAN_121', "Show Calendar");
//define('EC_LAN_122', "Css element to show events on this day (menu)");
define('EC_LAN_123', "Subscriptions");
define('EC_LAN_124', "Calendar Subscriptions");
define('EC_LAN_125', "Categories available for subscription");
define('EC_LAN_126', "Subscribed");
define('EC_LAN_127', "Category");
define('EC_LAN_128', "No categories available to subscribe to");
define('EC_LAN_129', "Update");
define('EC_LAN_130', "Subscriptions updated");
define('EC_LAN_131', "Return");
define('EC_LAN_132', "Expand details");
define('EC_LAN_133', "[read more]");
define('EC_LAN_134', "You have to provide a category name");
define('EC_LAN_135', "Event");
define('EC_LAN_136', "Category Description");
define('EC_LAN_137', "Future Events");
// Added 12.07.06 for next_event_menu.php
define('EC_LAN_140', "Forthcoming Events");
define('EC_LAN_141', "No forthcoming events");
define('EC_LAN_142', "Only registered and logged in users can subscribe to events");
define('EC_LAN_143', "Facility not available");
define('EC_LAN_144', " at ");
define('EC_ADLAN_A10', "Configuration");
define('EC_ADLAN_A11', "Categories");
define('EC_ADLAN_A12', "Calendar");
define('EC_ADLAN_A13', "Edit");
define('EC_ADLAN_A14', "New");
define('EC_ADLAN_A15', "Delete");
define('EC_ADLAN_A16', "Confirm");
define('EC_ADLAN_A17', "Proceed");
define('EC_ADLAN_A18', "Action");
define('EC_ADLAN_A19', "Administer Categories");
define('EC_ADLAN_A20', "Calendar Categories");
define('EC_ADLAN_A21', "Category name");
define('EC_ADLAN_A23', "Create category");
define('EC_ADLAN_A24', "Edit category");
define('EC_ADLAN_A25', "Save");
define('EC_ADLAN_A26', "Category created");
define('EC_ADLAN_A27', "Unable to create category");
define('EC_ADLAN_A28', "Changes Saved");
define('EC_ADLAN_A29', "Unable to save changes");
define('EC_ADLAN_A30', "Category Deleted");
define('EC_ADLAN_A31', "Tick the confirm box to delete");
define('EC_ADLAN_A32', "Unable to delete this category");
define('EC_ADLAN_A33', "None defined");
define('EC_ADLAN_A34', "Calendar Administrator Class");
define('EC_ADLAN_A35', "");
define('EC_ADLAN_A59', "Category is in use. Can not delete.");
define('EC_ADLAN_A80', "Visible to");
define('EC_ADLAN_A81', "Allow subscription");
define('EC_ADLAN_A82', "Forced notification class");
define('EC_ADLAN_A83', "Days ahead to notify of event");
define('EC_ADLAN_A84', "Advanced message");
define('EC_ADLAN_A85', "Message on the day");
define('EC_ADLAN_A86', "Send email");
define('EC_ADLAN_A87', "None");
define('EC_ADLAN_A88', "Only advanced");
define('EC_ADLAN_A89', "Only on the day");
define('EC_ADLAN_A90', "Advanced and on the day");
define('EC_ADLAN_A91', "Email Subject");
define('EC_ADLAN_A92', "Email from (name)");
define('EC_ADLAN_A93', "Email from email address");
define('EC_ADLAN_A94', "Add new event class");
define('EC_ADLAN_A95', "Enable manual subscriptions");
define('EC_ADLAN_A96', "Disabling this removes the subscriptions button and overrides the category manual subscription setting.");
//define('EC_ADLAN_A97', "If set to force subscriptions this category will not be displayed in the available subscription list for the user.");
// Added from here 12.07.06 for forthcoming events and mailout upgrades
define('EC_ADLAN_A100', "Forthcoming Events");
define('EC_ADLAN_A101', "Days to look forward:");
define('EC_ADLAN_A102', "Number of events to display:");
define('EC_ADLAN_A103', "Include recurring events:");
define('EC_ADLAN_A104', "Title is link to events list:");
define('EC_ADLAN_A105', "Configure Forthcoming Events Menu");
define('EC_ADLAN_A106', "Menu has to be enabled on the 'Menu' page");
define('EC_ADLAN_A107', "Will not work reliably if looking forward more than 59 days");
define('EC_ADLAN_A108', "Menu Heading");
define('EC_ADLAN_A109', "Forthcoming Events preferences updated");
define('EC_ADLAN_A110', "Only on previous day");
define('EC_ADLAN_A111', "Advanced and previous day");
define('EC_ADLAN_A112', "Previous day and on the day");
define('EC_ADLAN_A113', "Advanced, previous day and on the day");
define('EC_ADLAN_A114', "Logging of Emails");
define('EC_ADLAN_A115', "Summary");
define('EC_ADLAN_A116', "Detailed");
define('EC_ADLAN_A117', "Message on the day or the previous day");
define('EC_ADLAN_A118', "Categories to display");
define('EC_ADLAN_A119', "No categories defined, or error reading database");
define('EC_ADLAN_A120', "Show category icon in menu");
define('EC_ADLAN_A121', "Category Description");
define('EC_ADLAN_A122', "Calendar time reference");
define('EC_ADLAN_A123', "Calendar time format");
define('EC_ADLAN_A124', "Current server time: ");
define('EC_ADLAN_A125', "Current site time: ");
define('EC_ADLAN_A126', "Current user time: ");
define('EC_ADLAN_A127', "Determines time display format throughout event calendar.");
define('EC_ADLAN_A128', "Custom time uses the format in the box on the right");
define('EC_ADLAN_A129', '"Site Time" uses the offset defined in preferences');
define('EC_ADLAN_A130', "Event name is link to:");
define('EC_ADLAN_A131', "Calendar Event");
define('EC_ADLAN_A132', "Source Info URL");
define('EC_ADLAN_A133', "Date format for event entry: ");
define('EC_ADLAN_A134', "Level of logging to main admin log:");
define('EC_ADLAN_A135', "Edit/delete");
define('EC_ADLAN_A136', "All changes");
define('EC_ADLAN_A137', "Can cover additions, updates to and deletions from the event list");
define('EC_ADLAN_A138', "Event start/end times on 5-minute boundaries");
define('EC_ADLAN_A139', "(Reduces number of entries in drop-down list)");
define('EC_ADLAN_A140', "Show number of events for this month in Calendar Menu");
define('EC_ADLAN_A141', "Maintenance");
define('EC_ADLAN_A142', "Remove past events ending more than x months ago");
define('EC_ADLAN_A143', "timed from beginning of current month");
define('EC_ADLAN_A144', "Event Calendar Maintenance");
define('EC_ADLAN_A145', "Delete old entries");
define('EC_ADLAN_A146', "Events older than ");
define('EC_ADLAN_A147', " deleted");
define('EC_ADLAN_A148', "Parameter error - nothing deleted");
define('EC_ADLAN_A149', "No old events to delete, or delete of past events failed");
define('EC_ADLAN_A150', "Confirm delete events older than ");
define('EC_ADLAN_A151', "e107 Web Site");
define('EC_ADLAN_A152', "calendar@yoursite.com");
define('EC_ADLAN_A153', "Log directory must be created manually - create a subdirectory 'log' off your event calendar plugin directory, with '666' access rights");
define('EC_ADLAN_A154', "Could not change log directory permissions");
define('EC_ADLAN_A155', "Log directory permissions may require manual update to 0666 or 0766, although depending on your server setup they may work");
define('EC_ADLAN_A156', "Database upgraded");
define('EC_ADLAN_A157', "this is the rss feed for the calendar entries");
define('EC_ADLAN_A158', "Could not create log directory");
define('EC_ADLAN_A159', "Cache Management");
define('EC_ADLAN_A160', "(Only relevant if cache enabled)");
define('EC_ADLAN_A161', "Empty Calendar Cache");
define('EC_ADLAN_A162', "Confirm Empty Cache");
define('EC_ADLAN_A163', "Cache emptied");
define('EC_ADLAN_A164', "Update completed");
define('EC_ADLAN_A165', "Calendar menu header links to:");
define('EC_ADLAN_A166', "Date display in Event List:");
define('EC_ADLAN_A167', "Date display in Forthcoming Events:");
define('EC_ADLAN_A168', "Custom date uses the format in the box on the right");
define('EC_ADLAN_A169', "Determines date display format for event listings");
define('EC_ADLAN_A170', "Determines date display format for forthcoming events menu");
define('EC_ADLAN_A171', "Flag recently added/updated events");
define('EC_ADLAN_A172', "Value is time from update in hours; zero to disable");
// Notify
define("NT_LAN_EC_1", "Event Calendar Events");
define("NT_LAN_EC_2", "Event Updated");
define("NT_LAN_EC_3", "Update by");
define("NT_LAN_EC_4", "IP Address");
define("NT_LAN_EC_5", "Message");
define("NT_LAN_EC_6", "Event Calendar - Event added");
define("NT_LAN_EC_7", "New event posted");
define("NT_LAN_EC_8", "Event Calendar - Event modified");
?>

View File

@@ -0,0 +1,5 @@
<?php
define("CM_SCH_LAN_1", "Calendar");
?>

View File

@@ -0,0 +1,153 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/next_event_menu.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:47 $
| $Author: mcfly_e107 $
|
| 09.11.06 - Cache support added, templating/shortcode tweaks
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
global $ecal_dir, $tp;
$ecal_dir = e_PLUGIN . "calendar_menu/";
global $ecal_class;
require_once($ecal_dir."ecal_class.php");
$ecal_class = new ecal_class;
$cache_tag = "nq_event_cal_next";
// See if the page is already in the cache
if($cacheData = $e107cache->retrieve($cache_tag, $ecal_class->max_cache_time))
{
echo $cacheData;
return;
}
include_lan(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php");
// Values defined through admin pages
$menu_title = $pref['eventpost_menuheading'];
$days_ahead = $pref['eventpost_daysforward'];
$show_count = $pref['eventpost_numevents'];
$show_recurring = $pref['eventpost_checkrecur'];
$link_in_heading = $pref['eventpost_linkheader'];
// Now set defaults for anything not defined
if (!$menu_title) $menu_title = EC_LAN_140;
if (!$days_ahead) $days_ahead = 30; // Number of days ahead to go
if (!$show_count) $show_count = 3; // Number of events to show
if (!$show_recurring) $show_recurring = 1; // Zero to exclude recurring events
if (!$link_in_heading) $link_in_heading = 0; // Zero for simple heading, 1 to have clickable link
require($ecal_dir."calendar_shortcodes.php");
if (is_readable(THEME."calendar_template.php"))
{ // Needs to be require in case second
require(THEME."calendar_template.php");
}
else
{
require($ecal_dir."calendar_template.php");
}
$site_time = $ecal_class->cal_timedate;
$end_time = $site_time + (86400 * $days_ahead);
// Build up query bit by bit
$cal_qry = "SELECT e.event_id, e.event_rec_m, e.event_rec_y, e.event_start, e.event_thread, e.event_title, e.event_recurring, e.event_allday, ec.*
FROM #event as e LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
WHERE (((e.event_start >= {$site_time} AND e.event_start < {$end_time}))";
if ($show_recurring > 0)
{ // This won't work properly under some circumstances if $days_ahead is greater than the number of days in the current month plus next month.
// If that matters, need another test on event_rec_y (which is actually the month) - plus the calculation to generate the values
$cal_datearray = $ecal_class->cal_date;
$first_day = $cal_datearray['mday'];
$first_month = $cal_datearray['mon'];
$end_date = mktime(0,0,0,$first_month,$first_day,0) + (86400 * $days_ahead);
$end_datearray = getdate($end_date);
$last_month = $end_datearray['mon'];
$last_day = $end_datearray['mday'];
$cal_qry .= " OR ((e.event_recurring = '1')
AND ";
if ($first_month == $last_month)
{ // All dates within current month
$cal_qry .= "(((e.event_rec_y = {$first_month})
AND (e.event_rec_m >= {$first_day}) AND (e.event_rec_m < {$last_day}) ) ))";
}
else
{ // Dates overlap one or more months
$cal_qry .= "(((e.event_rec_y = {$first_month}) AND (e.event_rec_m >= {$first_day}))
OR ((e.event_rec_y = {$last_month}) AND (e.event_rec_m < {$last_day}))";
$first_month++;
if ($first_month > 12) $first_month = 1;
if ($first_month <> $last_month)
{ // Add a whole month in the middle
$cal_qry .= " OR (e.event_rec_y = {$first_month}) ";
}
$cal_qry .= "))";
}
}
$cal_qry .= ')'.$ecal_class->extra_query; // Puts in class filter if not calendar admin
if (isset($pref['eventpost_fe_set']))
{
$cal_qry .= " AND find_in_set(ec.event_cat_id,'".$pref['eventpost_fe_set']."')";
}
$cal_qry .= " order by e.event_start LIMIT {$show_count}";
$cal_totev = 0;
$cal_text = '';
$cal_row = array();
global $cal_row, $cal_totev;
$cal_totev = $sql->db_Select_gen($cal_qry);
if ($cal_totev > 0)
{
while ($cal_row = $sql->db_Fetch())
{
$cal_totev --; // Can use this to modify inter-event gap
$cal_text .= $tp->parseTemplate($EVENT_CAL_FE_LINE,FALSE,$calendar_shortcodes);
}
}
else
{
$cal_text.= EC_LAN_141;
}
$calendar_title = $menu_title;
if ($link_in_heading == 1)
{
$calendar_title = "<a class='forumlink' href='" . e_PLUGIN . "calendar_menu/event.php' >" . $menu_title . "</a>";
}
// Now handle the data, cache as well
ob_start(); // Set up a new output buffer
$ns->tablerender($calendar_title, $cal_text, 'next_event_menu');
$cache_data = ob_get_flush(); // Get the page content, and display it
$e107cache->set($cache_tag, $cache_data); // Save to cache
?>

View File

@@ -0,0 +1,280 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/plugin.php,v $
| $Revision: 1.1.1.1 $ - with mods to hopefully trigger upgrade to new version
| $Date: 2006-12-02 04:34:48 $
| $Author: mcfly_e107 $
|
| 22.07.06 - Mods for V3.6 upgrade, including log directory
| 02.08.06 - Support for category icon display added
| 29.09.06 - prefs, db field added for next batch of mods
| 03.10.06 - forced subs fields changed
| 04.10.06 - db field order changed to avoid confusing update routines
| 29.10.06 - Language mods to reflect CVS update to V1.14
| 10.11.06 - Mods for next release to CVS
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
// Plugin info -------------------------------------------------------------------------------------------------------
$lan_file = e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php";
@require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."calendar_menu/languages/English.php");
$eplug_name = EC_ADLAN_1;
$eplug_version = "3.6";
$eplug_author = "jalist / cameron / McFly / Barry / Lisa_ / steved";
$eplug_url = "http://e107.org";
$eplug_email = "jalist@e107.org";
$eplug_description = EC_LAN_107;
$eplug_compatible = "e107v7";
$eplug_readme = "readme.pdf";
// leave blank if no readme file
$eplug_compliant = TRUE;
// Name of the plugin's folder -------------------------------------------------------------------------------------
$eplug_folder = "calendar_menu";
// Name of menu item for plugin ----------------------------------------------------------------------------------
$eplug_menu_name = "calendar_menu";
// Name of the admin configuration file --------------------------------------------------------------------------
$eplug_conffile = "admin_config.php";
// Icon image and caption text ------------------------------------------------------------------------------------
$eplug_icon = $eplug_folder."/images/calendar_32.png";
$eplug_icon_small = $eplug_folder."/images/calendar_16.png";
$eplug_caption = EC_LAN_81; // "Configure Event Calendar";
$ecalSQL = new db;
$ecalSQL->db_Select("plugin", "plugin_version", "plugin_name='Event Calendar' AND plugin_installflag > 0");
list($ecalVer) = $ecalSQL->db_Fetch();
$ecalVer = preg_replace("/[a-zA-z\s]/", '', $ecalVer);
// List of preferences -----------------------------------------------------------------------------------------------
$eplug_prefs = array(
"eventpost_admin" => 0,
"eventpost_adminlog" => 0,
"eventpost_showeventcount" => 1,
"eventpost_forum" => 1,
"eventpost_recentshow" => 0,
"eventpost_super" => 0,
"eventpost_menulink" => 0,
"eventpost_dateformat" => 1,
"eventpost_fivemins" => 0,
"eventpost_weekstart" => "sun",
"eventpost_lenday" => 1,
"eventpost_caltime" => 0,
"eventpost_datedisplay" => 1,
"eventpost_timedisplay" => 0,
"eventpost_timecustom" => "%H%M",
"eventpost_dateevent" => 1,
"eventpost_datenext" => 1,
"eventpost_eventdatecustom" => "&A %d %B %Y",
"eventpost_nextdatecustom" => "%d %b",
"eventpost_mailsubject" => EC_ADLAN_12,
"eventpost_mailfrom" => EC_ADLAN_A151,
"eventpost_mailaddress" => EC_ADLAN_A152,
"eventpost_asubs" => 1,
"eventpost_emaillog" => 1,
"eventpost_menuheading" => EC_LAN_140,
"eventpost_daysforward" => 30,
"eventpost_numevents" => 3,
"eventpost_checkrecur" => 1,
"eventpost_linkheader" => 0,
"eventpost_fe_set" => "",
"eventpost_showcaticon" => 0,
"eventpost_namelink" => 1 );
// List of table names -----------------------------------------------------------------------------------------------
$eplug_table_names = array("event","event_cat","event_subs" );
// List of sql requests to create tables -----------------------------------------------------------------------------
$eplug_tables = array(
"CREATE TABLE ".MPREFIX."event (
event_id int(11) unsigned NOT NULL auto_increment,
event_start int(10) NOT NULL default '0',
event_end int(10) NOT NULL default '0',
event_allday tinyint(1) unsigned NOT NULL default '0',
event_recurring tinyint(1) unsigned NOT NULL default '0',
event_datestamp int(10) unsigned NOT NULL default '0',
event_title varchar(200) NOT NULL default '',
event_location text NOT NULL,
event_details text NOT NULL,
event_author varchar(100) NOT NULL default '',
event_contact varchar(200) NOT NULL default '',
event_category smallint(5) unsigned NOT NULL default '0',
event_thread varchar(100) NOT NULL default '',
event_rec_m tinyint(2) unsigned NOT NULL default '0',
event_rec_y tinyint(2) unsigned NOT NULL default '0',
PRIMARY KEY (event_id)
) TYPE=MyISAM;",
"CREATE TABLE ".MPREFIX."event_cat (
event_cat_id smallint(5) unsigned NOT NULL auto_increment,
event_cat_name varchar(100) NOT NULL default '',
event_cat_icon varchar(100) NOT NULL default '',
event_cat_class int(10) unsigned NOT NULL default '0',
event_cat_subs tinyint(3) unsigned NOT NULL default '0',
event_cat_ahead tinyint(3) unsigned NOT NULL default '0',
event_cat_msg1 text,
event_cat_msg2 text,
event_cat_notify tinyint(3) unsigned NOT NULL default '0',
event_cat_last int(10) unsigned NOT NULL default '0',
event_cat_today int(10) unsigned NOT NULL default '0',
event_cat_lastupdate int(10) unsigned NOT NULL default '0',
event_cat_addclass int(10) unsigned NOT NULL default '0',
event_cat_description text,
event_cat_force_class int(10) unsigned NOT NULL default '0',
PRIMARY KEY (event_cat_id)
) TYPE=MyISAM;"
,
"CREATE TABLE ".MPREFIX."event_subs (
event_subid int(10) unsigned NOT NULL auto_increment,
event_userid int(10) unsigned NOT NULL default '0',
event_cat int(10) unsigned NOT NULL default '0',
PRIMARY KEY (event_subid)
) TYPE=MyISAM;");
// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
$ec_dir = e_PLUGIN."calendar_menu/";
$eplug_link = TRUE;
$eplug_link_name = EC_LAN_83; // "Calendar";
$eplug_link_url = "".$ec_dir."calendar.php";
$eplug_link_perms = "Everyone"; // Everyone, Guest, Member, Admin
// Text to display after plugin successfully installed ------------------------------------------------------------------
$eplug_done = EC_LAN_82; // "To activate please go to your menus screen and select the calendar_menu into one of your menu areas.";
// upgrading ... //
$upgrade_add_prefs = "";
$upgrade_remove_prefs = "";
$upgrade_alter_tables = array();
$version_notes = "";
if (!function_exists('create_ec_log_dir'))
{
function create_ec_log_dir()
{
global $eplug_folder;
$response = "";
$cal_log_dir = e_PLUGIN.$eplug_folder.'/log';
if (!is_dir($cal_log_dir))
{ // Need to create log directory
if (!mkdir($cal_log_dir,0666))
{
$response = EC_ADLAN_A158."<br />";
}
}
if (!is_dir($cal_log_dir))
{
$response .= EC_ADLAN_A153;
return $response;
}
// Now check directory permissions
if (!is_writable($cal_log_dir."/"))
{
if (!chmod($cal_log_dir,0666))
{
$response = EC_ADLAN_A154."<br />";
}
if (!is_writable($cal_log_dir."/"))
{
$response .= EC_ADLAN_A155;
}
}
return $response;
}
}
if ($ecalVer < 3.5)
{
// To version 3.5
$upgrade_alter_tables = array(
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_class int(10) unsigned NOT NULL default '0'",
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_subs tinyint(3) unsigned NOT NULL default '0'",
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_force tinyint(3) unsigned NOT NULL default '0'",
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_ahead tinyint(3) unsigned NOT NULL default '0'",
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_msg1 text",
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_msg2 text",
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_notify tinyint(3) unsigned NOT NULL default '0'",
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_last int(10) unsigned NOT NULL default '0'",
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_today int(10) unsigned NOT NULL default '0'",
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_lastupdate int(10) unsigned NOT NULL default '0'",
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_addclass int(10) unsigned NOT NULL default '0'",
"CREATE TABLE ".MPREFIX."event_subs (
event_subid int(10) unsigned NOT NULL auto_increment,
event_userid int(10) unsigned NOT NULL default '0',
event_cat int(10) unsigned NOT NULL default '0',
PRIMARY KEY (event_subid)
) TYPE=MyISAM;"
);
$version_notes .= "<u>3.5</u><br />".EC_ADLAN_A156."<br />";
}
// To version 3.6 - fair number of tweaks overall
if ($ecalVer < 3.6)
{
$upgrade_alter_tables = array(
"ALTER TABLE ".MPREFIX."event_cat DROP event_cat_force",
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_description text",
"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_force_class int(10) unsigned NOT NULL default '0'"
);
$verprefs = array(
"eventpost_adminlog" => 0,
"eventpost_showeventcount" => 1,
"eventpost_menuheading" => EC_LAN_140,
"eventpost_daysforward" => 30,
"eventpost_numevents" => 3,
"eventpost_checkrecur" => 1,
"eventpost_linkheader" => 0,
"eventpost_showcaticon" => 0,
"eventpost_dateformat" => 1,
"eventpost_fivemins" => 0,
"eventpost_emaillog" => 1,
"eventpost_caltime" => 0,
"eventpost_datedisplay" => 1,
"eventpost_timedisplay" => 0,
"eventpost_timecustom" => "%H%M",
"eventpost_fe_set" => "",
"eventpost_namelink" => 1,
"eventpost_recentshow" => 0,
"eventpost_dateevent" => 1,
"eventpost_datenext" => 1,
"eventpost_eventdatecustom" => "&A %d %B %Y",
"eventpost_nextdatecustom" => "%d %b",
"eventpost_menulink" => 0 );
$upgrade_add_prefs .= $verprefs;
$version_notes .= "<u>3.6</u><br />".EC_ADLAN_A156."<br />".create_ec_log_dir()."<br />
<a href='".e_PLUGIN_ABS.$eplug_folder."/".$eplug_conffile."'>Configure</a><br />";
$upgrade_remove_prefs = array(
"eventpost_addcat",
"eventpost_evtoday",
"eventpost_headercss",
"eventpost_daycss",
"eventpost_todaycss"
);
}
$eplug_upgrade_done = EC_LAN_108."<br />".$version_notes;
?>

Binary file not shown.

View File

@@ -0,0 +1,40 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/search/search_parser.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:50 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
$return_fields = 'event_id, event_start, event_title, event_location, event_details';
$search_fields = array('event_title', 'event_location', 'event_details');
$weights = array('1.2', '0.6', '0.6');
$no_results = LAN_198;
$where = "";
$order = array('event_start' => DESC);
$ps = $sch -> parsesearch('event', $return_fields, $search_fields, $weights, 'search_events', $no_results, $where, $order);
$text .= $ps['text'];
$results = $ps['results'];
function search_events($row) {
global $con;
$res['link'] = e_PLUGIN."calendar_menu/event.php?".time().".event.".$row['event_id'];
$res['title'] = $row['event_title'];
$res['summary'] = $row['event_details'];
$res['detail'] = $row['event_location']." | ".$con -> convert_date($row['event_start'], "long");
return $res;
}
?>

View File

@@ -0,0 +1,251 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dun.an 2001-2002
| http://e107.org
| jali.@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/subs_menu.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:49 $
| $Author: mcfly_e107 $
|
| 09.07.06 - Mods by steved:
| General restructuring to use common routines
| Support for sending emails on previous day.
| Logging capability
| Debugging option
|
| 11.07.06 - Adjustment to logging messages
| 12.07.06 - More adjustment to logging messages
| 15.07.06 - Adjustment to 'tomorrow' query
| 17.07.06 - More adjustment to 'tomorrow' query
|
| 04.10.06 - Mods to mailout to allow mix of voluntary and forced subs to the same event
| 24.10.06 - Change DB names so works as a menu
| 25.10.06 - Logging selectively disabled when run as menu
| 27.10.06 - Update queries to new structure, don't email banned users
| 31.10.06 - Attempt to optimise query better
| 01.11.06 - More refinements on query
| 05.11.06 - More refinement on query - ignores midnight at end of day. **** BANG ****
|
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
// This menu can be called from a cron job - see readme.rtf
$run_from_menu = function_exists("parseheader"); // Use this to suppress logging in 'through' path
$ec_dir = e_PLUGIN . "calendar_menu/";
// Check if we are going to do the notify
$debug_level = 0; // Set to 1 or 2 to suppress actual sending of emails
if (($debug_level > 0) && e_QUERY)
{ // Run with query of ?dd-mm[-yy] to test specific date
list($day,$month,$year) = explode("-",e_QUERY);
if (!isset($year) || ($year == 0)) $year = date("Y");
$cal_starttime = mktime(0,0,0,$month,$day,$year);
echo "Debug run for {$day}-{$month}-{$year}<br />";
}
else
{ // Normal operation
$cal_starttime = mktime(0, 0, 0, date("n"), date("d"), date("Y"));
}
$log_requirement = 0; // Logging required 0=none, 1=summary, 2=detailed
if (isset($pref['eventpost_emaillog'])) $log_requirement = $pref['eventpost_emaillog'];
if ($debug_level >= 2) $log_requirement = 2; // Force full logging if debug
if ($log_requirement > 0)
{
$log_filename = $ec_dir.'log/calendar_mail.txt';
if (!$run_from_menu)
{
if (!($handle = fopen($log_filename, 'a'))) $log_requirement = 0;
if (fwrite($handle,"\r\n\r\nMail subscriptions run started at ".date("D j M Y G:i:s")) === false) $log_requirement = 0;
fclose($handle);
}
}
// Start with the 'in advance' emails
$cal_args = "select * from #event left join #event_cat on event_category=event_cat_id where (event_cat_subs>0 OR event_cat_force_class != '') and
event_cat_last < " . intval($cal_starttime) . " and
event_cat_ahead > 0 and
event_start >= (" . intval($cal_starttime) . "+(86400*(event_cat_ahead))) and
event_start < (" . intval($cal_starttime) . "+(86400*(event_cat_ahead+1))) and
find_in_set(event_cat_notify,'1,3,5,7')";
send_mailshot($cal_args, 'Advance',1);
// then for today
//$cal_starttime = mktime(0, 0, 0, date("n"), date("d"), date("Y"));
$cal_args = "select * from #event left join #event_cat on event_category=event_cat_id where (event_cat_subs>0 OR event_cat_force_class != '') and
event_cat_today < " . intval($cal_starttime) . " and
event_start >= (" . intval($cal_starttime) . ") and
event_start < (86400+" . intval($cal_starttime) . ") and
find_in_set(event_cat_notify,'2,3,6,7')";
send_mailshot($cal_args, 'today',2);
// Finally do 'day before' emails
$cal_args = "select * from #event left join #event_cat on event_category=event_cat_id where (event_cat_subs>0 OR event_cat_force_class != '') and
event_cat_today < " . intval($cal_starttime) . " and
event_start >= (" . intval($cal_starttime) ." + 86400 ) and
event_start < (" . intval($cal_starttime) ." + 172800) and
find_in_set(event_cat_notify,'4,5,6,7')";
send_mailshot($cal_args, 'tomorrow',2);
if (($log_requirement > 0) && (!$run_from_menu))
{
if (!($handle = fopen($log_filename, 'a'))) $log_requirement = 0;
if (fwrite($handle," .. completed at ".date("D j M Y G:i:s")."\r\n") === false) $log_requirement = 0;
fclose($handle);
}
// Done
/*
Function to actually send a mailshot
*/
function send_mailshot($cal_query, $shot_type, $msg_num)
{
global $sql, $sql2;
global $log_requirement, $log_filename, $debug_level;
global $pref;
global $run_from_menu;
if (($log_requirement > 1) && (!$run_from_menu))
{
if (!$handle = fopen($log_filename, 'a')) $log_requirement = 0;
if (fwrite($handle,"\r\n Starting emails for ".$shot_type." at ".date("D j M Y G:i:s")) === false) $log_requirement = 0;
if ($debug_level >= 2)
{
if (fwrite($handle,"\r\n Query is: ".$cal_query."\r\n") === false) $log_requirement = 0;
}
}
if ($num_cat_proc = $sql->db_Select_gen($cal_query))
{ // Got at least one event to process here
if ($log_requirement > 1)
{
if ($run_from_menu) if (!($handle = fopen($log_filename, 'a'))) $log_requirement = 0;
if (fwrite($handle," - ".$num_cat_proc." categories found to process\r\n") === false) $log_requirement = 0;
}
require_once(e_HANDLER . "mail.php");
while ($cal_row = $sql->db_Fetch())
{ // Process one event at a time
extract($cal_row);
if ($log_requirement > 1)
{
if (fwrite($handle," Processing event: ".$event_title." \r\n") === false) $log_requirement = 0;
}
if ($msg_num == 1)
$sql2->db_Update("event_cat", "event_cat_last=" . time() . " where event_cat_id=" . intval($event_cat_id));
else
$sql2->db_Update("event_cat", "event_cat_today=" . time() . " where event_cat_id=" . intval($event_cat_id));
// Start of next try on query
// Four cases for the query:
// 1. No forced mailshots - based on event_subs table only Need INNER JOIN
// 2. Forced mailshot to members - send to all users (don't care about subscriptions) Don't need JOIN
// 3. Forced mailshot to group of members - based on user table only Don't need JOIN
// 4. Forced mailshot to group, plus optional subscriptions - use the lot! Need LEFT JOIN
// (Always block sent to banned members)
$manual_subs = (isset($pref['eventpost_asubs']) && ($pref['eventpost_asubs'] == '1'));
$subs_fields = '';
$subs_join = '';
$where_clause = '';
$group_clause = '';
if ($event_cat_force_class != e_UC_MEMBER)
{ // Cases 1, 3, 4 (basic query does for case 2)
if ((!$event_cat_force_class) || ($manual_subs))
{ // Cases 1 & 4 - need to join with event_subs database
$subs_fields = ", es.* ";
if ($event_cat_force_class) $subs_join = "LEFT"; else $subs_join = "INNER";
$subs_join .= " join #event_subs AS es on u.user_id=es.event_userid ";
$where_clause = " es.event_cat='".intval($event_category)."' ";
$group_clause = " GROUP BY u.user_id";
}
if ($event_cat_force_class)
{ // cases 3 and 4 - ... and check for involuntary subscribers
if ($where_clause) $where_clause .= " OR ";
if ($event_cat_force_class == e_UC_ADMIN)
{
$where_clause .= "(u.user_admin = '1' )";
}
else
{
$where_clause .= "find_in_set('".intval($event_cat_force_class)."', u.user_class)";
}
}
if ($where_clause) $where_clause = ' AND ('.$where_clause.' ) ';
} // End of cases 1, 3, 4
$cal_emilargs = "SELECT u.user_id, u.user_class, u.user_email, u.user_name, u.user_ban, u.user_admin{$subs_fields}
from #user AS u {$subs_join}
WHERE u.user_ban = '0' {$where_clause} {$group_clause}";
if ($debug_level >= 2)
{
if (fwrite($handle,"\r\n Email selection query is: ".$cal_emilargs."\r\n") === false) $log_requirement = 0;
}
if ($num_shots = $sql2->db_Select_gen($cal_emilargs))
{
if ($log_requirement > 1)
{
if (fwrite($handle," - ".$num_shots." emails found to send\r\n") === false) $log_requirement = 0;
}
while ($cal_emrow = $sql2->db_Fetch())
{
extract($cal_emrow);
if ($msg_num == 1)
$cal_msg = $event_title . "\n\n" . $event_cat_msg1;
else
$cal_msg = $event_title . "\n\n" . $event_cat_msg2;
if ($debug_level == 0) $send_result = sendemail($user_email, $pref['eventpost_mailsubject'], $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']);
if ($log_requirement > 1)
{
$log_string = " Send to: ".$user_email." Name: ".$user_name;
if ($debug_level > 0)
{ $log_string .= " *DEBUG*
"; }
else
{ $log_string .= " Result = ".$send_result."
"; }
if (fwrite($handle,$log_string) === false) $log_requirement = 0;
}
}
}
} // while
if ($log_requirement > 1)
{
if (fwrite($handle," Completed emails for ".$shot_type." at ".date("D j M Y G:i:s")."\r\n") === false) $log_requirement = 0;
fclose($handle);
}
}
}
?>

View File

@@ -0,0 +1,110 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dun.an 2001-2002
| http://e107.org
| jali.@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/subscribe.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:49 $
| $Author: mcfly_e107 $
|
| 05.10.06 - Mods started
| 06.11.06 - Reflect updated shortcodes and template directories
|
| Think how to unsubscribe user if he's voluntarily subscribed, and is later forcibly subscribed, or no longer allowed to subscribe
| (A subscription update, with nothing visibly changed, may well do it)
+----------------------------------------------------------------------------+
*/
require_once("../../class2.php");
@include_lan(e_PLUGIN . "calendar_menu/languages/English.php");
define("PAGE_NAME", EC_LAN_80);
require_once(HEADERF);
if ((USER) && (isset($pref['eventpost_asubs']) && ($pref['eventpost_asubs'] == '1')))
{
$cal_db = new db; // Probably best to keep this
if (isset($_POST['upsubs']))
{
$cal_cats = $tp -> toDB($_POST['event_list']); // IDs of allowed categories
$cal_subs = $tp -> toDB($_POST['event_subd']); // Checkbox results
$cal_db->db_Delete("event_subs", "event_userid='" . USERID . "'"); // Delete all for this user to start
foreach($cal_cats as $cal_row)
{ // Now add in a subscription for each allowed category
if ($cal_subs[$cal_row])
{
$cal_inargs = "0,'" . USERID . "','" . $cal_row . "'";
$cal_db->db_Insert("event_subs", $cal_inargs);
}
// print $cal_row . $cal_subs[$cal_row] . "<br>";
}
$caltext = "<table class='fborder' width='97%'>
<tr><td class='fcaption' >" . EC_LAN_130 . "</td></tr>
<tr><td class='forumheader3' ><a href='calendar.php'>" . EC_LAN_131 . "</a></tr>
<tr><td class='fcaption' >&nbsp;</td></tr></table>";
}
else
{
$caltext = "<form id='calsubs' action='" . e_SELF . "' method='post' >
<table class='fborder' width='97%'>
<tr><td class='fcaption' colspan='3'>" . EC_LAN_125 . "</td></tr>
<tr><td class='forumheader2' >" . EC_LAN_126 . "</td><td class='forumheader2' >" . EC_LAN_127 . "</td><td class='forumheader2' >" . EC_LAN_136 . "</td></tr>";
// Get list of currently subscribed
$cal_db->db_Select("event_subs", "event_cat", "where event_userid='" . USERID . "'", "nowhere");
while ($cal_s = $cal_db->db_Fetch())
{
extract($cal_s);
$cal_array[] = $event_cat;
} // while
// Get list of categories that have subscriptions and are visible to this member
$cal_args = "select * from #event_cat
where event_cat_subs>0 and (find_in_set(event_cat_class,'".USERCLASS_LIST."') OR find_in_set(event_cat_force_class,'".USERCLASS_LIST."'))";
if ($cal_db->db_Select_gen($cal_args))
{
// echo $cal_args."<br />";
while ($cal_row = $cal_db->db_Fetch())
{
extract($cal_row);
$caltext .= "<tr><td class='forumheader3' style='width:10%;'>";
if (check_class($event_cat_force_class))
{
$caltext .= EC_LAN_126;
}
else
{
$caltext .= "<input type='hidden' name='event_list[]' value='" . $event_cat_id . "' />
<input type='checkbox' class='tbox' value='1' name='event_subd[$event_cat_id]' " . (in_array($event_cat_id, $cal_array)?"checked='checked' ":"") . " /> </td>";
}
$caltext .= "<td class='forumheader3'>{$event_cat_name}</td><td class='forumheader3'>{$event_cat_description}</td></tr>";
}
}
else
{
$caltext .= "<tr><td class='forumheader3' colspan='3'>" . EC_LAN_128 . "</td></tr>";
}
$caltext .= "<tr><td class='forumheader3' colspan='3'><input class='tbox' type='submit' value='" . EC_LAN_129 . "' name='upsubs' /></td></tr>";
$caltext .= "</table></form>";
}
}
else
{
if (isset($pref['eventpost_asubs']) && ($pref['eventpost_asubs'] == '1'))
$caltext = EC_LAN_142; // Register or log in
else
$caltext = EC_LAN_143; // No facility
}
$ns->tablerender(EC_LAN_124, $caltext);
require_once(FOOTERF);
?>

View File

@@ -0,0 +1,177 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/chatbox_menu/admin_chatbox.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:51 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../../class2.php");
if(!getperms("P")) { header("location:".e_BASE."index.php"); exit; }
@include_once e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE."_config.php";
@include_once e_PLUGIN."chatbox_menu/languages/English/English_config.php";
require_once(e_ADMIN."auth.php");
require_once(e_HANDLER."userclass_class.php");
if (isset($_POST['updatesettings'])) {
$pref['chatbox_posts'] = $_POST['chatbox_posts'];
$pref['cb_layer'] = $_POST['cb_layer'];
$pref['cb_layer_height'] = ($_POST['cb_layer_height'] ? $_POST['cb_layer_height'] : 200);
$pref['cb_emote'] = $_POST['cb_emote'];
$pref['cb_mod'] = $_POST['cb_mod'];
save_prefs();
$e107cache->clear("chatbox");
$message = CHBLAN_1;
}
if (isset($_POST['prune'])) {
$chatbox_prune = $_POST['chatbox_prune'];
$prunetime = time() - $chatbox_prune;
$sql->db_Delete("chatbox", "cb_datestamp < '$prunetime' ");
$e107cache->clear("chatbox");
$message = CHBLAN_28;
}
if (isset($_POST['recalculate'])) {
$sql->db_Update("user", "user_chats = 0");
$qry = "SELECT u.user_id AS uid, count(c.cb_nick) AS count FROM #chatbox AS c
LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.cb_nick,'.',1) = u.user_id
WHERE u.user_id > 0
GROUP BY uid";
if ($sql -> db_Select_gen($qry)) {
$ret = array();
while($row = $sql -> db_Fetch())
{
$list[$row['uid']] = $row['count'];
}
}
foreach($list as $uid => $cnt)
{
$sql->db_Update("user", "user_chats = '{$cnt}' WHERE user_id = '{$uid}'");
}
$message = CHBLAN_33;
}
if (isset($message)) {
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
$chatbox_posts = $pref['chatbox_posts'];
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."' id='cbform'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='forumheader3' style='width:40%'>".CHBLAN_11.": <div class='smalltext'>".CHBLAN_12."</div></td>
<td class='forumheader3' style='width:60%'>
<select name='chatbox_posts' class='tbox'>";
if ($chatbox_posts == 5) {
$text .= "<option selected='selected'>5</option>\n";
} else {
$text .= "<option>5</option>\n";
}
if ($chatbox_posts == 10) {
$text .= "<option selected='selected'>10</option>\n";
} else {
$text .= "<option>10</option>\n";
}
if ($chatbox_posts == 15) {
$text .= "<option selected='selected'>15</option>\n";
} else {
$text .= "<option>15</option>\n";
}
if ($chatbox_posts == 20) {
$text .= "<option selected='selected'>20</option>\n";
} else {
$text .= "<option>20</option>\n";
}
if ($chatbox_posts == 25) {
$text .= "<option selected='selected'>25</option>\n";
} else {
$text .= "<option>25</option>\n";
}
if(!isset($pref['cb_mod']))
{
$pref['cb_mod'] = e_UC_ADMIN;
}
$text .= "</select>
</td>
</tr>
<tr><td class='forumheader3' style='width:40%'>".CHBLAN_32.": </td>
<td class='forumheader3' style='width:60%'>". r_userclass("cb_mod", $pref['cb_mod'], 'off', "admin, classes")."
</td>
</tr>
<tr><td class='forumheader3' style='width:40%'>".CHBLAN_36."</td>
<td class='forumheader3' style='width:60%'>".
($pref['cb_layer'] == 0 ? "<input type='radio' name='cb_layer' value='0' checked='checked' />" : "<input type='radio' name='cb_layer' value='0' />")."&nbsp;&nbsp;". CHBLAN_37."<br />".
($pref['cb_layer'] == 1 ? "<input type='radio' name='cb_layer' value='1' checked='checked' />" : "<input type='radio' name='cb_layer' value='1' />")."&nbsp;".CHBLAN_29."&nbsp;--&nbsp;". CHBLAN_30.": <input class='tbox' type='text' name='cb_layer_height' size='8' value='".$pref['cb_layer_height']."' maxlength='3' /><br />".
($pref['cb_layer'] == 2 ? "<input type='radio' name='cb_layer' value='2' checked='checked' />" : "<input type='radio' name='cb_layer' value='2' />")."&nbsp;&nbsp;". CHBLAN_38."
</td>
</tr>
";
if($pref['smiley_activate'])
{
$text .= "<tr><td class='forumheader3' style='width:40%'>".CHBLAN_31."?: </td>
<td class='forumheader3' style='width:60%'>". ($pref['cb_emote'] ? "<input type='checkbox' name='cb_emote' value='1' checked='checked' />" : "<input type='checkbox' name='cb_emote' value='1' />")."
</td>
</tr>
";
}
$text .= "<tr>
<td class='forumheader3' style='width:40%'>".CHBLAN_21.": <div class='smalltext'>".CHBLAN_22."</div></td>
<td class='forumheader3' style='width:60%'>
".CHBLAN_23." <select name='chatbox_prune' class='tbox'>
<option></option>
<option value='86400'>".CHBLAN_24."</option>
<option value='604800'>".CHBLAN_25."</option>
<option value='2592000'>".CHBLAN_26."</option>
<option value='1'>".CHBLAN_27."</option>
</select>
<input class='button' type='submit' name='prune' value='".CHBLAN_21."' />
</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='width:40%'>".CHBLAN_34.":</td>
<td class='forumheader3' style='width:60%'>
<input class='button' type='submit' name='recalculate' value='".CHBLAN_35."' />
</td>
</tr>";
$text .= "<tr>
<td class='forumheader' colspan='3' style='text-align:center'>
<input class='button' type='submit' name='updatesettings' value='".CHBLAN_19."' />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(CHBLAN_20, $text);
require_once(e_ADMIN."footer.php");
?>

View File

@@ -0,0 +1,168 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/chatbox_menu/chat.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:51 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../../class2.php");
if (file_exists(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php")) {
include_once(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");
} else {
include_once(e_PLUGIN."chatbox_menu/languages/English/English.php");
}
require_once(HEADERF);
$sql->db_Select("menus", "*", "menu_name='chatbox_menu'");
$row = $sql->db_Fetch();
if (!check_class($row['menu_class'])) {
$ns->tablerender(CHATBOX_L23, "<div style='text-align:center'>".CHATBOX_L24."</div>");
require_once(FOOTERF);
exit;
}
if(!isset($pref['cb_mod']))
{
$pref['cb_mod'] = e_UC_ADMIN;
}
define("CB_MOD", check_class($pref['cb_mod']));
if($_POST['moderate'] && CB_MOD)
{
if(isset($_POST['block']))
{
foreach(array_keys($_POST['block']) as $k){ $kk[] = intval($k); }
$blocklist = implode(",", $kk);
$sql->db_Select_gen("UPDATE #chatbox SET cb_blocked=1 WHERE cb_id IN ({$blocklist})");
}
if(isset($_POST['unblock']))
{
foreach(array_keys($_POST['unblock']) as $k){ $kk[] = intval($k); }
$unblocklist = implode(",", $kk);
$sql->db_Select_gen("UPDATE #chatbox SET cb_blocked=0 WHERE cb_id IN ({$unblocklist})");
}
if(isset($_POST['delete']))
{
$deletelist = implode(",", array_keys($_POST['delete']));
$sql -> db_Select_gen("SELECT c.cb_id, u.user_id FROM #chatbox AS c
LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.cb_nick,'.',1) = u.user_id
WHERE c.cb_id IN (".$deletelist.")");
$rowlist = $sql -> db_getList();
foreach ($rowlist as $row) {
$sql -> db_Select_gen("UPDATE #user SET user_chats=user_chats-1 where user_id = ".intval($row['user_id']));
}
$sql -> db_Select_gen("DELETE FROM #chatbox WHERE cb_id IN ({$deletelist})");
}
$e107cache->clear("chatbox");
$message = CHATBOX_L18;
}
// when coming from search.php
if (strstr(e_QUERY, "fs")) {
$cgtm = str_replace(".fs", "", e_QUERY);
$fs = TRUE;
}
// end search
if (e_QUERY ? $from = e_QUERY : $from = 0);
$chat_total = $sql->db_Count("chatbox");
$qry_where = (CB_MOD ? "1" : "cb_blocked=0");
// when coming from search.php calculate page number
if ($fs) {
$page_count = 0;
$row_count = 0;
$sql->db_Select("chatbox", "*", "{$qry_where} ORDER BY cb_datestamp DESC");
while ($row = $sql -> db_Fetch()) {
if ($row['cb_id'] == $cgtm) {
$from = $page_count;
break;
}
$row_count++;
if ($row_count == 30) {
$row_count = 0;
$page_count += 30;
}
}
}
// end search
$sql->db_Select("chatbox", "*", "{$qry_where} ORDER BY cb_datestamp DESC LIMIT ".intval($from).", 30");
$obj2 = new convert;
$chatList = $sql->db_getList();
foreach ($chatList as $row)
{
$CHAT_TABLE_DATESTAMP = $obj2->convert_date($row['cb_datestamp'], "long");
$CHAT_TABLE_NICK = preg_replace("/[0-9]+\./", "", $row['cb_nick']);
$cb_message = $tp->toHTML($row['cb_message']);
if($row['cb_blocked'])
{
$cb_message .= "<br />".CHATBOX_L25;
}
if(CB_MOD)
{
$cb_message .= "<br /><input type='checkbox' name='delete[{$row['cb_id']}]' value='1' />".CHATBOX_L10;
if($row['cb_blocked'])
{
$cb_message .= "&nbsp;&nbsp;&nbsp;<input type='checkbox' name='unblock[{$row['cb_id']}]' value='1' />".CHATBOX_L7;
}
else
{
$cb_message .= "&nbsp;&nbsp;&nbsp;<input type='checkbox' name='block[{$row['cb_id']}]' value='1' />".CHATBOX_L9;
}
}
$CHAT_TABLE_MESSAGE = $cb_message;
$CHAT_TABLE_FLAG = ($flag ? "forumheader3" : "forumheader4");
if (!$CHAT_TABLE) {
if (file_exists(THEME."chat_template.php"))
{
require_once(THEME."chat_template.php");
}
else
{
require_once(e_PLUGIN."chatbox_menu/chat_template.php");
}
}
$textstring .= preg_replace("/\{(.*?)\}/e", '$\1', $CHAT_TABLE);
$flag = (!$flag ? TRUE : FALSE);
}
$textstart = preg_replace("/\{(.*?)\}/e", '$\1', $CHAT_TABLE_START);
$textend = preg_replace("/\{(.*?)\}/e", '$\1', $CHAT_TABLE_END);
$text = $textstart.$textstring.$textend;
if(CB_MOD)
{
$text = "<form method='post' action='".e_SELF."'>".$text."<input type='submit' class='button' name='moderate' value='".CHATBOX_L13."' /></form>";
}
if($message)
{
$ns->tablerender("", $message);
}
$ns->tablerender(CHATBOX_L20, $text);
require_once(e_HANDLER."np_class.php");
$ix = new nextprev("chat.php", $from, 30, $chat_total, CHATBOX_L21);
require_once(FOOTERF);
?>

View File

@@ -0,0 +1,27 @@
<?php
if (!defined('e107_INIT')) { exit; }
// ##### CHAT TABLE -----------------------------------------------------------------------------
if(!$CHAT_TABLE_START){
$CHAT_TABLE_START = "
<br /><table style='width:100%'><tr><td>";
}
if(!$CHAT_TABLE){
$CHAT_TABLE = "\n
<div class='spacer'>
<div class='{CHAT_TABLE_FLAG}'>
<img src='".THEME."images/bullet2.gif' alt='bullet' /> \n<b>{CHAT_TABLE_NICK}</b> ".CHATBOX_L22." {CHAT_TABLE_DATESTAMP}<br />
<div class='defaulttext'><i>{CHAT_TABLE_MESSAGE}</i></div>\n
</div>
</div>\n";
}
if(!$CHAT_TABLE_END){
$CHAT_TABLE_END = "
</td></tr></table>";
}
// ##### ------------------------------------------------------------------------------------------
?>

View File

@@ -0,0 +1,266 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/chatbox_menu/chatbox_menu.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:51 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
global $tp, $e107cache, $e_event, $e107, $pref, $footer_js, $PLUGINS_DIRECTORY;
if($pref['cb_layer'] || isset($_POST['chatbox_ajax']))
{
if(isset($_POST['chat_submit']))
{
include_once("../../class2.php");
//Normally the menu.sc file will auto-load the language file, this is needed in case
//ajax is turned on and the menu is not loaded from the menu.sc
@include_lan(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");
@include_lan(e_PLUGIN."chatbox_menu/languages/English/English.php");
}
$footer_js[] = e_FILE_ABS.'e_ajax.js';
}
if(!defined("e_HANDLER")){ exit; }
require_once(e_HANDLER."emote.php");
$emessage='';
if(isset($_POST['chat_submit']) && $_POST['cmessage'] != "")
{
if(!USER && !$pref['anon_post'])
{
// disallow post
}
else
{
$nick = trim(preg_replace("#\[.*\]#si", "", $tp -> toDB($_POST['nick'])));
$cmessage = $_POST['cmessage'];
$cmessage = preg_replace("#\[.*?\](.*?)\[/.*?\]#s", "\\1", $cmessage);
$fp = new floodprotect;
if($fp -> flood("chatbox", "cb_datestamp"))
{
if((strlen(trim($cmessage)) < 1000) && trim($cmessage) != "")
{
$cmessage = $tp -> toDB($cmessage, false, true);
if($sql -> db_Select("chatbox", "*", "cb_message='$cmessage' AND cb_datestamp+84600>".time()))
{
$emessage = CHATBOX_L17;
}
else
{
$datestamp = time();
$ip = $e107->getip();
if(USER)
{
$nick = USERID.".".USERNAME;
$sql -> db_Update("user", "user_chats=user_chats+1, user_lastpost='".time()."' WHERE user_id='".USERID."' ");
}
else if(!$nick)
{
$nick = "0.Anonymous";
}
else
{
if($sql -> db_Select("user", "*", "user_name='$nick' ")){
$emessage = CHATBOX_L1;
}
else
{
$nick = "0.".$nick;
}
}
if(!$emessage)
{
$sql -> db_Insert("chatbox", "0, '$nick', '$cmessage', '".time()."', '0' , '$ip' ");
$edata_cb = array("cmessage" => $cmessage, "ip" => $ip);
$e_event -> trigger("cboxpost", $edata_cb);
$e107cache->clear("nq_chatbox");
}
}
}
else
{
$emessage = CHATBOX_L15;
}
}
else
{
$emessage = CHATBOX_L19;
}
}
}
if(!USER && !$pref['anon_post']){
if($pref['user_reg'])
{
$texta = "<div style='text-align:center'>".CHATBOX_L3."</div><br /><br />";
}
}
else
{
$cb_width = (defined("CBWIDTH") ? CBWIDTH : "");
if($pref['cb_layer'] == 2)
{
$texta = "\n<form id='chatbox' action='".e_SELF."?".e_QUERY."' method='post' onsubmit='return(false);'>
<div><input type='hidden' id='chatbox_ajax' value='1' /></div>
";
}
else
{
$texta = (e_QUERY ? "\n<form id='chatbox' method='post' action='".e_SELF."?".e_QUERY."'>" : "\n<form id='chatbox' method='post' action='".e_SELF."'>");
}
$texta .= "<div style='text-align:center; width:100%'>";
if(($pref['anon_post'] == "1" && USER == FALSE))
{
$texta .= "\n<input class='tbox chatbox' type='text' id='nick' name='nick' value='' maxlength='50' ".($cb_width ? "style='width: ".$cb_width.";'" : '')." /><br />";
}
if($pref['cb_layer'] == 2)
{
$oc = "onclick=\"javascript:sendInfo('".SITEURL.$PLUGINS_DIRECTORY."chatbox_menu/chatbox_menu.php', 'chatbox_posts', this.form);\"";
}
else
{
$oc = "";
}
$texta .= "
<textarea class='tbox chatbox' id='cmessage' name='cmessage' cols='20' rows='5' style='".($cb_width ? "width:".$cb_width.";" : '')." overflow: auto' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'></textarea>
<br />
<input class='button' type='submit' id='chat_submit' name='chat_submit' value='".CHATBOX_L4."' {$oc}/>
<input class='button' type='reset' name='reset' value='".CHATBOX_L5."' />";
if($pref['cb_emote'] && $pref['smiley_activate']){
$texta .= "
<input class='button' type ='button' style='cursor:hand; cursor:pointer' size='30' value='".CHATBOX_L14."' onclick=\"expandit('emote')\" />
<div style='display:none' id='emote'>".r_emote()."
</div>\n";
}
$texta .="</div>\n</form>\n";
}
if($emessage != ""){
$texta .= "<div style='text-align:center'><b>".$emessage."</b></div>";
}
if(!$text = $e107cache->retrieve("nq_chatbox"))
{
global $pref,$tp;
$pref['chatbox_posts'] = ($pref['chatbox_posts'] ? $pref['chatbox_posts'] : 10);
$chatbox_posts = $pref['chatbox_posts'];
if(!isset($pref['cb_mod']))
{
$pref['cb_mod'] = e_UC_ADMIN;
}
define("CB_MOD", check_class($pref['cb_mod']));
$qry = "
SELECT c.*, u.user_name FROM #chatbox AS c
LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.cb_nick,'.',1) = u.user_id
ORDER BY c.cb_datestamp DESC LIMIT 0, ".intval($chatbox_posts);
if($sql -> db_Select_gen($qry))
{
$obj2 = new convert;
$cbpost = $sql -> db_getList();
foreach($cbpost as $cb)
{
// get available vars
list($cb_uid, $cb_nick) = explode(".", $cb['cb_nick'], 2);
if($cb['user_name'])
{
$cb_nick = "<a href='".e_BASE."user.php?id.{$cb_uid}'>{$cb['user_name']}</a>";
}
else
{
$cb_nick = $tp -> toHTML($cb_nick,FALSE,'emotes_off, no_make_clickable');
$cb_nick = str_replace("Anonymous", LAN_ANONYMOUS, $cb_nick);
}
$datestamp = $obj2->convert_date($cb['cb_datestamp'], "short");
if(!$pref['cb_wordwrap']) { $pref['cb_wordwrap'] = 30; }
$emotes_active = $pref['cb_emote'] ? 'emotes_on' : 'emotes_off';
$cb_message = $tp -> toHTML($cb['cb_message'], FALSE, $emotes_active, $cb_uid, $pref['menu_wordwrap']);
$replace[0] = "["; $replace[1] = "]";
$search[0] = "&lsqb;"; $search[1] = "&rsqb;";
$cb_message = str_replace($search, $replace, $cb_message);
global $CHATBOXSTYLE;
if(!$CHATBOXSTYLE)
{
$bullet = (defined("BULLET") ? "<img src='".THEME_ABS."images/".BULLET."' alt='' style='vertical-align: middle;' />" : "<img src='".THEME_ABS."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' style='vertical-align: middle;' />");
// default chatbox style
$CHATBOXSTYLE = "<!-- chatbox -->\n<div class='spacer'>
$bullet <b>{USERNAME}</b><br /><span class='smalltext'>{TIMEDATE}</span><br /><div class='smallblacktext'>{MESSAGE}</div></div><br />\n";
}
$search[0] = "/\{USERNAME\}(.*?)/si";
$replace[0] = $cb_nick;
$search[1] = "/\{TIMEDATE\}(.*?)/si";
$replace[1] = $datestamp;
$search[2] = "/\{MESSAGE\}(.*?)/si";
$replace[2] = ($cb['cb_blocked'] ? CHATBOX_L6 : $cb_message);
$text .= preg_replace($search, $replace, $CHATBOXSTYLE);
}
}
else
{
$text .= "<span class='mediumtext'>".CHATBOX_L11."</span>";
}
$total_chats = $sql -> db_Count("chatbox");
if($total_chats > $chatbox_posts || CB_MOD)
{
$text .= "<br /><div style='text-align:center'><a href='".e_PLUGIN."chatbox_menu/chat.php'>".(CB_MOD ? CHATBOX_L13 : CHATBOX_L12)."</a> (".$total_chats.")</div>";
}
$e107cache->set("nq_chatbox", $text);
}
$caption = (file_exists(THEME."images/chatbox_menu.png") ? "<img src='".THEME_ABS."images/chatbox_menu.png' alt='' /> ".CHATBOX_L2 : CHATBOX_L2);
if($pref['cb_layer'] == 1)
{
$text = $texta."<div style='border : 0; padding : 4px; width : auto; height : ".$pref['cb_layer_height']."px; overflow : auto; '>".$text."</div>";
$ns -> tablerender($caption, $text, 'chatbox');
}
elseif($pref['cb_layer'] == 2 && isset($_POST['chat_submit']))
{
$text = $texta.$text;
$text = str_replace(e_IMAGE, e_IMAGE_ABS, $text);
echo $text;
}
else
{
$text = $texta.$text;
if($pref['cb_layer'] == 2)
{
$text = "<div id='chatbox_posts'>".$text."</div>";
}
$ns -> tablerender($caption, $text, 'chatbox');
}
//$text = ($pref['cb_layer'] ? $texta."<div style='border : 0; padding : 4px; width : auto; height : ".$pref['cb_layer_height']."px; overflow : auto; '>".$text."</div>" : $texta.$text);
//if(ADMIN && getperms("C")){$text .= "<br /><div style='text-align: center'>[ <a href='".e_PLUGIN."chatbox_menu/admin_chatbox.php'>".CHATBOX_L13."</a> ]</div>";}
//$ns -> tablerender($caption, $text, 'chatbox');
?>

View File

@@ -0,0 +1,9 @@
CREATE TABLE chatbox (
cb_id int(10) unsigned NOT NULL auto_increment,
cb_nick varchar(30) NOT NULL default '',
cb_message text NOT NULL,
cb_datestamp int(10) unsigned NOT NULL default '0',
cb_blocked tinyint(3) unsigned NOT NULL default '0',
cb_ip varchar(15) NOT NULL default '',
PRIMARY KEY (cb_id)
) TYPE=MyISAM;

View File

@@ -0,0 +1,41 @@
<?php
if (!defined('e107_INIT')) { exit; }
if(!$chatbox_install = $sql -> db_Select("plugin", "*", "plugin_path = 'chatbox_menu' AND plugin_installflag = '1' ")){
return;
}
$LIST_CAPTION = $arr[0];
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
if($mode == "new_page" || $mode == "new_menu" ){
$lvisit = $this -> getlvisit();
$qry = "cb_datestamp>".$lvisit;
}else{
$qry = "cb_id != '0' ";
}
$qry .= " ORDER BY cb_datestamp DESC LIMIT 0,".intval($arr[7]);
$bullet = $this -> getBullet($arr[6], $mode);
if(!$chatbox_posts = $sql -> db_Select("chatbox", "*", $qry)){
$LIST_DATA = LIST_CHATBOX_2;
}else{
while($row = $sql -> db_Fetch()) {
$cb_id = substr($row['cb_nick'] , 0, strpos($row['cb_nick'] , "."));
$cb_nick = substr($row['cb_nick'] , (strpos($row['cb_nick'] , ".")+1));
$cb_message = ($row['cb_blocked'] ? CHATBOX_L6 : str_replace("<br />", " ", $tp -> toHTML($row['cb_message'])));
$rowheading = $this -> parse_heading($cb_message, $mode);
$ICON = $bullet;
$HEADING = $rowheading;
$AUTHOR = ($arr[3] ? ($cb_id != 0 ? "<a href='".e_BASE."user.php?id.$cb_id'>".$cb_nick."</a>" : $cb_nick) : "");
$CATEGORY = "";
$DATE = ($arr[5] ? ($row['cb_datestamp'] ? $this -> getListDate($row['cb_datestamp'], $mode) : "") : "");
$INFO = "";
$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
}
}
?>

View File

@@ -0,0 +1,40 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/chatbox_menu/e_notify.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:51 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
if(defined('ADMIN_PAGE') && ADMIN_PAGE === true)
{
include_lan(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");
$config_category = NT_LAN_CB_1;
$config_events = array('cboxpost' => NT_LAN_CB_2);
}
if (!function_exists('notify_cboxpost')) {
function notify_cboxpost($data) {
global $nt;
include_lan(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");
$message = NT_LAN_CB_3.': '.USERNAME.' ('.NT_LAN_CB_4.': '.$data['ip'].' )<br />';
$message .= NT_LAN_CB_5.':<br />'.$data['cmessage'].'<br /><br />';
$nt -> send('cboxpost', NT_LAN_CB_6, $message);
}
}
?>

View File

@@ -0,0 +1,44 @@
<?php
if (!defined('e107_INIT')) { exit; }
//##### create feed for admin, return array $eplug_rss_feed --------------------------------
$feed['name'] = 'Chatbox';
$feed['url'] = 'chatbox'; //the identifier for the rss feed url
$feed['topic_id'] = ''; //the topic_id, empty on default (to select a certain category)
$feed['path'] = 'chatbox_menu'; //this is the plugin path location
$feed['text'] = 'this is the rss feed for the chatbox entries';
$feed['class'] = '0';
$feed['limit'] = '9';
// ------------------------------------------------------------------------------------
//##### create rss data, return as array $eplug_rss_data -----------------------------------
$rss = array();
if($items = $sql -> db_Select('chatbox', "*", "cb_blocked=0 ORDER BY cb_datestamp DESC LIMIT 0,".$this -> limit)){
$i=0;
while($rowrss = $sql -> db_Fetch()){
$tmp = explode(".", $rowrss['cb_nick']);
$rss[$i]['author'] = $tmp[1];
$rss[$i]['author_email'] = '';
$rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."chatbox_menu/chat.php?".$rowrss['cb_id'];
$rss[$i]['linkid'] = $rowrss['cb_id'];
$rss[$i]['title'] = '';
$rss[$i]['description'] = $rowrss['cb_message'];
$rss[$i]['category_name'] = '';
$rss[$i]['category_link'] = '';
$rss[$i]['datestamp'] = $rowrss['cb_datestamp'];
$rss[$i]['enc_url'] = "";
$rss[$i]['enc_leng'] = "";
$rss[$i]['enc_type'] = "";
$i++;
}
}
//##### ------------------------------------------------------------------------------------
$eplug_rss_data[] = $rss;
$eplug_rss_feed[] = $feed;
?>

View File

@@ -0,0 +1,11 @@
<?php
if (!defined('e107_INIT')) { exit; }
if (file_exists(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/lan_chatbox_search.php")) {
include_once(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/lan_chatbox_search.php");
} else {
include_once(e_PLUGIN."chatbox_menu/languages/English/lan_chatbox_search.php");
}
$search_info[] = array('sfile' => e_PLUGIN.'chatbox_menu/search/search_parser.php', 'qtype' => CB_SCH_LAN_1, 'refpage' => 'chat.php', 'advanced' => e_PLUGIN.'chatbox_menu/search/search_advanced.php');
?>

View File

@@ -0,0 +1,6 @@
<?php
if (!defined('e107_INIT')) { exit; }
$chatbox_posts = $sql -> db_Count("chatbox");
$text .= "<div style='padding-bottom: 2px;'><img src='".e_PLUGIN."chatbox_menu/images/chatbox_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' /> ".ADLAN_115.": ".$chatbox_posts."</div>";
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,55 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/chatbox_menu/languages/English/English.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:51 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
define("CHATBOX_L1", "Unable to accept post as that username is registered - if it is your username please login to post.");
define("CHATBOX_L2", "Chatbox");
define("CHATBOX_L3", "You must be logged in to post comments on this site - please either log in or if you are not registered click <a href='".e_BASE."signup.php'>here</a> to signup");
define("CHATBOX_L4", "Submit");
define("CHATBOX_L5", "Reset");
define("CHATBOX_L6", "[blocked by admin]");
define("CHATBOX_L7", "Unblock");
define("CHATBOX_L8", "Info");
define("CHATBOX_L9", "Block");
define("CHATBOX_L10", "Delete");
define("CHATBOX_L11", "No messages yet.");
define("CHATBOX_L12", "View all posts");
define("CHATBOX_L13", "moderate chatbox");
define("CHATBOX_L14", "Emotes");
define("CHATBOX_L15", "Post too long, or empty post submitted");
define("CHATBOX_L16", "Anonymous");
define("CHATBOX_L17", "Duplicate post");
define("CHATBOX_L18", "Chatbox messages moderated");
define("CHATBOX_L19", "You may only post once every ".(FLOODPROTECT ? FLOODTIMEOUT : 'n/a')." seconds");
define("CHATBOX_L20", "Chatbox (all posts)");
define("CHATBOX_L21", "Chat Posts");
define("CHATBOX_L22", "on");
define("CHATBOX_L23", "Error!");
define("CHATBOX_L24", "You do not have the correct permissions to view this page.");
define("CHATBOX_L25", "[ this post has been blocked by admin ]");
// Notify
define("NT_LAN_CB_1", "Chatbox Events");
define("NT_LAN_CB_2", "Message posted");
define("NT_LAN_CB_3", "Posted by");
define("NT_LAN_CB_4", "IP Address");
define("NT_LAN_CB_5", "Message");
define("NT_LAN_CB_6", "Chatbox Message Posted");
?>

View File

@@ -0,0 +1,56 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/chatbox_menu/languages/English/English_config.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:51 $
| $Author: mcfly_e107 $
| Encoding:
+----------------------------------------------------------------------------+
*/
define("CHBLAN_1", "Chatbox settings updated.");
define("CHBLAN_2", "Moderated.");
define("CHBLAN_3", "No chatbox posts yet.");
define("CHBLAN_4", "Member");
define("CHBLAN_5", "Guest");
define("CHBLAN_6", "unblock");
define("CHBLAN_7", "block");
define("CHBLAN_8", "delete");
define("CHBLAN_9", "Moderate Chatbox");
define("CHBLAN_10", "Moderate posts");
define("CHBLAN_11", "Chatbox posts to display");
define("CHBLAN_12", "amount of posts displayed in chatbox");
define("CHBLAN_13", "Replace links");
define("CHBLAN_14", "if ticked, posted links will be replaced by text entered in box below");
define("CHBLAN_15", "Replace string if activated");
define("CHBLAN_16", "links will be replaced by this string");
define("CHBLAN_17", "Wordwrap count");
define("CHBLAN_18", "words longer than the number you set here will be wrapped");
define("CHBLAN_19", "Update Chatbox Settings");
define("CHBLAN_20", "Chatbox Settings");
define("CHBLAN_21", "Prune");
define("CHBLAN_22", "Delete posts older than a certain time period");
define("CHBLAN_23", "Delete posts older than ");
define("CHBLAN_24", "One day");
define("CHBLAN_25", "One week");
define("CHBLAN_26", "One month");
define("CHBLAN_27", "- Delete all posts -");
define("CHBLAN_28", "Chatbox pruned.");
define("CHBLAN_29", "Display chatbox inside scrolling layer");
define("CHBLAN_30", "Layer height");
define("CHBLAN_31", "Show emoticons");
define("CHBLAN_32", "Moderator userclass");
define("CHBLAN_33", "User counts recalculated");
define("CHBLAN_34", "Recalculate user post counts");
define("CHBLAN_35", "Recalculate");
define("CHBLAN_36", "Chatbox Display options");
define("CHBLAN_37", "Normal chatbox");
define("CHBLAN_38", "Use javascript code to update posts dynamically (AJAX)");
?>

View File

@@ -0,0 +1,15 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/chatbox_menu/languages/English/lan_chatbox_search.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:51 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
define("CB_SCH_LAN_1", "Chatbox");
?>

View File

@@ -0,0 +1,102 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/chatbox_menu/plugin.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:51 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
// Plugin info -------------------------------------------------------------------------------------------------------
$eplug_name = "Chatbox";
$eplug_version = "1.0";
$eplug_author = "e107";
$eplug_url = "http://e107.org";
$eplug_email = "jalist@e107.org";
$eplug_description = "Chatbox Menu";
$eplug_compatible = "e107v0.7+";
$eplug_readme = "";
$eplug_status = TRUE;
// Name of the plugin's folder -------------------------------------------------------------------------------------
$eplug_folder = "chatbox_menu";
// Name of menu item for plugin ----------------------------------------------------------------------------------
$eplug_menu_name = "chatbox_menu";
// Name of the admin configuration file --------------------------------------------------------------------------
$eplug_conffile = "admin_chatbox.php";
// Icon image and caption text ------------------------------------------------------------------------------------
$eplug_icon = $eplug_folder."/images/chatbox_32.png";
$eplug_icon_small = $eplug_folder."/images/chatbox_16.png";
$eplug_caption = LAN_CONFIGURE; // e107 generic term.
// List of preferences -----------------------------------------------------------------------------------------------
$eplug_prefs = array(
'chatbox_posts' => '10',
'cb_wordwrap' => '20',
'cb_layer' => '0',
'cb_layer_height' => '200',
'cb_emote' => '0',
'cb_mod' => e_UC_ADMIN
);
// List of table names -----------------------------------------------------------------------------------------------
$eplug_table_names = array(
"chatbox"
);
// List of sql requests to create tables -----------------------------------------------------------------------------
$eplug_tables = array(
"CREATE TABLE ".MPREFIX."chatbox (
cb_id int(10) unsigned NOT NULL auto_increment,
cb_nick varchar(30) NOT NULL default '',
cb_message text NOT NULL,
cb_datestamp int(10) unsigned NOT NULL default '0',
cb_blocked tinyint(3) unsigned NOT NULL default '0',
cb_ip varchar(15) NOT NULL default '',
PRIMARY KEY (cb_id)
) TYPE=MyISAM;"
);
// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
$eplug_link = FALSE;
$eplug_link_name = '';
$eplug_link_url = '';
// upgrading ... //
$upgrade_add_prefs = "";
$upgrade_remove_prefs = "";
$upgrade_alter_tables = "";
if (!function_exists('chatbox_menu_uninstall')) {
function chatbox_menu_uninstall() {
global $sql;
$sql -> db_Update("user", "user_chats='0'");
}
}
if (!function_exists('chatbox_menu_install')) {
function chatbox_menu_install() {
global $sql;
$sql -> db_Update("user", "user_chats='0'");
}
}
?>

View File

@@ -0,0 +1,28 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/chatbox_menu/search/search_advanced.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:51 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
$advanced['date']['type'] = 'date';
$advanced['date']['text'] = LAN_SEARCH_50.':';
$advanced['author']['type'] = 'author';
$advanced['author']['text'] = LAN_SEARCH_61.':';
?>

View File

@@ -0,0 +1,57 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/chatbox_menu/search/search_parser.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:51 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
$cb_count = $sql -> db_Count('chatbox');
// advanced
$advanced_where = "";
if (isset($_GET['time']) && is_numeric($_GET['time'])) {
$advanced_where .= " cb_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND";
}
if (isset($_GET['author']) && $_GET['author'] != '') {
$advanced_where .= " cb_nick LIKE '%".$tp -> toDB($_GET['author'])."%' AND";
}
// basic
$return_fields = 'cb_id, cb_nick, cb_message, cb_datestamp';
$search_fields = array('cb_nick', 'cb_message');
$weights = array('1', '1');
$no_results = LAN_198;
$where = $advanced_where;
$order = array('cb_datestamp' => DESC);
$ps = $sch -> parsesearch('chatbox', $return_fields, $search_fields, $weights, 'search_chatbox', $no_results, $where, $order);
$text .= $ps['text'];
$results = $ps['results'];
function search_chatbox($row) {
global $con, $cb_count;
preg_match("/([0-9]+)\.(.*)/", $row['cb_nick'], $user);
$res['link'] = e_PLUGIN."chatbox_menu/chat.php?".$row['cb_id'].".fs";
$res['pre_title'] = LAN_SEARCH_7;
$res['title'] = $user[2];
$res['summary'] = $row['cb_message'];
$res['detail'] = $con -> convert_date($row['cb_datestamp'], "long");
return $res;
}
?>

View File

@@ -0,0 +1,70 @@
<!--
function tick(e107_datepref,e107_dateformat,e107_datesuff1,e107_datesuff2,e107_datesuff3,e107_datesuff4) {
if(e107_datepref=='undefined'){e107_datepref = '';}
var hours, minutes, seconds, ap;
var intHours, intMinutes, intSeconds; var today;
today = new Date();
intDay = today.getDay();
intDate = today.getDate();
intMonth = today.getMonth();
intYear = today.getYear();
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
timeString = DayNam[intDay]+" "+e107_datepref+" "+intDate;
if (intDate == 1 || intDate == 21 || intDate == 31) {
timeString= timeString + e107_datesuff1 + " ";
} else if (intDate == 2 || intDate == 22) {
timeString= timeString + e107_datesuff2 + " ";
} else if (intDate == 3 || intDate == 23) {
timeString= timeString + e107_datesuff3 + " ";
} else {
timeString = timeString + e107_datesuff4 + " ";
}
if (intYear < 2000){
intYear += 1900;
}
timeString = timeString+" "+MnthNam[intMonth]+" "+intYear;
if(e107_dateformat == 1){
if (intHours == 0) {
hours = "12:";
ap = "am.";
} else if (intHours < 12) {
hours = intHours+":";
ap = "am.";
} else if (intHours == 12) {
hours = "12:";
ap = "pm.";
} else {
intHours = intHours - 12
hours = intHours + ":";
ap = "pm.";
}
}else{
if (intHours < 10) {
hours = "0" + intHours + ":";
} else {
hours = intHours + ":";
}
ap = '';
}
if (intMinutes < 10) {
minutes = "0"+intMinutes;
} else {
minutes = intMinutes;
}
if (intSeconds < 10) {
seconds = ":0"+intSeconds;
} else {
seconds = ":"+intSeconds;
}
timeString = (document.all)? timeString+", "+hours+minutes+seconds+" "+ap:timeString+" "+hours+minutes+" "+ap;
var clock = (document.all) ? document.all("Clock") : document.getElementById("Clock");
clock.innerHTML = timeString;
(document.all)?window.setTimeout("tick('"+e107_datepref+"','"+e107_dateformat+"','"+e107_datesuff1+"','"+e107_datesuff2+"','"+e107_datesuff3+"','"+e107_datesuff4+"');", 1000):window.setTimeout("tick('"+e107_datepref+"','"+e107_dateformat+"','"+e107_datesuff1+"','"+e107_datesuff2+"','"+e107_datesuff3+"','"+e107_datesuff4+"');", 6000);
}
////tick();
//-->

View File

@@ -0,0 +1,65 @@
<?php
/*
+---------------------------------------------------------------+
| e107 Clock Menu
| /clock_menu.php
|
| Compatible with the e107 content management system
| http://e107.org
|
| Originally written by jalist, modified for greater
| detail and cross browser compatiblity by Caveman
| Last modified 19:11 08/04/2003
|
| Works with Mozilla 1.x, NS6, NS7, IE5, IE5.5, Opera 7
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/clock_menu/clock_menu.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:52 $
| $Author: mcfly_e107 $
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
global $menu_pref;
$indexArray = array('clock_dateprefix','clock_format','clock_datesuffix1','clock_datesuffix2','clock_datesuffix3','clock_datesuffix4');
foreach($indexArray as $ind)
{
if(!isset($menu_pref[$ind]))
{
$menu_pref[$ind]='';
}
}
$ec_dir = e_PLUGIN."clock_menu/";
$lan_file = $ec_dir."languages/".e_LANGUAGE.".php";
e107_include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."clock_menu/languages/English.php");
if (!defined("e_HTTP")) {
exit;
}
$text = "\n\n<!-- ### clock ### //-->\n<div id='Clock'>&nbsp;</div>\n";
if (!isset($clock_flat) || !$clock_flat) {
$ns->tablerender($menu_pref['clock_caption'], "<div style='text-align:center'>".$text."</div>", 'clock');
} else {
echo $text;
}
?>
<script type="text/javascript">
<!--
var DayNam = new Array(
"<?php echo isset($LAN_407)?$LAN_407:"".CLOCK_MENU_L11; ?>","<?php echo isset($LAN_401)?$LAN_401:"".CLOCK_MENU_L5; ?>","<?php echo isset($LAN_402)?$LAN_402:"".CLOCK_MENU_L6; ?>","<?php echo isset($LAN_403)?$LAN_403:"".CLOCK_MENU_L7; ?>","<?php echo isset($LAN_404)?$LAN_404:"".CLOCK_MENU_L8; ?>","<?php echo isset($LAN_405)?$LAN_405:"".CLOCK_MENU_L9; ?>","<?php echo isset($LAN_406)?$LAN_406:"".CLOCK_MENU_L10; ?>");
var MnthNam = new Array(
"<?php echo isset($LAN_411)?$LAN_411:"".CLOCK_MENU_L12; ?>","<?php echo isset($LAN_412)?$LAN_412:"".CLOCK_MENU_L13; ?>","<?php echo isset($LAN_413)?$LAN_413:"".CLOCK_MENU_L14; ?>","<?php echo isset($LAN_414)?$LAN_414:"".CLOCK_MENU_L15; ?>","<?php echo isset($LAN_415)?$LAN_415:"".CLOCK_MENU_L16; ?>","<?php echo isset($LAN_416)?$LAN_416:"".CLOCK_MENU_L17; ?>","<?php echo isset($LAN_417)?$LAN_417:"".CLOCK_MENU_L18; ?>","<?php echo isset($LAN_418)?$LAN_418:"".CLOCK_MENU_L19; ?>","<?php echo isset($LAN_419)?$LAN_419:"".CLOCK_MENU_L20; ?>","<?php echo isset($LAN_420)?$LAN_420:"".CLOCK_MENU_L21; ?>","<?php echo isset($LAN_421)?$LAN_421:"".CLOCK_MENU_L22; ?>","<?php echo isset($LAN_422)?$LAN_422:"".CLOCK_MENU_L23; ?>");
//-->
</script>
<?php
echo "
<script type='text/javascript' src='".e_PLUGIN."clock_menu/clock.js'></script>
<script type=\"text/javascript\">\nwindow.setTimeout(\"tick('".$menu_pref['clock_dateprefix']."', '".$menu_pref['clock_format']."', '".$menu_pref['clock_datesuffix1']."', '".$menu_pref['clock_datesuffix2']."', '".$menu_pref['clock_datesuffix3']."', '".$menu_pref['clock_datesuffix4']."')\",150);\n</script>
<!-- ### end clock ### //-->\n\n";
?>

View File

@@ -0,0 +1,111 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/clock_menu/config.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:52 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
$eplug_admin = TRUE;
require_once("../../class2.php");
if (!getperms("1")) {
header("location:".e_BASE."index.php");
exit ;
}
require_once(e_ADMIN."auth.php");
@include_once(e_PLUGIN."clock_menu/languages/admin/".e_LANGUAGE.".php");
@include_once(e_PLUGIN."clock_menu/languages/admin/English.php");
require_once(e_HANDLER."form_handler.php");
$rs = new form;
if (isset($_POST['update_menu'])) {
while (list($key, $value) = each($_POST)) {
if ($key != "update_menu") {
$menu_pref[$key] = $value;
}
}
if ($_POST['clock_format'] != 1) {
$menu_pref['clock_format'] = 0;
}
$tmp = addslashes(serialize($menu_pref));
$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
$ns->tablerender("", "<div style=\"text-align:center\"><b>".CLOCK_AD_L1."</b></div>");
}
$text = "<div style='text-align:center'>
<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" name=\"menu_conf_form\">
<table style=\"width:85%\" class=\"fborder\">";
// Title
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L2.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input class=\"tbox\" type=\"text\" name=\"clock_caption\" size=\"20\" value=\"".$menu_pref['clock_caption']."\" maxlength=\"100\" />
</td>
</tr>";
// Format Time
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L5.": </td>
<td style=\"width:60%\" class='forumheader3'>".($menu_pref['clock_format'] == 1 ? $rs->form_checkbox("clock_format", 1, 1) : $rs->form_checkbox("clock_format", 1, 0) )."
<br /><b class='smalltext'>".CLOCK_AD_L6."</b></td>
</tr>";
// Date Prefix
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L7.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input class=\"tbox\" type=\"text\" name=\"clock_dateprefix\" size=\"10\" value=\"".$menu_pref['clock_dateprefix']."\" maxlength=\"50\" />
<br /><b class='smalltext'>".CLOCK_AD_L8."</b></td>
</tr>";
// Date Suffix
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L9.": </td>
<td style=\"width:60%\" class='forumheader3'>
1<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix1\" size=\"10\" value=\"".$menu_pref['clock_datesuffix1']."\" maxlength=\"50\" />
<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
</tr>";
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L10.": </td>
<td style=\"width:60%\" class='forumheader3'>
2<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix2\" size=\"10\" value=\"".$menu_pref['clock_datesuffix2']."\" maxlength=\"50\" />
<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
</tr>";
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L11.": </td>
<td style=\"width:60%\" class='forumheader3'>
3<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix3\" size=\"10\" value=\"".$menu_pref['clock_datesuffix3']."\" maxlength=\"50\" />
<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
</tr>";
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L12.": </td>
<td style=\"width:60%\" class='forumheader3'>
4<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix4\" size=\"10\" value=\"".$menu_pref['clock_datesuffix4']."\" maxlength=\"50\" />
<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
</tr>";
$text .= "<tr style=\"vertical-align:top\">
<td colspan=\"2\" style=\"text-align:center\" class='forumheader'>
<input class=\"button\" type=\"submit\" name=\"update_menu\" value=\"".CLOCK_AD_L3."\" />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(CLOCK_AD_L4, $text);
require_once(e_ADMIN."footer.php");
?>

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