mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 14:46:56 +02:00
new module creation
This commit is contained in:
70
e107_plugins/clock_menu/clock.js
Normal file
70
e107_plugins/clock_menu/clock.js
Normal 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();
|
||||
|
||||
//-->
|
65
e107_plugins/clock_menu/clock_menu.php
Normal file
65
e107_plugins/clock_menu/clock_menu.php
Normal 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'> </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";
|
||||
?>
|
111
e107_plugins/clock_menu/config.php
Normal file
111
e107_plugins/clock_menu/config.php
Normal 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");
|
||||
?>
|
44
e107_plugins/clock_menu/languages/English.php
Normal file
44
e107_plugins/clock_menu/languages/English.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?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/languages/English.php,v $
|
||||
| $Revision: 1.1.1.1 $
|
||||
| $Date: 2006-12-02 04:34:52 $
|
||||
| $Author: mcfly_e107 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
define('CLOCK_MENU_L1', 'Clock menu configuration saved');
|
||||
define('CLOCK_MENU_L2', 'Caption');
|
||||
define('CLOCK_MENU_L3', 'Update Menu Settings');
|
||||
define('CLOCK_MENU_L4', 'Clock Menu Config');
|
||||
define('CLOCK_MENU_L5', 'Monday,');
|
||||
define('CLOCK_MENU_L6', 'Tuesday,');
|
||||
define('CLOCK_MENU_L7', 'Wednesday,');
|
||||
define('CLOCK_MENU_L8', 'Thursday,');
|
||||
define('CLOCK_MENU_L9', 'Friday,');
|
||||
define('CLOCK_MENU_L10', 'Saturday,');
|
||||
define('CLOCK_MENU_L11', 'Sunday,');
|
||||
define('CLOCK_MENU_L12', 'January');
|
||||
define('CLOCK_MENU_L13', 'February');
|
||||
define('CLOCK_MENU_L14', 'March');
|
||||
define('CLOCK_MENU_L15', 'April');
|
||||
define('CLOCK_MENU_L16', 'May');
|
||||
define('CLOCK_MENU_L17', 'June');
|
||||
define('CLOCK_MENU_L18', 'July');
|
||||
define('CLOCK_MENU_L19', 'August');
|
||||
define('CLOCK_MENU_L20', 'September');
|
||||
define('CLOCK_MENU_L21', 'October');
|
||||
define('CLOCK_MENU_L22', 'November');
|
||||
define('CLOCK_MENU_L23', 'December');
|
||||
define('CLOCK_MENU_L24', '');
|
||||
?>
|
44
e107_plugins/clock_menu/languages/admin/English.php
Normal file
44
e107_plugins/clock_menu/languages/admin/English.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?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/languages/admin/English.php,v $
|
||||
| $Revision: 1.1.1.1 $
|
||||
| $Date: 2006-12-02 04:34:52 $
|
||||
| $Author: mcfly_e107 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
define("CLOCK_AD_L1", "Clock menu configuration saved");
|
||||
define("CLOCK_AD_L2", "Caption");
|
||||
define("CLOCK_AD_L3", "Update Menu Settings");
|
||||
define("CLOCK_AD_L4", "Clock Menu Config");
|
||||
define("CLOCK_AD_L5", "AM/PM");
|
||||
define("CLOCK_AD_L6", "If checked, you will display time with US format (0-12 AM/PM format). Unchecked you will display a 'military' format 0-24 format");
|
||||
define("CLOCK_AD_L7", "Date Prefix");
|
||||
define("CLOCK_AD_L8", "If your language requires a short word before the date (e.g. 'le' for French or 'den' for German...), use this field. If not required, leave blank.");
|
||||
define("CLOCK_AD_L9", "Suffix 1");
|
||||
define("CLOCK_AD_L10", "Suffix 2");
|
||||
define("CLOCK_AD_L11", "Suffix 3");
|
||||
define("CLOCK_AD_L12", "Suffix 4 and more");
|
||||
define("CLOCK_AD_L13", "If your language requires to display a suffix just after numbers for date, fill these fields with suffix only (Example: 'st' for 1, 'nd' for 2, 'rd' for 3 and 'th' for 4 and more - for English users). If not required leave blank.");
|
||||
define("CLOCK_AD_L14", "");
|
||||
define("CLOCK_AD_L15", "");
|
||||
define("CLOCK_AD_L16", "");
|
||||
define("CLOCK_AD_L17", "");
|
||||
define("CLOCK_AD_L18", "");
|
||||
define("CLOCK_AD_L19", "");
|
||||
define("CLOCK_AD_L20", "");
|
||||
define("CLOCK_AD_L21", "");
|
||||
define("CLOCK_AD_L22", "");
|
||||
define("CLOCK_AD_L23", "");
|
||||
define("CLOCK_AD_L24", "");
|
||||
?>
|
Reference in New Issue
Block a user