1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-29 19:00:26 +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

41
article.php Normal file
View File

@@ -0,0 +1,41 @@
<?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/article.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:01 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
// This file is now deprecated and remains in core for backward compatibility reasons.
$tmp = explode(".", $_SERVER['QUERY_STRING']);
$action = $tmp[0];
$sub_action = $tmp[1];
$id = $tmp[2];
if ($sub_action == 255) {
// content page
header("Location: content.php?content.{$action}");
exit;
}
if ($action == 0) {
// content page
header("Location: content.php?article");
exit;
} else {
header("Location: content.php?review");
exit;
}
?>

105
backend.php Normal file
View File

@@ -0,0 +1,105 @@
<?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/backend.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:01 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("class2.php");
$pubdate = strftime("%a, %d %b %Y %I:%M:00 GMT", time());
$rss = "<?xml version=\"1.0\"?>
<rss version=\"2.0\">
<channel>
<title>".SITENAME."</title>
<link>".SITEURL."</link>
<description>".SITEDESCRIPTION."</description>
<language>en-gb</language>
<copyright>".SITEDISCLAIMER."</copyright>
<managingEditor>".SITEADMIN."</managingEditor>
<webMaster>".SITEADMINEMAIL."</webMaster>
<pubDate>{$pubdate}</pubDate>
<lastBuildDate>{$pubdate}</lastBuildDate>
<docs>http://backend.userland.com/rss</docs>
<skipDays><day></day></skipDays>
<skipHours><hour></hour></skipHours>
<generator>e107 website system (http://e107.org)</generator>
<ttl>60<ttl>
<image>
<title>".SITENAME."</title>
<url>".SITEBUTTON."</url>
<link>".SITEURL."</link>
<width>88</width>
<height>31</height>
<description>".SITETAG."</description>
</image>
<textInput>
<title>Search</title>
<description>Search ".SITENAME."</description>
<name>query</name>
<link>".SITEURL."search.php</link>
</textInput>
";
$sql2 = new db;
$sql->db_Select("news", "*", "news_class=0 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") ORDER BY news_datestamp DESC LIMIT 0, 10");
while ($row = $sql->db_Fetch()) {
extract($row);
$sql2->db_Select("news_category", "*", "category_id='{$news_category}'");
$row = $sql->db_Fetch();
extract($row);
$sql2->db_Select("user", "user_name", "user_id='{$news_author}' ");
$row = $sql->db_Fetch();
extract($row);
$tmp = explode(" ", $news_body);
unset($nb);
for($a = 0; $a <= 100; $a++) {
$nb .= $tmp[$a]." ";
}
$nb = htmlspecialchars($nb);
$wlog .= $news_title."\n".SITEURL."/comment.php?comment.news.".$news_id."\n\n";
$itemdate = strftime("%a, %d %b %Y %I:%M:00 GMT", $news_datestamp);
$rss .= "<item>
<title>$news_title</title>
<link>http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id."</link>
<description>$nb</description>
<category domain=\"".SITEURL."\">$category_name</category>
<comments>http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id."</comments>
<author>$user_name</author>
<pubDate>$itemdate</pubDate>
<guid isPermaLink=\"true\">http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id."</guid>
</item>
";
}
$rss .= "</channel>
</rss>";
echo $rss;
?>

125
banner.php Normal file
View File

@@ -0,0 +1,125 @@
<?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/banner.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:01 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("class2.php");
require_once(e_HANDLER."form_handler.php");
$rs = new form;
if (e_QUERY) {
$query_string = intval(e_QUERY);
$sql->db_Select("banner", "*", "banner_id = '{$query_string}' ");
$row = $sql->db_Fetch();
$ip = $e107->getip();
$newip = (strpos($row['banner_ip'], "{$ip}^") !== FALSE) ? $row['banner_ip'] : "{$row['banner_ip']}{$ip}^";
$sql->db_Update("banner", "banner_clicks = banner_clicks + 1, `banner_ip` = '{$newip}' WHERE `banner_id` = '{$query_string}'");
header("Location: {$row['banner_clickurl']}");
exit;
}
require_once(HEADERF);
if (isset($_POST['clientsubmit'])) {
$clean_login = $tp -> toDB($_POST['clientlogin']);
$clean_password = $tp -> toDB($_POST['clientpassword']);
if (!$sql->db_Select("banner", "*", "`banner_clientlogin` = '{$clean_login}' AND `banner_clientpassword` = '{$clean_password}'")) {
$ns->tablerender(BANNERLAN_38, "<br /><div style='text-align:center'>".BANNERLAN_20."</div><br />");
require_once(FOOTERF);
exit;
}
$row = $sql->db_Fetch();
$banner_total = $sql->db_Select("banner", "*", "`banner_clientname` = '{$row['banner_clientname']}'");
if (!$banner_total) {
$ns->tablerender(BANNERLAN_38, "<br /><div style='text-align:center'>".BANNERLAN_29."</div><br />");
require_once(FOOTERF);
exit;
} else {
while ($row = $sql->db_Fetch()) {
$start_date = ($row['banner_startdate'] ? strftime("%d %B %Y", $row['banner_startdate']) : BANNERLAN_31);
$end_date = ($row['banner_enddate'] ? strftime("%d %B %Y", $row['banner_enddate']) : BANNERLAN_31);
$BANNER_TABLE_CLICKPERCENTAGE = ($row['banner_clicks'] && $row['banner_impressions'] ? round(($row['banner_clicks'] / $row['banner_impressions']) * 100)."%" : "-");
$BANNER_TABLE_IMPRESSIONS_LEFT = ($row['banner_impurchased'] ? $row['banner_impurchased'] - $row['banner_impressions'] : BANNERLAN_30);
$BANNER_TABLE_IMPRESSIONS_PURCHASED = ($row['banner_impurchased'] ? $row['banner_impurchased'] : BANNERLAN_30);
$BANNER_TABLE_CLIENTNAME = $row['banner_clientname'];
$BANNER_TABLE_BANNER_ID = $row['banner_id'];
$BANNER_TABLE_BANNER_CLICKS = $row['banner_clicks'];
$BANNER_TABLE_BANNER_IMPRESSIONS = $row['banner_impressions'];
$BANNER_TABLE_ACTIVE = BANNERLAN_36.($row['banner_active'] != "255" ? BANNERLAN_32 : "<b>".BANNERLAN_33."</b>");
$BANNER_TABLE_STARTDATE = BANNERLAN_37." ".$start_date;
$BANNER_TABLE_ENDDATE = BANNERLAN_34." ".$end_date;
if ($row['banner_ip']) {
$tmp = explode("^", $row['banner_ip']);
$BANNER_TABLE_IP_LAN = BANNERLAN_35.": ".(count($tmp)-1);
for($a = 0; $a <= (count($tmp)-2); $a++) {
$BANNER_TABLE_IP .= $tmp[$a]."<br />";
}
}
if (!$BANNER_TABLE) {
if (file_exists(THEME."banner_template.php")) {
require_once(THEME."banner_template.php");
} else {
require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
}
}
$textstring .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE);
}
}
if (!$BANNER_TABLE) {
if (file_exists(THEME."banner_template.php")) {
require_once(THEME."banner_template.php");
} else {
require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
}
}
$textstart = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE_START);
$textend = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE_END);
$text = $textstart.$textstring.$textend;
echo $text;
require_once(FOOTERF);
exit;
}
$BANNER_LOGIN_TABLE_LOGIN = $rs->form_text("clientlogin", 30, $id, 20, "tbox");
$BANNER_LOGIN_TABLE_PASSW = $rs->form_password("clientpassword", 30, "", 20, "tbox");
$BANNER_LOGIN_TABLE_SUBMIT = $rs->form_button("submit", "clientsubmit", BANNERLAN_18);
if (!$BANNER_LOGIN_TABLE) {
if (file_exists(THEME."banner_template.php")) {
require_once(THEME."banner_template.php");
} else {
require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
}
}
$text = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_LOGIN_TABLE);
$ns->tablerender(BANNERLAN_19, $text);
require_once(FOOTERF);
?>

1612
class2.php Normal file

File diff suppressed because it is too large Load Diff

326
comment.php Normal file
View File

@@ -0,0 +1,326 @@
<?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/comment.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:02 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("class2.php");
require_once(e_HANDLER."news_class.php");
require_once(e_HANDLER."comment_class.php");
define("PAGE_NAME", COMLAN_99);
if (!e_QUERY) {
header("location:".e_BASE."index.php");
exit;
}
$cobj =& new comment;
$temp_query = explode(".", e_QUERY);
$action = $temp_query[0];
$table = $temp_query[1];
$id = (isset($temp_query[2]) ? intval($temp_query[2]) : "");
$nid = (isset($temp_query[3]) ? intval($temp_query[3]) : "");
$xid = (isset($temp_query[4]) ? intval($temp_query[4]) : "");
unset($temp_query);
if (isset($_POST['commentsubmit']) || isset($_POST['editsubmit'])) {
if(!ANON && !USER)
{
header("location: ".e_BASE."index.php");
exit;
}
if($table == "poll") {
if (!$sql->db_Select("polls", "poll_title", "`poll_id` = {$id} AND `poll_comment` = 1")) {
header("location: ".e_BASE."index.php");
exit;
}
} else if($table == "news") {
if (!$sql->db_Select("news", "news_allow_comments", "`news_id` = {$id} AND `news_allow_comments` = 0")) {
header("location: ".e_BASE."index.php");
exit;
}
}
$pid = (isset($_POST['pid']) ? $_POST['pid'] : 0);
$pid = intval($pid);
$editpid = intval((isset($_POST['editpid']) ? $_POST['editpid'] : false));
$clean_authorname = $_POST['author_name'];
$clean_comment = $_POST['comment'];
$clean_subject = $_POST['subject'];
$cobj->enter_comment($clean_authorname, $clean_comment, $table, $id, $pid, $clean_subject);
if ($table == "news") {
$e107cache->clear("news");
} else {
$e107cache->clear("comment.php?{$table}.{$id}");
}
if($editpid) {
$redir = preg_replace("#\.edit.*#si", "", e_QUERY);
header("Location: ".e_SELF."?{$redir}");
exit;
}
}
if (isset($_POST['replysubmit']))
{
if ($table == "news" && !$sql->db_Select("news", "news_allow_comments", "news_id='{$nid}' ")) {
header("location:".e_BASE."index.php");
exit;
} else {
$row = $sql->db_Fetch();
if (!$row['news_id']) {
$pid = (isset($_POST['pid']) ? $_POST['pid'] : 0);
$pid = intval($pid);
$clean_authorname = $_POST['author_name'];
$clean_comment = $_POST['comment'];
$clean_subject = $_POST['subject'];
$cobj->enter_comment($clean_authorname, $clean_comment, $table, $nid, $pid, $clean_subject);
$e107cache->clear("comment.php?{$table}.{$id}");
}
//plugin e_comment.php files
$plugin_redir = false;
$e_comment = $cobj->get_e_comment();
if ($table == $e_comment[$table]['eplug_comment_ids']){
$plugin_redir = TRUE;
$reply_location = str_replace("{NID}", $nid, $e_comment[$table]['reply_location']);
}
if ($plugin_redir)
{
echo "<script type='text/javascript'>document.location.href='{$reply_location}'</script>\n";
exit;
} elseif ($table == "news" || $table == "poll")
{
echo "<script type='text/javascript'>document.location.href='".e_BASE."comment.php?comment.{$table}.{$nid}'</script>\n";
exit;
} elseif($table == "bugtrack")
{
echo "<script type='text/javascript'>document.location.href='".e_PLUGIN."bugtracker/bugtracker.php?show.{$nid}'</script>\n";
exit;
} elseif($table == "faq")
{
echo "<script type='text/javascript'>document.location.href='".e_PLUGIN."faq/faq.php?cat.{$xid}.{$nid}'</script>\n";
exit;
} elseif ($table == "content")
{
echo "<script type='text/javascript'>document.location.href='".e_BASE."content.php?{$_POST['content_type']}.{$nid}'</script>\n";
exit;
} elseif ($table == "download")
{
echo "<script type='text/javascript'>document.location.href='".e_BASE."download.php?view.{$nid}'</script>\n";
exit;
} elseif ($table == "page")
{
echo "<script type='text/javascript'>document.location.href='".e_BASE."page.php?{$nid}'</script>\n";
exit;
}
}
}
if ($action == "reply") {
if (!$pref['nested_comments']) {
header("Location: ".e_BASE."comment.php?comment.{$table}.{$nid}");
exit;
}
$query = "`comment_id` = '{$id}' LIMIT 0,1";
if ($sql->db_Select("comments", "comment_subject", "`comment_id` = '{$id}'")) {
list($comments['comment_subject']) = $sql->db_Fetch();
$not_parsed_subject = $comments['comment_subject'];
$subject = $tp->toHTML($comments['comment_subject']);
}
if ($subject == "") {
if ($table == "news") {
if (!$sql->db_Select("news", "news_title", "news_id='{$nid}' ")) {
header("location: ".e_BASE."index.php");
exit;
} else {
list($news['news_title']) = $sql->db_Fetch();
$subject = $news['news_title'];
$title = COMLAN_100;
}
} elseif ($table == "poll") {
if (!$sql->db_Select("polls", "poll_title", "poll_id='{$nid}' ")) {
header("location:".e_BASE."index.php");
exit;
} else {
list($poll['poll_title']) = $sql->db_Fetch();
$subject = $poll['poll_title'];
$title = COMLAN_101;
}
} elseif ($table == "content") {
$sql->db_Select("content", "content_heading", "content_id='{$nid}'");
$subject = $content['content_heading'];
} elseif ($table == "bugtracker") {
$sql->db_Select("bugtrack", "bugtrack_summary", "bugtrack_id='{$nid}'");
$subject = $content['content_heading'];
}
}
if ($table == "content") {
$sql->db_Select("content", "content_type", "content_id='{$nid}'");
list($content['content_type']) = $sql->db_Fetch();
if ($content['content_type'] == "0") {
$content_type = "article";
$title = COMLAN_103;
} elseif ($content['content_type'] == "3") {
$content_type = "review";
$title = COMLAN_104;
} elseif ($content['content_type'] == "1") {
$content_type = "content";
$title = COMLAN_105;
}
}
define('e_PAGETITLE', $title." / ".COMLAN_99." / ".COMLAN_102.$subject."");
require_once(HEADERF);
} else {
if ($cache = $e107cache->retrieve("comment.php?{$table}.{$id}")) {
require_once(HEADERF);
echo $cache;
require_once(FOOTERF);
exit;
} else {
if ($table == "news") {
/*
changes by jalist 19/01/05:
updated db query removed one call
*/
if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled']) {
$query = "SELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
LEFT JOIN #user AS u ON n.news_author = u.user_id
LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
LEFT JOIN #trackback AS tb ON tb.trackback_pid = n.news_id
WHERE n.news_class REGEXP '".e_CLASS_REGEXP."'
AND n.news_id={$id}
AND n.news_allow_comments=0
GROUP by n.news_id";
} else {
$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
LEFT JOIN #user AS u ON n.news_author = u.user_id
LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
WHERE n.news_class REGEXP '".e_CLASS_REGEXP."'
AND n.news_id={$id}
AND n.news_allow_comments=0";
}
if (!$sql->db_Select_gen($query)) {
header("location:".e_BASE."index.php");
exit;
} else {
$news = $sql->db_Fetch();
$subject = $tp->toForm($news['news_title']);
define("e_PAGETITLE", COMLAN_100." / ".COMLAN_99." / {$subject}");
require_once(HEADERF);
ob_start();
$ix = new news;
$ix->render_newsitem($news, "extend"); // extend so that news-title-only news text is displayed in full when viewing comments.
$field = $news['news_id'];
$comtype = 0;
}
}
else if($table == "poll") {
if (!$sql->db_Select("polls", "*", "poll_id='{$id}'")) {
header("location:".e_BASE."index.php");
exit;
} else {
$row = $sql->db_Fetch();
$comments_poll = $row['poll_comment'];
$subject = $row['poll_title'];
define("e_PAGETITLE", COMLAN_101." / ".COMLAN_99." / ".$subject."");
require_once(HEADERF);
require(e_PLUGIN."poll/poll_menu.php");
$field = $row['poll_id'];
$comtype = 4;
if(!$comments_poll)
{
require_once(FOOTERF);
exit;
}
}
}
require_once(HEADERF);
}
}
if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news"){
echo "<span class='smalltext'><b>".$pref['trackbackString']."</b> ".$e107->http_path.e_PLUGIN."trackback/trackback.php?pid={$id}</span>";
}
$field = ($field ? $field : ($id ? $id : ""));
$width = (isset($width) && $width ? $width : "");
$cobj->compose_comment($table, $action, $field, $width, $subject, $rate=FALSE);
if (!strstr(e_QUERY, "poll")) {
$cache = ob_get_contents();
$e107cache->set("comment.php?{$table}.{$field}", $cache);
}
ob_end_flush(); // dump the buffer we started
if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news"){
if($sql->db_Select("trackback", "*", "trackback_pid={$id}"))
{
$tbArray = $sql -> db_getList();
if (file_exists(THEME."trackback_template.php")) {
require_once(THEME."trackback_template.php");
} else {
require_once(e_THEME."templates/trackback_template.php");
}
$text = "";
foreach($tbArray as $trackback)
{
extract($trackback);
$TITLE = $trackback_title;
$EXCERPT = $trackback_excerpt;
$BLOGNAME = "<a href='{$trackback_url}' rel='external'>{$trackback_blogname}</a>";
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TRACKBACK);
}
if($TRACKBACK_RENDER_METHOD)
{
$ns->tablerender("<a name='track'></a>".COMLAN_315, $text);
}
else
{
echo "<a name='track'></a>".$text;
}
}
else
{
echo "<a name='track'></a>".COMLAN_316;
}
if (ADMIN && getperms("B")) {
echo "<div style='text-align:right'><a href='".e_PLUGIN."trackback/modtrackback.php?".$id."'>".COMLAN_317."</a></div><br />";
}
}
require_once(FOOTERF);
?>

160
contact.php Normal file
View File

@@ -0,0 +1,160 @@
<?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/contact.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:02 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("class2.php");
// security image may be disabled by removing the appropriate shortcodes from the template.
require_once(e_HANDLER."secure_img_handler.php");
$sec_img = new secure_image;
require_once(HEADERF);
if (!$CONTACT_FORM) {
if (file_exists(THEME."contact_template.php")) {
require_once(THEME."contact_template.php");
} else {
require_once(e_THEME."templates/contact_template.php");
}
}
if(isset($_POST['send-contactus'])){
$error = "";
$sender_name = $tp->toEmail($_POST['author_name'],TRUE);
$sender = check_email($_POST['email_send']);
$subject = $tp->toEmail($_POST['subject'],TRUE);
$body = $tp->toEmail($_POST['body'],TRUE);
// Check Image-Code
if (isset($_POST['rand_num']) && !$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify']))
{
$error .= LANCONTACT_15."\\n";
}
// Check message body.
if(strlen(trim($_POST['body'])) < 15)
{
$error .= LANCONTACT_12."\\n";
}
// Check subject line.
if(strlen(trim($_POST['subject'])) < 2)
{
$error .= LANCONTACT_13."\\n";
}
if(!strpos(trim($_POST['email_send']),"@"))
{
$error .= LANCONTACT_11."\\n";
}
// Check email address on remote server (if enabled).
if ($pref['signup_remote_emailcheck'] && $error == "")
{
require_once(e_HANDLER."mail_validation_class.php");
list($adminuser,$adminhost) = split ("@", SITEADMINEMAIL);
$validator = new email_validation_class;
$validator->localuser= $adminuser;
$validator->localhost= $adminhost;
$validator->timeout=3;
// $validator->debug=1;
// $validator->html_debug=1;
if($validator->ValidateEmailBox($sender) != 1)
{
$error .= LANCONTACT_11."\\n";
}
}
// No errors - so proceed to email the admin and the user (if selected).
if(!$error)
{
$body .= "\n\nIP:\t".USERIP."\n";
$body .= "User:\t#".USERID." ".USERNAME."\n";
if(!$_POST['contact_person'] && isset($pref['sitecontacts'])) // only 1 person, so contact_person not posted.
{
if($pref['sitecontacts'] == e_UC_MAINADMIN)
{
$query = "user_perms = '0' OR user_perms = '0.' ";
}
elseif($pref['sitecontacts'] == e_UC_ADMIN)
{
$query = "user_admin = 1 ";
}
else
{
$query = $pref['sitecontacts'] . " IN (user_class) ";
}
}
else
{
$query = "user_id = ".$_POST['contact_person'];
}
if($sql -> db_Select("user", "user_name,user_email",$query." LIMIT 1"))
{
$row = $sql -> db_Fetch();
$send_to = $row['user_email'];
$send_to_name = $row['user_name'];
}
else
{
$send_to = SITEADMINEMAIL;
$send_to_name = ADMIN;
}
require_once(e_HANDLER."mail.php");
$message = (sendemail($send_to,"[".SITENAME."] ".$subject, $body,$send_to_name,$sender,$sender_name)) ? LANCONTACT_09 : LANCONTACT_10;
if(isset($pref['contact_emailcopy']) && $pref['contact_emailcopy'] && $_POST['email_copy'] == 1){
sendemail($sender,"[".SITENAME."] ".$subject, $body,ADMIN,$sender,$sender_name);
}
$ns -> tablerender('', $message);
require_once(FOOTERF);
exit;
}
else
{
require_once(e_HANDLER."message_handler.php");
message_handler("P_ALERT", $error);
}
}
if(SITECONTACTINFO && $CONTACT_INFO)
{
$text = $tp->toHTML($CONTACT_INFO,"","parse_sc");
$ns -> tablerender(LANCONTACT_01, $text,"contact");
}
if(isset($pref['sitecontacts']) && $pref['sitecontacts'] != 255)
{
require_once(e_FILE."shortcode/batch/contact_shortcodes.php");
$text = $tp->parseTemplate($CONTACT_FORM, TRUE, $contact_shortcodes);
if(trim($text) != "")
{
$ns -> tablerender(LANCONTACT_02, $text, "contact");
}
}
require_once(FOOTERF);
exit;
?>

73
content.php Normal file
View File

@@ -0,0 +1,73 @@
<?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/content.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:02 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("class2.php");
//##### REDIRECTION MANAGEMENT -----------------------------------------------------------------------------
if($content_install = $sql -> db_Select("plugin", "*", "plugin_path = 'content' AND plugin_installflag = '1' ")){
//require_once($plugindir."handlers/content_class.php");
//$aa = new content;
$tmp = explode(".", e_QUERY);
if($tmp[0]){
//get type_id from the row with heading content, article or review
//this will only work if the three main parents are not renamed !
if(!$sql -> db_Select("pcontent", "content_id", "content_heading='".$tp -> toDB($tmp[0])."'")){
header("location:".e_PLUGIN."content/content.php");
}else{
$row = $sql -> db_Fetch();
}
}
if ($tmp[0] == "content") {
if (is_numeric($tmp[1])) { //content view
$tmp[1] = intval($tmp[1]);
header("location:".e_PLUGIN."content/content.php?content.".$tmp[1]);
}else{ //content recent page
header("location:".e_PLUGIN."content/content.php?recent.".$row['content_id']);
}
}elseif ($tmp[0] == "article" || $tmp[0] == "review") {
if (is_numeric($tmp[1])) { //item view
$tmp[1] = intval($tmp[1]);
header("location:".e_PLUGIN."content/content.php?content.".$tmp[1]);
}elseif($tmp[1] == "cat" ) { //category page
if(!$tmp[2] || $tmp[2] == "0") { //all categories
//$mainparent = $aa -> getMainParent($tmp[2]);
//header("location:".e_PLUGIN."content/content.php?cat.list.".$mainparent."");
header("location:".e_PLUGIN."content/content.php");
}else{ //view category
header("location:".e_PLUGIN."content/content.php?cat.".$tmp[2]);
}
} else { //recent page
header("location:".e_PLUGIN."content/content.php?recent.".$row['content_id']);
}
}else{ //redirect to new content main page
header("location:".e_PLUGIN."content/content.php");
}
}
//##### END REDIRECTION MANAGEMENT -------------------------------------------------------------------------
?>

739
download.php Normal file
View File

@@ -0,0 +1,739 @@
<?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/download.php,v $
| $Revision: 1.1.1.1 $ - with modifications
| $Date: 2006-12-02 04:33:03 $
| $Author: mcfly_e107 $
|
| Modifications by steved:
| 1. Can display sub-categories which contain sub-sub categories and files
| 2. New $pref['download_subsub'] - if defined and '0', doesn't display sub-sub categories
+----------------------------------------------------------------------------+
*/
require_once("class2.php");
require_once(e_HANDLER."comment_class.php");
require_once(e_FILE."shortcode/batch/download_shortcodes.php");
unset($text);
$agreetext = $tp->toHTML($pref['agree_text'],TRUE,"parse_sc");
$cobj = new comment;
global $tp;
if(!defined("USER_WIDTH")){ define("USER_WIDTH","width:100%"); }
// To prevent display of sub-categories on the main display, un-comment the following line
//$pref['download_subsub'] = '0';
/* define images */
define("IMAGE_DOWNLOAD", (file_exists(THEME."images/download.png") ? THEME."images/download.png" : e_IMAGE."generic/".IMODE."/download.png"));
define("IMAGE_NEW", (file_exists(THEME."images/new.png") ? THEME."images/new.png" : e_IMAGE."generic/".IMODE."/new.png"));
/* define image style */
if (!e_QUERY || $_GET['elan'])
{
require_once(HEADERF);
// no qs - render categories ...
if($cacheData = $e107cache->retrieve("download_cat",720)) // expires every 12 hours.
{
echo $cacheData;
require_once(FOOTERF);
exit;
}
if (!$DOWNLOAD_CAT_PARENT_TABLE)
{
if (is_readable(THEME."templates/download_template.php"))
{
require_once(THEME."templates/download_template.php");
}
elseif (is_readable(THEME."download_template.php"))
{
require_once(THEME."download_template.php");
}
else
{
require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php");
}
}
if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:1px solid blue");}
$qry = "
SELECT dc.*, SUM(d.download_filesize) AS d_size,
COUNT(d.download_id) AS d_count,
MAX(d.download_datestamp) as d_last,
SUM(d.download_requested) as d_requests,
COUNT(d2.download_id) AS d_subcount,
SUM(d2.download_filesize) AS d_subsize,
SUM(d2.download_requested) as d_subrequests
FROM #download_category AS dc
LEFT JOIN #download AS d ON dc.download_category_id = d.download_category AND d.download_active > 0 AND d.download_visible IN (".USERCLASS_LIST.")
LEFT JOIN #download_category as dc2 ON dc2.download_category_parent=dc.download_category_id
LEFT JOIN #download AS d2 ON dc2.download_category_id = d2.download_category AND d2.download_active > 0 AND d2.download_visible IN (".USERCLASS_LIST.")
WHERE dc.download_category_class IN (".USERCLASS_LIST.")
GROUP by dc.download_category_id ORDER by dc.download_category_order
";
if (!$sql->db_Select_gen($qry))
{
$ns->tablerender(LAN_dl_18, "<div style='text-align:center'>".LAN_dl_2."</div>");
require_once(FOOTERF);
exit;
}
else
{
while($row = $sql->db_Fetch())
{
$catList[$row['download_category_parent']][] = $row;
}
foreach($catList[0] as $row)
{ // Display main category headings, then sub-categories, optionally with sub-sub categories expanded
$download_cat_table_string .= parse_download_cat_parent_table($row);
foreach($catList[$row['download_category_id']] as $crow)
{
if (isset($pref['download_subsub']) && ($pref['download_subsub'] == '0'))
{ // Don't display sub-sub categories here
$download_cat_table_string .= parse_download_cat_child_table($crow, FALSE);
}
else
{ // Display sub-sub categories
$download_cat_table_string .= parse_download_cat_child_table($crow, $catList[$crow['download_category_id']]);
}
}
}
}
$download_cat_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_START);
$DOWNLOAD_CAT_NEWDOWNLOAD_TEXT = "<img src='".IMAGE_NEW."' alt='' style='vertical-align:middle' /> ".LAN_dl_36;
$DOWNLOAD_CAT_SEARCH = "
<form method='get' action='".e_BASE."search.php'>
<p>
<input class='tbox' type='text' name='q' size='30' value='' maxlength='50' />
<input class='button' type='submit' name='s' value='".LAN_dl_41."' />
<input type='hidden' name='r' value='0' />
</p>
</form>";
$download_cat_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_END);
$text .= $download_cat_table_start.$download_cat_table_string.$download_cat_table_end;
ob_start();
if($DOWNLOAD_CAT_TABLE_RENDERPLAIN) {
echo $text;
} else {
$ns->tablerender(LAN_dl_18.$type, $text);
}
$cache_data = ob_get_flush();
$e107cache->set("download_cat", $cache_data);
require_once(FOOTERF);
exit;
}
// Got a query string from now on
$tmp = explode(".", e_QUERY);
if (is_numeric($tmp[0]))
{
$from = intval($tmp[0]);
$action = preg_replace("#\W#", "", $tp -> toDB($tmp[1]));
$id = intval($tmp[2]);
$view = intval($tmp[3]);
$order = preg_replace("#\W#", "", $tp -> toDB($tmp[4]));
$sort = preg_replace("#\W#", "", $tp -> toDB($tmp[5]));
}
else
{
$action = preg_replace("#\W#", "", $tp -> toDB($tmp[0]));
$id = intval($tmp[1]);
}
if (isset($_POST['commentsubmit']))
{
if (!$sql->db_Select("download", "download_comment", "download_id = '{$id}' "))
{
header("location:".e_BASE."index.php");
exit;
}
else
{
$row = $sql->db_Fetch();
if ($row['download_comment'] && (ANON === TRUE || USER === TRUE))
{
$clean_authorname = $_POST['author_name'];
$clean_comment = $_POST['comment'];
$clean_subject = $_POST['subject'];
$cobj->enter_comment($clean_authorname, $clean_comment, "download", $id, $pid, $clean_subject);
$e107cache->clear("comment.download.{$sub_action}");
}
}
}
// -------------------------------------------------------------------------------------------------------------------------------------------------------------------
if ($action == "list") {
if (isset($_POST['view'])) {
extract($_POST);
}
if (!$from) {
$from = 0;
}
if (!$order) {
$order = ($pref['download_order'] ? $pref['download_order'] : "download_datestamp");
}
if (!$sort) {
$sort = ($pref['download_sort'] ? $pref['download_sort'] : "DESC");
}
if (!$view) {
$view = ($pref['download_view'] ? $pref['download_view'] : "10");
}
$total_downloads = $sql->db_Count("download", "(*)", "WHERE download_category = '{$id}' AND download_active > 0 AND download_visible REGEXP '".e_CLASS_REGEXP."'");
// Next three lines extract page title
if ($sql->db_Select("download_category", "*", "(download_category_id='{$id}') AND (download_category_class IN (".USERCLASS_LIST."))") )
{
$row = $sql->db_Fetch();
extract($row);
$type = $download_category_name;
$type .= ($download_category_description) ? " [ ".$download_category_description." ]" : "";
define("e_PAGETITLE", PAGE_NAME." / ".$download_category_name);
}
else
{ // No access to this category
define("e_PAGETITLE", PAGE_NAME);
require_once(HEADERF);
$ns->tablerender(LAN_dl_18, "<div style='text-align:center'>".LAN_dl_3."</div>");
require_once(FOOTERF);
exit;
}
require_once(HEADERF);
/* SHOW SUBCATS ... */
if($sql -> db_Select("download_category", "download_category_id", "download_category_parent='{$id}' "))
{
/* there are subcats - display them ... */
$qry = "
SELECT dc.*, dc2.download_category_name AS parent_name, dc2.download_category_icon as parent_icon, SUM(d.download_filesize) AS d_size,
COUNT(d.download_id) AS d_count,
MAX(d.download_datestamp) as d_last,
SUM(d.download_requested) as d_requests
FROM #download_category AS dc
LEFT JOIN #download AS d ON dc.download_category_id = d.download_category AND d.download_active > 0 AND d.download_visible IN (".USERCLASS_LIST.")
LEFT JOIN #download_category as dc2 ON dc2.download_category_id='{$id}'
WHERE dc.download_category_class IN (".USERCLASS_LIST.") AND dc.download_category_parent='{$id}'
GROUP by dc.download_category_id ORDER by dc.download_category_order
";
$sql->db_Select_gen($qry);
$scArray = $sql -> db_getList();
if (!$DOWNLOAD_CAT_PARENT_TABLE)
{
if (file_exists(THEME."download_template.php"))
{
require_once(THEME."download_template.php");
}
else
{
require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php");
}
}
if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:1px solid blue");}
foreach($scArray as $row)
{
$download_cat_table_string .= parse_download_cat_child_table($row, FALSE);
}
if(strstr($row['parent_icon'], chr(1))) {
list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $row['parent_icon']);
}
$DOWNLOAD_CAT_MAIN_ICON = ($download_category_icon ? "<img src='".e_IMAGE."icons/".$download_category_icon."' alt='' style='float: left' />" : "&nbsp;");
$DOWNLOAD_CAT_MAIN_NAME = $tp->toHTML($row['parent_name']);
$download_cat_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_START);
$DOWNLOAD_CAT_NEWDOWNLOAD_TEXT = "<img src='".IMAGE_NEW."' alt='' style='vertical-align:middle' /> ".LAN_dl_36;
$download_cat_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_END);
$text = $download_cat_table_start.$download_cat_table_string.$download_cat_table_end;
if($DOWNLOAD_CAT_TABLE_RENDERPLAIN)
{
echo $text;
}
else
{
$ns->tablerender($type, $text);
}
$text = ""; // If other files, show in a separate block
$type = ""; // Cancel title once displayed
} // End of subcategory display
// Now display individual downloads
$core_total = $sql->db_Count("download WHERE download_category='{$id}' AND download_active > 0 AND download_visible IN (".USERCLASS_LIST.")");
if (!check_class($download_category_class))
{
$ns->tablerender(LAN_dl_18, "<div style='text-align:center'>".LAN_dl_3."</div>");
require_once(FOOTERF);
exit;
}
if(strstr($download_category_icon, chr(1)))
{
list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $download_category_icon);
}
$DOWNLOAD_CATEGORY_ICON = ($download_category_icon ? "<img src='".e_IMAGE."icons/".$download_category_icon."' alt='' style='float: left' />" : "&nbsp;");
$DOWNLOAD_CATEGORY = $tp->toHTML($download_category_name,FALSE,"emotes_off, no_make_clickable");
$DOWNLOAD_CATEGORY_DESCRIPTION = $tp -> toHTML($download_category_description, TRUE);
if (!$DOWNLOAD_LIST_TABLE) {
if (file_exists(THEME."download_template.php")) {
require_once(THEME."download_template.php");
} else {
require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php");
}
}
if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:1px solid blue");}
$gen = new convert;
require_once(e_HANDLER."rate_class.php");
$rater = new rater;
$sql = new db;
$sql2 = new db;
$filetotal = $sql->db_Select("download", "*", "download_category='{$id}' AND download_active > 0 AND download_visible IN (".USERCLASS_LIST.") ORDER BY {$order} {$sort} LIMIT {$from}, {$view}");
$ft = ($filetotal < $view ? $filetotal : $view);
while ($row = $sql->db_Fetch()) {
extract($row);
$download_list_table_string .= parse_download_list_table($row);
$tdownloads += $download_requested;
}
$DOWNLOAD_LIST_TOTAL_AMOUNT = $tdownloads." ".LAN_dl_16;
$DOWNLOAD_LIST_TOTAL_FILES = $ft." ".LAN_dl_17;
$download_list_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_LIST_TABLE_START);
$download_list_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_LIST_TABLE_END);
$text .= $download_list_table_start.$download_list_table_string.$download_list_table_end;
if($DOWNLOAD_LIST_TABLE_RENDERPLAIN) {
echo $text;
} else {
$ns->tablerender($type, $text);
}
echo "<div style='text-align:center;margin-left:auto;margin-right:auto'><a href='".e_SELF."'>".LAN_dl_9."</a><br /><br />";
$parms = $total_downloads.",".$view.",".$from.",".e_SELF."?[FROM].list.{$id}.{$view}.{$order}.{$sort}.";
echo ($total_downloads > $view) ? "<div class='nextprev'>&nbsp;".$tp->parseTemplate("{NEXTPREV={$parms}}")."</div>" : "";
echo "</div>";
require_once(FOOTERF);
exit;
} // end of action=="list"
// ---------------- View Mode ---------------------------------------------------------------------------------------------------------------------------------------------------
if ($action == "view") {
$gen = new convert;
$highlight_search = FALSE;
if (isset($_POST['highlight_search'])) {
$highlight_search = TRUE;
}
$query = "
SELECT d.*, dc.* FROM #download AS d
LEFT JOIN #download_category AS dc ON d.download_category = dc.download_category_id
WHERE d.download_id = {$id} AND d.download_active > 0
AND d.download_visible IN (".USERCLASS_LIST.")
AND dc.download_category_class IN (".USERCLASS_LIST.")
LIMIT 1";
if(!$sql -> db_Select_gen($query)){
require_once(HEADERF);
$ns->tablerender(LAN_dl_18, "<div style='text-align:center'>".LAN_dl_3."</div>");
require_once(FOOTERF);
exit;
}
$dl = $sql -> db_Fetch();
if (!isset($DOWNLOAD_VIEW_TABLE) && is_readable(THEME."download_template.php"))
{
include_once(THEME."download_template.php");
}
else
{
include_once(e_THEME."templates/download_template.php");
}
if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:0px");}
if(!isset($DL_VIEW_PAGETITLE))
{
$DL_VIEW_PAGETITLE = PAGE_NAME." / {DOWNLOAD_CATEGORY} / {DOWNLOAD_VIEW_NAME}";
}
$DL_TITLE = $tp->parseTemplate($DL_VIEW_PAGETITLE, TRUE, $download_shortcodes);
define("e_PAGETITLE", $DL_TITLE);
require_once(HEADERF);
$DL_TEMPLATE = $DOWNLOAD_VIEW_TABLE_START.$DOWNLOAD_VIEW_TABLE.$DOWNLOAD_VIEW_TABLE_END;
$text = $tp->parseTemplate($DL_TEMPLATE, TRUE, $download_shortcodes);
if(!isset($DL_VIEW_CAPTION))
{
$DL_VIEW_CAPTION = "{DOWNLOAD_VIEW_CAPTION}";
}
if(!isset($DL_VIEW_NEXTPREV))
{
$DL_VIEW_NEXTPREV = "
<div style='text-align:center'>
<table style='".USER_WIDTH."'>
<tr>
<td style='width:40%;'>{DOWNLOAD_VIEW_PREV}</td>
<td style='width:20%; text-align: center;'>{DOWNLOAD_BACK_TO_LIST}</td>
<td style='width:40%; text-align: right;'>{DOWNLOAD_VIEW_NEXT}</td>
</tr>
</table>
</div>
";
}
// ------- Next/Prev -----------
$text .= $tp->parseTemplate($DL_VIEW_NEXTPREV,TRUE,$download_shortcodes);
$caption = $tp->parseTemplate($DL_VIEW_CAPTION,TRUE,$download_shortcodes);
if($DOWNLOAD_VIEW_TABLE_RENDERPLAIN) {
echo $text;
} else {
$ns->tablerender($caption, $text);
}
unset($text);
if ($dl['download_comment']) {
$cobj->compose_comment("download", "comment", $id, $width,$dl['download_name'], $showrate=FALSE);
}
require_once(FOOTERF);
exit;
}
// ---------------- Report Broken Link Mode ---------------------------------------------------------------------------------------------------------------------------------------------------
if ($action == "report" && check_class($pref['download_reportbroken'])) {
if (!$sql->db_Select("download", "*", "download_id = {$id} AND download_active > 0")) {
require_once(HEADERF);
require_once(FOOTERF);
exit;
}
$row = $sql -> db_Fetch();
extract($row);
if (isset($_POST['report_download'])) {
$report_add = $tp -> toDB($_POST['report_add']);
$download_name = $tp -> toDB($download_name);
$user = USER ? USERNAME : LAN_dl_52;
if ($pref['download_email']) { // this needs to be moved into the NOTIFY, with an event.
require_once(e_HANDLER."mail.php");
$subject = LAN_dl_60." ".SITENAME;
$report = LAN_dl_58." ".SITENAME.":\n".(substr(SITEURL, -1) == "/" ? SITEURL : SITEURL."/")."download.php?view.".$download_id."\n
".LAN_dl_59." ".$user."\n".$report_add;
sendemail(SITEADMINEMAIL, $subject, $report);
}
$sql->db_Insert('generic', "0, 'Broken Download', ".time().",'".USERID."', '{$download_name}', {$id}, '{$report_add}'");
define("e_PAGETITLE", PAGE_NAME." / ".LAN_dl_47);
require_once(HEADERF);
$text = LAN_dl_48."<br /><br /><a href='".e_BASE."download.php?view.".$download_id."'>".LAN_dl_49."</a";
$ns->tablerender(LAN_dl_50, $text);
} else {
define("e_PAGETITLE", PAGE_NAME." / ".LAN_dl_51." ".$download_name);
require_once(HEADERF);
$text = "<form action='".e_SELF."?report.{$download_id}' method='post'>
<table style='".USER_WIDTH."'>
<tr>
<td style='width:50%' >
".LAN_dl_32.": ".$download_name."<br />
<a href='".e_SELF."?view.{$download_id}'>
<span class='smalltext'>".LAN_dl_53."</span>
</a>
</td>
<td style='text-align:center;width:50%'>
</td>
</tr>
<tr>
<td>".LAN_dl_54."<br />".LAN_dl_55."
</td>
<td style='text-align:center;'>
<textarea cols='40' rows='10' class='tbox' name='report_add'></textarea>
</td>
</tr>
<tr>
<td colspan='2' style='text-align:center;'><br />
<input class='button' type='submit' name='report_download' value=\"".LAN_dl_45."\" />
</td>
</tr>
</table>";
$ns->tablerender(LAN_dl_50, $text);
}
require_once(FOOTERF);
exit;
}
// ---------------- Mirror Mode ---------------------------------------------------------------------------------------------------------------------------------------------------
if($action == "mirror")
{
require_once(HEADERF);
if (!$DOWNLOAD_MIRROR_START) {
if (file_exists(THEME."download_template.php")) {
require_once(THEME."download_template.php");
} else {
require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php");
}
}
$sql -> db_Select("download_mirror");
$mirrorList = $sql -> db_getList("ALL", 0, 200, "mirror_id");
if($sql -> db_Select("download", "*", "download_id = {$id}"))
{
$row = $sql->db_Fetch();
extract($row);
$array = explode(chr(1), $download_mirror);
$c = (count($array)-1);
for ($i=1; $i<$c; $i++) {
$d = mt_rand(0, $i);
$tmp = $array[$i];
$array[$i] = $array[$d];
$array[$d] = $tmp;
}
$download_mirror = "";
foreach($array as $mirrorstring)
{
if($mirrorstring)
{
$download_mirror .= parse_download_mirror_table($row, $mirrorstring, $mirrorList);
}
}
$DOWNLOAD_MIRROR_HOST_LAN = LAN_dl_68;
$DOWNLOAD_MIRROR_GET_LAN = LAN_dl_32;
$DOWNLOAD_MIRROR_LOCATION_LAN = LAN_dl_70;
$DOWNLOAD_MIRROR_DESCRIPTION_LAN = LAN_dl_71;
$DOWNLOAD_MIRROR_REQUEST = LAN_dl_72."'".$download_name."'";
$download_mirror_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_MIRROR_START);
$download_mirror_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_MIRROR_END);
$text = $download_mirror_start.$download_mirror.$download_mirror_end;
if($DOWNLOAD_MIRROR_RENDERPLAIN) {
echo $text;
} else {
$ns->tablerender(LAN_dl_67, $text);
}
require_once(FOOTERF);
}
}
function parse_download_mirror_table($row, $mirrorstring, $mirrorList)
{
global $DOWNLOAD_MIRROR;
list($mirrorHost_id, $mirrorHost_url, $mirrorRequests) = explode(",", $mirrorstring);
extract($mirrorList[$mirrorHost_id]);
$DOWNLOAD_MIRROR_NAME = "<a href='{$mirror_url}' rel='external'>{$mirror_name}</a>";
$DOWNLOAD_MIRROR_IMAGE = ($mirror_image ? "<a href='{$mirror_url}' rel='external'><img src='".e_FILE."downloadimages/".$mirror_image."' alt='' style='border:0' /></a>" : "");
$DOWNLOAD_MIRROR_LOCATION = ($mirror_location ? $mirror_location : "");
$DOWNLOAD_MIRROR_DESCRIPTION = ($mirror_description ? $mirror_description : "");
$DOWNLOAD_MIRROR_FILESIZE = parsesize($row['download_filesize']);
$DOWNLOAD_MIRROR_LINK = "<a href='".e_BASE."request.php?mirror.{$row['download_id']}.{$mirrorHost_id}' title='".LAN_dl_32."'><img src='".IMAGE_DOWNLOAD."' alt='' style='border:0' /></a>";
$DOWNLOAD_MIRROR_REQUESTS = (ADMIN ? LAN_dl_73.$mirrorRequests : "");
$DOWNLOAD_TOTAL_MIRROR_REQUESTS = (ADMIN ? LAN_dl_74.$mirror_count : "");
return(preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_MIRROR));
}
function parsesize($size) {
$kb = 1024;
$mb = 1024 * $kb;
$gb = 1024 * $mb;
$tb = 1024 * $gb;
if(!$size)
{
return '0';
}
if ($size < $kb) {
return $size." b";
}
else if($size < $mb) {
return round($size/$kb, 2)." kb";
}
else if($size < $gb) {
return round($size/$mb, 2)." mb";
}
else if($size < $tb) {
return round($size/$gb, 2)." gb";
} else {
return round($size/$tb, 2)." tb";
}
}
function parse_download_cat_parent_table($row) {
global $tp,$current_row,$DOWNLOAD_CAT_PARENT_TABLE;
extract($row);
$current_row = ($current_row) ? 0 : 1; // Alternating CSS for each row.(backwards compatible)
$template = ($current_row == 1) ? $DOWNLOAD_CAT_PARENT_TABLE : str_replace("forumheader3","forumheader3 forumheader3_alt",$DOWNLOAD_CAT_PARENT_TABLE);
if (check_class($download_category_class)) {
$parent_status == "open";
if(strstr($download_category_icon, chr(1)))
{
list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $download_category_icon);
}
$DOWNLOAD_CAT_MAIN_ICON .= ($download_category_icon ? "<img src='".e_IMAGE."icons/".$download_category_icon."' alt='' style='float: left' />" : "&nbsp;");
$DOWNLOAD_CAT_MAIN_NAME .= $tp->toHTML($download_category_name,FALSE,"emotes_off, no_make_clickable");
} else {
$parent_status == "closed";
}
return(preg_replace("/\{(.*?)\}/e", '$\1', $template));
}
function parse_download_cat_child_table($row, $subList)
{
global $tp,$current_row, $DOWNLOAD_CAT_CHILD_TABLE, $DOWNLOAD_CAT_SUBSUB_TABLE;
$current_row = ($current_row) ? 0 : 1; // Alternating CSS for each row.(backwards compatible)
$template = ($current_row == 1) ? $DOWNLOAD_CAT_CHILD_TABLE : str_replace("forumheader3","forumheader3 forumheader3_alt",$DOWNLOAD_CAT_CHILD_TABLE);
if(USER && $row['d_last'] > USERLV){
$new = "<img src='".IMAGE_NEW."' alt='' style='vertical-align:middle' />";
}else{
$new = "";
}
list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $row['download_category_icon']);
if (!$download_category_icon_empty)
{
$download_category_icon_empty = $download_category_icon;
}
if(!$row['d_count'] && !$row['d_subcount'])
{
$download_icon = "<img src='".e_IMAGE."icons/{$download_category_icon_empty}' alt='' style='float: left' />";
}
else
{
$download_icon = "<img src='".e_IMAGE."icons/{$download_category_icon}' alt='' style='float: left' />";
}
$DOWNLOAD_CAT_SUB_ICON = ($row['download_category_icon'] ? $download_icon : "&nbsp;");
$DOWNLOAD_CAT_SUB_NEW_ICON = $new;
$dcatname=$tp->toHTML($row['download_category_name'],FALSE,"emotes_off, no_make_clickable");
$DOWNLOAD_CAT_SUB_NAME = ($row['d_count'] ? "<a href='".e_BASE."download.php?list.".$row['download_category_id']."'>".$dcatname."</a>" : $dcatname);
$DOWNLOAD_CAT_SUB_NAME_LINKED = "<a href='".e_BASE."download.php?list.".$row['download_category_id']."'>".$$dcatname."</a>";
$DOWNLOAD_CAT_SUB_DESCRIPTION = $tp->toHTML($row['download_category_description']);
$DOWNLOAD_CAT_SUB_COUNT = ($row['d_subcount'] ? $row['d_subcount'] : $row['d_count']);
$DOWNLOAD_CAT_SUB_SIZE = parsesize(($row['d_subsize'] ? $row['d_subsize'] : $row['d_size']));
$DOWNLOAD_CAT_SUB_DOWNLOADED = intval(($row['d_subrequests'] ? $row['d_subrequests'] : $row['d_requests']));
$DOWNLOAD_CAT_SUBSUB = "";
// check for subsub cats ...
if($subList != FALSE)
{
foreach($subList as $subrow)
{
list($sub_download_category_icon, $sub_download_category_icon_empty) = explode(chr(1), $subrow['download_category_icon']);
if (!$sub_download_category_icon_empty)
{
$sub_download_category_icon_empty = $sub_download_category_icon;
}
if(!$row['d_count'] && !$row['d_subcount'])
{
$sub_download_icon = "<img src='".e_IMAGE."icons/{$sub_download_category_icon_empty}' alt='' style='float: left' />";
}
else
{
$sub_download_icon = "<img src='".e_IMAGE."icons/{$sub_download_category_icon}' alt='' style='float: left' />";
}
$DOWNLOAD_CAT_SUBSUB_ICON = ($subrow['download_category_icon'] ? "$sub_download_icon" : "&nbsp;");
$DOWNLOAD_CAT_SUBSUB_DESCRIPTION = $tp->toHTML($subrow['download_category_description']);
$DOWNLOAD_CAT_SUBSUB_COUNT = intval($subrow['d_count']);
$DOWNLOAD_CAT_SUBSUB_SIZE = parsesize($subrow['d_size']);
$DOWNLOAD_CAT_SUBSUB_DOWNLOADED = intval($subrow['d_requests']);
if(USER && $subrow['d_last'] > USERLV) {
$subsub_new = "<img src='".IMAGE_NEW."' alt='' style='vertical-align:middle' />";
}else {
$subsub_new = "";
}
$DOWNLOAD_CAT_SUBSUB_NEW_ICON = $subsub_new;
$DOWNLOAD_CAT_SUBSUB_NAME = ($subrow['d_count'] ? "<a href='".e_BASE."download.php?list.".$subrow['download_category_id']."'>".$tp->toHTML($subrow['download_category_name'])."</a>" : $tp->toHTML($subrow['download_category_name'],FALSE,"emotes_off, no_make_clickable"));
$DOWNLOAD_CAT_SUBSUB .= preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_SUBSUB_TABLE);
}
}
return(preg_replace("/\{(.*?)\}/e", '$\1', $template));
}
function parse_download_list_table($row) {
global $download_shortcodes,$tp,$current_row,$DOWNLOAD_LIST_TABLE, $rater, $pref, $gen, $agreetext;
$current_row = ($current_row) ? 0 : 1; // Alternating CSS for each row.(backwards compatible)
$template = ($current_row == 1) ? $DOWNLOAD_LIST_TABLE : str_replace("forumheader3","forumheader3 forumheader3_alt",$DOWNLOAD_LIST_TABLE);
return $tp->parseTemplate($template,TRUE,$download_shortcodes);
}
?>

5
e107.htaccess Normal file
View File

@@ -0,0 +1,5 @@
ErrorDocument 400 /error.php?400
ErrorDocument 401 /error.php?401
ErrorDocument 403 /error.php?403
ErrorDocument 404 /error.php?404
ErrorDocument 500 /error.php?500

465
e107_admin/ad_links.php Normal file
View File

@@ -0,0 +1,465 @@
<?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_admin/ad_links.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:11 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
if (file_exists(THEME.'admin_images/admin_images.php')) {
e107_require_once(THEME.'admin_images/admin_images.php');
}
// Small Category Images
if (!defined('E_16_CAT_SETT')) {
define('E_16_CAT_SETT', e_IMAGE.'admin_images/cat_settings_16.png');
}
if (!defined('E_16_CAT_USER')) {
define('E_16_CAT_USER', e_IMAGE.'admin_images/cat_users_16.png');
}
if (!defined('E_16_CAT_CONT')) {
define('E_16_CAT_CONT', e_IMAGE.'admin_images/cat_content_16.png');
}
if (!defined('E_16_CAT_FILE')) {
define('E_16_CAT_FILE', e_IMAGE.'admin_images/cat_files_16.png');
}
if (!defined('E_16_CAT_TOOL')) {
define('E_16_CAT_TOOL', e_IMAGE.'admin_images/cat_tools_16.png');
}
if (!defined('E_16_CAT_PLUG')) {
define('E_16_CAT_PLUG', e_IMAGE.'admin_images/cat_plugins_16.png');
}
// Large Category Images
if (!defined('E_32_CAT_SETT')) {
define('E_32_CAT_SETT', "<img src='".e_IMAGE."admin_images/cat_settings_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_CAT_USER')) {
define('E_32_CAT_USER', "<img src='".e_IMAGE."admin_images/cat_users_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_CAT_CONT')) {
define('E_32_CAT_CONT', "<img src='".e_IMAGE."admin_images/cat_content_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_CAT_FILE')) {
define('E_32_CAT_FILE', "<img src='".e_IMAGE."admin_images/cat_files_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_CAT_TOOL')) {
define('E_32_CAT_TOOL', "<img src='".e_IMAGE."admin_images/cat_tools_32.png' alt='' style='border:0px; width:32px; height:32px' />");
}
if (!defined('E_32_CAT_PLUG')) {
define('E_32_CAT_PLUG', "<img src='".e_IMAGE."admin_images/cat_plugins_32.png' alt='' style='border:0px; width:32px; height:32px' />");
}
// Small Nav Images
if (!defined('E_16_NAV_MAIN')) {
define('E_16_NAV_MAIN', e_IMAGE.'admin_images/main_16.png');
}
if (!defined('E_16_NAV_DOCS')) {
define('E_16_NAV_DOCS', e_IMAGE.'admin_images/docs_16.png');
}
if (!defined('E_16_NAV_LEAV')) {
define('E_16_NAV_LEAV', e_IMAGE.'admin_images/leave_16.png');
}
if (!defined('E_16_NAV_LGOT')) {
define('E_16_NAV_LGOT', e_IMAGE.'admin_images/logout_16.png');
}
if (!defined('E_16_NAV_ARROW')) {
define('E_16_NAV_ARROW', e_IMAGE.'admin_images/arrow_16.png');
}
if (!defined('E_16_NAV_ARROW_OVER')) {
define('E_16_NAV_ARROW_OVER', e_IMAGE.'admin_images/arrow_over_16.png');
}
// Large Nav Images
if (!defined('E_32_NAV_MAIN')) {
define('E_32_NAV_MAIN', "<img src='".e_IMAGE."'admin_images/main_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_NAV_DOCS')) {
define('E_32_NAV_DOCS', "<img src='".e_IMAGE."'admin_images/docs_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_NAV_LEAV')) {
define('E_32_NAV_LEAV', "<img src='".e_IMAGE."'admin_images/leave_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_NAV_LGOT')) {
define('E_32_NAV_LGOT', "<img src='".e_IMAGE."'admin_images/logout_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_NAV_ARROW')) {
define('E_32_NAV_ARROW', "<img src='".e_IMAGE."'admin_images/arrow_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_NAV_ARROW_OVER')) {
define('E_32_NAV_ARROW_OVER', "<img src='".e_IMAGE."'admin_images/arrow_over_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
// Small Admin Main Link Images
if (!defined('E_16_ADMIN')) {
define('E_16_ADMIN', "<img src='".e_IMAGE."admin_images/admins_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_ADPASS')) {
define('E_16_ADPASS', "<img src='".e_IMAGE."admin_images/adminpass_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_BANLIST')) {
define('E_16_BANLIST', "<img src='".e_IMAGE."admin_images/banlist_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_BANNER')) {
define('E_16_BANNER', "<img src='".e_IMAGE."admin_images/banners_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_CACHE')) {
define('E_16_CACHE', "<img src='".e_IMAGE."admin_images/cache_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_CREDITS')) {
define('E_16_CREDITS', "<img src='".e_IMAGE."admin_images/credits_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_CUST')) {
define('E_16_CUST', "<img src='".e_IMAGE."admin_images/custom_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_DATAB')) {
define('E_16_DATAB', "<img src='".e_IMAGE."admin_images/database_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_DOWNL')) {
define('E_16_DOWNL', "<img src='".e_IMAGE."admin_images/downloads_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_EMOTE')) {
define('E_16_EMOTE', "<img src='".e_IMAGE."admin_images/emoticons_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_FILE')) {
define('E_16_FILE', "<img src='".e_IMAGE."admin_images/filemanager_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_FORUM')) {
define('E_16_FORUM', "<img src='".e_IMAGE."admin_images/forums_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_FRONT')) {
define('E_16_FRONT', "<img src='".e_IMAGE."admin_images/frontpage_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_IMAGES')) {
define('E_16_IMAGES', "<img src='".e_IMAGE."admin_images/images_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_INSPECT')) {
define('E_16_INSPECT', "<img src='".e_IMAGE."admin_images/fileinspector_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_LINKS')) {
define('E_16_LINKS', "<img src='".e_IMAGE."admin_images/links_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_WELCOME')) {
define('E_16_WELCOME', "<img src='".e_IMAGE."admin_images/welcome_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_MAIL')) {
define('E_16_MAIL', "<img src='".e_IMAGE."admin_images/mail_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_MAINTAIN')) {
define('E_16_MAINTAIN', "<img src='".e_IMAGE."admin_images/maintain_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_MENUS')) {
define('E_16_MENUS', "<img src='".e_IMAGE."admin_images/menus_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_META')) {
define('E_16_META', "<img src='".e_IMAGE."admin_images/meta_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_NEWS')) {
define('E_16_NEWS', "<img src='".e_IMAGE."admin_images/news_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_NEWSFEED')) {
define('E_16_NEWSFEED', "<img src='".e_IMAGE."admin_images/newsfeeds_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_NOTIFY')) {
define('E_16_NOTIFY', "<img src='".e_IMAGE."admin_images/notify_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_PHP')) {
define('E_16_PHP', "<img src='".e_IMAGE."admin_images/phpinfo_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_POLLS')) {
define('E_16_POLLS', "<img src='".e_IMAGE."admin_images/polls_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_PREFS')) {
define('E_16_PREFS', "<img src='".e_IMAGE."admin_images/prefs_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_SEARCH')) {
define('E_16_SEARCH', "<img src='".e_IMAGE."admin_images/search_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_UPLOADS')) {
define('E_16_UPLOADS', "<img src='".e_IMAGE."admin_images/uploads_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_USER')) {
define('E_16_USER', "<img src='".e_IMAGE."admin_images/users_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_USER_EXTENDED')) {
define('E_16_USER_EXTENDED', "<img src='".e_IMAGE."admin_images/extended_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_USERCLASS')) {
define('E_16_USERCLASS', "<img src='".e_IMAGE."admin_images/userclass_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_LANGUAGE')) {
define('E_16_LANGUAGE', "<img src='".e_IMAGE."admin_images/language_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
// Small Admin Other Link Images
if (!defined('E_16_PLUGIN')) {
define('E_16_PLUGIN', "<img src='".e_IMAGE."admin_images/plugins_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_PLUGMANAGER')) {
define('E_16_PLUGMANAGER', "<img src='".e_IMAGE."admin_images/plugmanager_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_DOCS')) {
define('E_16_DOCS', "<img src='".e_IMAGE."admin_images/docs_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_THEMEMANAGER')) {
define('E_16_THEMEMANAGER', "<img src='".e_IMAGE."admin_images/themes_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
// Small Admin Other Images
if (!defined('E_16_COMMENT')) {
define('E_16_COMMENT', "<img src='".e_IMAGE."admin_images/comments_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
if (!defined('E_16_ADMINLOG')) {
define('E_16_ADMINLOG', "<img src='".e_IMAGE."admin_images/adminlogs_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
}
// Large Admin Main Link Images
if (!defined('E_32_ADMIN')) {
define('E_32_ADMIN', "<img src='".e_IMAGE."admin_images/admins_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_ADPASS')) {
define('E_32_ADPASS', "<img src='".e_IMAGE."admin_images/adminpass_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_BANLIST')) {
define('E_32_BANLIST', "<img src='".e_IMAGE."admin_images/banlist_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_BANNER')) {
define('E_32_BANNER', "<img src='".e_IMAGE."admin_images/banners_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_CACHE')) {
define('E_32_CACHE', "<img src='".e_IMAGE."admin_images/cache_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_CREDITS')) {
define('E_32_CREDITS', "<img src='".e_IMAGE."admin_images/credits_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_CUST')) {
define('E_32_CUST', "<img src='".e_IMAGE."admin_images/custom_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_DATAB')) {
define('E_32_DATAB', "<img src='".e_IMAGE."admin_images/database_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_DOWNL')) {
define('E_32_DOWNL', "<img src='".e_IMAGE."admin_images/downloads_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_EMOTE')) {
define('E_32_EMOTE', "<img src='".e_IMAGE."admin_images/emoticons_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_FILE')) {
define('E_32_FILE', "<img src='".e_IMAGE."admin_images/filemanager_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_FORUM')) {
define('E_32_FORUM', "<img src='".e_IMAGE."admin_images/forums_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_FRONT')) {
define('E_32_FRONT', "<img src='".e_IMAGE."admin_images/frontpage_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_IMAGES')) {
define('E_32_IMAGES', "<img src='".e_IMAGE."admin_images/images_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_INSPECT')) {
define('E_32_INSPECT', "<img src='".e_IMAGE."admin_images/fileinspector_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_LINKS')) {
define('E_32_LINKS', "<img src='".e_IMAGE."admin_images/links_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_WELCOME')) {
define('E_32_WELCOME', "<img src='".e_IMAGE."admin_images/welcome_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_MAIL')) {
define('E_32_MAIL', "<img src='".e_IMAGE."admin_images/mail_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_MAINTAIN')) {
define('E_32_MAINTAIN', "<img src='".e_IMAGE."admin_images/maintain_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_MENUS')) {
define('E_32_MENUS', "<img src='".e_IMAGE."admin_images/menus_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_META')) {
define('E_32_META', "<img src='".e_IMAGE."admin_images/meta_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_NEWS')) {
define('E_32_NEWS', "<img src='".e_IMAGE."admin_images/news_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_NEWSFEED')) {
define('E_32_NEWSFEED', "<img src='".e_IMAGE."admin_images/newsfeeds_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_NOTIFY')) {
define('E_32_NOTIFY', "<img src='".e_IMAGE."admin_images/notify_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_PHP')) {
define('E_32_PHP', "<img src='".e_IMAGE."admin_images/phpinfo_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_POLLS')) {
define('E_32_POLLS', "<img src='".e_IMAGE."admin_images/polls_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_PREFS')) {
define('E_32_PREFS', "<img src='".e_IMAGE."admin_images/prefs_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_SEARCH')) {
define('E_32_SEARCH', "<img src='".e_IMAGE."admin_images/search_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_UPLOADS')) {
define('E_32_UPLOADS', "<img src='".e_IMAGE."admin_images/uploads_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_USER')) {
define('E_32_USER', "<img src='".e_IMAGE."admin_images/users_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_USER_EXTENDED')) {
define('E_32_USER_EXTENDED', "<img src='".e_IMAGE."admin_images/extended_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_USERCLASS')) {
define('E_32_USERCLASS', "<img src='".e_IMAGE."admin_images/userclass_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_LANGUAGE')) {
define('E_32_LANGUAGE', "<img src='".e_IMAGE."admin_images/language_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
// Large Admin Other Link Images
if (!defined('E_32_PLUGIN')) {
define('E_32_PLUGIN', "<img src='".e_IMAGE."admin_images/plugins_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_PLUGMANAGER')) {
define('E_32_PLUGMANAGER', "<img src='".e_IMAGE."admin_images/plugmanager_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_DOCS')) {
define('E_32_DOCS', "<img src='".e_IMAGE."admin_images/docs_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_MAIN')) {
define('E_32_MAIN', "<img src='".e_IMAGE."admin_images/main_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_THEMEMANAGER')) {
define('E_32_THEMEMANAGER', "<img src='".e_IMAGE."admin_images/themes_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
// Large Admin Other Images
if (!defined('E_32_COMMENT')) {
define('E_32_COMMENT', "<img src='".e_IMAGE."admin_images/comments_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_ADMINLOG')) {
define('E_32_ADMINLOG', "<img src='".e_IMAGE."admin_images/adminlogs_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
if (!defined('E_32_LOGOUT')) {
define('E_32_LOGOUT', "<img src='".e_IMAGE."admin_images/logout_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
}
$e_icon_array = array(
'main' => E_32_MAIN,
'admin' => E_32_ADMIN,
'admin_pass' => E_32_ADPASS,
'banlist' => E_32_BANLIST,
'banner' => E_32_BANNER,
'cache' => E_32_CACHE,
'credits' => E_32_CREDITS,
'custom' => E_32_CUST,
'database' => E_32_DATAB,
'docs' => E_32_DOCS,
'download' => E_32_DOWNL,
'emoticon' => E_32_EMOTE,
'filemanage' => E_32_FILE,
'fileinspector' => E_32_INSPECT,
'frontpage' => E_32_FRONT,
'image' => E_32_IMAGES,
'language' => E_32_LANGUAGE,
'links' => E_32_LINKS,
'mail' => E_32_MAIL,
'menus' => E_32_MENUS,
'meta' => E_32_META,
'newsfeed' => E_32_NEWSFEED,
'news' => E_32_NEWS,
'notify' => E_32_NOTIFY,
'phpinfo' => E_32_PHP,
'plug_manage' => E_32_PLUGMANAGER,
'poll' => E_32_POLLS,
'prefs' => E_32_PREFS,
'search' => E_32_SEARCH,
'theme_manage' => E_32_THEMEMANAGER,
'maintain' => E_32_MAINTAIN,
'upload' => E_32_UPLOADS,
'userclass' => E_32_USERCLASS,
'user_extended' => E_32_USER_EXTENDED,
'users' => E_32_USER,
'wmessage' => E_32_WELCOME );
$admin_cat['title'][1] = ADLAN_CL_1;
$admin_cat['id'][1] = 'setMenu';
$admin_cat['img'][1] = E_16_CAT_SETT;
$admin_cat['lrg_img'][1] = E_32_CAT_SETT;
$admin_cat['title'][2] = ADLAN_CL_2;
$admin_cat['id'][2] = 'userMenu';
$admin_cat['img'][2] = E_16_CAT_USER;
$admin_cat['lrg_img'][2] = E_32_CAT_USER;
$admin_cat['title'][3] = ADLAN_CL_3;
$admin_cat['id'][3] = 'contMenu';
$admin_cat['img'][3] = E_16_CAT_CONT;
$admin_cat['lrg_img'][3] = E_32_CAT_CONT;
$admin_cat['title'][4] = ADLAN_CL_6;
$admin_cat['id'][4] = 'toolMenu';
$admin_cat['img'][4] = E_16_CAT_TOOL;
$admin_cat['lrg_img'][4] = E_32_CAT_TOOL;
$admin_cat['title'][5] = ADLAN_CL_7;
$admin_cat['id'][5] = 'plugMenu';
$admin_cat['img'][5] = E_16_CAT_PLUG;
$admin_cat['lrg_img'][5] = E_32_CAT_PLUG;
// Info about attributes
/*
attribute 1 = link
attribute 2 = title
attribute 3 = description
attribute 4 = perms
attribute 5 = category
attribute 6 = 16 x 16 image
attribute 7 = 32 x 32 image
*/
$array_functions = array(
0 => array(e_ADMIN."administrator.php", ADLAN_8, ADLAN_9, "3", 2, E_16_ADMIN, E_32_ADMIN),
1 => array(e_ADMIN."updateadmin.php", ADLAN_10, ADLAN_11, "", 2, E_16_ADPASS, E_32_ADPASS),
2 => array(e_ADMIN."banlist.php", ADLAN_34, ADLAN_35, "4", 2, E_16_BANLIST, E_32_BANLIST),
3 => array(e_ADMIN."banner.php", ADLAN_54, ADLAN_55, "D", 3, E_16_BANNER, E_32_BANNER),
4 => array(e_ADMIN."cache.php", ADLAN_74, ADLAN_75, "C", 1, E_16_CACHE, E_32_CACHE),
5 => array(e_ADMIN."cpage.php", ADLAN_42, ADLAN_43, "5", 3, E_16_CUST, E_32_CUST),
6 => array(e_ADMIN."db.php", ADLAN_44, ADLAN_45, "0", 4, E_16_DATAB, E_32_DATAB),
7 => array(e_ADMIN."download.php", ADLAN_24, ADLAN_25, "R", 3, E_16_DOWNL, E_32_DOWNL),
8 => array(e_ADMIN."emoticon.php", ADLAN_58, ADLAN_59, "F", 1, E_16_EMOTE, E_32_EMOTE),
9 => array(e_ADMIN."filemanager.php", ADLAN_30, ADLAN_31, "6", 4, E_16_FILE, E_32_FILE),
10 => array(e_ADMIN."frontpage.php", ADLAN_60, ADLAN_61, "G", 1, E_16_FRONT, E_32_FRONT),
11 => array(e_ADMIN."image.php", ADLAN_105, ADLAN_106, "A", 1, E_16_IMAGES, E_32_IMAGES),
12 => array(e_ADMIN."links.php", ADLAN_138, ADLAN_139, "I", 1, E_16_LINKS, E_32_LINKS),
13 => array(e_ADMIN."wmessage.php", ADLAN_28, ADLAN_29, "M", 3, E_16_WELCOME, E_32_WELCOME),
14 => array(e_ADMIN."ugflag.php", ADLAN_40, ADLAN_41, "9", 4, E_16_MAINTAIN, E_32_MAINTAIN),
15 => array(e_ADMIN."menus.php", ADLAN_6, ADLAN_7, "2", 3, E_16_MENUS, E_32_MENUS),
16 => array(e_ADMIN."meta.php", ADLAN_66, ADLAN_67, "T", 1, E_16_META, E_32_META),
17 => array(e_ADMIN."newspost.php", ADLAN_0, ADLAN_1, "H", 3, E_16_NEWS, E_32_NEWS),
18 => array(e_ADMIN."phpinfo.php", ADLAN_68, ADLAN_69, "0", 4, E_16_PHP, E_32_PHP),
19 => array(e_ADMIN."prefs.php", ADLAN_4, ADLAN_5, "1", 1, E_16_PREFS, E_32_PREFS),
20 => array(e_ADMIN."search.php", ADLAN_142, ADLAN_143, "X", 1, E_16_SEARCH, E_32_SEARCH),
21 => array(e_ADMIN."theme.php", ADLAN_140, ADLAN_141, "1", 4, E_16_THEMEMANAGER, E_32_THEMEMANAGER),
22 => array(e_ADMIN."upload.php", ADLAN_72, ADLAN_73, "V", 3, E_16_UPLOADS, E_32_UPLOADS),
23 => array(e_ADMIN."users.php", ADLAN_36, ADLAN_37, "4", 2, E_16_USER, E_32_USER),
24 => array(e_ADMIN."userclass2.php", ADLAN_38, ADLAN_39, "4", 2, E_16_USERCLASS, E_32_USERCLASS),
25 => array(e_ADMIN."language.php", ADLAN_132, ADLAN_133, "0", 1, E_16_LANGUAGE, E_32_LANGUAGE),
26 => array(e_ADMIN."mailout.php", ADLAN_136, ADLAN_137, "W", 2, E_16_MAIL, E_32_MAIL),
27 => array(e_ADMIN."users_extended.php", ADLAN_78, ADLAN_79, "4", 2, E_16_USER_EXTENDED, E_32_USER_EXTENDED),
28 => array(e_ADMIN."fileinspector.php", ADLAN_147, ADLAN_148, "Y", 4, E_16_INSPECT, E_32_INSPECT),
29 => array(e_ADMIN."notify.php", ADLAN_149, ADLAN_150, "O", 4, E_16_NOTIFY, E_32_NOTIFY)
);
?>

269
e107_admin/admin.php Normal file
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_admin/admin.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:11 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once('../class2.php');
$e_sub_cat = 'main';
require_once('auth.php');
require_once(e_HANDLER.'admin_handler.php');
// --- check for htmlarea.
if (is_dir(e_ADMIN.'htmlarea') || is_dir(e_HANDLER.'htmlarea')) {
$text = ADLAN_ERR_2."<br /><br />
<div style='text-align:center'>".$HANDLERS_DIRECTORY."htmlarea/<br />".$ADMIN_DIRECTORY."htmlarea/</div>";
$ns -> tablerender(ADLAN_ERR_1, $text);
}
// check for old modules.
if(getperms('0') && isset($pref['modules']) && $pref['modules'] && $sql->db_Field("plugin",5) == "plugin_addons"){
$mods=explode(",", $pref['modules']);
$thef = "e_module.php";
foreach ($mods as $mod)
{
if (is_readable(e_PLUGIN."{$mod}/module.php"))
{
$mod_found[] = e_PLUGIN."{$mod}/module.php";
}
}
if($mod_found)
{
$text = ADLAN_ERR_5." <b>".$thef."</b>:<br /><br /><ul>";
foreach($mod_found as $val){
$text .= "<li>".str_replace("../","",$val)."</li>\n";
}
$text .="</ul><br />
<form method='post' action='".e_ADMIN."db.php' id='upd'>
<a href='#' onclick=\"document.getElementById('upd').submit()\">".ADLAN_ERR_6."</a>
<input type='hidden' name='plugin_scan' value='1' />
</form>";
$ns -> tablerender(ADLAN_ERR_4,$text);
}
}
// check for file-types;
if (is_readable(e_ADMIN.'filetypes.php')) {
$a_types = strtolower(trim(file_get_contents(e_ADMIN.'filetypes.php')));
} else {
$a_types = 'zip, gz, jpg, png, gif';
}
$a_types = explode(',', $a_types);
foreach ($a_types as $f_type) {
$allowed_types[] = '.'.trim(str_replace('.', '', $f_type));
}
// avatar check.
$public = array(e_FILE.'public', e_FILE.'public/avatars');
foreach ($public as $dir) {
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (is_dir($dir."/".$file) == FALSE && $file != '.' && $file != '..' && $file != '/' && $file != 'CVS' && $file != 'avatars' && $file != 'Thumbs.db' && $file !=".htaccess" && $file !="php.ini") {
$fext = substr(strrchr($file, "."), 0);
if (!in_array(strtolower($fext), $allowed_types) ) {
if ($file == 'index.html' || $file == "null.txt") {
if (filesize($dir.'/'.$file)) {
$potential[] = str_replace('../', '', $dir).'/'.$file;
}
} else {
$potential[] = str_replace('../', '', $dir).'/'.$file;
}
}
}
}
closedir($dh);
}
}
}
if (isset($potential)) {
$text = ADLAN_ERR_3."<br /><br />";
foreach ($potential as $p_file) {
$text .= $p_file.'<br />';
}
$ns -> tablerender(ADLAN_ERR_1, $text);
}
// update users using old layout names to their new names
$update_prefs = FALSE;
if (!$pref['adminstyle'] || $pref['adminstyle'] == 'default') {
$pref['adminstyle'] = 'compact';
$update_prefs = true;
}
if ($pref['adminstyle'] == 'adminb') {
$pref['adminstyle'] = 'cascade';
$update_prefs = true;
}
if ($pref['adminstyle'] == 'admin_etalkers') {
$pref['adminstyle'] = 'categories';
$update_prefs = true;
}
if ($pref['adminstyle'] == 'admin_combo') {
$pref['adminstyle'] = 'combo';
$update_prefs = true;
}
if ($pref['adminstyle'] == 'admin_classis') {
$pref['adminstyle'] = 'classis';
$update_prefs = true;
}
// temporary code to switch users using admin_jayya to jayya
if ($pref['admintheme'] == 'admin_jayya') {
$pref['admintheme'] = 'jayya';
$update_prefs = true;
}
if ($pref['sitetheme'] == 'admin_jayya') {
$pref['sitetheme'] = 'jayya';
$update_prefs = true;
}
// ---------------------------------------------------------
if ($update_prefs == true) {
save_prefs();
}
// auto db update
if ('0' == ADMINPERMS) {
require_once(e_ADMIN.'update_routines.php');
update_check();
}
// end auto db update
if (e_QUERY == 'purge' && getperms('0')) {
$admin_log->purge_log_events(false);
}
$td = 1;
if(!defined("ADLINK_COLS")){
define("ADLINK_COLS",5);
}
function render_links($link, $title, $description, $perms, $icon = FALSE, $mode = FALSE) {
global $td,$tp;
$text = '';
if (getperms($perms)) {
if ($mode == 'adminb') {
$text = "<tr><td class='forumheader3'>
<div class='td' style='text-align:left; vertical-align:top; width:100%'
onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">
".$icon." <b>".$title."</b> ".($description ? "[ <span class='smalltext'>".$description."</span> ]" : "")."</div></td></tr>";
} else {
if ($td == (ADLINK_COLS+1)) {
$text .= '</tr>';
$td = 1;
}
if ($td == 1) {
$text .= '<tr>';
}
if ($mode == 'default') {
$text .= "<td class='td' style='text-align:left; vertical-align:top; width:20%; white-space:nowrap'
onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">".$icon." ".$tp->toHTML($title,FALSE,"defs emotes_off")."</td>";
}
else if ($mode == 'classis') {
$text .= "<td style='text-align:center; vertical-align:top; width:20%'><a href='".$link."' title='$description'>".$icon."</a><br />
<a href='".$link."' title='$description'><b>".$tp->toHTML($title,FALSE,"defs emotes_off")."</b></a><br /><br /></td>";
}elseif ($mode == 'beginner'){
$text .= "<td style='text-align:center; vertical-align:top; width:20%' ><a href='".$link."' >".$icon."</a>
<div style='padding:5px'>
<a href='".$link."' title='".$description."' style='text-decoration:none'><b>".$tp->toHTML($title,FALSE,"defs emotes_off")."</b></a></div><br /><br /><br /></td>";
}
$td++;
}
}
return $text;
}
function render_clean() {
global $td;
while ($td <= ADLINK_COLS) {
$text .= "<td class='td' style='width:20%;'></td>";
$td++;
}
$text .= "</tr>";
$td = 1;
return $text;
}
$newarray = asortbyindex($array_functions, 1);
require_once(e_ADMIN.'includes/'.$pref['adminstyle'].'.php');
function admin_info() {
global $tp;
$width = (getperms('0')) ? "33%" : "50%";
$ADMIN_INFO_TEMPLATE = "
<div style='text-align:center'>
<table style='width: 100%; border-collapse:collapse; border-spacing:0px;'>
<tr>
<td style='width: ".$width."; vertical-align: top'>
{ADMIN_STATUS}
</td>
<td style='width:".$width."; vertical-align: top'>
{ADMIN_LATEST}
</td>";
if(getperms('0'))
{
$ADMIN_INFO_TEMPLATE .= "
<td style='width:".$width."; vertical-align: top'>{ADMIN_LOG}</td>";
}
$ADMIN_INFO_TEMPLATE .= "
</tr></table></div>";
return $tp->parseTemplate($ADMIN_INFO_TEMPLATE);
}
function status_request() {
global $pref;
if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade' || $pref['adminstyle'] == 'beginner') {
return TRUE;
} else {
return FALSE;
}
}
function latest_request() {
global $pref;
if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade' || $pref['adminstyle'] == 'beginner') {
return TRUE;
} else {
return FALSE;
}
}
function log_request() {
global $pref;
if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade'|| $pref['adminstyle'] == 'beginner') {
return TRUE;
} else {
return FALSE;
}
}
require_once("footer.php");
?>

View File

@@ -0,0 +1,27 @@
<?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_admin/admin_classis.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:11 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (ADMIN) {
header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
exit;
} else {
header('Location:'.SITEURL.'index.php');
exit;
}
?>

View File

@@ -0,0 +1,27 @@
<?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_admin/admin_combo.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:11 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (ADMIN) {
header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
exit;
} else {
header('Location:'.SITEURL.'index.php');
exit;
}
?>

View File

@@ -0,0 +1,27 @@
<?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_admin/admin_etalkers.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:11 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (ADMIN) {
header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
exit;
} else {
header('Location:'.SITEURL.'index.php');
exit;
}
?>

114
e107_admin/admin_log.php Normal file
View File

@@ -0,0 +1,114 @@
<?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_admin/admin_log.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:11 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms('0'))
{
header('location:'.e_BASE.'index.php');
exit;
}
require_once("auth.php");
$text = "";
$amount = 30;
$from = ($_GET['fm']) ? intval($_GET['fm']) : 0;
if(e_QUERY == 'purge')
{
$sql->db_Delete('dblog');
}
$total = $sql -> db_Select("dblog", "*", "ORDER BY `dblog_datestamp` DESC", "no_where");
$query = "SELECT l.*, u.user_name FROM #dblog AS l LEFT JOIN #user AS u ON l.dblog_user_id = u.user_id ORDER BY l.dblog_datestamp DESC LIMIT $from,$amount";
$sql -> db_Select_gen($query);
if(!is_object($gen)) {
$gen = new convert;
}
$parms = $total.",".$amount.",".$from.",".e_SELF.'?fm=[FROM]';
$text .= "<div style='text-align:center'><br />".$tp->parseTemplate("{NEXTPREV={$parms}}")."<br /><br /></div>";
$text .= "<div id='admin_log'><table>\n";
$text .= "
<tr>
<td class='fcaption'>&nbsp;</td>
<td class='fcaption' style='font-weight: bold;'>".LAN_ADMINLOG_1."</td>
<td class='fcaption' style='font-weight: bold;'>".LAN_ADMINLOG_2."</td>
<td class='fcaption' style='font-weight: bold;'>".LAN_ADMINLOG_3."</td>
<td class='fcaption' style='font-weight: bold;'>".LAN_ADMINLOG_4."</td>
<td class='fcaption' style='font-weight: bold;'>".LAN_ADMINLOG_5."</td>
</tr>\n";
while ($row = $sql -> db_Fetch()) {
$datestamp = $gen->convert_date($row['dblog_datestamp'], 'short');
$image = get_log_img($row['dblog_type']);
$text .= " <tr>\n";
$text .= " <td style='width: 16px;'>{$image}</td>\n";
$text .= " <td>{$datestamp}</td>\n";
$text .= " <td>".$tp->toHtml($row['dblog_title'],FALSE,"defs")."</td>\n";
$text .= " <td>".$tp->toHtml($row['dblog_remarks'],FALSE,"defs")."</td>\n";
$text .= " <td>{$row['dblog_ip']}</td>\n";
$text .= ($row['user_name']) ? " <td><a href='".e_BASE."user.php?id.{$row['dblog_user_id']}'>{$row['user_name']}</a></td>\n" : " <td>{$row['dblog_user_id']}</td>\n";
$text .= " </tr>\n";
}
$text .= "</table></div>\n";
$text .= "<div style='text-align:center'><br />".$tp->parseTemplate("{NEXTPREV={$parms}}")."</div>";
$ns->tablerender(LAN_ADMINLOG_0, $text);
require_once("footer.php");
function get_log_img($log_type) {
switch ($log_type) {
case E_LOG_INFORMATIVE:
return "<img src='".e_IMAGE_ABS."admin_images/docs_16.png' alt='".LAN_ADMINLOG_6."' title='".LAN_ADMINLOG_7."' />";
break;
case E_LOG_NOTICE:
return "<img src='".e_IMAGE_ABS."admin_images/notice_16.png' alt='".LAN_ADMINLOG_8."' title='".LAN_ADMINLOG_9."' />";
break;
case E_LOG_WARNING:
return "<img src='".e_IMAGE_ABS."admin_images/blocked.png' alt='".LAN_ADMINLOG_10."' title='".LAN_ADMINLOG_11."' style='width:16p;height:16px' />";
break;
case E_LOG_FATAL:
return "<img src='".e_IMAGE_ABS."admin_images/nopreview.png' alt='".LAN_ADMINLOG_12."' title='".LAN_ADMINLOG_13."' />";
break;
case E_LOG_PLUGIN;
return "<img src='".e_IMAGE_ABS."admin_images/plugins_16.png' alt='".LAN_ADMINLOG_6."' title='".LAN_ADMINLOG_6."' />";
break;
}
return $log_type;
}
function headerjs() {
?>
<style type="text/css">
#admin_log td {
border: 1px solid #000000;
margin: 0px;
padding: 2px;
}
#admin_log table {
width: 99%;
/*border-spacing: 0px;
border-collapse: collapse;*/
}
</style>
<?php
}
?>

27
e107_admin/adminb.php Normal file
View File

@@ -0,0 +1,27 @@
<?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_admin/adminb.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:11 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (ADMIN) {
header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
exit;
} else {
header('Location:'.SITEURL.'index.php');
exit;
}
?>

View File

@@ -0,0 +1,377 @@
<?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_admin/administrator.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:11 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once('../class2.php');
if (!getperms('3'))
{
header('location:'.e_BASE.'index.php');
exit;
}
$e_sub_cat = 'admin';
require_once('auth.php');
if (e_QUERY)
{
$tmp = explode(".", e_QUERY);
$action = $tmp[0];
$sub_action = $tmp[1];
unset($tmp);
}
if (isset($_POST['update_admin']))
{
$sql->db_Select("user", "*", "user_id='".$_POST['a_id']."' ");
$row = $sql->db_Fetch();
$a_name = $row['user_name'];
$perm = "";
foreach($_POST['perms'] as $value)
{
if ($value == "0")
{
if (!getperms('0')) { $value = ""; break; }
$perm = "0."; break;
}
if ($value)
{
$perm .= $value.".";
}
}
admin_update($sql -> db_Update("user", "user_perms='$perm' WHERE user_name='$a_name' "), 'update', ADMSLAN_56." ".$_POST['ad_name']." ".ADMSLAN_2."<br />");
unset($ad_name, $a_perms);
}
if ($_POST['edit_admin'] || $action == "edit")
{
$edid = array_keys($_POST['edit_admin']);
$theid = ($edid[0]) ? $edid[0] : $sub_action;
$sql->db_Select("user", "*", "user_id=".$theid);
$row = $sql->db_Fetch();
if ($a_perms == "0")
{
$text = "<div style='text-align:center'>$ad_name ".ADMSLAN_3."
<br /><br />
<a href='administrator.php'>".ADMSLAN_4."</a></div>";
$ns->tablerender(LAN_ERROR, $text);
require_once("footer.php");
exit;
}
}
if (isset($_POST['del_admin']))
{
$delid = array_keys($_POST['del_admin']);
$sql->db_Select("user", "*", "user_id= ".$delid[0]);
$row = $sql->db_Fetch();
if ($row['user_id'] == 1)
{
$text = "<div style='text-align:center'>".$row['user_name']." ".ADMSLAN_6."
<br /><br />
<a href='administrator.php'>".ADMSLAN_4."</a>";
$ns->tablerender(ADMSLAN_5, $text);
require_once("footer.php");
exit;
}
admin_update($sql -> db_Update("user", "user_admin=0, user_perms='' WHERE user_id= ".$delid[0]), 'update', ADMSLAN_61, LAN_DELETED_FAILED);
}
if($_POST['edit_admin'] || $action == "edit"){
edit_administrator($row);
}else{
show_admins();
}
function show_admins(){
global $sql,$tp,$ns,$pref;
$sql->db_Select("user", "*", "user_admin='1'");
$text = "<div style='text-align:center'><div style='padding: 1px; ".ADMIN_WIDTH."; margin-left: auto; margin-right: auto;'>
<form action='".e_SELF."' method='post' id='del_administrator'>
<div>
<input type='hidden' name='del_administrator_confirm' id='del_administrator_confirm' value='1' />
<table class='fborder' style='width:99%'>
<tr>
<td style='width:5%' class='fcaption'>ID</td>
<td style='width:20%' class='fcaption'>".ADMSLAN_56."</td>
<td style='width:65%' class='fcaption'>".ADMSLAN_18."</td>
<td style='width:10%' class='fcaption'>".LAN_OPTIONS."</td>
</tr>";
while ($row = $sql->db_Fetch())
{
$text .= "<tr>
<td style='width:5%' class='forumheader3'>".$row['user_id']."</td>
<td style='width:20%' class='forumheader3'><a href='".e_BASE."user.php?id.".$row['user_id']."'>".$row['user_name']."</a></td>
<td style='width:65%' class='forumheader3'>";
$permtxt = "";
$text .= renderperms($row['user_perms'],$row['user_id'],"words");
$text .= "</td>
<td style='width:10%; text-align:center' class='forumheader3'>";
if($row['user_id'] != "1")
{
$text .= "
<input type='image' name='edit_admin[{$row['user_id']}]' value='edit' src='".e_IMAGE."admin_images/edit_16.png' title='".LAN_EDIT."' />
<input type='image' name='del_admin[{$row['user_id']}]' value='del' src='".e_IMAGE."admin_images/delete_16.png' onclick=\"return jsconfirm('".$tp->toJS(ADMSLAN_59."? [".$row['user_name']."]")."') \" title='".ADMSLAN_59."' style='border:0px' />";
}
$text .= "&nbsp;</td>
</tr>";
}
$text .= "</table></div>\n</form></div>\n</div>";
$ns->tablerender(ADMSLAN_13, $text);
}
function edit_administrator($row){
global $sql,$tp,$ns,$pref;
$lanlist = explode(",",e_LANLIST);
$a_id = $row['user_id'];
$ad_name = $row['user_name'];
$a_perms = $row['user_perms'];
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."' id='myform' >
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:25%' class='forumheader3'>".ADMSLAN_16.": </td>
<td style='width:75%' class='forumheader3'>
";
$text .= $ad_name;
$text .= "<input type='hidden' name='ad_name' size='60' value='$ad_name' />";
$text .= "
</td>
</tr>";
$text .="
<tr>
<td style='width:25%;vertical-align:top' class='forumheader3'>".ADMSLAN_18.": <br /></td>
<td style='width:75%' class='forumheader3'>";
$text .= checkb("1", $a_perms).ADMSLAN_19."<br />"; // Alter site preferences
$text .= checkb("2", $a_perms).ADMSLAN_20."<br />"; // Alter Menus
$text .= checkb("3", $a_perms).ADMSLAN_21."<br />"; // Modify administrator permissions
$text .= checkb("4", $a_perms).ADMSLAN_22."<br />"; // Moderate users/bans etc
$text .= checkb("5", $a_perms).ADMSLAN_23."<br />"; // create/edit custom pages/menus
$text .= checkb("Q", $a_perms).ADMSLAN_24."<br />"; // Manage download categories
$text .= checkb("6", $a_perms).ADMSLAN_25."<br />"; // Upload /manage files
$text .= checkb("Y", $a_perms).ADMSLAN_67."<br />"; // file inspector
$text .= checkb("O", $a_perms).ADMSLAN_68."<br />"; // notify
$text .= checkb("7", $a_perms).ADMSLAN_26."<br />"; // Oversee news categories
$text .= checkb("8", $a_perms).ADMSLAN_27."<br />"; // Oversee link categories
$text .= checkb("C", $a_perms).ADMSLAN_64."<br />"; // Clear Cache - Previously moderate chatbox
$text .= checkb("9", $a_perms).ADMSLAN_28."<br />"; // Take site down for maintenance
$text .= checkb("W", $a_perms).ADMSLAN_65."<br /><br />"; // Configure mail settings and mailout
$text .= checkb("D", $a_perms).ADMSLAN_29."<br />"; // Manage banners
$text .= checkb("E", $a_perms).ADMSLAN_30."<br />"; // Configure news feed headlines
$text .= checkb("F", $a_perms).ADMSLAN_31."<br />"; // Configure emoticons
$text .= checkb("G", $a_perms).ADMSLAN_32."<br />"; // Configure front page content
$text .= checkb("S", $a_perms).ADMSLAN_33."<br />"; // Configure log/stats
$text .= checkb("T", $a_perms).ADMSLAN_34."<br />"; // Configure meta tags
$text .= checkb("V", $a_perms).ADMSLAN_35."<br />"; // Configure public file uploads
$text .= checkb("X", $a_perms).ADMSLAN_66."<br />"; // Configure Search
$text .= checkb("A", $a_perms).ADMSLAN_36."<br />"; // Configure Image Settings (Previously Moderate forums - NOW PLUGIN)
$text .= checkb("B", $a_perms).ADMSLAN_37."<br />"; // Moderate comments
$text .= checkb("H", $a_perms).ADMSLAN_39."<br />"; // Post news
$text .= checkb("I", $a_perms).ADMSLAN_40."<br />"; // Post links
// $text .= checkb("J", $a_perms).ADMSLAN_41."<br />"; // Post articles - NOW PLUGIN
// $text .= checkb("K", $a_perms).ADMSLAN_42."<br />"; // Post reviews - NOW PLUGIN
// $text .= checkb("L", $a_perms).ADMSLAN_43."<br />"; // Post content pages - NOW PLUGIN
$text .= checkb("R", $a_perms).ADMSLAN_44."<br />"; // Post downloads
$text .= checkb("U", $a_perms).ADMSLAN_45."<br />"; // Post polls
$text .= checkb("M", $a_perms).ADMSLAN_46."<br />"; // Welcome message
$text .= checkb("N", $a_perms).ADMSLAN_47."<br /><br />"; // Moderate submitted news
$text .= "<br /><div class='fcaption'>".ADLAN_CL_7."</div><br />";
$text .= checkb("Z", $a_perms).ADMSLAN_62."<br /><br />"; // Plugin Manager
$sql->db_Select("plugin", "*", "plugin_installflag='1'");
while ($row = $sql->db_Fetch())
{
$text .= checkb("P".$row['plugin_id'], $a_perms).LAN_PLUGIN." - ".$row['plugin_name']."<br />";
}
// Language Rights.. --------------
if($pref['multilanguage'])
{
sort($lanlist);
$text .= "<br /><div class='fcaption'>".ADLAN_132."</div><br />\n";
$text .= checkb($pref['sitelanguage'], $a_perms).$pref['sitelanguage']."<br />\n";
foreach($lanlist as $langval)
{
$langname = $langval;
$langval = ($langval == $pref['sitelanguage']) ? "" : $langval;
if ($langval)
{
$text .= checkb($langval, $a_perms).$langval."<br />\n";
}
}
}
// -------------------------
if (getperms('0'))
{
$text .= "<br /><br /><div class='fcaption'>".ADMSLAN_58."</div><br />";
$text .= checkb("0", $a_perms).ADMSLAN_58."<br />";
}
$text .= "<br /><br />
<a href='".e_SELF."?checkall=1' onclick=\"setCheckboxes('myform', true, 'perms[]'); return false;\">".ADMSLAN_49."</a> -
<a href='".e_SELF."' onclick=\"setCheckboxes('myform', false, 'perms[]'); return false;\">".ADMSLAN_51."</a><br />
<br />
</td>
</tr>";
$text .= "<tr style='vertical-align:top'>
<td colspan='2' style='text-align:center' class='forumheader'>";
$text .= "<input class='button' type='submit' name='update_admin' value='".ADMSLAN_52."' />
<input type='hidden' name='a_id' value='$a_id' />";
$text .= "</td>
</tr>
</table>
</form>
</div>";
$text .= "<div style='text-align:center'><br /><a href='".e_SELF."'>".ADMSLAN_70."</a></div>";
$ns->tablerender(ADMSLAN_52, $text);
}
require_once("footer.php");
function checkb($arg, $perms)
{
if (getperms($arg, $perms))
{
$par = "<input type='checkbox' name='perms[]' value='$arg' checked='checked' />\n";
}
else
{
$par = "<input type='checkbox' name='perms[]' value='$arg' />\n";
}
return $par;
}
function renderperms($perm,$id){
global $pref,$sql,$pt;
if($perm == "0"){
return ADMSLAN_58;
}
$sql2 = new db;
$lanlist = explode(",",e_LANLIST);
if(!$pt){
$pt["1"] = ADMSLAN_19;
$pt["2"] = ADMSLAN_20;
$pt["3"] = ADMSLAN_21;
$pt["4"] = ADMSLAN_22; // Moderate users/bans etc
$pt["5"] = ADMSLAN_23; // create/edit custom pages/menus
$pt["Q"] = ADMSLAN_24; // Manage download categories
$pt["6"] = ADMSLAN_25; // Upload /manage files
$pt["Y"] = ADMSLAN_67; // file inspector
$pt["O"] = ADMSLAN_68; // notify
$pt["7"] = ADMSLAN_26;
$pt["8"] = ADMSLAN_27;
$pt["C"] = ADMSLAN_64;
$pt["9"] = ADMSLAN_28;
$pt["W"] = ADMSLAN_65;
$pt["D"] = ADMSLAN_29;
$pt["E"] = ADMSLAN_30;
$pt["F"] = ADMSLAN_31;
$pt["G"] = ADMSLAN_32;
$pt["S"] = ADMSLAN_33;
$pt["T"] = ADMSLAN_34;
$pt["V"] = ADMSLAN_35;
$pt["X"] = ADMSLAN_66;
$pt["A"] = ADMSLAN_36; // Configure Image Settings
$pt["B"] = ADMSLAN_37;
$pt["H"] = ADMSLAN_39;
$pt["I"] = ADMSLAN_40;
$pt["L"] = ADMSLAN_43;
$pt["R"] = ADMSLAN_44;
$pt["U"] = ADMSLAN_45;
$pt["M"] = ADMSLAN_46;
$pt["N"] = ADMSLAN_47;
$pt["Z"] = ADMSLAN_62;
// foreach($lanlist as $lan){
// $pt[$lan] = $lan;
// }
$sql2->db_Select("plugin", "*", "plugin_installflag='1'");
while ($row2 = $sql2->db_Fetch()){
$pt[("P".$row2['plugin_id'])] = LAN_PLUGIN." - ".$row2['plugin_name'];
}
}
$tmp = explode(".", $perm);
$langperm = "";
foreach($tmp as $pms){
if(in_array($pms, $lanlist)){
$langperm .= $pms."&nbsp;";
}else{
$permtxt[] = $pms;
if($pt[$pms]){
$ptext[] = $pt[$pms];
}
}
}
$ret = implode(" ",$permtxt);
if($pref['multilanguage']){
$ret .= ",&nbsp;". $langperm;
}
$text = "<div onclick=\"expandit('id_$id')\" style='cursor:pointer' title='".ADMSLAN_71."'>$ret</div>
<div id='id_$id' style='display:none'><br />".implode("<br />",$ptext)."</div>";
return $text;
}
?>

23
e107_admin/article.php Normal file
View File

@@ -0,0 +1,23 @@
<?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_admin/article.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:11 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
header('Location: admin.php');
exit;
?>

175
e107_admin/auth.php Normal file
View File

@@ -0,0 +1,175 @@
<?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_admin/auth.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:11 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php");
@include_once(e_LANGUAGEDIR."English/admin/lan_admin.php");
if (ADMIN)
{
define("ADMIN_PAGE", true);
require_once(e_ADMIN."header.php");
}
else
{
$use_imagecode = ($pref['logcode'] && extension_loaded("gd"));
if ($use_imagecode)
{
require_once(e_HANDLER."secure_img_handler.php");
$sec_img = new secure_image;
}
if ($_POST['authsubmit'])
{
$obj = new auth;
if($use_imagecode)
{
if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify']))
{
echo "<script type='text/javascript'>document.location.href='../index.php'</script>\n";
header("location: ../index.php");
exit;
}
}
$row = $authresult = $obj->authcheck($_POST['authname'], $_POST['authpass']);
if ($row[0] == "authfail") {
echo "<script type='text/javascript'>document.location.href='../index.php'</script>\n";
header("location: ../index.php");
exit;
} else {
$userpass = md5($_POST['authpass']);
$cookieval = $row['user_id'].".".md5($userpass);
$sql->db_Select("user", "*", "user_name='".$tp -> toDB($_POST['authname'])."'");
list($user_id, $user_name, $userpass) = $sql->db_Fetch();
if ($pref['user_tracking'] == "session") {
$_SESSION[$pref['cookie_name']] = $cookieval;
} else {
cookie($pref['cookie_name'], $cookieval, (time()+3600 * 24 * 30));
}
echo "<script type='text/javascript'>document.location.href='admin.php'</script>\n";
}
}
$e_sub_cat = 'logout';
require_once(e_ADMIN."header.php");
if (ADMIN == FALSE) {
$obj = new auth;
$obj->authform();
require_once(e_ADMIN."footer.php");
exit;
}
}
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
class auth
{
function authform()
{
/*
# Admin auth login
#
# - parameters none
# - return null
# - scope public
*/
global $use_imagecode, $sec_img;
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>\n
<table style='width:50%' class='fborder'>
<tr>
<td style='width:35%' class='forumheader3'>".ADLAN_89."</td>
<td class='forumheader3' style='text-align:center'><input class='tbox' type='text' name='authname' size='30' value='$authname' maxlength='20' />\n</td>
</tr>
<tr>
<td style='width:35%' class='forumheader3'>".ADLAN_90."</td>
<td class='forumheader3' style='text-align:center'><input class='tbox' type='password' name='authpass' size='30' value='' maxlength='20' />\n</td>
</tr>
";
if ($use_imagecode) {
$text .= "
<tr>
<td style='width:35%' class='forumheader3'>".ADLAN_152."</td>
<td style='text-align:center'>
<input type='hidden' name='rand_num' value='".$sec_img->random_number."'>".
$sec_img->r_image().
"<br /><input class='tbox' type='text' name='code_verify' size='15' maxlength='20' /></td>
</tr>
";
}
$text .= "
<tr>
<td colspan='2' style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='authsubmit' value='".ADLAN_91."' />
</td>
</tr>
</table>
</form>
</div>";
$au = new e107table;
$au->tablerender(ADLAN_92, $text);
}
function authcheck($authname, $authpass)
{
/*
# Admin auth check
# - parameter #1: string $authname, entered name
# - parameter #2: string $authpass, entered pass
# - return boolean if fail, else result array
# - scope public
*/
global $tp;
$sql_auth = new db;
$authname = $tp -> toDB(preg_replace("/\sOR\s|\=|\#/", "", $authname));
if ($sql_auth->db_Select("user", "*", "user_loginname='$authname' AND user_admin='1' "))
{
$row = $sql_auth->db_Fetch();
}
else
{
if ($sql_auth->db_Select("user", "*", "user_name='$authname' AND user_admin='1' "))
{
$row = $sql_auth->db_Fetch();
}
}
if($row['user_id'])
{
if($row['user_password'] == md5($authpass))
{
return $row;
}
}
return array("authfail");
}
}
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
?>

131
e107_admin/banlist.php Normal file
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_admin/banlist.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:11 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("4")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'banlist';
require_once("auth.php");
require_once(e_HANDLER."form_handler.php");
$rs = new form;
if (e_QUERY) {
$tmp = explode("-", e_QUERY);
$action = $tmp[0];
$sub_action = $tmp[1];
$id = $tmp[2];
unset($tmp);
}
$_POST['ban_ip'] = trim($_POST['ban_ip']);
if (isset($_POST['add_ban']) && $_POST['ban_ip'] != "" && strpos($_POST['ban_ip'], ' ') === false) {
$_POST['ban_reason'] = $tp->toDB($_POST['ban_reason']);
admin_update($sql -> db_Insert("banlist", "'".$_POST['ban_ip']."', '".ADMINID."', '".$_POST['ban_reason']."'"), 'insert');
unset($ban_ip);
}
if (isset($_POST['update_ban']) && $_POST['ban_ip'] != "" && strpos($_POST['ban_ip'], ' ') === false) {
$_POST['ban_reason'] = $tp->toDB($_POST['ban_reason']);
admin_update($sql -> db_Update("banlist", "banlist_ip='".$_POST['ban_ip']."', banlist_admin=".ADMINID.", banlist_reason='".$_POST['ban_reason']."' WHERE banlist_ip='".$_POST['old_ip']."'"));
unset($ban_ip);
}
if ($action == "remove" && isset($_POST['ban_secure'])) {
$sql -> db_Delete("generic", "gen_type='failed_login' AND gen_ip='$sub_action'");
admin_update($sql -> db_Delete("banlist", "banlist_ip='$sub_action'"), 'delete');
}
if ($action == "edit") {
$sql->db_Select("banlist", "*", "banlist_ip='$sub_action'");
$row = $sql->db_Fetch();
extract($row);
} else {
unset($banlist_ip, $banlist_reason);
if (e_QUERY && strpos($_SERVER["HTTP_REFERER"], "userinfo")) {
$banlist_ip = $action;
}
}
$text = "";
$text .= "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:30%' class='forumheader3'>".BANLAN_5.": {$rdns_warn}</td>
<td style='width:70%' class='forumheader3'>
<input class='tbox' type='text' name='ban_ip' size='40' value='".$banlist_ip."' maxlength='200' />
</td>
</tr>
<tr>
<td style='width:20%' class='forumheader3'>".BANLAN_7.": </td>
<td style='width:80%' class='forumheader3'>
<textarea class='tbox' name='ban_reason' cols='50' rows='4'>$banlist_reason</textarea>
</td>
</tr>
<tr style='vertical-align:top'>
<td colspan='2' style='text-align:center' class='forumheader'>".
($action == "edit" ? "<input type='hidden' name='old_ip' value='$banlist_ip' /><input class='button' type='submit' name='update_ban' value='".LAN_UPDATE."' />" : "<input class='button' type='submit' name='add_ban' value='".BANLAN_8."' />")."
</td>
</tr>
</table>
</form>
</div>";
if(!varsettrue($pref['enable_rdns']))
{
$text .= "<div style='text-align:center'><br />".BANLAN_12."</div>";
}
$ns->tablerender(BANLAN_9, $text);
if ($action != "edit") {
$text = $rs->form_open("post", e_SELF, "ban_form")."<div style='text-align:center'>".$rs->form_hidden("ban_secure", "1");
if (!$ban_total = $sql->db_Select("banlist","*","ORDER BY banlist_ip","nowhere")) {
$text .= "<div style='text-align:center'>".BANLAN_2."</div>";
} else {
$text .= "<table class='fborder' style='".ADMIN_WIDTH."'>
<tr>
<td style='width:70%' class='fcaption'>".BANLAN_10."</td>
<td style='width:30%' class='fcaption'>".LAN_OPTIONS."</td>
</tr>";
$count = 0;
while ($row = $sql->db_Fetch()) {
extract($row);
$banlist_reason = str_replace("LAN_LOGIN_18", BANLAN_11, $banlist_reason);
$text .= "<tr><td style='width:70%' class='forumheader3'>$banlist_ip<br />".BANLAN_7.": $banlist_reason</td>
<td style='width:30%; text-align:center' class='forumheader3'>".$rs->form_button("submit", "main_edit_$count", LAN_EDIT, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?edit-$banlist_ip'\"").$rs->form_button("submit", "main_delete_$count", BANLAN_4, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?remove-$banlist_ip'\"")."</td>\n</tr>";
$count++;
}
$text .= "</table>\n";
}
$text .= "</div>".$rs->form_close();
$ns->tablerender(BANLAN_3, $text);
}
require_once("footer.php");
?>

677
e107_admin/banner.php Normal file
View File

@@ -0,0 +1,677 @@
<?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_admin/banner.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:12 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("D")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'banner';
require_once("auth.php");
require_once(e_HANDLER."form_handler.php");
$rs = new form;
require_once(e_HANDLER."userclass_class.php");
require_once(e_HANDLER."file_class.php");
$fl = new e_file;
$lan_file = e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php";
include_once(file_exists($lan_file) ? $lan_file : e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php");
if(e_QUERY)
{
list($action, $sub_action, $id) = explode(".", e_QUERY);
}
$reject = array('$.','$..','/','CVS','thumbs.db','*._$',"thumb_", 'index', '.DS_Store');
$images = $fl->get_files(e_IMAGE."banners/","",$reject);
if (isset($_POST['update_menu'])) {
$menu_pref['banner_caption'] = $tp->toDB($_POST['banner_caption']);
$menu_pref['banner_amount'] = intval($_POST['banner_amount']);
$menu_pref['banner_rendertype'] = intval($_POST['banner_rendertype']);
if (isset($_POST['catid'])) {
$array_cat = explode("-", $_POST['catid']);
$cat='';
for($i = 0; $i < count($array_cat); $i++) {
$cat .= $tp->toDB($array_cat[$i])."|";
}
$cat = substr($cat, 0, -1);
$menu_pref['banner_campaign'] = $cat;
}
$sysprefs->setArray('menu_pref');
$message = BANNER_MENU_L2;
}
if ($_POST['createbanner'] || $_POST['updatebanner'])
{
$start_date = (!$_POST['startmonth'] || !$_POST['startday'] || !$_POST['startyear'] ? 0 : mktime (0, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear']));
$end_date = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear']));
$cli = ($_POST['client_name'] ? $_POST['client_name'] : $_POST['banner_client_sel']);
if ($_POST['banner_pages']) {
$postcampaign = ($_POST['banner_campaign'] ? $_POST['banner_campaign'] : $_POST['banner_campaign_sel']);
$pagelist = explode("\r\n", $_POST['banner_pages']);
for($i = 0 ; $i < count($pagelist) ; $i++) {
$pagelist[$i] = trim($pagelist[$i]);
}
$plist = implode("|", $pagelist);
$pageparms = $postcampaign."^".$_POST['banner_listtype']."-".$plist;
$pageparms = preg_replace("#\|$#", "", $pageparms);
$pageparms = (trim($_POST['banner_pages']) == '') ? '' :
$pageparms;
$cam = $pageparms;
} else {
$cam = ($_POST['banner_campaign'] ? $_POST['banner_campaign'] : $_POST['banner_campaign_sel']);
}
if ($_POST['createbanner']) {
admin_update($sql->db_Insert("banner", "0, '".$cli."', '".$_POST['client_login']."', '".$_POST['client_password']."', '".$_POST['banner_image']."', '".$_POST['click_url']."', '".intval($_POST['impressions_purchased'])."', '$start_date', '$end_date', '".$_POST['banner_class']."', 0, 0, '', '".$cam."'"), 'insert', BNRLAN_63);
} else {
admin_update($sql->db_Update("banner", "banner_clientname='".$cli."', banner_clientlogin='".$_POST['client_login']."', banner_clientpassword='".$_POST['client_password']."', banner_image='".$_POST['banner_image']."', banner_clickurl='".$_POST['click_url']."', banner_impurchased='".intval($_POST['impressions_purchased'])."', banner_startdate='$start_date', banner_enddate='$end_date', banner_active='".$_POST['banner_class']."', banner_campaign='".$cam."' WHERE banner_id='".$_POST['eid']."'"), 'update', BNRLAN_64);
}
unset($_POST['client_name'], $_POST['client_login'], $_POST['client_password'], $_POST['banner_image'], $_POST['click_url'], $_POST['impressions_purchased'], $start_date, $end_date, $_POST['banner_enabled'], $_POST['startday'], $_POST['startmonth'], $_POST['startyear'], $_POST['endday'], $_POST['endmonth'], $_POST['endyear'], $_POST['banner_class'], $_POST['banner_pages'], $_POST['banner_listtype']);
}
if (isset($_POST['confirm'])) {
admin_update($sql->db_Delete("banner", "banner_id='".$_POST['id']."' "), 'delete', BNRLAN_1);
}
if ($action == "delete" && $sub_action) {
$text = "<div style='text-align:center'>
<b>".BNRLAN_2."</b>
<br /><br />
<form method='post' action='".e_SELF."'>
<input class='button' type='submit' name='cancel' value='".LAN_CANCEL."' />
<input class='button' type='submit' name='confirm' value='".LAN_CONFDELETE."' />
<input type='hidden' name='id' value='".$sub_action."' />
</form>
</div>";
$ns->tablerender(BNRLAN_5, $text);
require_once("footer.php");
exit;
}
if (isset($_POST['cancel'])) {
$message = BNRLAN_6;
}
if (isset($message)) {
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
if ($sql->db_Select("banner")) {
while ($row = $sql->db_Fetch()) {
extract($row);
if (strpos($banner_campaign, "^") !== FALSE) {
$campaignsplit = explode("^", $banner_campaign);
$banner_campaign = $campaignsplit[0];
}
if ($banner_campaign) {
$campaigns[] = $banner_campaign;
}
if ($banner_clientname) {
$clients[] = $banner_clientname;
}
if ($banner_clientlogin) {
$logins[] = $banner_clientlogin;
}
if ($banner_clientpassword) {
$passwords[] = $banner_clientpassword;
}
}
}
if (!$action) {
$text = "
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr><td colspan='7' style='text-align:center' class='fcaption'>".BNRLAN_7."</td></tr>
<tr>
<td class='forumheader' style='text-align:center'>".BNRLAN_8."</td>
<td class='forumheader' style='text-align:center'>".BNRLAN_9."</td>
<td class='forumheader' style='text-align:center'>".BNRLAN_10."</td>
<td class='forumheader' style='text-align:center'>".BNRLAN_11."</td>
<td class='forumheader' style='text-align:center'>".BNRLAN_12."</td>
<td class='forumheader' style='text-align:center'>".BNRLAN_13."</td>
<td class='forumheader' style='text-align:center'>".LAN_OPTIONS."</td>
</tr>";
if (!$banner_total = $sql->db_Select("banner")) {
$text .= "<tr><td colspan='7' class='forumheader3' style='text-align:center'>".BNRLAN_15."</td></tr>";
} else {
while ($row = $sql->db_Fetch()) {
extract($row);
$clickpercentage = ($banner_clicks && $banner_impressions ? round(($banner_clicks / $banner_impressions) * 100)."%" : "-");
$impressions_left = ($banner_impurchased ? $banner_impurchased - $banner_impressions : BNRLAN_16);
$impressions_purchased = ($banner_impurchased ? $banner_impurchased : BNRLAN_16);
$start_date = ($banner_startdate ? strftime("%d %B %Y", $banner_startdate) : BNRLAN_17);
$end_date = ($banner_enddate ? strftime("%d %B %Y", $banner_enddate) : BNRLAN_17);
if (strpos($banner_campaign, "^") !== FALSE) {
$campaignsplit = explode("^", $banner_campaign);
$banner_campaign = $campaignsplit[0];
$textvisivilitychanged = "(*)";
} else {
$textvisivilitychanged = "";
}
$text .= "<tr>
<td class='forumheader3' style='text-align:center'>".$banner_id."</td>
<td class='forumheader3' style='text-align:center'>".$banner_clientname."</td>
<td class='forumheader3' style='text-align:center'>".$banner_clicks."</td>
<td class='forumheader3' style='text-align:center'>".$clickpercentage."</td>
<td class='forumheader3' style='text-align:center'>".$impressions_purchased."</td>
<td class='forumheader3' style='text-align:center'>".$impressions_left."</td>
<td class='forumheader3' style='text-align:center'><a href='".e_SELF."?create.edit.".$banner_id."'>".ADMIN_EDIT_ICON."</a> <a href='".e_SELF."?delete.".$banner_id."'>".ADMIN_DELETE_ICON."</a></td>
</tr>
<tr>
<td class='forumheader3' style='text-align:center'>&nbsp;</td>
<td class='forumheader3' style='text-align:center'>".$banner_campaign."</td>
<td colspan='2' class='forumheader3' style='text-align:center'>".r_userclass_name($banner_active)." ".$textvisivilitychanged."</td>
<td colspan='3' class='forumheader3' style='text-align:center'>".BNRLAN_45.": ".$start_date." &lt;&gt; ".BNRLAN_21.": ".$end_date."</td>
</tr>
<tr><td colspan='8'>&nbsp;</td></tr>";
}
}
$text .= "</table></div>";
$ns->tablerender(BNRLAN_42, $text);
}
if ($action == "create") {
if ($sub_action == "edit" && $id) {
if (!$sql->db_Select("banner", "*", "banner_id = '".$id."' " )) {
$text .= "<div style='text-align:center;'>".BNRLAN_15."</div>";
} else {
while ($row = $sql->db_Fetch()) {
extract($row);
$_POST['client_name'] = $banner_clientname;
$_POST['client_login'] = $banner_clientlogin;
$_POST['client_password'] = $banner_clientpassword;
$_POST['banner_image'] = $banner_image;
$_POST['click_url'] = $banner_clickurl;
$_POST['impressions_purchased'] = $banner_impurchased;
$_POST['banner_campaign'] = $banner_campaign;
$_POST['banner_active'] = $banner_active;
if ($banner_startdate) {
$tmp = getdate($banner_startdate);
$_POST['startmonth'] = $tmp['mon'];
$_POST['startday'] = $tmp['mday'];
$_POST['startyear'] = $tmp['year'];
}
if ($banner_enddate) {
$tmp = getdate($banner_enddate);
$_POST['endmonth'] = $tmp['mon'];
$_POST['endday'] = $tmp['mday'];
$_POST['endyear'] = $tmp['year'];
}
if (strpos($_POST['banner_campaign'], "^") !== FALSE) {
$campaignsplit = explode("^", $_POST['banner_campaign']);
$listtypearray = explode("-", $campaignsplit[1]);
$listtype = $listtypearray[0];
$campaign_pages = str_replace("|", "\n", $listtypearray[1]);
$_POST['banner_campaign'] = $campaignsplit[0];
} else {
$_POST['banner_campaign'] = $banner_campaign;
}
}
}
}
$text = "
<div style='text-align: center;'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr><td colspan='2' style='text-align:center' class='fcaption'>".($sub_action == "edit" ? BNRLAN_22 : BNRLAN_23)."</td></tr>
<tr>
<td class='forumheader3'>".BNRLAN_24."</td>
<td class='forumheader3'>";
if (count($campaigns)) {
$text .= "<select name='banner_campaign_sel' class='tbox'><option></option>";
$c = 0;
while ($campaigns[$c]) {
if (!isset($for_var[$campaigns[$c]])) {
$text .= ($_POST['banner_campaign'] == $campaigns[$c] ? "<option selected='selected'>".$campaigns[$c]."</option>" : "<option>".$campaigns[$c]."</option>");
$for_var[$campaigns[$c]] = $campaigns[$c];
}
$c++;
}
unset($for_var);
$text .= "</select> ".BNRLAN_25."&nbsp;&nbsp;";
}
$text .= " <input class='tbox' type='text' size='30' maxlength='100' name='banner_campaign' value='' />
".BNRLAN_26."
</td>
</tr>
<tr>
<td class='forumheader3'>".BNRLAN_27."</td>
<td class='forumheader3'>";
if (count($clients)) {
$text .= "<select name='banner_client_sel' class='tbox' onchange=\"Change_Details(this.form)\"><option></option>";
$c = 0;
while ($clients[$c]) {
if (!isset($for_var[$clients[$c]])) {
$text .= ($_POST['client_name'] == $clients[$c] ? "<option selected='selected'>".$clients[$c]."</option>" : "<option>".$clients[$c]."</option>");
$for_var[$clients[$c]] = $clients[$c];
}
$c++;
}
unset($for_var);
$text .= "</select> ".BNRLAN_28."&nbsp;&nbsp;";
$text .= "<script type='text/javascript'>
function Change_Details(form){
var login_field = (document.all) ? document.all(\"clientlogin\") : document.getElementById(\"clientlogin\");
var password_field = (document.all) ? document.all(\"clientpassword\") : document.getElementById(\"clientpassword\");
switch(form.banner_client_sel.selectedIndex-1){";
$c = 0;
$i = 0;
while ($logins[$c]) {
if (!isset($for_var[$logins[$c]])) {
$text .= "
case ".$i.":
login_field.value = \"".$logins[$c]."\";
password_field.value = \"".$passwords[$c]."\";
break;";
$for_var[$logins[$c]] = $logins[$c];
$i++;
}
$c++;
}
unset($for_var);
$text .= "
default:
login_field.value = \"\";
password_field.value = \"\";
break;
}
}
</script>";
}
$text .= "<input class='tbox' type='text' size='30' maxlength='100' name='client_name' value='' />
".BNRLAN_29."
</td></tr>
<tr>
<td class='forumheader3'>".BNRLAN_30."</td>
<td class='forumheader3'>
<input class='tbox' type='text' size='30' maxlength='20' id='clientlogin' name='client_login' value='".$_POST['client_login']."' />
</td></tr>
<tr>
<td class='forumheader3'>".BNRLAN_31."</td>
<td class='forumheader3'>
<input class='tbox' type='text' size='30' maxlength='50' id='clientpassword' name='client_password' value='".$_POST['client_password']."' />
</td></tr>
<tr>
<td class='forumheader3'>".BNRLAN_32."</td>
<td class='forumheader3'>
<input class='button' type ='button' value='".BNRLAN_43."' onclick='expandit(this)' />
<div style='display:none'><br />";
$c = 0;
while ($images[$c])
{
$image = $images[$c]['path'].$images[$c]['fname'];
$fileext1 = substr(strrchr($image, "."), 1);
$fileext2 = substr(strrchr($image, "."), 0);
$text .= "<input type='radio' name='banner_image' value='".$images[$c]['fname']."'";
if (basename($image) == $_POST['banner_image']) {
$text .= "checked='checked'";
}
if ($fileext1 == swf) {
$text .= " /> <br><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='468' height='60'>
<param name='movie' value='".e_IMAGE."banners/".$images[$c]['fname']."'>
<param name='quality' value='high'><param name='SCALE' value='noborder'>
<embed src='".e_IMAGE."banners/".$images[$c]['fname']."' width='468' height='60' scale='noborder' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed></object>
<br />";
}
else if($fileext1 == "php" || $fileext1 == "html" || $fileext1 == "js") {
$text .= " /> ".BNRLAN_46.": ".$images[$c]['fname']."<br />";
} else {
$text .= " /> <img src='$image' alt='' /><br />";
}
$c++;
}
$text .= "</div></td></tr>
<tr>
<td class='forumheader3'>".BNRLAN_33."</td>
<td class='forumheader3'>
<input class='tbox' type='text' size='70' maxlength='150' name='click_url' value='".$_POST['click_url']."' />
</td></tr>
<tr>
<td class='forumheader3'>".BNRLAN_34."</td>
<td class='forumheader3'>
<input class='tbox' type='text' size='10' maxlength='10' name='impressions_purchased' value='".$_POST['impressions_purchased']."' /> 0 = ".BNRLAN_35."
</td></tr>
<tr>
<td class='forumheader3'>".BNRLAN_36."</td>
<td class='forumheader3'><select name='startday' class='tbox'><option selected='selected'> </option>";
for($a = 1; $a <= 31; $a++) {
$text .= ($a == $_POST['startday'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
}
$text .= "</select> <select name='startmonth' class='tbox'><option selected='selected'> </option>";
for($a = 1; $a <= 12; $a++) {
$text .= ($a == $_POST['startmonth'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
}
$text .= "</select> <select name='startyear' class='tbox'><option selected='selected'> </option>";
for($a = 2003; $a <= 2010; $a++) {
$text .= ($a == $_POST['startyear'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
}
$text .= "</select> ".BNRLAN_38."
</td></tr>
<tr>
<td class='forumheader3'>".BNRLAN_37."</td>
<td class='forumheader3'>
<select name='endday' class='tbox'><option selected='selected'> </option>";
for($a = 1; $a <= 31; $a++) {
$text .= ($a == $_POST['endday'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
}
$text .= "</select> <select name='endmonth' class='tbox'><option selected='selected'> </option>";
for($a = 1; $a <= 12; $a++) {
$text .= ($a == $_POST['endmonth'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
}
$text .= "</select> <select name='endyear' class='tbox'><option selected='selected'> </option>";
for($a = 2003; $a <= 2010; $a++) {
$text .= ($a == $_POST['endyear'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
}
$text .= "</select> ".BNRLAN_38."
</td>
</tr>
<tr>
<td class='forumheader3'>".BNRLAN_39."</td>
<td class='forumheader3'>
".MENLAN_4."
".r_userclass("banner_class", $_POST['banner_active'], "off", "public,member,guest,admin,classes,nobody,classes")."
</td></tr>
<tr><td colspan='2' style='text-align:center' class='forumheader'>";
$text .= ($sub_action == "edit" && $id ? "<input class='button' type='submit' name='updatebanner' value='".BNRLAN_40."' /><input type='hidden' name='eid' value='".$id."'" : "<input class='button' type='submit' name='createbanner' value='".BNRLAN_41."' />");
$text .= "</td></tr></table>
</form>";
$ns->tablerender(BNRLAN_42, $text);
}
if ($action == "menu")
{
$array_cat_in = explode("|", $menu_pref['banner_campaign']);
if (!$menu_pref['banner_caption'])
{
$menu_pref['banner_caption'] = BANNER_MENU_L1;
}
$category_total = $sql -> db_Select("banner", "DISTINCT(banner_campaign) as banner_campaign", "ORDER BY banner_campaign", "mode=no_where");
while ($row = $sql -> db_Fetch())
{
extract($row);
if (in_array($banner_campaign, $array_cat_in))
{
$in_catname[] = $banner_campaign;
} else {
$out_catname[] = $banner_campaign;
}
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."' name='menu_conf_form'>
<table style='".ADMIN_WIDTH."' 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>
<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();'>\n";
foreach($out_catname as $name)
{
$text .= "<option value='$name'>$name</option>\n";
}
$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'>\n";
$catidvalues = "";
foreach($in_catname as $name)
{
$text .= "<option value='$name'>$name</option>\n";
$catidvalues .= $name."-";
}
$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_L19."</td>
<td style='width:60%' class='forumheader3'>
<input class='tbox' type='text' name='banner_amount' size='10' value='".$menu_pref['banner_amount']."' maxlength='2' />
</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_L12, ($menu_pref['banner_rendertype'] == 1 ? "1" : "0"), 1)."
".$rs->form_option(BANNER_MENU_L13, ($menu_pref['banner_rendertype'] == 2 ? "1" : "0"), 2)."
".$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);
echo "<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";
}
function banner_adminmenu() {
global $action, $sql, $sub_action, $id;
$act = $action;
if ($act == "") {
$act = "main";
}
$var['main']['text'] = BNRLAN_58;
$var['main']['link'] = e_SELF;
$var['create']['text'] = BNRLAN_59;
$var['create']['link'] = e_SELF."?create";
$var['menu']['text'] = BNRLAN_61;
$var['menu']['link'] = e_SELF."?menu";
show_admin_menu(BNRLAN_62, $act, $var);
}
require_once("footer.php");
?>

87
e107_admin/cache.php Normal file
View File

@@ -0,0 +1,87 @@
<?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_admin/cache.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:12 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("C")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'cache';
require_once("auth.php");
require_once(e_HANDLER."cache_handler.php");
$ec = new ecache;
if ($pref['cachestatus'] == '2') {
$pref['cachestatus'] = '1';
}
if (isset($_POST['submit_cache'])) {
if ($pref['cachestatus'] != $_POST['cachestatus']) {
$pref['cachestatus'] = $_POST['cachestatus'];
save_prefs();
$ec->clear();
$update = true;
}
admin_update($update, 'update', CACLAN_4);
}
if (isset($_POST['empty_cache'])) {
$ec->clear();
$ns->tablerender(LAN_UPDATE, "<div style='text-align:center'><b>".CACLAN_6."</b></div>");
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='fcaption'>".CACLAN_1."</td>
</tr>
<tr>
<td class='forumheader3'>";
$text .= (!$pref['cachestatus']) ? "<input type='radio' name='cachestatus' value='0' checked='checked' />" :
"<input type='radio' name='cachestatus' value='0' />";
$text .= CACLAN_7."
</td>
</tr>
<tr>
<td class='forumheader3'>";
if (is_writable(e_FILE."cache")) {
$text .= ('1' == $pref['cachestatus']) ? "<input type='radio' name='cachestatus' value='1' checked='checked' />" :
"<input type='radio' name='cachestatus' value='1' />";
$text .= CACLAN_9;
} else {
$text .= CACLAN_9."<br /><br /><b>".CACLAN_10."</b>";
}
$text .= "</td>
</tr>
<tr style='vertical-align:top'>
<td style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='submit_cache' value='".CACLAN_2."' />
<input class='button' type='submit' name='empty_cache' value='".CACLAN_5."' />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(CACLAN_3, $text);
require_once("footer.php");
?>

27
e107_admin/cascade.php Normal file
View File

@@ -0,0 +1,27 @@
<?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_admin/cascade.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:12 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (ADMIN) {
header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
exit;
} else {
header('Location:'.SITEURL.'index.php');
exit;
}
?>

27
e107_admin/categories.php Normal file
View File

@@ -0,0 +1,27 @@
<?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_admin/categories.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:12 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (ADMIN) {
header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
exit;
} else {
header('Location:'.SITEURL.'index.php');
exit;
}
?>

27
e107_admin/classis.php Normal file
View File

@@ -0,0 +1,27 @@
<?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_admin/classis.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:12 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (ADMIN) {
header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
exit;
} else {
header('Location:'.SITEURL.'index.php');
exit;
}
?>

27
e107_admin/combo.php Normal file
View File

@@ -0,0 +1,27 @@
<?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_admin/combo.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:12 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (ADMIN) {
header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
exit;
} else {
header('Location:'.SITEURL.'index.php');
exit;
}
?>

47
e107_admin/comment.php Normal file
View File

@@ -0,0 +1,47 @@
<?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_admin/comment.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:12 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("B")) {
header("location:".e_BASE."index.php");
exit;
}
if (e_QUERY) {
$temp = explode("-", e_QUERY);
$action = $temp[0];
$id = intval($temp[1]);
$item = $temp[2];
$c_item = $temp[3];
if ($action == "block") {
$sql->db_Update("comments", "comment_blocked='1' WHERE comment_id='$id' ");
}
if ($action == "unblock") {
$sql->db_Update("comments", "comment_blocked='0' WHERE comment_id='$id' ");
}
if ($action == "delete") {
$sql->db_Delete("comments", "comment_id='$id' ");
}
if (!$e107cache->clear($item)) {
$tmp = explode("?", $item);
$item = $tmp[0]."?news.".$c_item;
$e107cache->clear($item);
}
}
echo "<script type='text/javascript'>window.history.go(-1);</script>\n";
?>

27
e107_admin/compact.php Normal file
View File

@@ -0,0 +1,27 @@
<?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_admin/compact.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:12 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (ADMIN) {
header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
exit;
} else {
header('Location:'.SITEURL.'index.php');
exit;
}
?>

23
e107_admin/content.php Normal file
View File

@@ -0,0 +1,23 @@
<?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_admin/content.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:12 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
header('Location: admin.php');
exit;
?>

5711
e107_admin/core_image.php Normal file

File diff suppressed because it is too large Load Diff

453
e107_admin/cpage.php Normal file
View File

@@ -0,0 +1,453 @@
<?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_admin/cpage.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:19 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("5")) { header("location:".e_BASE."index.php"); exit; }
$e_sub_cat = 'custom';
$e_wysiwyg = "data";
$page = new page;
require_once("auth.php");
// require_once(e_HANDLER."ren_help.php");
require_once(e_HANDLER."userclass_class.php");
$custpage_lang = ($sql->mySQLlanguage) ? $sql->mySQLlanguage : $pref['sitelanguage'];
if (e_QUERY)
{
$tmp = explode(".", e_QUERY);
$action = $tmp[0];
$sub_action = $tmp[1];
$id = $tmp[2];
$from = ($tmp[3] ? $tmp[3] : 0);
}
if(isset($_POST['submitPage']))
{
$page -> submitPage();
}
if(isset($_POST['uploadfiles']))
{
$page -> uploadPage();
$id = $_POST['pe_id'];
$sub_action = ($_POST['pe_id']) ? "edit" : "";
$page -> createPage($_POST['mode']);
}
if(isset($_POST['submitMenu']))
{
$page -> submitPage("", TRUE);
}
if(isset($_POST['updateMenu']))
{
$page -> submitPage($_POST['pe_id'], TRUE);
}
if(isset($_POST['updatePage']))
{
$page -> submitPage($_POST['pe_id']);
}
if(isset($_POST['delete']))
{
foreach(array_keys($_POST['delete']) as $pid)
{
$page -> delete_page($pid);
}
}
if (isset($_POST['saveOptions'])) {
$page -> saveSettings();
}
if($page->message)
{
$ns->tablerender("", "<div style='text-align:center'><b>".$page->message."</b></div>");
}
if(!e_QUERY)
{
$page -> showExistingPages();
}
else
{
$function = $action."Page";
$page -> $function();
}
require_once(e_ADMIN."footer.php");
class page
{
var $message;
function showExistingPages()
{
global $sql, $tp, $ns;
$text = "<div style='text-align: center;'>";
if(!$sql -> db_Select("page", "*", "ORDER BY page_datestamp DESC", "nowhere"))
{
$text .= CUSLAN_42;
}
else
{
$pages = $sql -> db_getList('ALL', FALSE, FALSE);
$text .= "<form action='".e_SELF."' id='newsform' method='post'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:5%; text-align: center;' class='fcaption'>ID</td>
<td style='width:60%' class='fcaption'>".CUSLAN_1."</td>
<td style='width:15%; text-align: center;' class='fcaption'>".CUSLAN_2."</td>
<td style='width:20%; text-align: center;' class='fcaption'>".CUSLAN_3."</td>
</tr>";
foreach($pages as $pge)
{
$text .= "
<tr>
<td style='width:5%; text-align: center;' class='forumheader3'>$pge[page_id]</td>
<td style='width:60%' class='forumheader3'><a href='".($pge[page_theme] ? e_ADMIN."menus.php" : e_BASE."page.php?{$pge[page_id]}" )."'>$pge[page_title]</a></td>
<td style='width:15%; text-align: center;' class='forumheader3'>".($pge[page_theme] ? "menu" : "page")."</td>
<td style='width:20%; text-align: center;' class='forumheader3'>
<a href='".e_SELF."?".($pge[page_theme] ? "createm": "create").".edit.{$pge[page_id]}'>".ADMIN_EDIT_ICON."</a>
<input type='image' title='".LAN_DELETE."' name='delete[{$pge[page_id]}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".CUSLAN_4." [ ID: $pge[page_id] ]')\"/>
</td>
</tr>";
}
$text .= "
</table>
</form>";
}
$text .= "
</div>";
$ns -> tablerender(CUSLAN_5, $text);
}
function createmPage()
{
$this -> createPage(TRUE);
}
function uploadPage()
{
global $pref;
$pref['upload_storagetype'] = "1";
require_once(e_HANDLER."upload_handler.php");
$uploaded = file_upload(e_IMAGE."custom/");
}
function createPage($mode=FALSE)
{
/* mode: FALSE == page, mode: TRUE == menu */
global $sql, $tp, $ns, $pref, $sub_action, $id;
if ($sub_action == "edit" && !$_POST['preview'] && !$_POST['submit'])
{
if ($sql->db_Select("page", "*", "page_id='$id' "))
{
$row = $sql->db_Fetch();
$page_class = $row['page_class'];
$page_password = $row['page_password'];
$page_title = $tp -> toFORM($row['page_title']);
$page_rating_flag = $row['page_rating_flag'];
$page_comment_flag = $row['page_comment_flag'];
$page_display_authordate_flag = $row['page_author'];
$data = $tp -> toFORM($row['page_text']);
$edit = TRUE;
}
if ($sql -> db_Select("links", "*", "link_url='page.php?".$id."'"))
{
$row = $sql -> db_Fetch();
$page_link = $row['link_name'];
}
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."' id='dataform' enctype='multipart/form-data'>
<table style='".ADMIN_WIDTH."' class='fborder'>";
if($mode)
{
$text .= "<tr>
<td style='width:25%' class='forumheader3'>".CUSLAN_7."</td>
<td style='width:75%' class='forumheader3'>";
if($edit)
{
$text .= $page_theme;
}
else
{
$text .= "<input class='tbox' type='text' name='menu_name' size='30' value='".$menu_name."' maxlength='50' />";
}
$text .= "</td>
</tr>";
}
$text .= "<tr>
<td style='width:25%' class='forumheader3'>".CUSLAN_8."</td>
<td style='width:75%' class='forumheader3'><input class='tbox' type='text' name='page_title' size='50' value='".$page_title."' maxlength='250' /></td>
</tr>
<tr>
<td style='width:25%' class='forumheader3'>".CUSLAN_9."</td>
<td style='width:75%' class='forumheader3'>";
require_once(e_HANDLER."ren_help.php");
$insertjs = (!e_WYSIWYG)?"rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);' style='width:95%'": "rows='25' style='width:100%' ";
$data = $tp->toForm($data);
$text .= "<textarea class='tbox' id='data' name='data' cols='80' $insertjs>".(strstr($data, "[img]http") ? $data : str_replace("[img]../", "[img]", $data))."</textarea>";
$text .= "<br />".display_help('',"cpage")."</td>
</tr>
<tr>
<td style='width:25%' class='forumheader3'>".LAN_UPLOAD_IMAGES."</td>
<td style='width:75%;' class='forumheader3'>".$tp->parseTemplate("{UPLOADFILE=".e_IMAGE."custom/}")."</td>
</tr>";
if(!$mode)
{
$text .= "
<tr>
<td style='width:25%' class='forumheader3'>".CUSLAN_10."</td>
<td style='width:75%;' class='forumheader3'>
<input type='radio' name='page_rating_flag' value='1'".($page_rating_flag ? " checked='checked'" : "")." /> ".CUSLAN_38."&nbsp;&nbsp;
<input type='radio' name='page_rating_flag' value='0'".($page_rating_flag ? "" : " checked='checked'")." /> ".CUSLAN_39."
</td>
</tr>
<tr>
<td style='width:25%' class='forumheader3'>".CUSLAN_13."</td>
<td style='width:75%;' class='forumheader3'>
<input type='radio' name='page_comment_flag' value='1'".($page_comment_flag ? " checked='checked'" : "")." /> ".CUSLAN_38."&nbsp;&nbsp;
<input type='radio' name='page_comment_flag' value='0'".($page_comment_flag ? "" : " checked='checked'")." /> ".CUSLAN_39."
</td>
</tr>
<tr>
<td style='width:25%' class='forumheader3'>".CUSLAN_41."</td>
<td style='width:75%;' class='forumheader3'>
<input type='radio' name='page_display_authordate_flag' value='1'".($page_display_authordate_flag ? " checked='checked'" : "")." /> ".CUSLAN_38."&nbsp;&nbsp;
<input type='radio' name='page_display_authordate_flag' value='0'".($page_display_authordate_flag ? "" : " checked='checked'")." /> ".CUSLAN_39."
</td>
</tr>
<tr>
<td style='width:25%' class='forumheader3'>".CUSLAN_14."<br /><span class='smalltext'>".CUSLAN_15."</span></td>
<td style='width:75%' class='forumheader3'><input class='tbox' type='text' name='page_password' size='20' value='".$page_password."' maxlength='50' /></td>
</tr>
<tr>
<td style='width:25%' class='forumheader3'>".CUSLAN_16."<br /><span class='smalltext'>".CUSLAN_17."</span></td>
<td style='width:75%' class='forumheader3'><input class='tbox' type='text' name='page_link' size='60' value='".$page_link."' maxlength='50' /></td>
</tr>
<tr>
<td style='width:25%' class='forumheader3'>".CUSLAN_18."</td>
<td style='width:75%' class='forumheader3'>".r_userclass("page_class", $page_class)."</td>
</tr>";
}
$text .= "<tr>
<td colspan='2' style='text-align:center' class='forumheader'>".
(!$mode ?
($edit ? "<input class='button' type='submit' name='updatePage' value='".CUSLAN_19."' /><input type='hidden' name='pe_id' value='$id' />" : "<input class='button' type='submit' name='submitPage' value='".CUSLAN_20."' />") :
($edit ? "<input class='button' type='submit' name='updateMenu' value='".CUSLAN_21."' /><input type='hidden' name='pe_id' value='$id' />" : "<input class='button' type='submit' name='submitMenu' value='".CUSLAN_22."' />"))
."<input type='hidden' name='mode' value='$mode' />
</td>
</tr>
</table>
</form>
</div>";
$caption =(!$mode ? ($edit ? CUSLAN_23 : CUSLAN_24) : ($edit ? CUSLAN_25 : CUSLAN_26));
$ns -> tablerender($caption, $text);
}
function submitPage($mode = FALSE, $type=FALSE)
{
global $sql, $tp, $e107cache;
$page_title = $tp -> toDB($_POST['page_title']);
$page_text = $tp -> toDB($_POST['data']);
$pauthor = ($_POST['page_display_authordate_flag'] ? USERID : 0);
if($mode)
{
$update = $sql -> db_Update("page", "page_title='$page_title', page_text='$page_text', page_author='$pauthor', page_rating_flag='".intval($_POST['page_rating_flag'])."', page_comment_flag='".intval($_POST['page_comment_flag'])."', page_password='".$_POST['page_password']."', page_class='".$_POST['page_class']."', page_ip_restrict='".$_POST['page_ip_restrict']."' WHERE page_id='$mode'");
$e107cache->clear("page_{$mode}");
$e107cache->clear("page-t_{$mode}");
if ($_POST['page_link'])
{
if ($sql -> db_Select("links", "link_id", "link_url='page.php?".$mode."' && link_name!='".$tp -> toDB($_POST['page_link'])."'"))
{
$sql -> db_Update("links", "link_name='".$tp -> toDB($_POST['page_link'])."' WHERE link_url='page.php?".$mode."'");
$update++;
$e107cache->clear("sitelinks");
}
else if (!$sql -> db_Select("links", "link_id", "link_url='page.php?".$mode."'"))
{
$sql -> db_Insert("links", "0, '".$tp -> toDB($_POST['page_link'])."', 'page.php?".$mode."', '', '', 1, 0, 0, 0, ".$_POST['page_class']);
$update++;
$e107cache->clear("sitelinks");
}
} else {
if ($sql -> db_Select("links", "link_id", "link_url='page.php?".$mode."'"))
{
$sql -> db_Delete("links", "link_url='page.php?".$mode."'");
$update++;
$e107cache->clear("sitelinks");
}
}
admin_update($update, 'update', "Page updated in database.");
}
else
{
$menuname = ($type ? $tp -> toDB($_POST['menu_name']) : "");
admin_update($sql -> db_Insert("page", "0, '$page_title', '$page_text', '$pauthor', '".time()."', '".intval($_POST['page_rating_flag'])."', '".intval($_POST['page_comment_flag'])."', '".$_POST['page_password']."', '".$_POST['page_class']."', '', '".$menuname."'"), 'insert', CUSLAN_27);
if($type)
{
$sql -> db_Insert("menus", "0, '$menuname', '0', '0', '0', '', '".mysql_insert_id()."' ");
}
if($_POST['page_link'])
{
$link = "page.php?".mysql_insert_id();
if (!$sql->db_Select("links", "link_id", "link_name='".$tp -> toDB($_POST['page_link'])."'"))
{
$linkname = $tp -> toDB($_POST['page_link']);
$sql->db_Insert("links", "0, '$linkname', '$link', '', '', 1, 0, 0, 0, ".$_POST['page_class']);
$e107cache->clear("sitelinks");
}
}
}
}
function delete_page($del_id)
{
global $sql, $e107cache;
admin_update($sql -> db_Delete("page", "page_id='$del_id' "), 'delete', CUSLAN_28);
$sql -> db_Delete("menus", "menu_path='$del_id' ");
if ($sql -> db_Select("links", "link_id", "link_url='page.php?".$del_id."'"))
{
$sql -> db_Delete("links", "link_url='page.php?".$del_id."'");
$e107cache->clear("sitelinks");
}
}
function optionsPage()
{
global $ns, $pref;
if(!isset($pref['pageCookieExpire'])) $pref['pageCookieExpire'] = 84600;
$text = "<div style='text-align: center; margin-left:auto; margin-right: auto;'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:50%' class='forumheader3'>".CUSLAN_29."</td>
<td style='width:50%; text-align: right;' class='forumheader3'>
<input type='radio' name='listPages' value='1'".($pref['listPages'] ? " checked='checked'" : "")." /> ".CUSLAN_38."&nbsp;&nbsp;
<input type='radio' name='listPages' value='0'".($pref['listPages'] ? "" : " checked='checked'")." /> ".CUSLAN_39."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".CUSLAN_30."</td>
<td style='width:50%; text-align: right;' class='forumheader3'>
<input class='tbox' type='text' name='pageCookieExpire' size='15' value='".$pref['pageCookieExpire']."' maxlength='10' />
</td>
</tr>
<tr>
<td colspan='2' style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='saveOptions' value='".CUSLAN_40."' />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender("Options", $text);
}
function saveSettings()
{
global $pref;
$pref['listPages'] = $_POST['listPages'];
$pref['pageCookieExpire'] = $_POST['pageCookieExpire'];
save_prefs();
$this -> message = "Settings saved.";
}
function show_options($action)
{
if ($action == "")
{
$action = "main";
}
$var['main']['text'] = CUSLAN_11;
$var['main']['link'] = e_SELF;
$var['create']['text'] = CUSLAN_12;
$var['create']['link'] = e_SELF."?create";
$var['createm']['text'] = CUSLAN_31;
$var['createm']['link'] = e_SELF."?createm";
$var['options']['text'] = LAN_OPTIONS;
$var['options']['link'] = e_SELF."?options";
show_admin_menu(CUSLAN_33, $action, $var);
}
}
function cpage_adminmenu() {
global $page;
global $action;
$page -> show_options($action);
}
?>

257
e107_admin/credits.php Normal file
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_admin/credits.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:19 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
$e_sub_cat = 'credits';
include(e_ADMIN.'ver.php');
$creditsArray = array(
array( "name" => "MagpieRSS",
"url" => "http://magpierss.sourceforge.net/",
"description" => CRELAN_10,
"version" => "0.71.1",
"licence" => "GPL, ".CRELAN_8
),
array( "name" => "PCLZip",
"url" => "http://www.phpconcept.net/pclzip/",
"description" => CRELAN_11,
"version" => "2.3",
"licence" => "GPL"
),
array( "name" => "PCLTar",
"url" => "http://www.phpconcept.net/pcltar/",
"description" => CRELAN_12,
"version" => "1.3",
"licence" => "GPL"
),
array( "name" => "TinyMCE",
"url" => "http://tinymce.moxiecode.com/",
"description" => CRELAN_13,
"version" => "2.08",
"licence" => "GPL"
),
array( "name" => "Nuvolo Icons",
"url" => "http://www.icon-king.com",
"description" => CRELAN_14,
"version" => "1.0",
"licence" => "GPL"
),
array( "name" => "PHPMailer",
"url" => "http://phpmailer.sourceforge.net/",
"description" => CRELAN_15,
"version" => "1.72",
"licence" => "GPL"
),
array( "name" => "Brainjar DHTML Menu",
"url" => "http://www.brainjar.com/dhtml/menubar/",
"description" => CRELAN_16,
"version" => "0.1",
"licence" => "GPL, ".CRELAN_8
),
array( "name" => "DHTML / JavaScript Calendar",
"url" => "http://www.dynarch.com/projects/",
"description" => CRELAN_17,
"version" => "1.0",
"licence" => "GPL"
),
array( "name" => "FPDF",
"url" => "http://www.fpdf.org/",
"description" => CRELAN_18,
"version" => "1.53",
"licence" => "Freeware"
),
array( "name" => "UFPDF",
"url" => "http://www.acko.net/node/56",
"description" => CRELAN_19,
"version" => "0.1",
"licence" => "GPL"
),
);
$contentA = array(
"<h3>".CRELAN_6."<\/h3>",
"<h1>Carl Cedergren<\/h1>[ asperon ]<br /><br /><br />".CRELAN_20,
"<h1>Cameron Hanly<\/h1>[ CaMer0n ]<br /><br /><br />".CRELAN_21,
"<h1>Steve Dunstan<\/h1>[ jalist ]<br /><br /><br />".CRELAN_22,
"<h1>Eric Vanderfeesten<\/h1> [ lisa ]<br /><br /><br />".CRELAN_23,
"<h1>Thom Michelbrink<\/h1>[ McFly ]<br /><br /><br />".CRELAN_24,
"<h1>William Moffett<\/h1>[ que ]<br /><br /><br />".CRELAN_25,
"<h1>Martin Nicholls<\/h1>[ streaky ]<br /><br /><br />".CRELAN_26,
"<h1>James Currie<\/h1>[ SweetAs ]<br /><br /><br />".CRELAN_27,
"<h1>Pete Holzmann<\/h1>[ MrPete ]<br /><br /><br />".CRELAN_28
);
echo "<?xml version='1.0' encoding='".CHARSET."' ?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>".PAGE_NAME."</title>
<meta http-equiv='content-type' content='text/html; charset=".CHARSET."' />
<meta http-equiv='content-style-type' content='text/css' />
<link rel='stylesheet' href='".e_THEME."lamb/style.css' type='text/css' />
</head>
<body style='padding: 0; margin: 0; background-color: #e8e8e8; color: #8E8E8E'>
<div><img src='".e_IMAGE."generic/cred.png' alt='' />
<div class='smalltext' style='position: absolute; top: 120px; left: 118px;'><b>".CRELAN_7." ".$e107info['e107_version'].", build ".($e107info['e107_build'] ? $e107info['e107_build'] : "zero")."</b><br />&copy; 2002-2006, ".CRELAN_3."</div>
";
$fadejs = "
<script type='text/javascript'>
<!--
var delay = 2000;
var maxsteps=30;
var stepdelay=40;
var startcolor= new Array(255,255,255);
var endcolor=new Array(0,0,0);
var fcontent=new Array();
";
if(e_QUERY && e_QUERY == "stps")
{
$count=1;
$fadejs .= "fcontent[0] = '<br /><br />".CRELAN_2."';";
foreach($creditsArray as $credits)
{
extract($credits);
$fadejs .= "fcontent[$count] = '<br /><br /><h1>$name<\/h1>".CRELAN_7." $version<br /><br />$description<br /><br />[ <a href=\"$url\" rel=\"external\">$url<\/a> ]<br /><br />".CRELAN_9." - $licence';
";
$count++;
}
}
else
{
$count=0;
foreach($contentA as $content)
{
$fadejs .= "fcontent[$count] = '<br /><br />$content';
";
$count++;
}
}
$fadejs .= <<<TEXT
begintag='';
closetag='';
var fadelinks=1;
var fwidth='95%';
var fheight='220px;'
///No need to edit below this line/////////////////
var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;
/*Rafael Raposo edited function*/
//function to change content
function changecontent(){
if (index>=fcontent.length)
index=0
if (DOM2){
document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
if (fadelinks)
linkcolorchange(1);
colorfade(1, 15);
}
else if (ie4)
document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
index++
}
// colorfade() partially by Marcio Galli for Netscape Communications. ////////////
// Modified by Dynamicdrive.com
function linkcolorchange(step){
var obj=document.getElementById("fscroller").getElementsByTagName("A");
if (obj.length>0){
for (i=0;i<obj.length;i++)
obj[i].style.color=getstepcolor(step);
}
}
/*Rafael Raposo edited function*/
var fadecounter;
function colorfade(step) {
if(step<=maxsteps) {
document.getElementById("fscroller").style.color=getstepcolor(step);
if (fadelinks)
linkcolorchange(step);
step++;
fadecounter=setTimeout("colorfade("+step+")",stepdelay);
}else{
clearTimeout(fadecounter);
document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
setTimeout("changecontent()", delay);
}
}
/*Rafael Raposo's new function*/
function getstepcolor(step) {
var diff
var newcolor=new Array(3);
for(var i=0;i<3;i++) {
diff = (startcolor[i]-endcolor[i]);
if(diff > 0) {
newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
} else {
newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
}
}
return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}
if (ie4||DOM2)
document.write('<div id="fscroller" style="text-align: center; width:'+fwidth+';height:'+fheight+'"><\/div>');
if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent;
//-->
</script>
TEXT;
echo $fadejs;
echo "
<div style='text-align: center; margin-left: auto; margin-right: auto;'>
<form method='get' action=''><div>".
(e_QUERY && e_QUERY == "stps" ? "<input class='tbox' type='button' onclick=\"self.parent.location='".e_ADMIN."credits.php'\" value='".CRELAN_4."' />" : "<input class='tbox' type='button' onclick=\"self.parent.location='".e_ADMIN."credits.php?stps'\" value='".CRELAN_5."' />")."</div>
</form>
</div>
</div>
</body>
</html>
";
?>

281
e107_admin/db.php Normal file
View File

@@ -0,0 +1,281 @@
<?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_admin/db.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:19 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms('0')) {
header('location:'.e_BASE.'index.php');
exit;
}
$e_sub_cat = 'database';
if (isset($_POST['db_update'])) {
header("location: ".e_ADMIN."e107_update.php");
exit;
}
if (isset($_POST['verify_sql'])) {
header("location: ".e_ADMIN."db_verify.php");
exit;
}
require_once("auth.php");
if(isset($_POST['delpref']) || (isset($_POST['delpref_checked']) && isset($_POST['delpref2'])) )
{
del_pref_val();
}
if(isset($_POST['pref_editor']) || isset($_POST['delpref']) || isset($_POST['delpref_checked']))
{
pref_editor();
require_once("footer.php");
exit;
}
if (isset($_POST['optimize_sql'])) {
optimizesql($mySQLdefaultdb);
require_once("footer.php");
exit;
}
if (isset($_POST['backup_core'])) {
backup_core();
message_handler("MESSAGE", DBLAN_1);
}
if(isset($_POST['delplug']))
{
delete_plugin_entry();
}
if (isset($_POST['plugin_scan']) || e_QUERY == "plugin" || $_POST['delplug']) {
plugin_viewscan();
require_once("footer.php");
exit;
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>\n
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:70%' class='forumheader3'>".DBLAN_15."</td>
<td class='forumheader3' style='width:30%;text-align:center'><input class='button' style='width: 100%' type='submit' name='db_update' value='".DBLAN_16."' /></td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>".DBLAN_4."</td>
<td class='forumheader3' style='width:30%;text-align:center'><input class='button' style='width: 100%' type='submit' name='verify_sql' value='".DBLAN_5."' /></td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>".DBLAN_6."</td>
<td class='forumheader3' style='width:30%;text-align:center'><input class='button' style='width: 100%' type='submit' name='optimize_sql' value='".DBLAN_7."' /></td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>".DBLAN_28."</td>
<td class='forumheader3' style='width:30%;text-align:center'><input class='button' style='width: 100%' type='submit' name='plugin_scan' value=\"".DBLAN_29."\" /></td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>".DBLAN_19."</td>
<td class='forumheader3' style='width:30%;text-align:center'><input class='button' style='width: 100%' type='submit' name='pref_editor' value='".DBLAN_20."' /></td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>".DBLAN_8."</td>
<td class='forumheader3' style='width:30%;text-align:center'><input class='button' style='width: 100%' type='submit' name='backup_core' value='".DBLAN_9."' />
<input type='hidden' name='sqltext' value='$sqltext' />
</td></tr>
</table>
</form>
</div>";
$ns->tablerender(DBLAN_10, $text);
function backup_core() {
global $pref, $sql;
$tmp = base64_encode((serialize($pref)));
if (!$sql->db_Insert("core", "'pref_backup', '{$tmp}' ")) {
$sql->db_Update("core", "e107_value='{$tmp}' WHERE e107_name='pref_backup'");
}
}
function optimizesql($mySQLdefaultdb) {
$result = mysql_list_tables($mySQLdefaultdb);
while ($row = mysql_fetch_row($result)) {
mysql_query("OPTIMIZE TABLE ".$row[0]);
}
$str = "
<div style='text-align:center'>
<b>".DBLAN_11." $mySQLdefaultdb ".DBLAN_12.".</b>
<br /><br />
<form method='POST' action='".e_SELF."'>
<input class='button' type='submit' name='back' value='".DBLAN_13."' />
</form>
</div>
<br />";
$ns = new e107table;
$ns->tablerender(DBLAN_14, $str);
}
function plugin_viewscan()
{
global $sql, $pref, $ns, $tp;
require_once(e_HANDLER."plugin_class.php");
$ep = new e107plugin;
$ep->update_plugins_table(); // scan for e_xxx changes and save to plugin table.
$ep->save_addon_prefs(); // generate global e_xxx_list prefs from plugin table.
$ns -> tablerender(DBLAN_22, "<div style='text-align:center'>".DBLAN_23."<br /><br /><a href='".e_SELF."'>".DBLAN_13."</a></div>");
$text = "<form method='post' action='".e_ADMIN."db.php' id='plug_edit'>
<div style='text-align:center'> <table class='fborder' style='".ADMIN_WIDTH."'>
<tr><td class='fcaption'>".DBLAN_24."</td>
<td class='fcaption'>".DBLAN_25."</td>
<td class='fcaption'>".DBLAN_26."</td>
<td class='fcaption'>".DBLAN_27."</td>";
$sql -> db_Select("plugin", "*", "plugin_id !='' order by plugin_path ASC"); // Must order by path to pick up duplicates. (plugin names may change).
while($row = $sql-> db_Fetch()){
$text .= "<tr>
<td class='forumheader3'>".$tp->toHtml($row['plugin_name'],FALSE,"defs")."</td>
<td class='forumheader3'>".$row['plugin_path']."</td>
<td class='forumheader3'>".str_replace(",","<br />",$row['plugin_addons'])."</td>
<td class='forumheader3' style='text-align:center'>";
if($previous == $row['plugin_path'])
{
$delid = $row['plugin_id'];
$delname = $row['plugin_name'];
$text .= "<input class='button' type='submit' title='".LAN_DELETE."' value='Delete Duplicate' name='delplug[$delid]' onclick=\"return jsconfirm('".LAN_CONFIRMDEL." ID:$delid [$delname]')\" />\n";
}
else
{
$text .= ($row['plugin_installflag'] == 1) ? DBLAN_27 : " "; // "Installed and not installed";
}
$text .= "</td>
</tr>";
$previous = $row['plugin_path'];
}
$text .= "</table></div></form>";
$ns -> tablerender(ADLAN_CL_7, $text);
}
function pref_editor()
{
global $pref,$ns,$tp;
ksort($pref);
$text = "<form method='post' action='".e_ADMIN."db.php' id='pref_edit'>
<div style='text-align:center'>
<table class='fborder' style='".ADMIN_WIDTH."'>
<tr>
<td class='fcaption'>".LAN_DELETE."</td>
<td class='fcaption'>".DBLAN_17."</td>
<td class='fcaption'>".DBLAN_18."</td>
<td class='fcaption'>".LAN_OPTIONS."</td>
</tr>";
foreach($pref as $key=>$val)
{
$ptext = (is_array($val)) ? "<pre>".print_r($val,TRUE)."</pre>" : htmlspecialchars($val);
$ptext = $tp -> textclean($ptext, 80);
$text .= "
<tr>
<td class='forumheader3' style='width:40px;text-align:center'><input type='checkbox' name='delpref2[$key]' value='1' /></td>
<td class='forumheader3'>".$key."</td>
<td class='forumheader3' style='width:50%'>".$ptext."</td>
<td class='forumheader3' style='width:20px;text-align:center'>
<input type='image' title='".LAN_DELETE."' src='".ADMIN_DELETE_ICON_PATH."' name='delpref[$key]' onclick=\"return jsconfirm('".LAN_CONFIRMDEL." [$key]')\" />
</td>
</tr>";
}
$text .= "<tr><td class='forumheader' colspan='4' style='text-align:center'>
<input class='button' type='submit' title='".LAN_DELETE."' value=\"".DBLAN_21."\" name='delpref_checked' onclick=\"return jsconfirm('".LAN_CONFIRMDEL."')\" />
</tr>
</table></div></form>";
$text .= "<div style='text-align:center'><br /><a href='".e_SELF."'>".DBLAN_13."</a></div>\n";
$ns -> tablerender(DBLAN_20, $text);
return $text;
}
function del_pref_val(){
global $pref,$ns,$e107cache;
$del = array_keys($_POST['delpref']);
$delpref = $del[0];
if($delpref)
{
unset($pref[$delpref]);
$deleted_list .= "<li>".$delpref."</li>";
}
if($_POST['delpref2']){
foreach($_POST['delpref2'] as $k=>$v)
{
$deleted_list .= "<li>".$k."</li>";
unset($pref[$k]);
}
}
$message = "<div><br /><ul>".$deleted_list."</ul></div>
<div style='text-align:center'><br /><a href='".e_SELF."'>".DBLAN_13."</a></div>";
save_prefs();
$e107cache->clear();
$ns -> tablerender(LAN_DELETED,$message);
}
function delete_plugin_entry()
{
global $sql,$ns;
$del = array_keys($_POST['delplug']);
$message = ($sql -> db_Delete("plugin", "plugin_id='".intval($del[0])."' LIMIT 1")) ? LAN_DELETED : LAN_DELETED_FAILED;
$caption = ($message == LAN_DELETED) ? LAN_DELETED : LAN_ERROR;
$ns -> tablerender($caption,$message);
}
require_once("footer.php");
?>

402
e107_admin/db_verify.php Normal file
View File

@@ -0,0 +1,402 @@
<?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_admin/db_verify.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:19 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
$e_sub_cat = 'database';
require_once("auth.php");
$filename = "sql/core_sql.php";
$fd = fopen ($filename, "r");
$sql_data = @fread($fd, filesize($filename));
fclose ($fd);
if (!$sql_data) {
echo DBLAN_1."<br /><br />";
exit;
}
$tables["core"] = $sql_data;
if (!getperms("0")) {
header("location:".e_BASE."index.php");
exit;
}
//Get any plugin _sql.php files
foreach($pref['e_sql_list'] as $path => $file)
{
$filename = e_PLUGIN.$path."/".$file.".php";
if(is_readable($filename)){
$fd = fopen($filename, "r");
$sql_data = fread($fd, filesize($filename));
fclose ($fd);
$id = str_replace("_sql","",$file);
$tables[$id] = $sql_data;
}else{
echo $filename." is not readable<br />";
}
}
function read_tables($tab) {
global $tablines;
global $table_list;
global $tables,$sql,$pref;
$file = split("\n", $tables[$tab]);
foreach($file as $line) {
$line = ltrim(stripslashes($line));
if (preg_match("/CREATE TABLE (.*) /", $line, $match)) {
if($match[1] != "user_extended"){
$table_list[$match[1]] = 1;
$current_table = $match[1];
$x = 0;
$cnt = 0;
}
}
if (strpos($line, "TYPE=") !== FALSE) {
$current_table = "";
}
if ($current_table && $x) {
$tablines[$current_table][$cnt++] = $line;
}
$x = 1;
}
// Get multi-language tables as well
if($pref['multilanguage']){
$langs = table_list();
foreach($table_list as $name=>$stuff){
if($langs[$name]){
$ltab = $langs[$name];
$table_list[$ltab] = 1;
$tablines[$ltab] = $tablines[$name];
}
}
}
}
function get_current($tab, $prefix = "") {
if (!$prefix) {
$prefix = MPREFIX;
}
$result = mysql_query('SET SQL_QUOTE_SHOW_CREATE = 1');
$qry = 'SHOW CREATE TABLE `'.$prefix.$tab."`";
$z = mysql_query($qry);
if ($z) {
$row = mysql_fetch_row($z);
return str_replace("`", "", stripslashes($row[1]));
} else {
return FALSE;
}
}
function check_tables($what) {
global $tablines;
global $table_list;
global $ns;
$cur=0;
$table_list = "";
read_tables($what);
$text = "<form method='post' action='".e_SELF."' id='checktab'>
<div style='text-align:center'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='fcaption' style='text-align:center'>".DBLAN_4."</td>
<td class='fcaption' style='text-align:center'>".DBLAN_5."</td>
<td class='fcaption' style='text-align:center'>".DBLAN_6."</td>
<td class='fcaption' style='text-align:center'>".DBLAN_7."</td>
</tr>";
foreach(array_keys($table_list) as $k) {
$prefix = MPREFIX;
$current_tab = get_current($k, $prefix);
unset($fields);
unset($xfields);
if ($current_tab) {
$lines = split("\n", $current_tab);
$fieldnum = 0;
foreach($tablines[$k] as $x) {
$fieldnum++;
$ffound = 0;
list($fname, $fparams) = split(" ", $x, 2);
if ($fname == "KEY") {
list($key, $keyname, $keyparms) = split(" ", $x, 3);
$fname = $key." ".$keyname;
$fparams = $keyparms;
}
$fields[$fname] = 1;
$fparams = ltrim(rtrim($fparams));
$fparams = preg_replace("/\r?\n$|\r[^\n]$|,$/", "", $fparams);
if(stristr($k, "lan_") !== FALSE && $cur != 1){
$text .= "<tr><td colspan='6' class='fcaption'>".ADLAN_132."</td></tr>";
$cur = 1;
};
$text .= "<tr><td class='forumheader3'>$k</td><td class='forumheader3'>$fname";
if (strpos($fparams, "KEY") !== FALSE) {
$text .= " $fparams";
}
$text .= "</td>";
$s = 0;
$xfieldnum = -1;
foreach($lines as $l) {
$xfieldnum++;
list($xl, $tmp) = split("\n", $l, 2);
$xl = ltrim(rtrim(stripslashes($xl)));
$xl = preg_replace("/\r?\n$|\r[^\n]$/", "", $xl);
list($xfname, $xfparams) = split(" ", $xl, 2);
if ($xfname == "KEY") {
list($key, $keyname, $keyparms) = split(" ", $xl, 3);
$xfname = $key." ".$keyname;
$xfparams = $keyparms;
}
if ($xfname != "CREATE" && $xfname != ")") {
$xfields[$xfname] = 1;
}
$xfparams = preg_replace("/,$/", "", $xfparams);
$fparams = preg_replace("/,$/", "", $fparams);
if ($xfname == $fname) {
$ffound = 1;
if (strcasecmp($fparams, $xfparams) != 0) {
$text .= "<td class='forumheader' style='text-align:center'>".DBLAN_8."</td>";
$text .= "<td class='forumheader3' style='text-align:center'>".DBLAN_9."<div class='indent'>".$xfparams."</div><b>".DBLAN_10."</b><div class='indent'>".$fparams." <br />".fix_form($k,$fname,$fparams,"alter")."</div></td>";
$fix_active = TRUE;
} elseif($fieldnum != $xfieldnum) {
$text .= "<td class='fcaption' style='text-align:center'>".DBLAN_5." ".DBLAN_8."</td>
<td class='forumheader3' style='text-align:center'>".DBLAN_9." #{$xfieldnum}<br />".DBLAN_10." #{$fieldnum}</td>";
} else {
$text .= "<td class='forumheader3' style='text-align:center;'>OK</td>
<td class='forumheader3' style='text-align:center'>&nbsp;</td>";
}
}
}
if ($ffound == 0) {
$text .= "<td class='forumheader' style='text-align:center'><strong><em>".DBLAN_11."</em></strong></td>
<td class='forumheader3' style='text-align:center'><b>".DBLAN_10." [$fparams]</b><br />".fix_form($k,$fname,$fparams,"insert",$prev_fname)."<br /></td>";
$fix_active = TRUE;
}
$prev_fname = $fname;
$text .= "</tr>\n";
}
foreach(array_keys($xfields) as $tf) {
if (!$fields[$tf] && $k != "user_extended") {
$fix_active = TRUE;
$text .= "<tr><td class='forumheader3' style='text-align:center'>$k</td><td class='forumheader3' style='text-align:center'>$tf</td><td class='forumheader3' style='text-align:center'><strong><em>".DBLAN_12."</em></strong></td><td class='forumheader3' style='text-align:center'>&nbsp;".fix_form($k,$tf,$fparams,"drop")."</td></tr>";
}
}
} else { // Table Missing.
$text .= "<tr><td class='forumheader3' style='text-align:center'>$k</td><td class='forumheader3' style='text-align:center'>&nbsp;</td><td class='forumheader' style='text-align:center'>".DBLAN_13."<br /><td class='forumheader3' style='text-align:center'>&nbsp;".fix_form($k,$tf,$tablines[$k],"create")."</td></tr>";
$fix_active = TRUE;
}
}
$text .= "</table></div>";
if($fix_active){
$text .= "<div style='".ADMIN_WIDTH.";text-align:right'>
<input class='button' type='submit' name='do_fix' value='".DBLAN_21."' /></div>\n";
}
foreach(array_keys($_POST) as $j) {
if (preg_match("/table_(.*)/", $j, $mitch)) {
$lx = $mitch[1];
$text .= "<input type='hidden' name='table_{$lx}' value='1' />\n";
}
}
$text .= "</form>";
return $text;
}
global $table_list;
// -------------------- Table Fixing ------------------------------
if(isset($_POST['do_fix'])){
$text = "<div><table class='fborder' style='".ADMIN_WIDTH."'>";
foreach( $_POST['fix_active'] as $key=>$val){
if (MAGIC_QUOTES_GPC == TRUE) {
$table = stripslashes($_POST['fix_table'][$key][0]);
$newval = stripslashes($_POST['fix_newval'][$key][0]);
$mode = stripslashes($_POST['fix_mode'][$key][0]);
$after = stripslashes($_POST['fix_after'][$key][0]);
} else {
$table = $_POST['fix_table'][$key][0];
$newval = $_POST['fix_newval'][$key][0];
$mode = $_POST['fix_mode'][$key][0];
$after = $_POST['fix_after'][$key][0];
}
$field= $key;
if($mode == "alter"){
$query = "ALTER TABLE `".MPREFIX.$table."` CHANGE `$field` `$field` $newval";
}
if($mode == "insert"){
$query = "ALTER TABLE `".MPREFIX.$table."` ADD `$field` $newval AFTER $after";
}
if($mode == "drop"){
$query = "ALTER TABLE `".MPREFIX.$table."` DROP `$field` ";
}
if($mode == "index"){
$query = "ALTER TABLE `".MPREFIX.$table."` ADD INDEX `$field` (`$newval`)";
}
if($mode == "indexdrop"){
$query = "ALTER TABLE `".MPREFIX.$table."` DROP INDEX `$field`";
}
if($mode == "create"){
$query = "CREATE TABLE ".MPREFIX.$table." ($newval) TYPE=MyISAM;";
}
$text .= "<tr><td class='forumheader3' style='vertical-align:top;width:70%'>".$query."</td><td class='forumheader3' style='vertical-align:top;width:30%'>";
$text .= (mysql_query($query)) ? " - <b>".LAN_UPDATED."</b>" : " - <b>".LAN_UPDATED_FAILED."</b>";
$text .= "</td></tr>";
}
$text .= "</table></div>";
$text .="<div style='text-align:center'><br />
<form method='post' action='db.php'>
<input class='button' type='submit' name='back' value='".DBLAN_17."' />
</form>
</div>";
$ns -> tablerender(DBLAN_20, $text);
}
// ---------------------- Main Form and Submit. ------------------------
if (!$_POST['db_verify'] && !$_POST['do_fix']) {
$text = "
<form method='post' action='".e_SELF."'>
<table border=0 align='center'>
<tr><td>".DBLAN_14."<br /><br />";
foreach(array_keys($tables) as $x) {
$text .= "<input type='checkbox' name='table_".$x."' />".$x."<br />";
}
$text .= "
<br /><input class='button' name='db_verify' type='submit' value='".DBLAN_15."' />
</td></tr></table></form>";
$ns->tablerender(DBLAN_16, $text);
} else {
foreach(array_keys($_POST) as $k) {
if (preg_match("/table_(.*)/", $k, $match)) {
$xx = $match[1];
$str = "<br />
<div style='text-align:center'>
<form method='post' action='db.php'>
<input class='button' type='submit' name='back' value='".DBLAN_17."' />
</form>
</div>";
$ns->tablerender(DBLAN_16." - $xx ".DBLAN_18, check_tables($xx).$str);
}
}
}
// --------------------------------------------------------------
function fix_form($table,$field, $newvalue,$mode,$after =''){
if(stristr($field, "KEY ") !== FALSE){
$field = chop(str_replace("KEY ","",$field));
$mode = ($mode == "drop") ? "indexdrop" : "index";
$search = array("(",")");
$newvalue = str_replace($search,"",$newvalue);
}
if($mode == "create"){
$newvalue = implode("\n",$newvalue);
}
$text .= "<input type='checkbox' name=\"fix_active[$field][]\" value='1' /> ".DBLAN_19."\n"; // 'attempt to fix'
$text .= "<input type='hidden' name=\"fix_newval[$field][]\" value=\"$newvalue\" />\n";
$text .= "<input type='hidden' name=\"fix_table[$field][]\" value=\"$table\" />\n";
$text .= "<input type='hidden' name=\"fix_mode[$field][]\" value=\"$mode\" />\n";
$text .= ($after) ? "<input type='hidden' name=\"fix_after[$field][]\" value=\"$after\" />\n" : "";
return $text;
}
function table_list() {
// grab default language lists.
global $mySQLdefaultdb;
$exclude[] = "banlist"; $exclude[] = "banner";
$exclude[] = "cache"; $exclude[] = "core";
$exclude[] = "online"; $exclude[] = "parser";
$exclude[] = "plugin"; $exclude[] = "user";
$exclude[] = "upload"; $exclude[] = "userclass_classes";
$exclude[] = "rbinary"; $exclude[] = "session";
$exclude[] = "tmp"; $exclude[] = "flood";
$exclude[] = "stat_info"; $exclude[] = "stat_last";
$exclude[] = "submit_news"; $exclude[] = "rate";
$exclude[] = "stat_counter";$exclude[] = "user_extended";
$exclude[] = "user_extended_struc";
$exclude[] = "pm_messages";
$exclude[] = "pm_blocks";
// print_r($search);
$tables = mysql_list_tables($mySQLdefaultdb);
while (list($temp) = mysql_fetch_array($tables)){
$prefix = MPREFIX."lan_";
if(preg_match("/^".$prefix."(.*)/", $temp, $match)){
$e107tab = str_replace(MPREFIX, "", $temp);
$pos = strrpos($match[1],"_")+1;
$core = substr(str_replace("lan_","",$e107tab),$pos);
if (str_replace($exclude, "", $e107tab)){
$tabs[$core] = $e107tab;
}
}
}
return $tabs;
}
require_once(e_ADMIN."footer.php");
?>

58
e107_admin/docs.php Normal file
View File

@@ -0,0 +1,58 @@
<?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_admin/docs.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:19 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!ADMIN) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'docs';
require_once("auth.php");
$i = 1;
$lang = e_LANGUAGE;
if (!$handle = opendir(e_DOCS.e_LANGUAGE."/")) {
$lang = "English";
$handle = opendir(e_DOCS."English/");
}
while ($file = readdir($handle)) {
if ($file != "." && $file != ".." && $file != "CVS") {
$helplist[$i] = $file;
$i++;
}
}
closedir($handle);
if (e_QUERY) {
$filename = e_DOCS.$lang."/".$helplist[e_QUERY];
$fd = fopen ($filename, "r");
$text .= fread ($fd, filesize ($filename));
fclose ($fd);
$text = $tp->toHTML($text, TRUE);
$text = preg_replace("/Q\>(.*?)A>/si", "<img src='".e_IMAGE."generic/".IMODE."/question.png' style='vertical-align: middle' /><b>\\1</b>A>", $text);
$text = str_replace("A>", "<img src='".e_IMAGE."generic/".IMODE."/answer.png' style='vertical-align: middle' />", $text);
$ns->tablerender(str_replace("_", " ", $helplist[e_QUERY]), $text."<br />");
unset($text);
}
require_once("footer.php");
?>

1646
e107_admin/download.php Normal file

File diff suppressed because it is too large Load Diff

117
e107_admin/e107_update.php Normal file
View File

@@ -0,0 +1,117 @@
<?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_admin/e107_update.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:20 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
$e_sub_cat = 'database';
require_once("auth.php");
require_once("update_routines.php");
function run_updates($dbupdate) {
global $ns;
foreach($dbupdate as $func => $rmks) {
$installed = call_user_func("update_".$func);
if ((LAN_UPDATE == $_POST[$func]) && !$installed) {
if (function_exists("update_".$func)) {
$message .= LAN_UPDATE_7." {$rmks}<br />";
$error=call_user_func("update_".$func, "do");
if ($error!='') {
$message = $error;
}
}
}
}
if ($message) {
$ns->tablerender(LAN_UPDATE, $message);
}
}
function show_updates($dbupdate, $additional = false) {
global $ns;
$text = "<form method='POST' action='".e_SELF."'>
<div style='width:100%'>
<table class='fborder' style='".ADMIN_WIDTH."'>
<tr>
<td class='fcaption'>".LAN_UPDATE."</td>
<td class='fcaption'>".LAN_UPDATE_2."</td>
</tr>
";
$updates = 0;
foreach($dbupdate as $func => $rmks) {
if (function_exists("update_".$func)) {
$text .= "<tr><td class='forumheader3' style='width: 60%'>{$rmks}</td>";
if (call_user_func("update_".$func)) {
$text .= "<td class='forumheader3' style='text-align:center; width: 40%'>".LAN_UPDATE_3."</td>";
} else {
$updates++;
$text .= "<td class='forumheader3' style='text-align:center; width: 40%'><input class='button' type='submit' name='{$func}' value='".LAN_UPDATE."' /></td>";
}
$text .= "</tr>";
}
}
$text .= "</table></div></form>";
$ns->tablerender(($additional ? (defined("LAN_UPDATE_11") ? LAN_UPDATE_11 : '.617 to .7 Update Continued') : LAN_UPDATE_10), $text);
}
if ($_POST) {
$message = run_updates($dbupdate);
}
if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'forum' AND plugin_installflag='1' ")) {
if(file_exists(e_PLUGIN.'forum/forum_update_check.php'))
{
include_once(e_PLUGIN.'forum/forum_update_check.php');
}
}
if ($sql -> db_Query("SHOW COLUMNS FROM ".MPREFIX."stat_info") && $sql -> db_Select("plugin", "*", "plugin_path = 'log' AND plugin_installflag='1'")) {
if(file_exists(e_PLUGIN.'log/log_update_check.php'))
{
include_once(e_PLUGIN.'log/log_update_check.php');
}
}
if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'content' AND plugin_installflag='1' "))
{
if(file_exists(e_PLUGIN.'content/content_update_check.php'))
{
include_once(e_PLUGIN.'content/content_update_check.php');
}
}
if ($sql->db_Select("plugin", "plugin_version", "plugin_path = 'pm' AND plugin_installflag='1' "))
{
if(file_exists(e_PLUGIN.'pm/pm_update_check.php'))
{
include_once(e_PLUGIN.'pm/pm_update_check.php');
}
}
if ($_POST) {
$message = run_updates($dbupdatep);
}
if (isset($dbupdatep)) {
show_updates($dbupdatep, true);
}
show_updates($dbupdate);
require_once("footer.php");
?>

353
e107_admin/emoticon.php Normal file
View File

@@ -0,0 +1,353 @@
<?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_admin/emoticon.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:21 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("F")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'emoticon';
require_once("auth.php");
if(!$sql->db_Count("core", "(*)", "e107_name = 'emote_default'"))
{
$tmp = 'a:28:{s:9:"alien!png";s:6:"!alien";s:10:"amazed!png";s:7:"!amazed";s:9:"angry!png";s:11:"!grr !angry";s:12:"biglaugh!png";s:4:"!lol";s:11:"cheesey!png";s:10:":D :oD :-D";s:12:"confused!png";s:10:":? :o? :-?";s:7:"cry!png";s:19:"&| &-| &o| :(( !cry";s:8:"dead!png";s:21:"x) xo) x-) x( xo( x-(";s:9:"dodge!png";s:6:"!dodge";s:9:"frown!png";s:10:":( :o( :-(";s:7:"gah!png";s:10:":@ :o@ :o@";s:8:"grin!png";s:10:":D :oD :-D";s:9:"heart!png";s:6:"!heart";s:8:"idea!png";s:10:":! :o! :-!";s:7:"ill!png";s:4:"!ill";s:7:"mad!png";s:13:"~:( ~:o( ~:-(";s:12:"mistrust!png";s:9:"!mistrust";s:11:"neutral!png";s:10:":| :o| :-|";s:12:"question!png";s:2:"?!";s:12:"rolleyes!png";s:10:"B) Bo) B-)";s:7:"sad!png";s:4:"!sad";s:10:"shades!png";s:10:"8) 8o) 8-)";s:7:"shy!png";s:4:"!shy";s:9:"smile!png";s:10:":) :o) :-)";s:11:"special!png";s:3:"%-6";s:12:"suprised!png";s:10:":O :oO :-O";s:10:"tongue!png";s:21:":p :op :-p :P :oP :-P";s:8:"wink!png";s:10:";) ;o) ;-)";}';
$sql->db_Insert("core", "'emote_default', '$tmp' ");
}
if (isset($_POST['active']))
{
if ($pref['smiley_activate'] != $_POST['smiley_activate']) {
$pref['smiley_activate'] = $_POST['smiley_activate'];
save_prefs();
$update = true;
}
admin_update($update);
}
/* get packs */
require_once(e_HANDLER."file_class.php");
$fl = new e_file;
$emote = new emotec;
foreach($_POST as $key => $value)
{
if(strstr($key, "subPack_"))
{
$subpack = str_replace("subPack_", "", $key);
$emote -> emoteConf($subpack);
break;
}
if(strstr($key, "defPack_"))
{
$pref['emotepack'] = str_replace("defPack_", "", $key);
save_prefs();
break;
}
}
$check = TRUE;
$check = $emote -> installCheck();
if($check!==FALSE){
$emote -> listPacks();
}
class emotec
{
var $packArray;
function emotec()
{
/* constructor */
global $fl;
$this -> packArray = $fl -> get_dirs(e_IMAGE."emotes");
if(isset($_POST['sub_conf']))
{
$this -> saveConf();
}
}
function listPacks()
{
global $ns, $fl, $pref;
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:30%' class='forumheader3'>".EMOLAN_4.": </td>
<td style='width:70%' class='forumheader3'>".($pref['smiley_activate'] ? "<input type='checkbox' name='smiley_activate' value='1' checked='checked' />" : "<input type='checkbox' name='smiley_activate' value='1' />")."</td>
</tr>
<tr>
<td colspan='2' style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='active' value='".LAN_UPDATE."' />
</td>
</tr>
</table>
</form>
</div>
";
$ns -> tablerender(EMOLAN_1, $text);
$text = "
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='forumheader' style='width: 20%;'>".EMOLAN_2."</td>
<td class='forumheader' style='width: 50%;'>".EMOLAN_3."</td>
<td class='forumheader' style='width: 10%; text-align: center;'>".EMOLAN_8."</td>
<td class='forumheader' style='width: 20%;'>".EMOLAN_9."</td>
";
$reject = array('^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$', 'emoteconf*');
foreach($this -> packArray as $pack)
{
$emoteArray = $fl -> get_files(e_IMAGE."emotes/".$pack, "", $reject);
$text .= "
<tr>
<td class='forumheader' style='width: 20%;'>$pack</td>
<td class='forumheader' style='width: 20%;'>
";
foreach($emoteArray as $emote)
{
$text .= "<img src='".$emote['path'].$emote['fname']."' alt='' /> ";
}
$text .= "</td>
<td class='forumheader3' style='width: 10%; text-align: center;'>".($pref['emotepack'] == $pack ? EMOLAN_10 : "<input class='button' type='submit' name='defPack_".$pack."' value=\"".EMOLAN_11."\" />")."</td>
<td class='forumheader3' style='width: 20%; text-align: center;'><input class='button' type='submit' name='subPack_".$pack."' value=\"".EMOLAN_12."\" /></td>
</tr>
";
}
$text .= "
</table>
</form>
";
$ns -> tablerender(EMOLAN_13, $text);
}
function emoteConf($packID)
{
global $ns, $fl, $pref, $sysprefs, $tp;
$corea = "emote_".$packID;
$emotecode = $sysprefs -> getArray($corea);
$reject = array('^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$', 'emoteconf*', '*\.txt', '*\.html', '*\.pak', '*php*', '.cvsignore');
$emoteArray = $fl -> get_files(e_IMAGE."emotes/".$packID, "", $reject);
$eArray = array();
foreach($emoteArray as $value)
{
if(!strstr($value['fname'], ".php") && !strstr($value['fname'], ".txt") && !strstr($value['fname'], ".pak") && !strstr($value['fname'], ".xml") && !strstr($value['fname'], "phpBB") && !strstr($value['fname'], ".html"))
{
$eArray[] = array('path' => $value['path'], 'fname' => $value['fname']);
}
}
$text = "
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='forumheader' style='width: 20%;'>".EMOLAN_2."</td>
<td class='forumheader' style='width: 20%; text-align: center;'>".EMOLAN_5."</td>
<td class='forumheader' style='width: 60%;'>".EMOLAN_6." <span class='smalltext'>( ".EMOLAN_7." )</a></td>
</tr>
";
foreach($eArray as $emote)
{
$ename = $emote['fname'];
$evalue = str_replace(".", "!", $ename);
$text .= "
<tr>
<td class='forumheader3' style='width: 20%;'>".$ename."</td>
<td class='forumheader3' style='width: 20%; text-align: center;'><img src='".$emote['path'].$ename."' alt='' /></td>
<td class='forumheader3' style='width: 60%;'><input style='width: 80%' class='tbox' type='text' name='$evalue' value='".$tp -> toForm($emotecode[$evalue])."' maxlength='200' /></td>
</tr>
";
}
$text .= "
<tr>
<td style='text-align: center;' colspan='3' class='forumheader'><input class='button' type='submit' name='sub_conf' value='".EMOLAN_14."' /></td>
</tr>
</table>
<input type='hidden' name='packID' value='$packID' />
</form>";
$ns -> tablerender(EMOLAN_15.": '".$packID."'", $text);
}
function saveConf()
{
global $ns, $sql, $tp;
$packID = $_POST['packID'];
unset($_POST['sub_conf'], $_POST['packID']);
foreach($_POST as $key => $value)
{
$key = str_replace("_", "!", $key);
$_POST[$key] = $value;
}
$encoded_emotes = $tp -> toDB($_POST);
$tmp = addslashes(serialize($encoded_emotes));
if ($sql->db_Select("core", "*", "e107_name='emote_".$packID."'")) {
admin_update($sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='emote_".$packID."' "), 'update', EMOLAN_16);
} else {
admin_update($sql->db_Insert("core", "'emote_".$packID."', '$tmp' "), 'insert', EMOLAN_16);
}
}
function installCheck()
{
global $sql, $fl;
foreach($this -> packArray as $value)
{
if(strpos($value,' ')!==FALSE){
global $ns;
$msg = "
<div style='text-align:center;'><b>".EMOLAN_17."<br />".EMOLAN_18."</b><br /><br />
<table class='fborder'>
<tr>
<td class='fcaption'>".EMOLAN_19."</td>
<td class='fcaption'>".EMOLAN_20."</td>
</tr>
<tr>
<td class='forumheader3'>".$value."</td>
<td class='forumheader3'>".e_IMAGE."emotes/</td>
</tr>
</table>
</div>";
$ns->tablerender(EMOLAN_21, $msg);
return FALSE;
}
if(!$sql -> db_Select("core", "*", "e107_name='emote_".$value."' "))
{
$fileArray = $fl -> get_files(e_IMAGE."emotes/".$value);
foreach($fileArray as $file)
{
if(strstr($file['fname'], ".xml"))
{
$confFile = array('file' => $file['fname'], 'type' => "xml");
}
else if(strstr($file['fname'], ".pak"))
{
$confFile = array('file' => $file['fname'], 'type' => "pak");
}
else if(strstr($file['fname'], ".php"))
{
$confFile = array('file' => $file['fname'], 'type' => "php");
}
}
/* .pak file ------------------------------------------------------------------------------------------------------------------------------------ */
if($confFile['type'] == "pak")
{
$filename = e_IMAGE."emotes/".$value."/".$confFile['file'];
$pakconf = file ($filename);
$contentArray = array();
foreach($pakconf as $line)
{
if(trim($line) && strstr($line, "=+") && !strstr($line, ".txt") && !strstr($line, ".html") && !strstr($line, "cvs")) $contentArray[] = $line;
}
$confArray = array();
foreach($contentArray as $pakline)
{
$tmp = explode("=+:", $pakline);
$confIC = str_replace(".", "!", $tmp[0]);
$confArray[$confIC] = trim($tmp[2]);
}
$tmp = addslashes(serialize($confArray));
$sql->db_Insert("core", "'emote_".$value."', '$tmp' ");
echo "<div style='text-align: center;'><b>New emote pak found: '</b> ".$value."'</div>";
}
/* end ----------------------------------------------------------------------------------------------------------------------------------------- */
/* .xml file ------------------------------------------------------------------------------------------------------------------------------------ */
if($confFile['type'] == "xml")
{
$filename = e_IMAGE."emotes/".$value."/".$confFile['file'];
$handle = fopen ($filename, "r");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
preg_match_all("#\<emoticon file=\"(.*?)\"\>(.*?)\<\/emoticon\>#si", $contents, $match);
$confArray = array();
for($a=0; $a<=(count($match[0])); $a++)
{
preg_match_all("#\<string\>(.*?)\<\/string\>#si", $match[0][$a], $match2);
$codet = "";
foreach($match2[1] as $code)
{
$codet .= $code." ";
}
foreach($fileArray as $emote)
{
if(strstr($emote['fname'], $match[1][$a]))
{
$file = str_replace(".", "!", $emote['fname']);
}
}
$confArray[$file] = $codet;
}
$tmp = addslashes(serialize($confArray));
$sql->db_Insert("core", "'emote_".$value."', '$tmp' ");
echo "<div style='text-align: center;'><b>New emote xml pak found: '</b> ".$value."'</div>";
}
if($confFile['type'] == "php")
{
echo "<b>.conf file found</b>: installing '".$value."'<br />";
include_once(e_IMAGE."emotes/".$value."/".$confFile['file']);
$sql->db_Insert("core", "'emote_".$value."', '$_emoteconf' ");
echo "<div style='text-align: center;'><b>New emote php found: '</b> ".$value."'</div>";
}
/* end ----------------------------------------------------------------------------------------------------------------------------------------- */
}
}
}
}
require_once("footer.php");
?>

View File

@@ -0,0 +1,785 @@
<?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_admin/fileinspector.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:21 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once('../class2.php');
if (!getperms('Y')) {
header('location:'.e_BASE.'index.php');
exit;
}
$e_sub_cat = 'fileinspector';
require_once('auth.php');
require_once(e_HANDLER.'form_handler.php');
$rs = new form;
$fi = new file_inspector;
$DOCS_DIRECTORY = str_replace('help/', '', $HELP_DIRECTORY);
$maindirs = array('admin' => $ADMIN_DIRECTORY, 'files' => $FILES_DIRECTORY, 'images' => $IMAGES_DIRECTORY, 'themes' => $THEMES_DIRECTORY, 'plugins' => $PLUGINS_DIRECTORY, 'handlers' => $HANDLERS_DIRECTORY, 'languages' => $LANGUAGES_DIRECTORY, 'downloads' => $DOWNLOADS_DIRECTORY, 'docs' => $DOCS_DIRECTORY);
foreach ($maindirs as $maindirs_key => $maindirs_value) {
$coredir[$maindirs_key] = substr($maindirs_value, 0, -1);
}
require_once('core_image.php');
if (e_QUERY) {
$fi -> snapshot_interface();
} else if (isset($_POST['scan'])) {
$fi -> scan_results();
$fi -> scan_config();
} else {
$fi -> scan_config();
}
class file_inspector {
var $root_dir;
var $files = array();
var $parent;
var $count = array();
var $results = 0;
function file_inspector() {
global $e107;
set_time_limit(240);
$this -> root_dir = $e107 -> file_path;
if (substr($this -> root_dir, -1) == '/') {
$this -> root_dir = substr($this -> root_dir, 0, -1);
}
if ($_POST['core'] == 'fail') {
$_POST['integrity'] = TRUE;
}
if (MAGIC_QUOTES_GPC && $_POST['regex']) {
$_POST['regex'] = stripslashes($_POST['regex']);
}
if ($_POST['regex']) {
if ($_POST['core'] == 'fail') {
$_POST['core'] = 'all';
}
$_POST['missing'] = 0;
$_POST['integrity'] = 0;
}
}
function scan_config() {
global $ns, $rs, $pref;
$text = "<div style='text-align: center'>
<form action='".e_SELF."' method='post' id='scanform'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='fcaption' colspan='2'>".FC_LAN_2."</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='width: 35%'>
".FC_LAN_3." ".FC_LAN_5.":
</td>
<td colspan='2' class='forumheader3' style='width: 65%'>
<input type='radio' name='core' value='all'".(($_POST['core'] == 'all' || !isset($_POST['core'])) ? " checked='checked'" : "")." /> ".FC_LAN_4."&nbsp;&nbsp;
<input type='radio' name='core' value='fail'".($_POST['core'] == 'fail' ? " checked='checked'" : "")." /> ".FC_LAN_6."&nbsp;&nbsp;
<input type='radio' name='core' value='none'".($_POST['core'] == 'none' ? " checked='checked'" : "")." /> ".FC_LAN_12."&nbsp;&nbsp;
</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='width: 35%'>
".FC_LAN_3." ".FC_LAN_13.":
</td>
<td colspan='2' class='forumheader3' style='width: 65%'>
<input type='radio' name='missing' value='1'".(($_POST['missing'] == '1' || !isset($_POST['missing'])) ? " checked='checked'" : "")." /> ".FC_LAN_9."&nbsp;&nbsp;
<input type='radio' name='missing' value='0'".($_POST['missing'] == '0' ? " checked='checked'" : "")." /> ".FC_LAN_10."&nbsp;&nbsp;
</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='width: 35%'>
".FC_LAN_3." ".FC_LAN_7.":
</td>
<td colspan='2' class='forumheader3' style='width: 65%'>
<input type='radio' name='noncore' value='1'".(($_POST['noncore'] == '1' || !isset($_POST['noncore'])) ? " checked='checked'" : "")." /> ".FC_LAN_9."&nbsp;&nbsp;
<input type='radio' name='noncore' value='0'".($_POST['noncore'] == '0' ? " checked='checked'" : "")." /> ".FC_LAN_10."&nbsp;&nbsp;
</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='width: 35%'>
".FC_LAN_3." ".FC_LAN_21.":
</td>
<td colspan='2' class='forumheader3' style='width: 65%'>
<input type='radio' name='oldcore' value='1'".(($_POST['oldcore'] == '1' || !isset($_POST['oldcore'])) ? " checked='checked'" : "")." /> ".FC_LAN_9."&nbsp;&nbsp;
<input type='radio' name='oldcore' value='0'".($_POST['oldcore'] == '0' ? " checked='checked'" : "")." /> ".FC_LAN_10."&nbsp;&nbsp;
</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='width: 35%'>
".FC_LAN_8.":
</td>
<td class='forumheader3' style='width: 65%; vertical-align: top'>
<input type='radio' name='integrity' value='1'".(($_POST['integrity'] == '1' || !isset($_POST['integrity'])) ? " checked='checked'" : "")." /> ".FC_LAN_9."&nbsp;&nbsp;
<input type='radio' name='integrity' value='0'".($_POST['integrity'] == '0' ? " checked='checked'" : "")." /> ".FC_LAN_10."&nbsp;&nbsp;
</td></tr>";
$text .= "<tr>
<td class='forumheader3' style='width: 35%'>
".FC_LAN_14.":
</td>
<td colspan='2' class='forumheader3' style='width: 65%'>
<input type='radio' name='type' value='tree'".(($_POST['type'] == 'tree' || !isset($_POST['type'])) ? " checked='checked'" : "")." /> ".FC_LAN_15."&nbsp;&nbsp;
<input type='radio' name='type' value='list'".($_POST['type'] == 'list' ? " checked='checked'" : "")." /> ".FC_LAN_16."&nbsp;&nbsp;
</td>
</tr>";
if ($pref['developer']) {
$text .= "<tr>
<td class='fcaption' colspan='2'>".FC_LAN_17."</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='width: 35%'>
".FC_LAN_18.":
</td>
<td colspan='2' class='forumheader3' style='width: 65%'>
#<input class='tbox' type='text' name='regex' size='40' value='".htmlentities($_POST['regex'], ENT_QUOTES)."' />#<input class='tbox' type='text' name='mod' size='5' value='".$_POST['mod']."' />
</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='width: 35%'>
".FC_LAN_19.":
</td>
<td colspan='2' class='forumheader3' style='width: 65%'>
<input type='checkbox' name='num' value='1'".(($_POST['num'] || !isset($_POST['num'])) ? " checked='checked'" : "")." />
</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='width: 35%'>
".FC_LAN_20.":
</td>
<td colspan='2' class='forumheader3' style='width: 65%'>
<input type='checkbox' name='line' value='1'".(($_POST['line'] || !isset($_POST['line'])) ? " checked='checked'" : "")." />
</td>
</tr>";
}
$text .= "<tr>
<td colspan='2' style='text-align:center' class='forumheader'>".$rs -> form_button('submit', 'scan', FC_LAN_11)."</td>
</tr>
</table>
</form>
</div>";
$ns -> tablerender(FC_LAN_1, $text);
}
function scan($dir, $image) {
$handle = opendir($dir.'/');
while (false !== ($readdir = readdir($handle))) {
if ($readdir != '.' && $readdir != '..' && $readdir != '/' && $readdir != 'CVS' && $readdir != 'Thumbs.db' && (strpos('._', $readdir) === FALSE)) {
$path = $dir.'/'.$readdir;
if (is_dir($path)) {
$dirs[$path] = $readdir;
} else if (!isset($image[$readdir])) {
$files[$readdir] = $this -> checksum($path, TRUE);
}
}
}
closedir($handle);
if (isset($dirs)) {
ksort ($dirs);
foreach ($dirs as $dir_path => $dir_list) {
$list[$dir_list] = ($set = $this -> scan($dir_path, $image[$dir_list])) ? $set : array();
}
}
if (isset($files)) {
ksort ($files);
foreach ($files as $file_name => $file_list) {
$list[$file_name] = $file_list;
}
}
return $list;
}
function inspect($list, $deprecated, $level, $dir, &$tree_end, &$parent_expand) {
global $coredir;
unset ($childOut);
$parent_expand = false;
if (substr($dir, -1) == '/') {
$dir = substr($dir, 0, -1);
}
$dir_id = dechex(crc32($dir));
$this -> files[$dir_id]['.']['level'] = $level;
$this -> files[$dir_id]['.']['parent'] = $this -> parent;
$this -> files[$dir_id]['.']['file'] = $dir;
$directory = $level ? basename($dir) : SITENAME;
$level++;
foreach ($list as $key => $value) {
$this -> parent = $dir_id;
if (is_array($value)) {
$path = $dir.'/'.$key;
$child_open = false;
$child_end = true;
$sub_text .= $this -> inspect($value, $deprecated[$key], $level, $path, $child_end, $child_expand);
$tree_end = false;
if ($child_expand) {
$parent_expand = true;
$last_expand = true;
}
} else {
$path = $dir.'/'.$key;
$fid = strtolower($key);
$this -> files[$dir_id][$fid]['file'] = ($_POST['type'] == 'tree') ? $key : $path;
if (($this -> files[$dir_id][$fid]['size'] = filesize($path)) !== FALSE) {
if ($_POST['core'] != 'none') {
$this -> count['core']['num']++;
$this -> count['core']['size'] += $this -> files[$dir_id][$fid]['size'];
if ($_POST['regex']) {
$file_content = file($path);
if (($this -> files[$dir_id][$fid]['size'] = filesize($path)) !== FALSE) {
if ($this -> files[$dir_id][$fid]['lines'] = preg_grep("#".$_POST['regex']."#".$_POST['mod'], $file_content)){
$this -> files[$dir_id][$fid]['file'] = ($_POST['type'] == 'tree') ? $key : $path;
$this -> files[$dir_id][$fid]['icon'] = 'file_core.png';
$dir_icon = 'fileinspector.png';
$parent_expand = TRUE;
$this -> results++;
} else {
unset($this -> files[$dir_id][$fid]);
$known[$dir_id][$fid] = true;
$dir_icon = ($dir_icon == 'fileinspector.png') ? $dir_icon : 'folder.png';
}
}
} else {
//if (strpos($dir.'/'.$key, 'htmlarea') === false) {
if ($_POST['integrity']) {
if ($dir.'/'.$key != $this -> root_dir.'/'.$coredir['admin'].'/core_image.php' && $dir.'/'.$key != $this -> root_dir.'/e107_config.php') {
if ($this -> checksum($path) != $value) {
$this -> count['fail']['num']++;
$this -> count['fail']['size'] += $this -> files[$dir_id][$fid]['size'];
$this -> files[$dir_id][$fid]['icon'] = 'file_fail.png';
$dir_icon = 'folder_fail.png';
$parent_expand = TRUE;
} else {
$this -> count['pass']['num']++;
$this -> count['pass']['size'] += $this -> files[$dir_id][$fid]['size'];
if ($_POST['core'] != 'fail') {
$this -> files[$dir_id][$fid]['icon'] = 'file_check.png';
$dir_icon = ($dir_icon == 'folder_fail.png' || $dir_icon == 'folder_missing.png') ? $dir_icon : 'folder_check.png';
} else {
unset($this -> files[$dir_id][$fid]);
$known[$dir_id][$fid] = true;
}
}
} else {
$this -> count['uncalculable']['num']++;
$this -> count['uncalculable']['size'] += $this -> files[$dir_id][$fid]['size'];
if ($_POST['core'] != 'fail') {
$this -> files[$dir_id][$fid]['icon'] = 'file_uncalc.png';
} else {
unset($this -> files[$dir_id][$fid]);
$known[$dir_id][$fid] = true;
}
}
} else {
$this -> files[$dir_id][$fid]['icon'] = 'file_core.png';
}
//} else {
// $this -> count['warning']['num']++;
// $this -> count['warning']['size'] += $this -> files[$dir_id][$fid]['size'];
// $this -> files[$dir_id][$fid]['icon'] = 'file_warning.png';
// $dir_icon = 'folder_warning.png';
// $parent_expand = TRUE;
//}
}
} else {
unset ($this -> files[$dir_id][$fid]);
$known[$dir_id][$fid] = true;
}
} else if ($_POST['missing']) {
$this -> count['missing']['num']++;
$this -> files[$dir_id][$fid]['icon'] = 'file_missing.png';
$dir_icon = ($dir_icon == 'folder_fail.png') ? $dir_icon : 'folder_missing.png';
$parent_expand = TRUE;
} else {
unset ($this -> files[$dir_id][$fid]);
}
}
}
if ($_POST['noncore'] || $_POST['oldcore']) {
$handle = opendir($dir.'/');
while (false !== ($readdir = readdir($handle))) {
if ($readdir != '.' && $readdir != '..' && $readdir != '/' && $readdir != 'CVS' && $readdir != 'Thumbs.db' && (strpos('._', $readdir) === FALSE)) {
if (is_dir($dir.'/'.$readdir)) {
if (!isset($list[$readdir]) && ($level > 1 || $readdir == 'e107_install')) {
$child_open = false;
$child_end = true;
$sub_text .= $this -> inspect(array(), $deprecated[$readdir], $level, $dir.'/'.$readdir, $child_end, $child_expand);
$tree_end = false;
if ($child_expand) {
$parent_expand = true;
$last_expand = true;
}
}
} else {
$aid = strtolower($readdir);
if (!isset($this -> files[$dir_id][$aid]['file']) && !$known[$dir_id][$aid]) {
if (strpos($dir.'/'.$readdir, 'htmlarea') === false) {
if (isset($deprecated[$readdir])) {
if ($_POST['oldcore']) {
$this -> files[$dir_id][$aid]['file'] = ($_POST['type'] == 'tree') ? $readdir : $dir.'/'.$readdir;
$this -> files[$dir_id][$aid]['size'] = filesize($dir.'/'.$readdir);
$this -> files[$dir_id][$aid]['icon'] = 'file_old.png';
$this -> count['deprecated']['num']++;
$this -> count['deprecated']['size'] += $this -> files[$dir_id][$aid]['size'];
}
} else {
if ($_POST['noncore']) {
$this -> files[$dir_id][$aid]['file'] = ($_POST['type'] == 'tree') ? $readdir : $dir.'/'.$readdir;
$this -> files[$dir_id][$aid]['size'] = filesize($dir.'/'.$readdir);
$this -> files[$dir_id][$aid]['icon'] = 'file_unknown.png';
$this -> count['unknown']['num']++;
$this -> count['unknown']['size'] += $this -> files[$dir_id][$aid]['size'];
}
}
} else {
$this -> files[$dir_id][$aid]['file'] = ($_POST['type'] == 'tree') ? $readdir : $dir.'/'.$readdir;
$this -> files[$dir_id][$aid]['size'] = filesize($dir.'/'.$readdir);
$this -> files[$dir_id][$aid]['icon'] = 'file_warning.png';
$this -> count['warning']['num']++;
$this -> count['warning']['size'] += $this -> files[$dir_id][$aid]['size'];
$this -> count['deprecated']['num']++;
$this -> count['deprecated']['size'] += $this -> files[$dir_id][$aid]['size'];
$dir_icon = 'folder_warning.png';
$parent_expand = TRUE;
}
if ($_POST['regex']) {
$file_content = file($dir.'/'.$readdir);
if ($this -> files[$dir_id][$aid]['lines'] = preg_grep("#".$_POST['regex']."#".$_POST['mod'], $file_content)) {
$dir_icon = 'fileinspector.png';
$parent_expand = TRUE;
$this -> results++;
} else {
unset($this -> files[$dir_id][$aid]);
$dir_icon = ($dir_icon == 'fileinspector.png') ? $dir_icon : 'folder.png';
}
} else {
if (isset($deprecated[$readdir])) {
if ($_POST['oldcore']) {
$dir_icon = ($dir_icon == 'folder_warning.png' || $dir_icon == 'folder_fail.png' || $dir_icon == 'folder_missing.png' || $dir_icon == 'folder_old_dir.png') ? $dir_icon : 'folder_old.png';
$parent_expand = TRUE;
}
} else {
if ($_POST['noncore']) {
$dir_icon = ($dir_icon == 'folder_warning.png' || $dir_icon == 'folder_fail.png' || $dir_icon == 'folder_missing.png' || $dir_icon == 'folder_old.png' || $dir_icon == 'folder_old_dir.png') ? $dir_icon : 'folder_unknown.png';
$parent_expand = TRUE;
}
}
}
} else if ($_POST['core'] == 'none') {
unset($this -> files[$dir_id][$aid]);
}
}
}
}
closedir($handle);
}
$dir_icon = $dir_icon ? $dir_icon : 'folder.png';
$icon = "<img src='".e_IMAGE."fileinspector/".$dir_icon."' class='i' alt='' />";
$hide = ($last_expand && $dir_icon != 'folder_core.png') ? "" : "style='display: none'";
$text = "<div class='d' style='margin-left: ".($level * 8)."px'>";
$text .= $tree_end ? "<img src='".e_IMAGE."fileinspector/blank.png' class='e' alt='' />" : "<span onclick=\"ec('".$dir_id."')\"><img src='".e_IMAGE."fileinspector/".($hide ? 'expand.png' : 'contract.png')."' class='e' alt='' id='e_".$dir_id."' /></span>";
$text .= "&nbsp;<span onclick=\"sh('f_".$dir_id."')\">".$icon."&nbsp;".$directory."</span>";
$text .= $tree_end ? "" : "<div ".$hide." id='d_".$dir_id."'>".$sub_text."</div>";
$text .= "</div>";
$this -> files[$dir_id]['.']['icon'] = $dir_icon;
return $text;
}
function scan_results() {
global $ns, $rs, $core_image, $deprecated_image;
$scan_text = $this -> inspect($core_image, $deprecated_image, 0, $this -> root_dir);
if ($_POST['type'] == 'tree') {
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='fcaption' colspan='2'>".FR_LAN_2."</td>
</tr>";
$text .= "<tr style='display: none'><td style='width:50%'></td><td style='width:50%'></td></tr>";
$text .= "<tr>
<td class='forumheader3' style='width:50%'>
<div style='height: 400px; overflow: auto'>
".$scan_text."
</div>
</td>
<td class='forumheader3' style='width:50%; vertical-align: top'><div style='height: 400px; overflow: auto'>";
} else {
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='fcaption' colspan='2'>".FR_LAN_2."</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' colspan='2'>";
}
$text .= "<table class='t' id='initial'>";
if ($_POST['type'] == 'tree') {
$text .= "<tr><td class='f' style='padding-left: 4px'>
<img src='".e_IMAGE."fileinspector/fileinspector.png' class='i' alt='' />&nbsp;<b>".FR_LAN_3."</b></td>
<td class='s' style='text-align: right; padding-right: 4px' onclick=\"sh('f_".dechex(crc32($this -> root_dir))."')\">
<img src='".e_IMAGE."fileinspector/forward.png' class='i' alt='' /></td></tr>";
} else {
$text .= "<tr><td class='f' style='padding-left: 4px' colspan='2'>
<img src='".e_IMAGE."fileinspector/fileinspector.png' class='i' alt='' />&nbsp;<b>".FR_LAN_3."</b></td>
</tr>";
}
if ($_POST['core'] != 'none') {
$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_core.png' class='i' alt='' />&nbsp;".FR_LAN_4.":&nbsp;".($this -> count['core']['num'] ? $this -> count['core']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['core']['size'], 2)."</td></tr>";
}
if ($_POST['missing']) {
$text .= "<tr><td class='f' colspan='2'><img src='".e_IMAGE."fileinspector/file_missing.png' class='i' alt='' />&nbsp;".FR_LAN_22.":&nbsp;".($this -> count['missing']['num'] ? $this -> count['missing']['num'] : FR_LAN_21)."&nbsp;</td></tr>";
}
if ($_POST['noncore']) {
$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_unknown.png' class='i' alt='' />&nbsp;".FR_LAN_5.":&nbsp;".($this -> count['unknown']['num'] ? $this -> count['unknown']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['unknown']['size'], 2)."</td></tr>";
}
if ($_POST['oldcore']) {
$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_old.png' class='i' alt='' />&nbsp;".FR_LAN_24.":&nbsp;".($this -> count['deprecated']['num'] ? $this -> count['deprecated']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['deprecated']['size'], 2)."</td></tr>";
}
if ($_POST['core'] == 'all') {
$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file.png' class='i' alt='' />&nbsp;".FR_LAN_6.":&nbsp;".($this -> count['core']['num'] + $this -> count['unknown']['num'] + $this -> count['deprecated']['num'])."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['core']['size'] + $this -> count['unknown']['size'] + $this -> count['deprecated']['size'], 2)."</td></tr>";
}
if ($this -> count['warning']['num']) {
$text .= "<tr><td colspan='2'>&nbsp;</td></tr>";
$text .= "<tr><td style='padding-left: 4px' colspan='2'>
<img src='".e_IMAGE."fileinspector/warning.png' class='i' alt='' />&nbsp;<b>".FR_LAN_26."</b></td></tr>";
$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_warning.png' class='i' alt='' />&nbsp;".FR_LAN_28.":&nbsp;".($this -> count['warning']['num'] ? $this -> count['warning']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['warning']['size'], 2)."</td></tr>";
$text .= "<tr><td class='w' colspan='2'><img src='".e_IMAGE."fileinspector/info.png' class='i' alt='' />&nbsp;".FR_LAN_27."</td></tr>";
}
if ($_POST['integrity'] && $_POST['core'] != 'none') {
$integrity_icon = $this -> count['fail']['num'] ? 'integrity_fail.png' : 'integrity_pass.png';
$integrity_text = $this -> count['fail']['num'] ? '( '.$this -> count['fail']['num'].' '.FR_LAN_19.' )' : '( '.FR_LAN_20.' )';
$text .= "<tr><td colspan='2'>&nbsp;</td></tr>";
$text .= "<tr><td class='f' style='padding-left: 4px' colspan='2'>
<img src='".e_IMAGE."fileinspector/".$integrity_icon."' class='i' alt='' />&nbsp;<b>".FR_LAN_7."</b> ".$integrity_text."</td></tr>";
$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_check.png' class='i' alt='' />&nbsp;".FR_LAN_8.":&nbsp;".($this -> count['pass']['num'] ? $this -> count['pass']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['pass']['size'], 2)."</td></tr>";
$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_fail.png' class='i' alt='' />&nbsp;".FR_LAN_9.":&nbsp;".($this -> count['fail']['num'] ? $this -> count['fail']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['fail']['size'], 2)."</td></tr>";
$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_uncalc.png' class='i' alt='' />&nbsp;".FR_LAN_25.":&nbsp;".($this -> count['uncalculable']['num'] ? $this -> count['uncalculable']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['uncalculable']['size'], 2)."</td></tr>";
$text .= "<tr><td colspan='2'>&nbsp;</td></tr>";
$text .= "<tr><td class='f' colspan='2'><img src='".e_IMAGE."fileinspector/info.png' class='i' alt='' />&nbsp;".FR_LAN_10.":&nbsp;</td></tr>";
$text .= "<tr><td style='padding-right: 4px' colspan='2'>
<ul><li>
<a href=\"javascript: expandit('i_corrupt')\">".FR_LAN_11."...</a><div style='display: none' id='i_corrupt'>
".FR_LAN_12."<br /><br /></div>
</li><li>
<a href=\"javascript: expandit('i_date')\">".FR_LAN_13."...</a><div style='display: none' id='i_date'>
".FR_LAN_14."<br /><br /></div>
</li><li>
<a href=\"javascript: expandit('i_edit')\">".FR_LAN_15."...</a><div style='display: none' id='i_edit'>
".FR_LAN_16."<br /><br /></div>
</li><li>
<a href=\"javascript: expandit('i_cvs')\">".FR_LAN_17."...</a><div style='display: none' id='i_cvs'>
".FR_LAN_18."<br /><br /></div>
</li></ul>
</td></tr>";
}
if ($_POST['type'] == 'tree' && !$this -> results && $_POST['regex']) {
$text .= "</td></tr>
<tr><td style='padding-right: 4px; text-align: center' colspan='2'><br />".FR_LAN_23."</td></tr>";
}
$text .= "</table>";
if ($_POST['type'] != 'tree') {
$text .= "<br /></td></tr><tr>
<td class='forumheader3' colspan='2'>
<table class='t'>";
if (!$this -> results && $_POST['regex']) {
$text .= "<tr><td class='f' style='padding-left: 4px; text-align: center' colspan='2'>".FR_LAN_23."</td></tr>";
}
}
foreach ($this -> files as $dir_id => $fid) {
ksort($fid);
$text .= ($_POST['type'] == 'tree') ? "<table class='t' style='display: none' id='f_".$dir_id."'>" : "";
$initial = FALSE;
foreach ($fid as $key => $stext) {
if (!$initial) {
if ($_POST['type'] == 'tree') {
$text .= "<tr><td class='f' style='padding-left: 4px' ".($stext['level'] ? "onclick=\"sh('f_".$stext['parent']."')\"" : "").">
<img src='".e_IMAGE."fileinspector/".($stext['level'] ? "folder_up.png" : "folder_root.png")."' class='i' alt='' />".($stext['level'] ? "&nbsp;.." : "")."</td>
<td class='s' style='text-align: right; padding-right: 4px' onclick=\"sh('initial')\"><img src='".e_IMAGE."fileinspector/close.png' class='i' alt='' /></td></tr>";
}
} else {
if ($_POST['type'] != 'tree') {
$stext['file'] = str_replace($this -> root_dir."/", "", $stext['file']);
}
$text .= "<tr>
<td class='f'><img src='".e_IMAGE."fileinspector/".$stext['icon']."' class='i' alt='' />&nbsp;".$stext['file']."&nbsp;";
if ($_POST['regex']) {
if ($_POST['num'] || $_POST['line']) {
$text .= "<br />";
}
foreach ($stext['lines'] as $rkey => $rvalue) {
if ($_POST['num']) {
$text .= "[".($rkey + 1)."] ";
}
if ($_POST['line']) {
$text .= htmlspecialchars($rvalue)."<br />";
}
}
$text .= "<br />";
} else {
$text .= "</td>
<td class='s'>".$this -> parsesize($stext['size']);
}
$text .= "</td></tr>";
}
$initial = TRUE;
}
$text .= ($_POST['type'] == 'tree') ? "</table>" : "";
}
if ($_POST['type'] != 'tree') {
$text .= "</td>
</tr></table>";
}
$text .= "</td></tr>";
$text .= "</table>
</dit><br />";
$ns -> tablerender(FR_LAN_1.'...', $text);
}
function create_image($dir) {
global $core_image, $deprecated_image, $coredir;
foreach ($coredir as $trim_key => $trim_dirs) {
$search[$trim_key] = "'".$trim_dirs."'";
$replace[$trim_key] = "\$coredir['".$trim_key."']";
}
$data = "<?php\n";
$data .= "/*\n";
$data .= "+ ----------------------------------------------------------------------------+\n";
$data .= "| e107 website system\n";
$data .= "|\n";
$data .= "| <20>Steve Dunstan 2001-2002\n";
$data .= "| http://e107.org\n";
$data .= "| jalist@e107.org\n";
$data .= "|\n";
$data .= "| Released under the terms and conditions of the\n";
$data .= "| GNU General Public License (http://gnu.org).\n";
$data .= "|\n";
$data .= "| \$Source: /cvs_backup/e107_0.8/e107_admin/fileinspector.php,v $\n";
$data .= "| \$Revision: 1.1.1.1 $\n";
$data .= "| \$Date: 2006-12-02 04:33:21 $\n";
$data .= "| \$Author: mcfly_e107 $\n";
$data .= "+----------------------------------------------------------------------------+\n";
$data .= "*/\n\n";
$data .= "if (!defined('e107_INIT')) { exit; }\n\n";
$scan_current = ($_POST['snaptype'] == 'current') ? $this -> scan($dir) : $core_image;
$image_array = var_export($scan_current, true);
$image_array = str_replace($search, $replace, $image_array);
$data .= "\$core_image = ".$image_array.";\n\n";
$scan_deprecated = ($_POST['snaptype'] == 'deprecated') ? $this -> scan($dir, $core_image) : $deprecated_image;
$image_array = var_export($scan_deprecated, true);
$image_array = str_replace($search, $replace, $image_array);
$data .= "\$deprecated_image = ".$image_array.";\n\n";
$data .= "?>";
$fp = fopen(e_ADMIN.'core_image.php', 'w');
fwrite($fp, $data);
}
function snapshot_interface() {
global $ns, $rs;
$text = "";
if (isset($_POST['create_snapshot'])) {
$this -> create_image($_POST['snapshot_path']);
$text = "<div style='text-align:center'>
<form action='".e_SELF."' method='post' id='main_page'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='fcaption'>Snapshot Created</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='text-align:center'>
The snapshot (".e_ADMIN."core_image.php) was successfully created.
</td>
</tr>
<tr>
<td style='text-align:center' class='forumheader'>".$rs -> form_button('submit', 'main_page', 'Return To Main Page')."</td>
</tr>
</table>
</form>
</div><br />";
}
$text .= "<div style='text-align:center'>
<form action='".e_SELF."?".e_QUERY."' method='post' id='snapshot'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='fcaption' colspan='2'>Create Snapshot</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='width:50%'>
Absolute path of root directory to create image from:
</td>
<td class='forumheader3' style='width:50%'>
<input class='tbox' type='text' name='snapshot_path' size='60' value='".(isset($_POST['snapshot_path']) ? $_POST['snapshot_path'] : $this -> root_dir)."' />
</td></tr>
<tr>
<td class='forumheader3' style='width: 35%'>
Create snapshot of current or deprecated core files:
</td>
<td colspan='2' class='forumheader3' style='width: 65%'>
<input type='radio' name='snaptype' value='current'".($_POST['snaptype'] == 'current' || !isset($_POST['snaptype']) ? " checked='checked'" : "")." /> Current&nbsp;&nbsp;
<input type='radio' name='snaptype' value='deprecated'".($_POST['snaptype'] == 'deprecated' ? " checked='checked'" : "")." /> Deprecated&nbsp;&nbsp;
</td>
</tr>
<tr>
<td class='forumheader' style='text-align:center' colspan='2'>".$rs -> form_button('submit', 'create_snapshot', 'Create Snapshot')."</td>
</tr>
</table>
</form>
</div>";
$ns -> tablerender('Snapshot', $text);
}
function checksum($filename) {
$checksum = md5(str_replace(array(chr(13),chr(10)), "", file_get_contents($filename)));
return $checksum;
}
function parsesize($size, $dec = 0) {
$size = $size ? $size : 0;
$kb = 1024;
$mb = 1024 * $kb;
$gb = 1024 * $mb;
$tb = 1024 * $gb;
if ($size < $kb) {
return $size." b";
} else if($size < $mb) {
return round($size/$kb)." kb";
} else if($size < $gb) {
return round($size/$mb, $dec)." mb";
} else if($size < $tb) {
return round($size/$gb, $dec)." gb";
} else {
return round($size/$tb, $dec)." tb";
}
}
function regex_match($file) {
$file_content = file_get_contents($file);
$match = preg_match($_POST['regex'], $file_content);
return $match;
}
}
require_once('footer.php');
function headerjs() {
global $e107;
$text = "<script type='text/javascript'>
<!--
c = new Image(); c = '".SITEURLBASE.e_IMAGE_ABS."fileinspector/contract.png';
e = '".SITEURLBASE.e_IMAGE_ABS."fileinspector/expand.png';
function ec(ecid) {
icon = document.getElementById('e_' + ecid).src;
if (icon == e) {
document.getElementById('e_' + ecid).src = c;
} else {
document.getElementById('e_' + ecid).src = e;
}
div = document.getElementById('d_' + ecid).style;
if (div.display == 'none') {
div.display = '';
} else {
div.display = 'none';
}
}
var hideid = 'initial';
function sh(showid) {
if (hideid != showid) {
show = document.getElementById(showid).style;
hide = document.getElementById(hideid).style;
show.display = '';
hide.display = 'none';
hideid = showid;
}
}
//-->
</script>
<style type='text/css'>
<!--\n";
if ($_POST['regex']) {
$text .= ".f { padding: 1px 0px 1px 8px; vertical-align: bottom; width: 90% }\n";
} else {
$text .= ".f { padding: 1px 0px 1px 8px; vertical-align: bottom; width: 90%; white-space: nowrap }\n";
}
$text .= ".d { margin: 2px 0px 1px 8px; cursor: default; white-space: nowrap }
.s { padding: 1px 8px 1px 0px; vertical-align: bottom; width: 10%; white-space: nowrap }
.t { margin-top: 1px; width: 100%; border-collapse: collapse; border-spacing: 0px }
.w { padding: 1px 0px 1px 8px; vertical-align: bottom; width: 90% }
.i { width: 16px; height: 16px }
.e { width: 9px; height: 9px }
-->
</style>\n";
return $text;
}
?>

377
e107_admin/filemanager.php Normal file
View File

@@ -0,0 +1,377 @@
<?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_admin/filemanager.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:22 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("6")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'filemanage';
require_once("auth.php");
$pubfolder = (str_replace("../","",e_QUERY) == str_replace("../","",e_FILE."public/")) ? TRUE : FALSE;
$imagedir = e_IMAGE."filemanager/";
$dir_options[0] = FMLAN_47;
$dir_options[1] = FMLAN_35;
$dir_options[2] = FMLAN_40;
$adchoice[0] = e_FILE."public/";
$adchoice[1] = e_FILE;
$adchoice[2] = e_IMAGE."newspost_images/";
$path = str_replace("../", "", e_QUERY);
if (!$path) {
$path = str_replace("../", "", $adchoice[0]);
}
if($path == "/")
{
$path = $adchoice[0];
echo "<b>Debug</b> ".$path." <br />";
}
// ===============================================
foreach($_POST['deleteconfirm'] as $key=>$delfile){
// check for delete.
if (isset($_POST['selectedfile'][$key]) && isset($_POST['deletefiles'])) {
if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
exit;
}
$destination_file = e_BASE.$delfile;
if (@unlink($destination_file)) {
$message .= FMLAN_26." '".$destination_file."' ".FMLAN_27.".<br />";
} else {
$message .= FMLAN_28." '".$destination_file."'.<br />";
}
}
// check for move to downloads or downloadimages.
if (isset($_POST['selectedfile'][$key]) && (isset($_POST['movetodls'])) ){
$newfile = str_replace($path,"",$delfile);
// Move file to whatever folder.
if (isset($_POST['movetodls'])){
$newpath = $_POST['movepath'];
if (rename(e_BASE.$delfile,$newpath.$newfile)){
$message .= FMLAN_38." ".$newpath.$newfile."<br />";
} else {
$message .= FMLAN_39." ".$newpath.$newfile."<br />";
$message .= (!is_writable($newpath)) ? $newpath.LAN_NOTWRITABLE : "";
}
}
}
}
if (isset($_POST['upload'])) {
if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
exit;
}
$pref['upload_storagetype'] = "1";
require_once(e_HANDLER."upload_handler.php");
$files = $_FILES['file_userfile'];
foreach($files['name'] as $key => $name) {
if ($files['size'][$key]) {
$uploaded = file_upload(e_BASE.$_POST['upload_dir'][$key]);
}
}
}
if (isset($message)) {
$ns->tablerender("", "<div style=\"text-align:center\"><b>".$message."</b></div>");
}
if (strpos(e_QUERY, ".") && !is_dir(realpath(e_BASE.$path))){
echo "<iframe style=\"width:100%\" src=\"".e_BASE.e_QUERY."\" height=\"300\" scrolling=\"yes\"></iframe><br /><br />";
if (!strpos(e_QUERY, "/")) {
$path = "";
} else {
$path = substr($path, 0, strrpos(substr($path, 0, -1), "/"))."/";
}
}
$files = array();
$dirs = array();
$path = explode("?", $path);
$path = $path[0];
$path = explode(".. ", $path);
$path = $path[0];
if ($handle = opendir(e_BASE.$path)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if (getenv('windir') && is_file(e_BASE.$path."\\".$file)) {
if (is_file(e_BASE.$path."\\".$file)) {
$files[] = $file;
} else {
$dirs[] = $file;
}
} else {
if (is_file(e_BASE.$path."/".$file)) {
$files[] = $file;
} else {
$dirs[] = $file;
}
}
}
}
}
closedir($handle);
if (count($files) != 0) {
sort($files);
}
if (count($dirs) != 0) {
sort($dirs);
}
if (count($files) == 1) {
$cstr = FMLAN_12;
} else {
$cstr = FMLAN_13;
}
if (count($dirs) == 1) {
$dstr = FMLAN_14;
} else {
$dstr = FMLAN_15;
}
$pathd = $path;
$text = "<div style='text-align:center'>\n
<form method='post' action='".e_SELF."?".e_QUERY."'>\n
<table style='".ADMIN_WIDTH."' class='fborder'>\n
<tr>\n\n
<td style='width:70%' class='forumheader3'>\n
".FMLAN_32."
</td>\n
<td class='forumheader3' style='text-align:center; width:30%'>\n
<select name='admin_choice' class='tbox' onchange=\"location.href=this.options[selectedIndex].value\">\n";
foreach($dir_options as $key=>$opt){
$select = (str_replace("../","",$adchoice[$key]) == e_QUERY) ? "selected='selected'" : "";
$text .= "<option value='".e_SELF."?".str_replace("../","",$adchoice[$key])."' $select>".$opt."</option>\n";
}
$text .= "</select>\n
</td>\n
</tr>\n\n
<tr style='vertical-align:top'>\n
<td colspan='2' style='text-align:center' class='forumheader'>\n
<input class='button' type='submit' name='updateoptions' value='".FMLAN_33."' />\n
</td>\n
</tr>\n\n
</table>\n
</form>\n
</div>";
$ns->tablerender(FMLAN_34, $text);
$text = "<form enctype=\"multipart/form-data\" action=\"".e_SELF.(e_QUERY ? "?".e_QUERY : "")."\" method=\"post\">
<div style=\"text-align:center\">
<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"1000000\" />
<table class='fborder' style=\"".ADMIN_WIDTH."\">";
$text .= "<tr>
<td style=\"width:5%\" class=\"fcaption\">&nbsp;</td>
<td style=\"width:30%\" class=\"fcaption\"><b>".FMLAN_17."</b></td>
<td class=\"fcaption\"><b>".FMLAN_18."</b></td>
<td style=\"width:30%\" class=\"fcaption\"><b>".FMLAN_19."</b></td>
<td class=\"fcaption\"><b>".LAN_OPTIONS."</b></td>
</tr>";
if ($path != e_FILE) {
if (substr_count($path, "/") == 1) {
$pathup = e_SELF;
} else {
$pathup = e_SELF."?".substr($path, 0, strrpos(substr($path, 0, -1), "/"))."/";
}
$text .= "<tr><td colspan=\"5\" class=\"forumheader3\"><a href=\"".$pathup."\"><img src=\"".$imagedir."updir.png\" alt=\"".FMLAN_30."\" style=\"border:0\" /></a>
<a href=\"filemanager.php\"><img src=\"".$imagedir."home.png\" alt=\"".FMLAN_16."\" style=\"border:0\" /></a>
</td>
</tr>";
}
$c = 0;
while ($dirs[$c]) {
$dirsize = dirsize($path.$dirs[$c]);
$text .= "<tr>
<td class=\"forumheader3\" style=\"vertical-align:middle; text-align:center; width:5%\">
<a href=\"".e_SELF."?".$path.$dirs[$c]."/\"><img src=\"".$imagedir."folder.png\" alt=\"".$dirs[$c]." ".FMLAN_31."\" style=\"border:0\" /></a>
</td>
<td style=\"width:30%\" class=\"forumheader3\">
<a href=\"".e_SELF."?".$path.$dirs[$c]."/\">".$dirs[$c]."</a>
</td>
<td class=\"forumheader3\">".$dirsize."
</td>
<td class=\"forumheader3\">&nbsp;</td>
<td class=\"forumheader3\">";
if (FILE_UPLOADS && is_writable(e_BASE.$path.$dirs[$c])) {
$text .= "<input class=\"button\" type=\"button\" name=\"erquest\" value=\"".FMLAN_21."\" onclick=\"expandit(this)\" />
<div style=\"display:none;\">
<input class=\"tbox\" type=\"file\" name=\"file_userfile[]\" size=\"50\" />
<input class=\"button\" type=\"submit\" name=\"upload\" value=\"".FMLAN_22."\" />
<input type=\"hidden\" name=\"upload_dir[]\" value=\"".$path.$dirs[$c]."\" />
</div>";
} else {
$text .= "&nbsp;";
}
$text .= "</td>
</tr>
";
$c++;
}
$c = 0;
while ($files[$c]) {
$img = substr(strrchr($files[$c], "."), 1, 3);
if (!$img || !preg_match("/css|exe|gif|htm|jpg|js|php|png|txt|xml|zip/i", $img)) {
$img = "def";
}
$size = parsesize(filesize(e_BASE.$path."/".$files[$c]));
$text .= "<tr>
<td class=\"forumheader3\" style=\"vertical-align:middle; text-align:center; width:5%\">
<img src=\"".$imagedir.$img.".png\" alt=\"".$files[$c]."\" style=\"border:0\" />
</td>
<td style=\"width:30%\" class=\"forumheader3\">
<a href=\"".e_SELF."?".$path.$files[$c]."\">".$files[$c]."</a>
</td>";
$gen = new convert;
$filedate = $gen -> convert_date(filemtime(e_BASE.$path."/".$files[$c]), "forum");
$text .= "<td style=\"width:10%\" class=\"forumheader3\">".$size."</td>
<td style=\"width:30%\" class=\"forumheader3\">".$filedate."</td>
<td class=\"forumheader3\">";
$text .= "<input type=\"checkbox\" name=\"selectedfile[$c]\" value=\"1\" />";
$text .="<input type=\"hidden\" name=\"deleteconfirm[$c]\" value=\"".$path.$files[$c]."\" />";
$text .="</td>
</tr>";
$c++;
}
$text .= "<tr><td colspan='5' class='forumheader' style='text-align:right'>";
if ($pubfolder || e_QUERY == ""){
require_once(e_HANDLER."file_class.php");
$fl = new e_file;
$dl_dirlist = $fl->get_dirs(e_DOWNLOAD);
$movechoice = array();
$movechoice[] = e_DOWNLOAD;
foreach($dl_dirlist as $dirs){
$movechoice[] = e_DOWNLOAD.$dirs."/";
}
sort($movechoice);
$movechoice[] = e_FILE."downloadimages/";
if(e_QUERY != str_replace("../","",e_FILE."public/")){
$movechoice[] = e_FILE."public/";
}
if(e_QUERY != str_replace("../","",e_FILE."downloadthumbs/")){
$movechoice[] = e_FILE."downloadthumbs/";
}
if(e_QUERY != str_replace("../","",e_FILE."misc/")){
$movechoice[] = e_FILE."misc/";
}
if(e_QUERY != str_replace("../","",e_IMAGE)){
$movechoice[] = e_IMAGE;
}
if(e_QUERY != str_replace("../","",e_IMAGE."newspost_images/")){
$movechoice[] = e_IMAGE."newspost_images/";
}
$text .= FMLAN_48."&nbsp;<select class='tbox' name='movepath'>\n";
foreach($movechoice as $paths){
$text .= "<option value='$paths'>".str_replace("../","",$paths)."</option>\n";
}
$text .= "</select>&nbsp;";
$text .="<input class=\"button\" type=\"submit\" name=\"movetodls\" value=\"".FMLAN_50."\" onclick=\"return jsconfirm('".$tp->toJS(FMLAN_49)."') \" />
";
}
$text .= "<input class=\"button\" type=\"submit\" name=\"deletefiles\" value=\"".FMLAN_43."\" onclick=\"return jsconfirm('".$tp->toJS(FMLAN_46)."') \" />
</td></tr></table>
<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
</div>
</form>";
$ns->tablerender(FMLAN_29.": <b>root/".$pathd."</b>&nbsp;&nbsp;[ ".count($dirs)." ".$dstr.", ".count($files)." ".$cstr." ]", $text);
function dirsize($dir) {
$_SERVER["DOCUMENT_ROOT"].e_HTTP.$dir;
$dh = @opendir($_SERVER["DOCUMENT_ROOT"].e_HTTP.$dir);
$size = 0;
while ($file = @readdir($dh)) {
if ($file != "." and $file != "..") {
$path = $dir."/".$file;
if (is_file($_SERVER["DOCUMENT_ROOT"].e_HTTP.$path)) {
$size += filesize($_SERVER["DOCUMENT_ROOT"].e_HTTP.$path);
} else {
$size += dirsize($path."/");
}
}
}
@closedir($dh);
return parsesize($size);
}
function parsesize($size) {
$kb = 1024;
$mb = 1024 * $kb;
$gb = 1024 * $mb;
$tb = 1024 * $gb;
if ($size < $kb) {
return $size." b";
}
else if($size < $mb) {
return round($size/$kb, 2)." kb";
}
else if($size < $gb) {
return round($size/$mb, 2)." mb";
}
else if($size < $tb) {
return round($size/$gb, 2)." gb";
} else {
return round($size/$tb, 2)." tb";
}
}
require_once("footer.php");
?>

View File

@@ -0,0 +1 @@
zip, gz, jpg, png, gif

157
e107_admin/fla.php Normal file
View File

@@ -0,0 +1,157 @@
<?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_admin/fla.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:22 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("4")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'failed_login';
require_once("auth.php");
$tmp = (e_QUERY) ? explode(".", e_QUERY) : "";
$from = (!$tmp[0]) ? 0 : intval($tmp[0]);
$amount = (!$tmp[1]) ? 50 : intval($tmp[1]);
if(isset($_POST['delbanSubmit']))
{
$delcount = 0;
foreach($_POST['fladelete'] as $delete)
{
$delcount ++;
$sql -> db_Delete("generic", "gen_id='$delete' ");
}
$message = FLALAN_3.": ".$delcount;
$bancount = 0;
foreach($_POST['flaban'] as $ban)
{
if($sql -> db_Select("generic", "*", "gen_id=$ban"))
{
$at = $sql -> db_Fetch();
$banlist_ip = $at['gen_ip'];
$sql->db_Insert("banlist", "'$banlist_ip', '".ADMINID."', '".FLALAN_4."' ");
$sql -> db_Delete("generic", "gen_id='$ban' ");
$bancount ++;
}
}
$message .= ", ".FLALAN_5.": ".$bancount;
}
if(e_QUERY == "dabl")
{
$sql -> db_Delete("generic", "gen_type='auto_banned' ");
$message = FLALAN_17;
}
if($sql -> db_Select("generic", "*", "gen_type='auto_banned' ORDER BY gen_datestamp DESC "))
{
$abArray = $sql -> db_getList();
$message = FLALAN_15;
foreach($abArray as $ab)
{
$message .= " - ".$ab['gen_ip'];
}
$message .= "<div style='text-align: right;'>( <a href='".e_SELF."?dabl'>".FLALAN_16."</a> )</div>";
}
if (isset($message)) {
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
$gen = new convert;
$fla_total = $sql->db_Count("generic", "(*)", "WHERE gen_type='failed_login'");
if(!$sql -> db_Select("generic", "*", "gen_type='failed_login' ORDER BY gen_datestamp DESC LIMIT $from,$amount"))
{
$text = "<div style='text-align: center;'>".FLALAN_2."</div>";
}
else
{
$faArray = $sql -> db_getList('ALL', FALSE, FALSE);
$text = "
<form method='post' action='".e_SELF."' id='flaform' >
<table class='fborder' style='width:99%;'>
<tr>
<td style='width: 20%;' class='forumheader'>".FLALAN_6."</td>
<td style='width: 50%;' class='forumheader'>".FLALAN_7."</td>
<td style='width: 20%;' class='forumheader'>".FLALAN_8."</td>
<td style='width: 10%; text-align: center;' class='forumheader'>".FLALAN_9."</td>
</tr>
";
foreach($faArray as $fa)
{
extract($fa);
$host = $e107->get_host_name(getenv($gen_ip));
$text .= "<tr>
<td style='width: 20%;' class='forumheader3'>".$gen->convert_date($gen_datestamp, "forum")."</td>
<td style='width: 50%;' class='forumheader3'>".str_replace(":::", "<br />", htmlentities($gen_chardata, ENT_QUOTES, CHARSET))."</td>
<td style='width: 20%;' class='forumheader'>".$fa['gen_ip']."<br />{$host}</td>
<td style='width: 10%; text-align: left;' class='forumheader3'>
<input type='checkbox' name='fladelete[]' value='$gen_id' /> ".LAN_DELETE."<br />
<input type='checkbox' name='flaban[]' value='$gen_id' /> ".LAN_BAN."
</td>
</tr>
";
}
$text .= "
<tr>
<td colspan='4' class='forumheader' style='text-align: right;'>
<a href='".e_SELF."?checkall=1' onclick=\"setCheckboxes('flaform', true, 'fladelete[]'); return false;\">".FLALAN_11."</a> -
<a href='".e_SELF."' onclick=\"setCheckboxes('flaform', false, 'fladelete[]'); return false;\">".FLALAN_12."</a>
<br />
<a href='".e_SELF."?checkall=1' onclick=\"setCheckboxes('flaform', true, 'flaban[]'); return false;\">".FLALAN_13."</a> -
<a href='".e_SELF."' onclick=\"setCheckboxes('flaform', false, 'flaban[]'); return false;\">".FLALAN_14."</a>
</td>
</tr>
<tr>
<td colspan='4' class='forumheader' style='text-align: center;'><input class='button' type='submit' name='delbanSubmit' value='".FLALAN_10."' /></td>
</tr>
</table>
</form>
<div style='text-align:center'><br />
";
$parms = $fla_total.",".$amount.",".$from.",".e_SELF.'?'."[FROM].".$amount;
$text .= $tp->parseTemplate("{NEXTPREV={$parms}}");
$text .= "</div>";
}
$ns->tablerender(FLALAN_1, $text);
require_once("footer.php");
?>

99
e107_admin/footer.php Normal file
View File

@@ -0,0 +1,99 @@
<?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_admin/footer.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:22 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
global $ADMIN_FOOTER, $footer_js, $sql;
if (ADMIN == TRUE) {
if ($pref['cachestatus']) {
if (!$sql->db_Select('generic', '*', "gen_type='empty_cache'"))
{
$sql->db_Insert('generic', "0,'empty_cache','".time()."','0','','0',''");
} else {
$row = $sql->db_Fetch();
if (($row['gen_datestamp']+604800) < time()) // If cache not cleared in last 7 days, clear it.
{
require_once(e_HANDLER."cache_handler.php");
$ec = new ecache;
$ec->clear();
$sql->db_Update('generic', "gen_datestamp='".time()."' WHERE gen_type='empty_cache'");
}
}
}
}
if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE) {
parse_admin($ADMIN_FOOTER);
}
$eTimingStop = microtime();
global $eTimingStart, $eTraffic;
$rendertime = number_format($eTraffic->TimeDelta( $eTimingStart, $eTimingStop ), 4);
$db_time = number_format($db_time,4);
$rinfo = '';
if($pref['displayrendertime']){ $rinfo .= "Render time: {$rendertime} second(s); {$db_time} of that for queries. "; }
if($pref['displaysql']){ $rinfo .= "DB queries: ".$sql -> db_QueryCount().". "; }
if(isset($pref['displaycacheinfo']) && $pref['displaycacheinfo']){ $rinfo .= $cachestring."."; }
echo ($rinfo ? "\n<div style='text-align:center' class='smalltext'>{$rinfo}</div>\n" : "");
if($error_handler->debug == true) {
echo "
<br /><br />";
echo "
<div>
<h3>PHP Errors:</h3><br />
".$error_handler->return_errors()."
</div>
";
$tmp = $eTraffic->Display();
if (strlen($tmp)) {
$ns->tablerender('Traffic Counters', $tmp);
}
$tmp = $db_debug->Show_Performance();
if (strlen($tmp)) {
$ns->tablerender('Time Analysis', $tmp);
}
$tmp = $db_debug->Show_SQL_Details();
if (strlen($tmp)) {
$ns->tablerender('SQL Analysis', $tmp);
}
}
if (function_exists('theme_foot'))
{
echo theme_foot();
}
if(isset($footer_js) && is_array($footer_js))
{
$footer_js = array_unique($footer_js);
foreach($footer_js as $fname)
{
echo "<script type='text/javascript' src='{$fname}'></script>\n";
$js_included[] = $fname;
}
}
echo "</body></html>";
$sql->db_Close();
?>

266
e107_admin/frontpage.php Normal file
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_admin/frontpage.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:22 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once('../class2.php');
if (!getperms('G')) {
header('location:'.e_BASE.'index.php');
exit;
}
$e_sub_cat = 'frontpage';
require_once('auth.php');
require_once(e_HANDLER.'form_handler.php');
$rs = new form;
require_once(e_HANDLER.'userclass_class.php');
$front_page['news'] = array('page' => 'news.php', 'title' => ADLAN_0);
$front_page['download'] = array('page' => 'download.php', 'title' => ADLAN_24);
$front_page['wmessage'] = array('page' => 'index.php', 'title' => ADLAN_28);
if ($sql -> db_Select("page", "*", "page_theme=''")) {
$front_page['custom']['title'] = 'Custom Page';
while ($row = $sql -> db_Fetch()) {
$front_page['custom']['page'][] = array('page' => 'page.php?'.$row['page_id'], 'title' => $row['page_title']);
}
}
foreach($pref['e_frontpage_list'] as $val)
{
if (is_readable(e_PLUGIN.$val."/e_frontpage.php"))
{
require_once(e_PLUGIN.$val."/e_frontpage.php");
}
}
if (isset($_POST['edit'])) {
$_POST['type'] = (isset($_POST['edit']['all'])) ? 'all_users' : 'user_class';
$_POST['class'] = key($_POST['edit']);
}
if (isset($_POST['updatesettings'])) {
if ($_POST['frontpage'] == 'other') {
$_POST['other_page'] = $tp -> toForm($_POST['other_page']);
$frontpage_value = $_POST['other_page'] ? $_POST['other_page'] : 'news.php';
} else {
if (is_array($front_page[$_POST['frontpage']]['page'])) {
$frontpage_value = $front_page[$_POST['frontpage']]['page'][$_POST['multipage'][$_POST['frontpage']]]['page'];
} else {
$frontpage_value = $front_page[$_POST['frontpage']]['page'];
}
}
if ($_POST['type'] == 'all_users') {
unset($pref['frontpage']);
$pref['frontpage']['all'] = $frontpage_value;
} else {
if (isset($pref['frontpage']['all'])) {
$pref['frontpage']['252'] = ($_POST['class'] == '252') ? $frontpage_value : $pref['frontpage']['all'];
$pref['frontpage']['253'] = ($_POST['class'] == '253') ? $frontpage_value : $pref['frontpage']['all'];
$pref['frontpage']['254'] = ($_POST['class'] == '254') ? $frontpage_value : $pref['frontpage']['all'];
$class_list = get_userclass_list();
foreach ($class_list as $fp_class) {
$pref['frontpage'][$fp_class['userclass_id']] = ($_POST['class'] == $fp_class['userclass_id']) ? $frontpage_value : $pref['frontpage']['all'];
}
unset($pref['frontpage']['all']);
}
$pref['frontpage'][$_POST['class']] = $frontpage_value;
}
save_prefs();
$ns -> tablerender(LAN_UPDATED, "<div style='text-align:center'><b>".FRTLAN_1."</b></div>");
}
$fp = new frontpage;
if (isset($_POST['select']) || isset($_POST['edit'])) {
$fp -> select_page();
} else {
$fp -> select_class();
}
class frontpage {
function select_class() {
global $rs, $pref, $ns, $front_page;
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>";
$text .= "<tr>
<td style='width: 50%' class='forumheader3'>".FRTLAN_2.":</td>
<td style='width: 50%' class='forumheader3'>
".$rs -> form_radio('type', 'all_users', (isset($pref['frontpage']['all']) ? TRUE : FALSE))." ".FRTLAN_31."&nbsp;
".$rs -> form_radio('type', 'user_class', (isset($pref['frontpage']['all']) ? FALSE : TRUE))." ".FRTLAN_32.":
".r_userclass('class', '', 'off', 'guest,member,admin,classes')."</td>
</tr>";
$text .= "<tr style='vertical-align:top'>
<td colspan='2' style='text-align: center' class='forumheader'>
".$rs -> form_button('submit', 'select', LAN_SELECT)."
</td>
</tr>
</table>
</form>
</div>";
$ns -> tablerender(FRTLAN_13, $text);
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'><tr>
<td style='width: 25%' class='fcaption'>".FRTLAN_32."</td>
<td style='width: 65%' class='fcaption'>".FRTLAN_34."</td>
<td style='width: 10%' class='fcaption'>".LAN_EDIT."</td>
</tr>";
if (isset($pref['frontpage']['all'])) {
$text .= "<tr>
<td class='forumheader3'>All Users</td>
<td class='forumheader3'>".$pref['frontpage']['all']."</td>
<td class='forumheader3' style='text-align:center'>
<input type='image' title='".LAN_EDIT."' name='edit[all]' src='".ADMIN_EDIT_ICON_PATH."' />
</td>
</tr>";
} else {
foreach ($pref['frontpage'] as $current_key => $current_value) {
if ($current_key == 252) {
$title = FRTLAN_27;
} else if ($current_key == 253) {
$title = FRTLAN_28;
} else if ($current_key == 254) {
$title = FRTLAN_29;
} else {
$class_list = get_userclass_list();
foreach ($class_list as $fp_class) {
if ($current_key == $fp_class['userclass_id']) {
$title = $fp_class['userclass_name'];
}
}
}
$text .= "<tr>
<td class='forumheader3'>".$title."</td>
<td class='forumheader3'>".$current_value."</td>
<td class='forumheader3' style='text-align:center'>
<input type='image' title='".LAN_EDIT."' name='edit[".$current_key."]' src='".ADMIN_EDIT_ICON_PATH."' />
</td>
</tr>";
}
}
$text .= "</table>
</form>
</div>";
$ns -> tablerender(FRTLAN_33, $text);
}
function select_page() {
global $rs, $pref, $ns, $front_page;
if ($_POST['type'] == 'all_users') {
$title = FRTLAN_26;
} else {
if ($_POST['class'] == 252) {
$title = FRTLAN_27;
} else if ($_POST['class'] == 253) {
$title = FRTLAN_28;
} else if ($_POST['class'] == 254) {
$title = FRTLAN_29;
} else {
$class_list = get_userclass_list();
foreach ($class_list as $fp_class) {
if ($_POST['class'] == $fp_class['userclass_id']) {
$title = $fp_class['userclass_name'];
}
}
}
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td colspan='3' class='fcaption'>".FRTLAN_2." ".$title.": </td>
</tr>";
foreach ($front_page as $front_key => $front_value) {
$type_selected = FALSE;
$current_setting = (isset($pref['frontpage']['all'])) ? $pref['frontpage']['all'] : $pref['frontpage'][$_POST['class']];
if (is_array($front_value['page'])) {
foreach ($front_value['page'] as $multipage) {
if ($current_setting == $multipage['page']) {
$type_selected = TRUE;
$not_other = TRUE;
}
}
} else {
if ($current_setting == $front_value['page']) {
$type_selected = TRUE;
$not_other = TRUE;
}
}
$text .= "<tr><td class='forumheader3'>";
$text .= $rs -> form_radio('frontpage', $front_key, $type_selected);
$text .= "</td>";
if (is_array($front_value['page'])) {
$text .= "<td style='width: 50%' class='forumheader3'>".$front_value['title']."</td>";
$text .= "<td style='width: 50%' class='forumheader3'>";
$text .= $rs -> form_select_open('multipage['.$front_key.']');
$type = isset($pref['frontpage']['all']) ? 'all' : $_POST['class'];
foreach ($front_value['page'] as $multipage_key => $multipage_value) {
$sub_selected = ($pref['frontpage'][$type] == $multipage_value['page']) ? TRUE : FALSE;
$text .= $rs -> form_option($multipage_value['title'], $sub_selected, $multipage_key);
}
$text .= $rs -> form_select_close();
$text .= "</td>";
} else {
$text .= "<td style='width: 100%' colspan='2' class='forumheader3'>".$front_value['title']."</td>";
}
$text .= "</tr>";
}
$text .= "<tr>
<td class='forumheader3'>".$rs -> form_radio('frontpage', 'other', (!$not_other ? TRUE : FALSE))."</td>
<td style='width: 50%' class='forumheader3'>".FRTLAN_15."</td>
<td style='width: 50%' class='forumheader3'>
".$rs -> form_text('other_page', 50, (!$not_other ? $current_setting : ''))."
</td>
</tr>";
$text .= "<tr style='vertical-align:top'>
<td colspan='3' style='text-align: center' class='forumheader'>";
$text .= $rs -> form_hidden('type', $_POST['type']);
$text .= $rs -> form_hidden('class', $_POST['class']);
$text .= $rs -> form_button('submit', 'updatesettings', FRTLAN_12);
$text .= "</td>
</tr>
</table>
</form>
</div>";
$ns -> tablerender(FRTLAN_13, $text);
}
}
require_once('footer.php');
?>

336
e107_admin/header.php Normal file
View File

@@ -0,0 +1,336 @@
<?php
/*
+---------------------------------------------------------------+
| e107 website system
| /e107_admin/header.php
|
| <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_admin/header.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:22 $
| $Author: mcfly_e107 $
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
define("ADMIN_AREA",TRUE);
define("USER_AREA",FALSE);
// send the charset to the browser - overides spurious server settings with the lan pack settings.
header("Content-type: text/html; charset=".CHARSET, true);
require_once(e_ADMIN.'ad_links.php');
echo defined('STANDARDS_MODE') ? "" :
"<?xml version='1.0' encoding='".CHARSET."' ?>";
if (file_exists(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_header.php')) {
@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_header.php");
} else {
@include_once(e_LANGUAGEDIR."English/admin/lan_header.php");
}
if (file_exists(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_footer.php')) {
@include_once(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_footer.php');
} else {
@include_once(e_LANGUAGEDIR.'English/admin/lan_footer.php');
}
if (!defined('ADMIN_WIDTH')) {
define('ADMIN_WIDTH', 'width: 95%');
}
if (!defined('ADMIN_TRUE_ICON'))
{
define("ADMIN_TRUE_ICON", "<img src='".e_IMAGE_ABS."fileinspector/integrity_pass.png' alt='' style='border:0px; height:16px; width:16px' />");
define("ADMIN_TRUE_ICON_PATH", e_IMAGE."fileinspector/integrity_pass.png");
}
if (!defined('ADMIN_FALSE_ICON'))
{
define("ADMIN_FALSE_ICON", "<img src='".e_IMAGE_ABS."fileinspector/integrity_fail.png' alt='' style='border:0px; height:16px; width:16px' />");
define("ADMIN_FALSE_ICON_PATH", e_IMAGE."fileinspector/integrity_fail.png");
}
if (!defined('ADMIN_EDIT_ICON'))
{
define("ADMIN_EDIT_ICON", "<img src='".e_IMAGE_ABS."admin_images/edit_16.png' alt='' title='".LAN_EDIT."' style='border:0px; height:16px; width:16px' />");
define("ADMIN_EDIT_ICON_PATH", e_IMAGE."admin_images/edit_16.png");
}
if (!defined('ADMIN_DELETE_ICON'))
{
define("ADMIN_DELETE_ICON", "<img src='".e_IMAGE_ABS."admin_images/delete_16.png' alt='' title='".LAN_DELETE."' style='border:0px; height:16px; width:16px' />");
define("ADMIN_DELETE_ICON_PATH", e_IMAGE."admin_images/delete_16.png");
}
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
<html xmlns='http://www.w3.org/1999/xhtml'".(defined("TEXTDIRECTION") ? " dir='".TEXTDIRECTION."'" : "").(defined("CORE_LC") ? " xml:lang=\"".CORE_LC."\"" : "").">
<head>
<title>".SITENAME." : ".LAN_head_4."</title>\n";
echo "<meta http-equiv='content-type' content='text/html; charset=".CHARSET."' />
<meta http-equiv='content-style-type' content='text/css' />\n";
if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE && isset($pref['admincss']) && $pref['admincss'] && file_exists(THEME.$pref['admincss'])) {
$css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? THEME_ABS.'admin_'.$pref['admincss'] : THEME_ABS.$pref['admincss'];
echo "<link rel='stylesheet' href='".$css_file."' type='text/css' />\n";
} else if (isset($pref['themecss']) && $pref['themecss'] && file_exists(THEME.$pref['themecss'])) {
$css_file = file_exists(THEME.'admin_'.$pref['themecss']) ? THEME_ABS.'admin_'.$pref['themecss'] : THEME_ABS.$pref['themecss'];
echo "<link rel='stylesheet' href='".$css_file."' type='text/css' />\n";
} else {
$css_file = file_exists(THEME.'admin_style.css') ? THEME_ABS.'admin_style.css' : THEME_ABS.'style.css';
echo "<link rel='stylesheet' href='".$css_file."' type='text/css' />\n";
}
if (!isset($no_core_css) || !$no_core_css) {
echo "<link rel='stylesheet' href='".e_FILE_ABS."e107.css' type='text/css' />\n";
}
// ---------- Favicon ---------
if (file_exists(THEME."favicon.ico")) {
echo "<link rel='icon' href='".THEME_ABS."favicon.ico' type='image/x-icon' />\n<link rel='shortcut icon' href='".THEME_ABS."favicon.ico' type='image/xicon' />\n";
}elseif (file_exists(e_BASE."favicon.ico")) {
echo "<link rel='icon' href='".SITEURL."favicon.ico' type='image/x-icon' />\n<link rel='shortcut icon' href='".SITEURL."favicon.ico' type='image/xicon' />\n";
}
if (function_exists('theme_head')) {
echo theme_head();
}
if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE) {
echo "<script type='text/javascript' src='".e_FILE_ABS."e107.js'></script>\n";
}
if (file_exists(THEME."theme.js")) {
echo "<script type='text/javascript' src='".THEME_ABS."theme.js'></script>\n";
}
if (filesize(e_FILE.'user.js')) {
echo "<script type='text/javascript' src='".e_FILE_ABS."user.js'></script>\n";
}
if (function_exists("headerjs")) {
echo headerjs();
}
if (isset($htmlarea_js) && $htmlarea_js) {
echo $htmlarea_js;
}
if (strpos(e_SELF, 'fileinspector.php') === FALSE) {
echo "<script type='text/javascript'>
<!--
function savepreset(ps,pid){
if(confirm('".$tp->toJS(LAN_PRESET_CONFIRMSAVE)."'))
{
document.getElementById(ps).action='".e_SELF."?savepreset.'+pid;
document.getElementById(ps).submit();
}
}
//-->
</script>\n";
}
if (isset($eplug_js) && $eplug_js) {
echo "<script type='text/javascript' src='{$eplug_js}'></script>\n";
}
if (isset($eplug_css) && $eplug_css) {
echo "\n<link rel='stylesheet' href='{$eplug_css}' type='text/css' />\n";
}
if(check_class($pref['post_html']) && $pref['wysiwyg'] && $e_wysiwyg == TRUE){
require_once(e_HANDLER."tiny_mce/wysiwyg.php");
echo wysiwyg($e_wysiwyg);
define("e_WYSIWYG",TRUE);
}else{
define("e_WYSIWYG",FALSE);
}
// load plugin header-data.
foreach($pref['e_meta_list'] as $val)
{
if(is_readable(e_PLUGIN.$val."/e_meta.php"))
{
require_once(e_PLUGIN.$val."/e_meta.php");
}
}
echo "</head>
<body>\n";
$ns = new e107table;
$e107_var = array();
if (!function_exists('show_admin_menu')) {
function show_admin_menu($title, $active_page, $e107_vars, $js = FALSE, $sub_link = FALSE, $sortlist = FALSE) {
global $ns, $BUTTON, $BUTTON_OVER, $BUTTONS_START, $BUTTONS_END, $SUB_BUTTON, $SUB_BUTTON_OVER, $SUB_BUTTONS_START, $SUB_BUTTONS_END;
$id_title = "yop_".str_replace(" ", "", $title);
if (!isset($BUTTONS_START)) {
$BUTTONS_START = "<div style='text-align:center; width:100%'><table class='fborder' style='width:98%;'>\n";
}
if (!isset($BUTTON)) {
$BUTTON = "<tr><td class='button'><div style='width:100%; text-align:center'><a style='cursor:hand; cursor:pointer; text-decoration:none;' {ONCLICK} >{LINK_TEXT}</a></div></td></tr>\n";
}
if (!isset($BUTTON_OVER)) {
$BUTTON_OVER = "<tr><td class='button'><div style='width:100%; text-align:center'><a style='cursor:hand; cursor:pointer; text-decoration:none;' {ONCLICK} ><b>&laquo;&nbsp;{LINK_TEXT}&nbsp;&raquo;</b></a></div></td></tr>\n";
}
if (!isset($BUTTONS_END)) {
$BUTTONS_END = "</table></div>\n";
}
if (!isset($SUB_BUTTON)) {
$SUB_BUTTON = "<a style='text-decoration:none;' href='{LINK_URL}'>{LINK_TEXT}</a><br />";
}
if (!isset($SUB_BUTTON_OVER)) {
$SUB_BUTTON_OVER = "<b> &laquo; <a style='text-decoration:none;' href='{LINK_URL}'>{LINK_TEXT}</a> &raquo; </b><br />";
}
if (!isset($SUB_BUTTONS_START)) {
$SUB_BUTTONS_START = "<div style='text-align:center; width:100%'><table class='fborder' style='width:98%;'>
<tr><td class='button'><a style='text-align:center; cursor:hand; cursor:pointer; text-decoration:none;'
onclick=\"expandit('{SUB_HEAD_ID}');\" >{SUB_HEAD}</a></td></tr>
<tr id='{SUB_HEAD_ID}' style='display: none' ><td class='forumheader3' style='text-align:left;'>";
}
if (!isset($SUB_BUTTONS_END)) {
$SUB_BUTTONS_END = "</td></tr></table></div>";
}
if ($sortlist == TRUE) {
$temp = $e107_vars;
unset($e107_vars);
foreach (array_keys($temp) as $key) {
$func_list[] = $temp[$key]['text'];
}
usort($func_list, 'strcoll');
foreach ($func_list as $func_text) {
foreach (array_keys($temp) as $key) {
if ($temp[$key]['text'] == $func_text) {
$e107_vars[] = $temp[$key];
}
}
}
}
$search[0] = "/\{LINK_TEXT\}(.*?)/si";
$search[1] = "/\{LINK_URL\}(.*?)/si";
$search[2] = "/\{ONCLICK\}(.*?)/si";
$search[3] = "/\{SUB_HEAD\}(.*?)/si";
$search[4] = "/\{SUB_HEAD_ID\}(.*?)/si";
if ($sub_link) {
$replace[0] = '';
$replace[1] = '';
$replace[2] = '';
$replace[3] = $title;
$replace[4] = $id_title;
$text = preg_replace($search, $replace, $SUB_BUTTONS_START);
} else {
$text = $BUTTONS_START;
}
foreach (array_keys($e107_vars) as $act) {
if (!isset($e107_vars[$act]['perm']) || !$e107_vars[$act]['perm'] || getperms($e107_vars[$act]['perm'])) {
if ($active_page == $act || (str_replace("?", "", e_PAGE.e_QUERY) == str_replace("?", "", $act))) {
$BUTTON_TEMPLATE = $sub_link ? $SUB_BUTTON_OVER : $BUTTON_OVER;
} else {
$BUTTON_TEMPLATE = $sub_link ? $SUB_BUTTON : $BUTTON;
}
$replace[0] = str_replace(" ", "&nbsp;", $e107_vars[$act]['text']);
$replace[1] = $e107_vars[$act]['link'];
if ($e107_vars[$act]['include']!='') {
$replace[2] = $e107_vars[$act]['include'];
} else {
$replace[2] = $js ? "onclick=\"showhideit('".$act."');\"" : "onclick=\"document.location='".$e107_vars[$act]['link']."'; disabled=true;\"";
}
$replace[3] = $title;
$replace[4] = $id_title;
$text .= preg_replace($search, $replace, $BUTTON_TEMPLATE);
}
}
$text .= $sub_link ? $SUB_BUTTONS_END : $BUTTONS_END;
if ($title == "" || $sub_link) {
return $text;
} else {
$ns -> tablerender($title, $text, array('id' => $id_title, 'style' => 'button_menu'));
}
}
}
if (file_exists(THEME.'admin_template.php')) {
require_once(THEME.'admin_template.php');
} else {
require_once(e_BASE.$THEMES_DIRECTORY.'templates/admin_template.php');
}
if (!function_exists("parse_admin")) {
function parse_admin($ADMINLAYOUT) {
global $tp;
$adtmp = explode("\n", $ADMINLAYOUT);
for ($a = 0; $a < count($adtmp); $a++) {
if (preg_match("/{.+?}/", $adtmp[$a])) {
echo $tp->parseTemplate($adtmp[$a]);
} else {
echo $adtmp[$a];
}
}
}
}
function admin_update($update, $type = 'update', $success = false, $failed = false) {
global $ns;
if (($type == 'update' && $update) || ($type == 'insert' && $update !== false)) {
$caption = LAN_UPDATE;
$text = "<b>".($success ? $success : LAN_UPDATED)."</b>";
} else if ($type == 'delete' && $update) {
$caption = LAN_DELETE;
$text = "<b>".($success ? $success : LAN_DELETED)."</b>";
} else if (!mysql_errno()) {
if ($type == 'update') {
$caption = LAN_UPDATED_FAILED;
$text = "<b>".LAN_NO_CHANGE."<br />".LAN_TRY_AGAIN."</b>";
} else if ($type == 'delete') {
$caption = LAN_DELETE;
$text = "<b>".LAN_DELETED_FAILED.".<br />".LAN_TRY_AGAIN."</b>";
}
} else {
$caption = LAN_UPDATED_FAILED;
$text = "<b>".($failed ? $failed : LAN_UPDATED_FAILED." - ".LAN_TRY_AGAIN)."</b><br />".LAN_ERROR." ".mysql_errno().": ".mysql_error();
}
$ns -> tablerender($caption, "<div style='text-align:center'>".$text."</div>");
return $update;
}
function admin_purge_related($table, $id)
{
global $ns, $tp;
$msg = "";
$tp->parseTemplate("");
// Delete any related comments
require_once(e_HANDLER."comment_class.php");
$_com = new comment;
$num = $_com->delete_comments($table, $id);
if($num)
{
$msg .= $num." ".ADLAN_114." ".LAN_DELETED."<br />";
}
// Delete any related ratings
require_once(e_HANDLER."rate_class.php");
$_rate = new rater;
$num = $_rate->delete_ratings($table, $id);
if($num)
{
$msg .= LAN_RATING." ".LAN_DELETED."<br />";
}
if($msg)
{
$ns->tablerender(LAN_DELETE, $msg);
}
}
if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE) {
parse_admin($ADMIN_HEADER);
}
?>

385
e107_admin/image.php Normal file
View File

@@ -0,0 +1,385 @@
<?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_admin/image.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:23 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("A")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'image';
require_once("auth.php");
require_once(e_HANDLER."form_handler.php");
require_once(e_HANDLER."userclass_class.php");
$rs = new form;
if (isset($_POST['delete'])) {
$image = $_POST['filename'];
@unlink(e_FILE."public/avatars/".$image);
$sql->db_Update("user", "user_image='' WHERE user_image='-upload-$image'");
$sql->db_Update("user", "user_sess='' WHERE user_sess='$image'");
$message = $image." ".IMALAN_28;
}
if (isset($_POST['deleteall'])) {
$handle = opendir(e_FILE."public/avatars/");
while ($file = readdir($handle)) {
if ($file != '.' && $file != '..' && $file != "index.html" && $file != "null.txt" && $file != '/' && $file != 'CVS' && $file != 'Thumbs.db') {
$dirlist[] = $file;
}
}
closedir($handle);
$count = 0;
while (list($key, $image_name) = each($dirlist)) {
if (!$sql->db_Select("user", "*", "user_image='-upload-$image_name' OR user_sess='$image_name'")) {
unlink(e_FILE."public/avatars/".$image_name);
$count ++;
}
}
$message = $count." ".IMALAN_26;
}
if (isset($_POST['avdelete'])) {
require_once(e_HANDLER."avatar_handler.php");
foreach($_POST['avdelete'] as $key => $val)
{
$key = $tp->toDB($key); // We only need the key
if ($sql->db_Select("user", "*", "user_id='$key'")) {
$row = $sql->db_Fetch();
extract($row);
$avname=avatar($user_image);
if (strpos($avname,"http://")===FALSE)
{ // Internal file, so unlink it
@unlink($avname);
}
$sql->db_Update("user","user_image='' WHERE user_id='$key'");
$message = IMALAN_51.$user_name." ".IMALAN_28;
}
}
$_POST['check_avatar_sizes'] = TRUE; // Force size recheck after doing one or more deletes
}
if (isset($_POST['update_options'])) {
$pref['image_post'] = $_POST['image_post'];
$pref['resize_method'] = $_POST['resize_method'];
$pref['im_path'] = $tp->toDB($_POST['im_path']);
$pref['image_post_class'] = $_POST['image_post_class'];
$pref['image_post_disabled_method'] = $_POST['image_post_disabled_method'];
$pref['enable_png_image_fix'] = $_POST['enable_png_image_fix'];
save_prefs();
$message = IMALAN_9;
}
if (isset($message)) {
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
if (isset($_POST['show_avatars'])) {
$handle = opendir(e_FILE."public/avatars/");
while ($file = readdir($handle)) {
if ($file != '.' && $file != '..' && $file != "index.html" && $file != "null.txt" && $file != '/' && $file != 'CVS' && $file != 'Thumbs.db' && !is_dir($file)) {
$dirlist[] = $file;
}
}
closedir($handle);
$text = "<div style='text-align:center'>\n";
if (!is_array($dirlist)) {
$text .= IMALAN_29;
} else {
while (list($key, $image_name) = each($dirlist)) {
$users = IMALAN_21." | ";
if ($sql->db_Select("user", "*", "user_image='-upload-$image_name' OR user_sess='$image_name'")) {
while ($row = $sql->db_Fetch()) {
extract($row);
$users .= "<a href='".e_BASE."user.php?id.$user_id'>$user_name</a> <span class='smalltext'>(".($user_sess == $image_name ? IMALAN_24 : IMALAN_23).")</span> | ";
}
} else {
$users = IMALAN_22;
}
$text .= "<div class='spacer'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='fcaption'>$image_name</td>
</tr>
<tr>
<td class='forumheader3'><img src='".e_FILE."public/avatars/".$image_name."' alt='' /><br />
<input type='hidden' name='filename' value='".$image_name."' />
<input class='button' type='submit' name='delete' value='".LAN_DELETE."' />
</td>
</tr>
<tr>
<td class='forumheader3'>$users</td>
</tr>
</table>
</form>
</div>";
}
$text .= "<div class='spacer'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='forumheader'>
<input class='button' type='submit' name='deleteall' value='".IMALAN_25."' />
</td>
</tr>
</table>
</form>
</div>";
}
$text .= "</div>";
$ns->tablerender(IMALAN_18, $text);
}
if (isset($_POST['check_avatar_sizes'])) {
//
// Set up to track what we've done
//
$iUserCount = 0;
$iAVinternal = 0;
$iAVexternal = 0;
$iAVnotfound = 0;
$iAVtoobig = 0;
require_once(e_HANDLER."avatar_handler.php");
$text = "<div style='text-align:center'>\n";
$text .= "<div class='spacer'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='forumheader3'>".$pref['im_width']."</td>
<td class='forumheader3'>".IMALAN_38."</td>
</tr>
<tr>
<td class='forumheader3'>".$pref['im_height']."</td>
<td class='forumheader3'>".IMALAN_39."</td>
</tr>";
//
// Loop through avatar field for every user
//
$iUserCount = $sql->db_Count("user");
if ($sql->db_Select("user", "*", "user_image!=''")) {
while ($row = $sql->db_Fetch()) {
extract($row);
//
// Check size
//
$avname=avatar($user_image);
if (strpos($avname,"http://")!==FALSE)
{
$iAVexternal++;
$bAVext=TRUE;
} else {
$iAVinternal++;
$bAVext=FALSE;
}
$image_stats = getimagesize($avname);
$sBadImage="";
if (!$image_stats)
{
$iAVnotfound++;
// allow delete
$sBadImage=IMALAN_42;
} else {
$imageWidth = $image_stats[0];
$imageHeight = $image_stats[1];
if ( ($imageHeight > $pref['im_height']) || ($imageWidth>$pref['im_width']) )
{ // Too tall or too wide
$iAVtoobig++;
if ($imageWidth > $pref['im_width']) {
$sBadImage = IMALAN_40." ($imageWidth)";
}
if ($imageHeight > $pref['im_height']) {
if (strlen($sBadImage))
{
$sBadImage .= ", ";
}
$sBadImage .= IMALAN_41." ($imageHeight)";
}
}
}
//
// If not found or too big, allow delete
//
if (strlen($sBadImage))
{
$sBadImage .=" [".$avname."]"; // Show all files that have a problem
$text .= "
<tr>
<td class='forumheader3'>
<input class='button' type='submit' name='avdelete[$user_id]' value='".($bAVext ? IMALAN_44 : IMALAN_43)."' />
</td>
<td class='forumheader3'>".IMALAN_51."<a href='".e_BASE."user.php?id.".$user_id."'>".$user_name."</a> ".$sBadImage."</td>
</tr>";
}
}
}
//
// Done, so show stats
//
$text .= "
<tr>
<td class='forumheader3'>".$iAVnotfound."</td>
<td class='forumheader3'>".IMALAN_45."</td>
</tr>
<tr>
<td class='forumheader3'>".$iAVtoobig."</td>
<td class='forumheader3'>".IMALAN_46."</td>
</tr>
<tr>
<td class='forumheader3'>".$iAVinternal."</td>
<td class='forumheader3'>".IMALAN_47."</td>
</tr>
<tr>
<td class='forumheader3'>".$iAVexternal."</td>
<td class='forumheader3'>".IMALAN_48."</td>
</tr>
<tr>
<td class='forumheader3'>".($iAVexternal+$iAVinternal)." (".(int)(100.0*(($iAVexternal+$iAVinternal)/$iUserCount)).'%, '.$iUserCount." ".IMALAN_50.")</td>
<td class='forumheader3'>".IMALAN_49."</td>
</tr>
</table>
</form>
</div>";
$text .= "</div>";
$ns->tablerender(IMALAN_37, $text);
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:75%' class='forumheader3'>
".IMALAN_1."<br />
<span class='smalltext'>".IMALAN_2."</span>
</td>
<td style='width:25%;text-align:center' class='forumheader3' >". ($pref['image_post'] ? "<input type='checkbox' name='image_post' value='1' checked='checked' />" : "<input type='checkbox' name='image_post' value='1' />")."
</td>
</tr>
<tr>
<td style='width:75%' class='forumheader3'>
".IMALAN_10."<br />
<span class='smalltext'>".IMALAN_11."</span>
</td>
<td style='width:25%;text-align:center' class='forumheader3' >
<select class='tbox' name='image_post_class'>
<option value='".e_UC_PUBLIC."'".($pref['image_post_class'] == e_UC_PUBLIC ? " selected='selected'" : "").">".IMALAN_30."</option>
<option value='".e_UC_GUEST."'".($pref['image_post_class'] == e_UC_GUEST ? " selected='selected'" : "").">".IMALAN_31."</option>
<option value='".e_UC_MEMBER."'".($pref['image_post_class'] == e_UC_MEMBER ? " selected='selected'" : "").">".IMALAN_32."</option>
<option value='".e_UC_ADMIN."'".($pref['image_post_class'] == e_UC_ADMIN ? " selected='selected'" : "").">".IMALAN_33."</option>\n";
if ($sql->db_Select("userclass_classes")) {
while ($row = $sql->db_Fetch()) {
extract($row);
$text .= "<option value='".$userclass_id."'".($pref['image_post_class'] == $userclass_id ? " selected='selected'" : "").">$userclass_name</option>\n";
}
}
$text .= "</select>
</td>
</tr>
<tr>
<td style='width:75%' class='forumheader3'>
".IMALAN_12."<br />
<span class='smalltext'>".IMALAN_13."</span>
</td>
<td style='width:25%;text-align:center' class='forumheader3' >
<select name='image_post_disabled_method' class='tbox'>". ($pref['image_post_disabled_method'] == "0" ? "<option value='1' selected='selected'>".IMALAN_14."</option>" : "<option value='0'>".IMALAN_14."</option>"). ($pref['image_post_disabled_method'] == "1" ? "<option value='1' selected='selected'>".IMALAN_15."</option>" : "<option value='1'>".IMALAN_15."</option>")."
</select></td>
</tr>
<tr>
<td style='width:75%' class='forumheader3'>".IMALAN_3."<br /><span class='smalltext'>".IMALAN_4."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' >
<select name='resize_method' class='tbox'>". ($pref['resize_method'] == "gd1" ? "<option selected='selected'>gd1</option>" : "<option>gd1</option>"). ($pref['resize_method'] == "gd2" ? "<option selected='selected'>gd2</option>" : "<option>gd2</option>"). ($pref['resize_method'] == "ImageMagick" ? "<option selected='selected'>ImageMagick</option>" : "<option>ImageMagick</option>")."
</select>
</td>
</tr>
<tr>
<td style='width:75%' class='forumheader3'>".IMALAN_5."<br /><span class='smalltext'>".IMALAN_6."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' >
<input class='tbox' type='text' name='im_path' size='40' value=\"".$pref['im_path']."\" maxlength='200' />
</td></tr>
<tr>
<td style='width:75%' class='forumheader3'>".IMALAN_34."<br />
<span class='smalltext'>".IMALAN_35."</span>
</td>
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['enable_png_image_fix'] ? "<input type='checkbox' name='enable_png_image_fix' value='1' checked='checked' />" : "<input type='checkbox' name='enable_png_image_fix' value='1' />")."
</td>
</tr>
<tr>
<td style='width:75%' class='forumheader3'>".IMALAN_16."</td>
<td style='width:25%;text-align:center' class='forumheader3' >
<input class='button' type='submit' name='show_avatars' value='".IMALAN_17."' />
</td></tr>
<tr>
<td style='width:75%' class='forumheader3'>".IMALAN_36."</td>
<td style='width:25%;text-align:center' class='forumheader3' >
<input class='button' type='submit' name='check_avatar_sizes' value='".IMALAN_17."' />
</td></tr>
<tr>
<td colspan='2' style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='update_options' value='".IMALAN_8."' />
</td>
</tr>
</table></form></div>";
$ns->tablerender(IMALAN_7, $text);
require_once("footer.php");
$pref['resize_method'] = $_POST['resize_method'];
$pref['im_path'] = $_POST['im_path'];
?>

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_admin/includes/beginner.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:32 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
if($_GET['mode'] == "e_advanced"){
$pref['adminstyle'] = "classis";
save_prefs();
Header("Location:". e_ADMIN."admin.php");
}
$buts = "";
$text = "<div style='text-align:center;vertical-align:middle'><br /><br />
<table style='".ADMIN_WIDTH.";margin-top:auto;margin-bottom:auto' >";
// $newarray[28] = array(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", 2, E_16_PLUGMANAGER, E_32_PLUGMANAGER);
$selection = array(22,12,17,25,5,19,7,23,28,26);
// $selection = array(21,11,17,24,5,19,7,27,28,25);
foreach($selection as $id)
{
$buts .= render_links($newarray[$id][0],$newarray[$id][1],$newarray[$id][2],$newarray[$id][3],$newarray[$id][6],'beginner');
}
$text .= $buts;
$text .= render_clean();
$text .= "\n</table><br /></div>";
$text .= "<div class='smalltext' style='text-align:center'>".ADLAN_144." <a href='".e_SELF."?mode=e_advanced' >".ADLAN_145."</a>&nbsp;&nbsp;</div>";
if($buts != '')
{
$ns->tablerender(ADLAN_47." ".ADMINNAME, $text);
}
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_32_PLUGMANAGER, "classis");
if ($sql->db_Select("plugin", "*", "plugin_installflag=1"))
{
while ($row = $sql->db_Fetch())
{
extract($row);
include(e_PLUGIN.$plugin_path."/plugin.php");
if ($eplug_conffile)
{
$eplug_name = $tp->toHTML($eplug_name,FALSE,"defs emotes_off");
$plugin_icon = $eplug_icon ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
}
unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon);
}
}
ksort($plugin_array, SORT_STRING);
foreach ($plugin_array as $plug_key => $plug_value)
{
$text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'classis');
}
$text .= render_clean();
$text .= "</table></div>";
$ns->tablerender(ADLAN_CL_7, $text);
?>

View File

@@ -0,0 +1,59 @@
<?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_admin/includes/cascade.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:32 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
$text = "<div style='text-align:center'>
<table class='fborder' style='".ADMIN_WIDTH."'>";
while (list($key, $funcinfo) = each($newarray)) {
$text .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'adminb');
}
$text .= "<tr>
<td class='fcaption' colspan='5'>
".ADLAN_CL_7."
</td>
</tr>";
$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'adminb');
if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
while ($row = $sql->db_Fetch()) {
extract($row);
include(e_PLUGIN.$plugin_path."/plugin.php");
if ($eplug_conffile) {
$eplug_name = $tp->toHTML($eplug_name,FALSE,"defs emotes_off");
$plugin_icon = $eplug_icon_small ? "<img src='".e_PLUGIN.$eplug_icon_small."' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />" : E_16_PLUGIN;
$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
}
unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
}
}
ksort($plugin_array, SORT_STRING);
foreach ($plugin_array as $plug_key => $plug_value) {
$text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'adminb');
}
$text .= "</table></div>";
$ns->tablerender(ADLAN_47." ".ADMINNAME, $text);
?>

View File

@@ -0,0 +1,83 @@
<?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_admin/includes/categories.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:32 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
$text = "<div style='text-align:center'>
<table class='fborder' style='".ADMIN_WIDTH."'>";
foreach ($admin_cat['id'] as $cat_key => $cat_id) {
$text_check = FALSE;
$text_cat = "<tr><td class='fcaption' colspan='2'>".$admin_cat['title'][$cat_key]."</td></tr>
<tr><td class='forumheader3' style='text-align: center; vertical-align: middle; width: 72px; height: 48px'>".$admin_cat['lrg_img'][$cat_key]."</td><td class='forumheader3'>
<table style='width:100%'>";
if ($cat_key != 5) {
foreach ($newarray as $key => $funcinfo) {
if ($funcinfo[4] == $cat_key) {
$text_rend = render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default');
if ($text_rend) {
$text_check = TRUE;
}
$text_cat .= $text_rend;
}
}
} else {
$text_rend = render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'default');
if ($text_rend) {
$text_check = TRUE;
}
$text_cat .= $text_rend;
if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
while ($row = $sql->db_Fetch()) {
extract($row);
include(e_PLUGIN.$plugin_path."/plugin.php");
if ($eplug_conffile) {
$eplug_name = $tp->toHTML($eplug_name,FALSE,"defs emotes_off");
$plugin_icon = $eplug_icon_small ? "<img src='".e_PLUGIN.$eplug_icon_small."' alt='".$eplug_caption."' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />" : E_16_PLUGIN;
$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
//$text_rend = render_links(e_PLUGIN.$plugin_path."/".$eplug_conffile, $eplug_name, $eplug_caption, "P".$plugin_id, $plugin_icon, 'default');
if ($plugin_array[0]) {
$text_check = TRUE;
}
//$text_cat .= $text_rend;
}
unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
}
}
ksort($plugin_array, SORT_STRING);
foreach ($plugin_array as $plug_key => $plug_value) {
$text_cat .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'default');
}
}
$text_cat .= render_clean();
$text_cat .= "</table>
</td></tr>";
if ($text_check) {
$text .= $text_cat;
}
}
$text .= "</table></div>";
$ns->tablerender(ADLAN_47." ".ADMINNAME, $text);
echo admin_info();
?>

View File

@@ -0,0 +1,66 @@
<?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_admin/includes/classis.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:32 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
$buts = "";
while (list($key, $funcinfo) = each($newarray))
{
$buts .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], "classis");
}
if($buts != "")
{
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
$text .= $buts;
$text .= render_clean();
$text .= "</table></div>";
$ns->tablerender(ADLAN_47." ".ADMINNAME, $text);
}
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_32_PLUGMANAGER, "classis");
if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
while ($row = $sql->db_Fetch()) {
extract($row);
include(e_PLUGIN.$plugin_path."/plugin.php");
if ($eplug_conffile) {
$eplug_name = $tp->toHTML($eplug_name,FALSE,"defs emotes_off");
$plugin_icon = $eplug_icon ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
}
unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon);
}
}
ksort($plugin_array, SORT_STRING);
foreach ($plugin_array as $plug_key => $plug_value) {
$text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'classis');
}
$text .= render_clean();
$text .= "</table></div>";
$ns->tablerender(ADLAN_CL_7, $text);
?>

View File

@@ -0,0 +1,70 @@
<?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_admin/includes/combo.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:32 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
$buts = "";
while (list($key, $funcinfo) = each($newarray)) {
$buts .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default');
}
$text .= $buts;
while ($td <= 5) {
$text .= "<td class='td' style='width:20%;' ></td>";
$td++;
}
$td = 1;
$text .= "</tr></table></div>";
if($buts != ""){
$ns->tablerender(ADLAN_47." ".ADMINNAME, $text);
}
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_32_PLUGMANAGER, "classis");
if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
while ($row = $sql->db_Fetch()) {
extract($row);
include(e_PLUGIN.$plugin_path."/plugin.php");
if ($eplug_conffile) {
$eplug_name = $tp->toHTML($eplug_name,FALSE,"defs emotes_off");
$plugin_icon = $eplug_icon ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
}
unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon);
}
}
ksort($plugin_array, SORT_STRING);
foreach ($plugin_array as $plug_key => $plug_value) {
$text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'classis');
}
$text .= render_clean();
$text .= "</table></div>";
$ns->tablerender(ADLAN_CL_7, $text);
echo admin_info();
?>

View File

@@ -0,0 +1,73 @@
<?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_admin/includes/compact.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:32 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
$buts = "";
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
while (list($key, $funcinfo) = each($newarray)) {
$buts .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default');
}
$text .= $buts;
$text_cat = '';
while ($td <= 5) {
$text_cat .= "<td class='td' style='width:20%;' ></td>";
$td++;
}
$td = 1;
$text .= "</tr></table></div>";
if($buts !=""){
$ns->tablerender(ADLAN_47." ".ADMINNAME, $text);
}
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'default');
if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
while ($row = $sql->db_Fetch()) {
extract($row);
include(e_PLUGIN.$plugin_path."/plugin.php");
if ($eplug_conffile) {
$eplug_name = $tp->toHTML($eplug_name,FALSE,"defs emotes_off");
$plugin_icon = $eplug_icon_small ? "<img src='".e_PLUGIN.$eplug_icon_small."' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />" : E_16_PLUGIN;
$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
}
unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
}
}
ksort($plugin_array, SORT_STRING);
foreach ($plugin_array as $plug_key => $plug_value) {
$text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'default');
}
$text .= "</tr>
</table></div>";
$ns->tablerender(ADLAN_CL_7, $text);
echo admin_info();
?>

23
e107_admin/index.php Normal file
View File

@@ -0,0 +1,23 @@
<?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_admin/index.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:23 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
header('Location: admin.php');
exit;
?>

680
e107_admin/lancheck.php Normal file
View File

@@ -0,0 +1,680 @@
<?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_admin/lancheck.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:23 $
| $Author: mcfly_e107 $
| With code from Izydor and Lolo.
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("0")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'language';
require_once("auth.php");
$qry = explode("|",e_QUERY);
$f = $qry[0];
$lan = $qry[1];
$mode = $qry[2];
// Write the language file.
if(isset($_POST['submit']))
{
unset($input);
$kom_start = chr(47)."*";
$kom_end = "*".chr(47);
if($_POST['root'])
{
$writeit = $_POST['root'];
}
$old_kom = "";
$in_kom=0;
$data = file($writeit);
foreach($data as $line)
{
if (strpos($line,$kom_start) !== False && $old_kom == "")
{
$in_kom=1;
}
if ($in_kom) { $old_kom.=$line; }
if (strpos($line,$kom_end) !== False && $in_kom) {$in_kom = 0;}
}
$message = "<div style='text-align:left'><br />";
$input .= chr(60)."?php\n";
if ($old_kom == "")
{
// create CVS compatible description.
$diz = chr(47)."*\n";
$diz .= "+---------------------------------------------------------------+\n";
$diz .= "| e107 website system ".$lan." Language File\n";
$diz .= "| Released under the terms and conditions of the\n";
$diz .= "| GNU General Public License (http://gnu.org).\n";
$diz .= "|\n";
$diz .= "| ".chr(36)."Source: $writeit ".chr(36)."\n";
$diz .= "| ".chr(36)."Revision: 1.0 ".chr(36)."\n";
$diz .= "| ".chr(36)."Date: ".date("Y/m/d H:i:s")." ".chr(36)."\n";
$diz .= "| ".chr(36)."Author: ".USERNAME." ".chr(36)."\n";
$diz .= "+---------------------------------------------------------------+\n";
$diz .= "*".chr(47)."\n\n";
}
else
{
$diz = $old_kom;
}
$input .= $diz;
$message .= str_replace("\n","<br />",$diz);
for ($i=0; $i<count($_POST['newlang']); $i++)
{
$notdef_start = "";
$notdef_end = "\n";
$deflang = (MAGIC_QUOTES_GPC === TRUE) ? stripslashes($_POST['newlang'][$i]) : $_POST['newlang'][$i];
$func = "define";
$quote = chr(34);
if (strpos($_POST['newdef'][$i],"ndef++") !== FALSE )
{
$defvar = str_replace("ndef++","",$_POST['newdef'][$i]);
$notdef_start = "if (!defined(".chr(34).$defvar.chr(34).")) {";
$notdef_end = "}\n";
}
else
{
$defvar = $_POST['newdef'][$i];
}
if($_POST['newdef'][$i] == "LC_ALL" && isset($_POST['root']))
{
$message .= $notdef_start.'setlocale('.htmlentities($defvar).','.$deflang.');<br />'.$notdef_end;
$input .= $notdef_start."setlocale(".$defvar.",".$deflang.");".$notdef_end;
}
else
{
$message .= $notdef_start.$func.'('.$quote.htmlentities($defvar).$quote.',"'.$deflang.'");<br />'.$notdef_end;
$input .= $notdef_start.$func."(".$quote.$defvar.$quote.", ".chr(34).$deflang.chr(34).");".$notdef_end;
}
}
$message .="<br />";
$message .="</div>";
$input .= "\n\n?>";
// Write to file.
$fp = @fopen($writeit,"w");
if(!@fwrite($fp, $input))
{
$caption = LAN_ERROR;
$message = LAN_CHECK_17;
}
else
{
$caption = LAN_SAVED." <b>$lan/".$writeit."</b>";
}
fclose($writeit);
$message .= "<form method='post' action='".e_SELF."' id='select_lang'>
<div style='text-align:center'><br />";
$message .= "<br /><br /><input class='button' type='submit' name='language_sel' value=\"".LAN_BACK."\" />
<input type='hidden' name='language' value='$lan' /></div></form>";
$ns -> tablerender($caption, $message);
require_once(e_ADMIN."footer.php");
exit;
}
// ============================================================================
// Edit the Language File.
if($f != ""){
if (!$mode)
{
$dir1 = e_BASE.$LANGUAGES_DIRECTORY."English/";
$f1=$f;
$dir2 = e_BASE.$LANGUAGES_DIRECTORY.$lan."/";
$f2=$f;
}
else
{
$fullpath_orig = $f;
$fullpath_trans = str_replace("English",$lan,$f);
$f1 = basename($fullpath_orig);
$f2 = basename($fullpath_trans);
$dir1 = dirname($fullpath_orig)."/";
$dir2 = dirname($fullpath_trans)."/";
}
edit_lanfiles($dir1,$dir2,$f1,$f2);
}
// ===========================================================================
$core_plugins = array(
"alt_auth","banner_menu","blogcalendar_menu","calendar_menu","chatbox_menu",
"clock_menu","comment_menu","compliance_menu","content","counter_menu",
"featurebox","forum","gsitemap","integrity_check","lastseen","links_page",
"linkwords","list_new","log","login_menu","newforumposts_main","newsfeed",
"newsletter","online_extended_menu","online_menu","other_news_menu","pdf",
"pm","poll","powered_by_menu","rss_menu","search_menu","sitebutton_menu",
"trackback","tree_menu","userlanguage_menu","usertheme_menu"
);
$core_themes = array("crahan","e107v4a","human_condition","interfectus","jayya",
"khatru","kubrick","lamb","leaf","reline","sebes","vekna_blue");
if(isset($_POST['language_sel']) && isset($_POST['language'])){
$ns -> tablerender(LAN_CHECK_3.": ".$_POST['language'],check_core_lanfiles($_POST['language']));
$ns -> tablerender(LAN_CHECK_3.": ".$_POST['language']."/admin",check_core_lanfiles($_POST['language'],"admin/"));
$plug_text = "<table class='fborder' style='".ADMIN_WIDTH."'>
<tr>
<td class='fcaption'>".LAN_PLUGIN."</td>
<td class='fcaption'>".LAN_CHECK_16."</td>
<td class='fcaption'>".$_POST['language']."</td>
<td class='fcaption'>".LAN_OPTIONS."</tr>";
foreach($core_plugins as $plugs)
{
if(is_readable(e_PLUGIN.$plugs))
{
$plug_text .= check_lanfiles('P',$plugs,"English",$_POST['language']);
}
}
$plug_text .= "</table>";
$ns -> tablerender(ADLAN_CL_7,$plug_text);
$theme_text = "<table class='fborder' style='".ADMIN_WIDTH."'>
<tr>
<td class='fcaption'>Theme</td>
<td class='fcaption'>".LAN_CHECK_16."</td>
<td class='fcaption'>".$_POST['language']."</td>
<td class='fcaption'>".LAN_OPTIONS."</tr>";
foreach($core_themes as $them)
{
if(is_readable(e_THEME.$them))
{
$theme_text .= check_lanfiles('T',$them,"English",$_POST['language']);
}
}
$theme_text .= "</table>";
$ns -> tablerender("Themes",$theme_text);
require_once(e_ADMIN."footer.php");
exit;
}
function check_core_lanfiles($checklan,$subdir=''){
global $lanfiles,$_POST;
$English = get_comp_lan_phrases(e_LANGUAGEDIR."English/".$subdir,$checklan);
$check = get_comp_lan_phrases(e_LANGUAGEDIR.$checklan."/".$subdir,$checklan);
$text .= "<table class='fborder' style='".ADMIN_WIDTH."'>
<tr>
<td class='fcaption'>".LAN_CHECK_16."</td>
<td class='fcaption'>".$_POST['language']." File</td>
<td class='fcaption'>".LAN_OPTIONS."</tr>";
$keys = array_keys($English);
sort($keys);
foreach($keys as $k)
{
if($k != "bom")
{
$lnk = $k;
$k_check = str_replace("English",$checklan,$k);
if(array_key_exists($k,$check))
{
$text .= "<tr><td class='forumheader3' style='width:45%'>{$lnk}</td>";
$subkeys = array_keys($English[$k]);
$er="";
$utf_error = "";
$bomkey = str_replace(".php","",$k_check);
$bom_error = ($check['bom'][$bomkey]) ? "<i>".LAN_CHECK_15."</i><br />" : ""; // illegal chars
foreach($subkeys as $sk)
{
if($utf_error == "" && !is_utf8($check[$k][$sk]))
{
$utf_error = "<i>".LAN_CHECK_19."</i><br />";
}
if($sk == "LC_ALL"){
$check[$k][$sk] = str_replace(chr(34).chr(34),"",$check[$k][$sk]);
}
if((!array_key_exists($sk,$check[$k]) && $English[$k][$sk] != "") || (trim($check[$k][$sk]) == "" && $English[$k][$sk] != ""))
{
$er .= ($er) ? "<br />" : "";
$er .= $sk." ".LAN_CHECK_5;
}
}
$style = ($er) ? "forumheader2" : "forumheader3";
$text .= "<td class='{$style}' style='width:50%'><div class='smalltext'>";
$text .= $bom_error . $utf_error;
$text .= (!$er && !$bom_error && !$utf_error) ? LAN_OK : $er."<br />";
$text .= "</div></td>";
}
else
{
$text .= "<tr>
<td class='forumheader3' style='width:45%'>{$lnk}</td>
<td class='forumheader' style='width:50%'>".LAN_CHECK_4."</td>"; // file missing.
}
// Leave in EDIT button for all entries - to allow re-translation of bad entries.
$subpath = ($subdir!='') ? $subdir.$k : $k;
$text .="<td class='forumheader3' style='width:5%;text-align:center'>
<input class='tbox' type='button' style='width:60px' name='but_$i' value=\"".LAN_EDIT."\" onclick=\"window.location='".e_SELF."?".$subpath."|".$_POST['language']."'\" /> ";
$text .="</td></tr>";
}
}
$text .= "</table>";
return $text;
}
function get_lan_file_phrases($dir1,$dir2,$file1,$file2){
$ret = array();
$fname = $dir1.$file1;
$type='orig';
if(is_file($fname))
{
$data = file($fname);
$ret=$ret + fill_phrases_array($data,$type);
if(substr($data[0],0,5) != "<?php")
{
$key = str_replace(".php","",$fname);
$ret['bom'][$key] = $fname;
}
}
$fname = $dir2.$file2;
$type='tran';
if(is_file($fname))
{
$data = file($fname);
$ret=$ret + fill_phrases_array($data,$type);
if(substr($data[0],0,5) != "<?php")
{
$key = str_replace(".php","",$fname);
$ret['bom'][$key] = $fname;
}
}
return $ret;
}
function get_comp_lan_phrases($comp_dir,$lang,$depth=0)
{
require_once(e_HANDLER."file_class.php");
$fl = new e_file;
$ret = array();
if($lang_array = $fl->get_files($comp_dir, ".php","standard",$depth)){
sort($lang_array);
}
$regexp = (strpos($comp_dir,e_LANGUAGEDIR) !== FALSE) ? "#.php#" : "#".$lang."#";
foreach($lang_array as $f)
{
if(preg_match($regexp,$f['path'].$f['fname']) && is_file($f['path'].$f['fname']))
{
$data = file($f['path'].$f['fname']);
$relpath = str_replace($comp_dir,"",$f['path']);
if(substr($data[0],0,5) != "<?php")
{
$key = str_replace(".php","",$relpath.$f['fname']);
$ret['bom'][$key] = $f['fname'];
}
if($f['path'].$f['fname'] == e_LANGUAGEDIR.$lang."/".$lang.".php")
{
$f['fname'] = "English.php"; // change the key for the main language file.
}
if($f['path'].$f['fname'] == e_LANGUAGEDIR.$lang."/".$lang."_custom.php")
{
$f['fname'] = "English_custom.php"; // change the key for the main language file.
}
$ret=$ret + fill_phrases_array($data,$relpath.$f['fname']);
}
}
return $ret;
}
// for plugins and themes - checkes what kind of language files directory structure we have
function check_lanfiles($mode,$comp_name,$base_lan="English",$target_lan){
global $ns,$sql;
$folder['P'] = e_PLUGIN.$comp_name;
$folder['T'] = e_THEME.$comp_name;
$comp_dir = $folder[$mode];
$baselang = get_comp_lan_phrases($comp_dir."/languages/","English",1);
$check = get_comp_lan_phrases($comp_dir."/languages/",$target_lan,1);
$text = "";
$keys = array_keys($baselang);
sort($keys);
foreach($keys as $k)
{
$lnk = $k;
//echo "klucz ".$k."<br />";
$k_check = str_replace("English",$target_lan,$k);
if(array_key_exists($k_check,$check))
{
$text .= "<tr>
<td class='forumheader3' style='width:20%'>".$comp_name."</td>
<td class='forumheader3' style='width:25%'>".str_replace("English/","",$lnk)."</td>";
$subkeys = array_keys($baselang[$k]);
$er="";
$utf_error = "";
$bomkey = str_replace(".php","",$k_check);
$bom_error = ($check['bom'][$bomkey]) ? "<i>".LAN_CHECK_15."</i><br />" : ""; // illegal chars
foreach($subkeys as $sk)
{
if($utf_error == "" && !is_utf8($check[$k_check][$sk]))
{
$utf_error = "<i>".LAN_CHECK_19."</i><br />";
}
if(!array_key_exists($sk,$check[$k_check]) || (trim($check[$k_check][$sk]) == "" && $baselang[$k][$sk] != ""))
{
$er .= ($er) ? "<br />" : "";
$er .= $sk." ".LAN_CHECK_5;
}
}
$style = ($er) ? "forumheader2" : "forumheader3";
$text .= "<td class='{$style}' style='width:50%'><div class='smalltext'>";
$text .= $bom_error . $utf_error;
$text .= (!$er && !$bom_error && !$utf_error) ? LAN_OK : $er."<br />";
$text .= "</div></td>";
}
else
{
$text .= "<tr>
<td class='forumheader3' style='width:20%'>".$comp_name."</td>
<td class='forumheader3' style='width:25%'>".str_replace("English/","",$lnk)."</td>
<td class='forumheader' style='width:50%'><span style='cursor:pointer' title=\"".str_replace("English",$target_lan,$lnk)."\">".LAN_CHECK_4."</span></td>";
}
$text .="<td class='forumheader3' style='width:5%;text-align:center'>
<input class='tbox' type='button' style='width:60px' name='but_$i' value=\"".LAN_EDIT."\" onclick=\"window.location='".e_SELF."?".$comp_dir."/languages/".$lnk."|".$target_lan."|file'\" /> ";
$text .="</td></tr>";
}
// if (!$known) {$text = LAN_CHECK_18." : --> ".$fname." :: ".$dname;}
return $text;
}
function edit_lanfiles($dir1,$dir2,$f1,$f2){
global $ns,$sql,$lan;
/* echo "<br />dir1 = $dir1";
echo "<br />file1 = $f1";
echo "<br />dir2 = $dir2";
echo "<br />file2 = $f2";*/
if($dir2.$f2 == e_LANGUAGEDIR.$lan."/English.php") // it's a language config file.
{
$f2 = $lan.".php";
$root_file = e_LANGUAGEDIR.$lan."/".$lan.".php";
}
else
{
$root_file = $dir2.$f2;
}
if($dir2.$f2 == e_LANGUAGEDIR.$lan."/English_custom.php") // it's a language config file.
{
$f2 = $lan."_custom.php";
$root_file = e_LANGUAGEDIR.$lan."/".$lan."_custom.php";
}
$writable = (is_writable($dir2)) ? TRUE : FALSE;
$trans = get_lan_file_phrases($dir1,$dir2,$f1,$f2);
$keys = array_keys($trans);
sort($keys);
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?".e_QUERY."' id='transform'>
<table style='".ADMIN_WIDTH."' class='fborder'>";
$subkeys = array_keys($trans['orig']);
foreach($subkeys as $sk)
{
$rowamount = round(strlen($trans['orig'][$sk])/34)+1;
$hglt1=""; $hglt2="";
if ($trans['tran'][$sk] == "" && $trans['orig'][$sk]!="") {
$hglt1="<span style='font-style:italic;font-weight:bold;color:red'>";
$hglt2="</span>";
}
$text .="<tr>
<td class='forumheader3' style='width:10%;vertical-align:top'>".$hglt1.htmlentities($sk).$hglt2."</td>
<td class='forumheader3' style='width:40%;vertical-align:top'>".htmlentities(str_replace("ndef++","",$trans['orig'][$sk])) ."</td>";
$text .= "<td class='forumheader3' style='width:50%;vertical-align:top'>";
$text .= ($writable) ? "<textarea class='tbox' name='newlang[]' rows='$rowamount' cols='45' style='height:100%'>" : "";
$text .= str_replace("ndef++","",$trans['tran'][$sk]);
$text .= ($writable) ? "</textarea>" : "";
//echo "orig --> ".$trans['orig'][$sk]."<br />";
if (strpos($trans['orig'][$sk],"ndef++") !== False)
{
//echo "+orig --> ".$trans['orig'][$sk]." <> ".strpos($trans['orig'][$sk],"ndef++")."<br />";
$text .= "<input type='hidden' name='newdef[]' value='ndef++".$sk."' />";
}
else
{
$text .= "<input type='hidden' name='newdef[]' value='".$sk."' />";
}
$text .="</td></tr>";
}
//Check if directory is writable
if($writable)
{
$text .="<tr style='vertical-align:top'>
<td colspan='3' style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='submit' value=\"".LAN_SAVE." ".str_replace($dir2,"",$root_file)." \" />";
if($root_file)
{
$text .= "<input type='hidden' name='root' value='".$root_file."' />";
}
$text .= "</td></tr>";
}
$text .= "
</table>
</form>
</div>";
$text .= "<form method='post' action='".e_SELF."' id='select_lang'>
<div style='text-align:center'><br />";
$text .= (!$writable) ? "<br />".$dir2.$f2.LAN_NOTWRITABLE : "";
$text .= "<br /><br /><input class='button' type='submit' name='language_sel' value=\"".LAN_BACK."\" />
<input type='hidden' name='language' value='$lan' /></div></form>";
$caption = LAN_CHECK_3." <b>".$dir2.$f2."</b> -> <b>".$lan."</b>";
$ns -> tablerender($caption, $text);
require_once(e_ADMIN."footer.php");
exit;
}
function fill_phrases_array($data,$type) {
$retloc = array();
foreach($data as $line){
//echo "line--> ".$line."<br />";
if (strpos($line,"define(") !== FALSE && strpos($line,");") === FALSE)
{
$indef=1;
$bigline="";
// echo "big1 -->".$line."<br />";
}
if ($indef)
{
$bigline.=str_replace("\n","",$line);
// echo "big2 -->".$line."<br />";
}
if (strpos($line,"define(") === FALSE && strpos($line,");") !== FALSE)
{
$indef=0;
$we_have_bigline=1;
// echo "big3 -->".$line."<br />";
}
if(strpos($line,"setlocale(") !== FALSE)
{
$indef=1;
$we_have_bigline=0;
}
if ((strpos($line,"define(") !== FALSE && strpos($line,");") !== FALSE && substr(ltrim($line),0,2) != "//") || $we_have_bigline || strpos($line,"setlocale(") !== FALSE)
{
if ($we_have_bigline)
{
$we_have_bigline=0;
$line=$bigline;
// echo "big -->".$line."<br />";
}
$ndef = "";
//echo "_ndefline -->".$line."<br />";
if (strpos($line,"defined(") !== FALSE )
{
$ndef = "ndef++";
$line = substr($line,strpos($line,"define("));
}
if(strpos($line,"setlocale(") !== FALSE)
{
$pos = substr(strstr($line,","),1);
$rep = array(");","\n",'""');
$val = str_replace($rep,"",$pos);
$retloc[$type]['LC_ALL']= $val;
$retloc['orig']['LC_ALL']= "'en'";
}
else
{
//echo "ndefline: ".$line."<br />";
if(preg_match("#\"(.*?)\".*?\"(.*)\"#",$line,$matches) ||
preg_match("#\'(.*?)\'.*?\"(.*)\"#",$line,$matches) ||
preg_match("#\"(.*?)\".*?\'(.*)\'#",$line,$matches) ||
preg_match("#\'(.*?)\'.*?\'(.*)\'#",$line,$matches) ||
preg_match("#\((.*?)\,.*?\"(.*)\"#",$line,$matches) ||
preg_match("#\((.*?)\,.*?\'(.*)\'#",$line,$matches)){
//echo "get_lan -->".$matches[1]." :: ".$ndef.$matches[2]."<br />";
$retloc[$type][$matches[1]]= $ndef.$matches[2];
}
}
}
}
return $retloc;
}
function is_utf8($string) {
// From http://w3.org/International/questions/qa-forms-utf-8.html
if(strtolower(CHARSET) != "utf-8" || $string == "")
{
return TRUE;
}
return preg_match('%^(?:
[\x09\x0A\x0D\x20-\x7E]
| [\xC2-\xDF][\x80-\xBF]
| \xE0[\xA0-\xBF][\x80-\xBF]
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}
| \xED[\x80-\x9F][\x80-\xBF]
| \xF0[\x90-\xBF][\x80-\xBF]{2}
| [\xF1-\xF3][\x80-\xBF]{3}
| \xF4[\x80-\x8F][\x80-\xBF]{2}
)*$%xs', $string);
}
function lancheck_adminmenu() {
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_language.php");
global $action,$pref;
if ($action == "") {
$action = "tools";
}
if($action == "modify"){
$action = "db";
}
$var['main']['text'] = LAN_PREFS;
$var['main']['link'] = e_ADMIN."language.php";
if(isset($pref['multilanguage']) && $pref['multilanguage']){
$var['db']['text'] = LANG_LAN_03;
$var['db']['link'] = e_ADMIN."language.php?db";
}
$var['tools']['text'] = ADLAN_CL_6;
$var['tools']['link'] = e_ADMIN."language.php?tools";
show_admin_menu(ADLAN_132, $action, $var);
}
?>

465
e107_admin/language.php Normal file
View File

@@ -0,0 +1,465 @@
<?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_admin/language.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:23 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("ML"))
{
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'language';
require_once("auth.php");
require_once(e_HANDLER."form_handler.php");
$rs = new form;
$tabs = table_list(); // array("news","content","links");
$lanlist = explode(",",e_LANLIST);
$message = "";
if (e_QUERY) {
$tmp = explode('.', e_QUERY);
$action = $tmp[0];
$sub_action = $tmp[1];
$id = $tmp[2];
unset($tmp);
}
if (isset($_POST['submit_prefs']) && isset($_POST['mainsitelanguage'])) {
$pref['multilanguage'] = $_POST['multilanguage'];
if($_POST['multilanguage_subdomain']){
$pref['multilanguage_subdomain'] = ".".$_POST['multilanguage_subdomain'];
}else{
$pref['multilanguage_subdomain'] = "";
}
$pref['sitelanguage'] = $_POST['mainsitelanguage'];
save_prefs();
$ns->tablerender(LAN_SAVED, "<div style='text-align:center'>".LAN_SETSAVED."</div>");
}
// ----------------- delete tables ---------------------------------------------
if (isset($_POST['del_existing']) && $_POST['lang_choices']) {
$lang = strtolower($_POST['lang_choices']);
foreach ($tabs as $del_table) {
if (db_Table_exists($lang."_".$del_table)) {
$qry = "DROP TABLE ".$mySQLprefix."lan_".$lang."_".$del_table;
echo $qry;
$message .= (mysql_query($qry)) ? $_POST['lang_choices']." ".$del_table." deleted<br />" :
$_POST['lang_choices']." $del_table couldn't be deleted<br />";
}
}
global $cachevar;
unset($cachevar['table_list']);
}
// ----------create tables -----------------------------------------------------
if (isset($_POST['create_tables']) && $_POST['language']) {
$table_to_copy = array();
$lang_to_create = array();
foreach ($tabs as $value) {
$lang = strtolower($_POST['language']);
if (isset($_POST[$value])) {
$copdata = ($_POST['copydata_'.$value]) ? 1 : 0;
if (copy_table($value, "lan_".$lang."_".$value, $_POST['drop'],$copdata)) {
$message .= " ".$_POST['language']." ".$value." created<br />";
} else {
$message .= (!$_POST['drop'])? " ".$_POST['language']." ".$value." ".LANG_LAN_00."<br />" : $_POST['language']." ".$value." ".LANG_LAN_01."<br />";
}
} elseif(db_Table_exists($lang."_".$value)) {
if ($_POST['remove']) {
// Remove table.
$message .= (mysql_query("DROP TABLE ".$mySQLprefix."lan_".$lang."_".$value)) ? $_POST['language']." ".$value." ".LAN_DELETED."<br />" : $_POST['language']." $value ".LANG_LAN_02."<br />";
} else {
// leave table.
$message = $_POST['language']." ".$value." was disabled but left intact.";
}
}
}
global $cachevar;
unset($cachevar['table_list']);
}
if(isset($message) && $message){
$ns->tablerender(LAN_OK, $message);
}
unset($text);
if (!e_QUERY || $action == 'main' && !$_POST['language'] && !$_POST['edit_existing']) {
multilang_prefs();
}
if ($action == 'db') {
multilang_db();
}
if($action == "tools"){
show_tools();
}
// Grab Language configuration. ---
if ($_POST['edit_existing']) {
$text .= "
<form method='post' action='".e_SELF."?db' >
<div style='text-align:center'>
<table class='fborder' style='".ADMIN_WIDTH."'>\n";
foreach ($tabs as $table_name) {
$installed = strtolower($_POST['lang_choices'])."_".$table_name;
if (stristr($_POST['lang_choices'], $installed) === FALSE) {
$text .= "<tr>
<td style='width:30%' class='forumheader3'>".ucfirst(str_replace("_", " ", $table_name))."</td>\n
<td style='width:70%' class='forumheader3'>\n";
$selected = (db_Table_exists($installed)) ? "checked='checked'" : "";
$text .= "<input type=\"checkbox\" id='$table_name' name=\"$table_name\" value=\"1\" $selected onclick=\"if(document.getElementById('$table_name').checked){document.getElementById('datacopy_$table_name').style.display = '';} \" />";
$text .= "<span id='datacopy_$table_name' style='display:none'>".LANG_LAN_15."<input type=\"checkbox\" name=\"copydata_$table_name\" value=\"1\" /> </span>";
$text .= "</td></tr>\n";
}
}
$text .= "
<tr><td class='forumheader3' colspan='2'>&nbsp;
<input type='hidden' name='language' value='".$_POST['lang_choices']."' />
</td></tr>";
// ===========================================================================
// Drop tables ?
$text .= "<tr><td class='forumheader3'><b>".LANG_LAN_07."</b></td>
<td class='forumheader3'>".$rs->form_checkbox("drop", 1)."\n
<span class=\"smalltext\" >".LANG_LAN_08."</span></td></tr>\n
<tr>
<td class='forumheader3'><b>".LANG_LAN_10."</b></td>
<td class='forumheader3'>".$rs->form_checkbox("remove", 1)."\n
<span class=\"smalltext\" >".LANG_LAN_11."</span></td>
</tr>
<tr>
<td colspan='2' style='width:100%; text-align: center;' class='forumheader' >";
$button_capt = LANG_LAN_06. " / ". LAN_UPDATE;
$text .="<input type='submit' class='button' name='create_tables' value=\"".$button_capt."\" />";
$text .="</td>
</tr>
</table></div>\n";
$text .= $rs->form_close();
$ns->tablerender($_POST['lang_choices'], $text);
}
require_once(e_ADMIN."footer.php");
// ---------------------------------------------------------------------------
function multilang_prefs() {
global $ns, $pref,$lanlist;
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."' id='linkform'>
<table style='".ADMIN_WIDTH."' class='fborder'>";
$text .= "<tr>
<td style='width:80%' class='forumheader3'>".LANG_LAN_14.": </td>
<td style='width:20%; text-align:center' class='forumheader3'>";
$text .= "
<select name='mainsitelanguage' class='tbox'>\n";
$sellan = preg_replace("/lan_*.php/i", "", $pref['sitelanguage']);
foreach($lanlist as $lan){
$sel = ($lan == $sellan) ? "selected='selected'" : "";
$text .= "<option value='{$lan}' {$sel}>".$lan."</option>\n";
}
$text .= "</select>
</td>
</tr>";
$text .= "
<tr>
<td style='width:80%' class='forumheader3'>".LANG_LAN_12.": </td>
<td style='width:20%;text-align:center' class='forumheader3'>";
$checked = ($pref['multilanguage'] == 1) ? "checked='checked'" : "";
$text .= "<input type='checkbox' name='multilanguage' value='1' $checked />
</td>
</tr>
";
$text .= "
<tr>
<td style='width:80%' class='forumheader3'>".LANG_LAN_18."<br />
<span class='smalltext'>".LANG_LAN_19."<br />".LANG_LAN_20."</span></td>
<td style='width:20%;text-align:center' class='forumheader3'>www.";
$text .= "<input class='tbox' type='text' name='multilanguage_subdomain' value=\"".substr($pref['multilanguage_subdomain'],1)."\" />
</td>
</tr>
";
$text .= "<tr style='vertical-align:top'>
<td colspan='2' style='text-align:center' class='forumheader'>";
$text .= "<input class='button' type='submit' name='submit_prefs' value='".LAN_SAVE."' />";
$text .= "</td>
</tr>
</table>
</form>
</div>";
$caption = LANG_LAN_13; // "Language Preferences";
$ns->tablerender($caption, $text);
}
// ----------------------------------------------------------------------------
function db_Table_exists($table)
{
global $mySQLdefaultdb;
$tables = getcachedvars("table_list");
if(!$tables)
{
$tablist = mysql_list_tables($mySQLdefaultdb);
while($tmp = mysql_fetch_array($tablist))
{
$tables[] = $tmp[0];
}
cachevars("table_list", $tables);
}
return in_array(strtolower(MPREFIX."lan_".$table), $tables);
}
// ----------------------------------------------------------------------------
function copy_table($oldtable, $newtable, $drop = FALSE, $data = FALSE)
{
global $sql;
$old = MPREFIX.strtolower($oldtable);
$new = MPREFIX.strtolower($newtable);
if($drop)
{
$sql->db_Select_gen("DROP TABLE IF EXISTS {$new}");
}
//Get $old table structure
$sql->db_Select_gen('SET SQL_QUOTE_SHOW_CREATE = 1');
$qry = "SHOW CREATE TABLE {$old}";
if($sql->db_Select_gen($qry))
{
$row = $sql->db_Fetch();
$qry = $row[1];
$qry = str_replace($old, $new, $qry);
}
$result = mysql_query($qry);
if(!$result)
{
return FALSE;
}
if ($data) //We need to copy the data too
{
$qry = "INSERT INTO {$new} SELECT * FROM {$old}";
$sql->db_Select_gen($qry);
}
return TRUE;
}
// ----------------------------------------------------------------------------
function table_list() {
// grab default language lists.
global $mySQLdefaultdb;
$exclude[] = "banlist"; $exclude[] = "banner";
$exclude[] = "cache"; $exclude[] = "core";
$exclude[] = "online"; $exclude[] = "parser";
$exclude[] = "plugin"; $exclude[] = "user";
$exclude[] = "upload"; $exclude[] = "userclass_classes";
$exclude[] = "rbinary"; $exclude[] = "session";
$exclude[] = "tmp"; $exclude[] = "flood";
$exclude[] = "stat_info"; $exclude[] = "stat_last";
$exclude[] = "submit_news"; $exclude[] = "rate";
$exclude[] = "stat_counter";$exclude[] = "user_extended";
$exclude[] = "user_extended_struc";
$exclude[] = "pm_messages";
$exclude[] = "pm_blocks";
$tables = mysql_list_tables($mySQLdefaultdb);
while (list($temp) = mysql_fetch_array($tables))
{
if(strpos($temp, MPREFIX) === 0)
{
$e107tab = str_replace(MPREFIX, "", $temp);
if (!in_array($e107tab, $exclude) && stristr($e107tab, "lan_") === FALSE)
{
$tabs[] = $e107tab;
}
}
}
return $tabs;
}
// ------------- render form ---------------------------------------------------
function multilang_db(){
global $pref,$ns,$tp,$rs,$lanlist,$tabs;
if(isset($pref['multilanguage']) && $pref['multilanguage']){
$caption = LANG_LAN_16; // language
$text = MLAD_LAN_4."<br /><br />";
// Choose Language to Edit:
$text = "<div style='text-align:center'>
<div style='".ADMIN_WIDTH.";margin-left: auto; margin-right: auto;'>
<table class='fborder' style='width:99%; margin-top: 1px;'>
<tr><td class='fcaption'>".ADLAN_132."</td>
<td class='fcaption'>".LANG_LAN_03."</td>
<td class='fcaption'>".LAN_OPTIONS."</td>
</tr>\n\n";
sort($lanlist);
for($i = 0; $i < count($lanlist); $i++)
{
$installed = 0;
$text .= "<tr><td class='forumheader3' style='width:30%'>".$lanlist[$i]."</td><td class='forumheader3'>\n";
foreach ($tabs as $tab_name) {
if (db_Table_exists(strtolower($lanlist[$i])."_".$tab_name)) {
$text .= $tab_name.", ";
$installed++;
}
}
if($lanlist[$i] == $pref['sitelanguage']){
$text .= "<div style='text-align:center'><i>".LANG_LAN_17."</i></div>";
}else{
$text .= (!$installed)? "<div style='text-align:center'><i>".LANG_LAN_05."</i></div>" : "";
}
$text .= "</td><td class='forumheader3' style='width:20%;white-space:nowrap;text-align:right'>\n";
$text .= $rs->form_open("post", e_SELF."?modify", "lang_form_".str_replace(" ", "_", $lanlist[$i]));
$text .= "<div style='text-align: center'>\n";
if ($installed) {
$text .= " <input type='submit' class='button' name='edit_existing' value='".LAN_EDIT."' />\n";
$text .= " <input type='submit' class='button' name='del_existing' value='".LAN_DELETE."' onclick=\"return jsconfirm('Delete all tables in ".$lanlist[$i]." ?')\" />\n";
} elseif($lanlist[$i] != $pref['sitelanguage']) {
$text .= "<input type='submit' class='button' name='edit_existing' value='".LAN_CREATE."' />\n";
}
$text .= "<input type='hidden' name='lang_choices' value='".$lanlist[$i]."' />";
$text .= "</div>";
$text .= $rs->form_close();
$text .= "</td></tr>";
}
$text .= "</table></div></div>";
$ns->tablerender($caption, $text);
}
}
// ----------------------------------------------------------------------------
function show_tools()
{
global $ns;
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_lancheck.php");
$text .= "
<form name='lancheck' method='post' action='".e_ADMIN."lancheck.php'>
<table class='fborder' style='".ADMIN_WIDTH."'>
<tr>
<td class='fcaption'>".LAN_CHECK_1."</td>
<td class='forumheader3' style='text-align:center'>
<select name='language' class='tbox'>
<option value=''>".LAN_SELECT."</option>";
$languages = explode(",",e_LANLIST);
sort($languages);
foreach($languages as $lang)
{
if($lang != "English")
{
$text .= "<option value='{$lang}' >{$lang}</option>\n";
}
}
$text .= "
</select>
<input type='submit' name='language_sel' value=\"".LAN_CHECK_2."\" class='button' />
</td></tr>
</table></form>";
$ns->tablerender(LANG_LAN_21, $text);
}
// ----------------------------------------------------------------------------
function language_adminmenu() {
global $action,$pref;
if ($action == "") {
$action = "main";
}
if($action == "modify"){
$action = "db";
}
$var['main']['text'] = LAN_PREFS;
$var['main']['link'] = e_SELF;
if(isset($pref['multilanguage']) && $pref['multilanguage']){
$var['db']['text'] = LANG_LAN_03;
$var['db']['link'] = e_SELF."?db";
}
$lcnt = explode(",",e_LANLIST);
if(count($lcnt) > 1)
{
$var['tools']['text'] = ADLAN_CL_6;
$var['tools']['link'] = e_SELF."?tools";
}
show_admin_menu(ADLAN_132, $action, $var);
}
?>

790
e107_admin/links.php Normal file
View File

@@ -0,0 +1,790 @@
<?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_admin/links.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:24 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once('../class2.php');
if (!getperms('I')) {
header('location:'.e_BASE.'index.php');
}
$e_sub_cat = 'links';
if (!is_object($tp)) $tp = new e_parse;
// ----- Presets.----------
require_once(e_HANDLER."preset_class.php");
$pst = new e_preset;
$pst->form = "linkform";
$pst->page = "links.php?create";
$pst->id = "admin_links";
require_once('auth.php');
// --------------------
$pst->save_preset();
require_once(e_HANDLER.'userclass_class.php');
require_once(e_HANDLER.'form_handler.php');
$rs = new form;
$linkpost = new links;
if (e_QUERY) {
$tmp = explode('.', e_QUERY);
$action = $tmp[0];
$sub_action = $tmp[1];
$id = $tmp[2];
unset($tmp);
}
foreach(array_keys($_POST) as $k)
{
if (preg_match("#(.*?)_delete_(\d+)(.*)#", $k, $matches))
{
$delete = $matches[1];
$del_id = $matches[2];
}
}
if(isset($_POST['generate_sublinks']) && isset($_POST['sublink_type']) && $_POST['sublink_parent'] !="" ){
$subtype = $_POST['sublink_type'];
$sublink = $linkpost->sublink_list($subtype);
if(!is_object($sql2)){
$sql2 = new db;
}
$sql -> db_Select("links", "*", "link_id = '".$_POST['sublink_parent']."'");
$par = $sql-> db_Fetch();
extract($par);
$sql -> db_Select($sublink['table'], "*", $sublink['query']);
$count = 1;
while($row = $sql-> db_Fetch()){
$subcat = $row[($sublink['fieldid'])];
$name = $row[($sublink['fieldname'])];
$subname = $name; // eliminate old embedded hierarchy from names. (e.g. 'submenu.TopName.name')
$suburl = str_replace("#",$subcat,$sublink['url']);
$subicon = ($sublink['fieldicon']) ? $row[($sublink['fieldicon'])] : $link_button;
$subdiz = ($sublink['fielddiz']) ? $row[($sublink['fielddiz'])] : $link_description;
$subparent = $_POST['sublink_parent'];
if($sql2->db_Insert("links", "0, '$subname', '$suburl', '$subdiz', '$subicon', '$link_category', '$count', '$subparent', '$link_open', '$link_class' ")){
$message .= LAN_CREATED. " ($name)<br />";
}else{
$message .= LAN_CREATED_FAILED. " ($name)<br />";
}
$count++;
}
if($message){
$ns -> tablerender(LAN_CREATED, $message);
}
}
if (isset($_POST['inc'])) {
$qs = explode(".", $_POST['inc']);
$linkid = $qs[0];
$link_order = $qs[1];
$sql->db_Update("links", "link_order=link_order+1 WHERE link_order='".($link_order-1)."'");
$sql->db_Update("links", "link_order=link_order-1 WHERE link_id='".$linkid."'");
}
if (isset($_POST['dec'])) {
$qs = explode(".", $_POST['dec']);
$linkid = $qs[0];
$link_order = $qs[1];
$sql->db_Update("links", "link_order=link_order-1 WHERE link_order='".($link_order+1)."'");
$sql->db_Update("links", "link_order=link_order+1 WHERE link_id='".$linkid."'");
}
if (isset($_POST['update'])) {
foreach ($_POST['link_order'] as $loid) {
$tmp = explode(".", $loid);
$sql->db_Update("links", "link_order=".$tmp[1]." WHERE link_id=".$tmp[0]);
}
foreach ($_POST['link_class'] as $lckey => $lcid) {
$sql->db_Update("links", "link_class='".$lcid."' WHERE link_id=".$lckey);
}
$e107cache->clear("sitelinks");
$linkpost->show_message(LAN_UPDATED);
}
if (isset($_POST['updateoptions'])) {
$pref['linkpage_screentip'] = $_POST['linkpage_screentip'];
$pref['sitelinks_expandsub'] = $_POST['sitelinks_expandsub'];
save_prefs();
$e107cache->clear("sitelinks");
$linkpost->show_message(LCLAN_1);
}
if ($delete == 'main')
{
if($sql->db_Select("links", "link_id, link_name, link_order", "link_id='".$del_id."'")){
$row = $sql->db_Fetch();
$msg = $linkpost->delete_link($row);
if($msg){
$e107cache->clear("sitelinks");
$linkpost->show_message($msg);
}
}
}
if (isset($_POST['add_link'])) {
$linkpost->submit_link($sub_action, $_POST['link_id']);
unset($id);
}
$linkArray = $linkpost->getLinks();
if ($action == 'create') {
$linkpost->create_link($sub_action, $id);
}
if (!e_QUERY || $action == 'main') {
$linkpost->show_existing_items();
}
if ($action == 'opt') {
$linkpost->show_pref_options();
}
if($action == "sublinks"){
$linkpost->show_sublink_generator();
}
require_once('footer.php');
exit;
// End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
class links
{
var $link_total;
var $aIdOptPrep, $aIdOptData, $aIdOptTest;
function getLinks()
{
global $sql;
if($this->link_total = $sql->db_Select("links", "*", "ORDER BY link_category,link_order, link_id ASC", "nowhere"))
{
while($row = $sql->db_Fetch())
{
$ret[$row['link_parent']][] = $row;
}
}
return $ret;
}
function linkName($text)
{
// This function is ONLY needed for link databases that have been upgraded from
// before 0.7+ -- all new link collections make use of link_parent instead
// of hierarchy embedded in the link_name. (Unfortunately, the upgraded
// data still includes embedded coding.)
if(substr($text, 0, 8) == "submenu.") // for backwards compatibility only.
{
$tmp = explode(".",$text);
switch (count($tmp)) {
case 3: // submenu.parent.node
$tmp = $tmp[2]; break;
case 5: // submenu.parent.midlev.child.node
$tmp = $tmp[4]; break;
case 2: // submenu.parent (invalid?)
default:
$parentLen = strlen($tmp[1]);
$tmp = substr($text,8+$parentLen+1); // Skip submenu.parent.
}
return $tmp;
}
else
{
return $text;
}
}
function dropdown($curval="", $lid=0, $indent=0)
{ // Drop-down list using on the parent_id. :)
global $linkArray,$id,$sub_action;
if(0 == $indent) {$ret = "<option value=''>".LINKLAN_3."</option>\n";}
foreach($linkArray[$lid] as $l)
{
$s = ($l['link_id'] == $curval ? " selected='selected' " : "" );
$thename = $this->linkName($l['link_name']);
// prevent making self the parent.
if ($l['link_id'] == $id) { $thename = "(".$thename.")"; }
if($sub_action == "sub")
{
$thelink = ($l['link_id'] != $lid) ? $l['link_id'] : $l['link_parent'] ;
}
else
{
$thelink = ($l['link_id'] != $id) ? $l['link_id'] : $l['link_parent'] ;
}
$ret .= "<option value='".$thelink."' {$s}>".str_pad("", $indent*36, "&nbsp;").$thename." </option>\n";
if(array_key_exists($l['link_id'], $linkArray))
{
$ret .= $this->dropdown($curval, $l['link_id'], $indent+1);
}
}
return $ret;
}
function existing($id=0, $level=0)
{
global $linkArray;
$ret = "";
foreach($linkArray[$id] as $l)
{
$s = ($l['link_parent'] == $curval ? " selected='selected' " : "" );
$ret .= $this->display_row($l, $level);
if(array_key_exists($l['link_id'], $linkArray))
{
$ret .= $this->existing($l['link_id'], $level+1);
}
}
return $ret;
}
function show_existing_items()
{
global $sql, $rs, $ns, $tp, $linkArray;
if (count($linkArray))
{
$this->prepIdOpts(); // Prepare the options list for all links
$text = $rs->form_open("post", e_SELF, "myform_{$link_id}", "", "");
$text .= "<div style='text-align:center'>
<table class='fborder' style='".ADMIN_WIDTH."'>
<colgroup>
<col width=\"5%\" />
<col width=\"60%\" />
<col width=\"15%\" />
<col width=\"10%\" />
<col width=\"5%\" />
<col width=\"5%\" />
</colgroup>
<tr>
<td class='fcaption'>".LCLAN_89."</td>
<td class='fcaption'>".LCLAN_15."</td>
<td class='fcaption'>".LAN_OPTIONS."</td>
<td class='fcaption'>".LCLAN_95."</td>
<td class='fcaption'>".LCLAN_91."</td>
<td class='fcaption'>".LAN_ORDER."</td>
</tr>";
$text .= $this->existing(0);
$text .= "<tr>
<td class='forumheader' colspan='6' style='text-align:center'><input class='button' type='submit' name='update' value='".LAN_UPDATE."' /></td>
</tr>";
$text .= "</table></div>";
$text .= $rs->form_close();
} else {
$text .= "<div style='text-align:center'>".LCLAN_61."</div>";
}
$ns->tablerender(LCLAN_8, $text);
}
function prepIdOpts() {
for($a = 1; $a <= $this->link_total; $a++) {
$sTxt = "".$a;
$this->aIdOptData[] = array('val'=>'|||.'.$a, 'txt'=>$sTxt); // Later, ||| becomes Id
$this->aIdOptTest[] = $sTxt;
}
$this->aIdOptPrep = $this->prepOpts($this->aIdOptData);
}
function display_row($row2, $indent = FALSE) {
global $sql, $rs, $ns, $tp, $linkArray,$previous_cat;
extract($row2);
//
if($link_category > 1 && $link_category != $previous_cat)
{
$text .= "
<tr>
<td class='fcaption'>".LCLAN_89."</td>
<td class='fcaption'>".LCLAN_15." (".LCLAN_12.": ".$link_category.")</td>
<td class='fcaption'>".LAN_OPTIONS."</td>
<td class='fcaption'>".LCLAN_95."</td>
<td class='fcaption'>".LCLAN_91."</td>
<td class='fcaption'>".LAN_ORDER."</td>
</tr>";
$previous_cat = $link_category;
}
if(strpos($link_name, "submenu.") !== FALSE || $link_parent !=0) // 'submenu' for upgrade compatibility only.
{
$link_name = $this->linkName( $link_name );
}
if ($indent) {
$subimage = "<img src='".e_IMAGE."admin_images/sublink.png' alt='' />";
$subspacer = ($indent > 1) ? " style='padding-left: ".(($indent - 1) * 16)."px'" : "";
$subindent = "<td".$subspacer.">".$subimage."</td>";
}
$text .= "<tr><td class='forumheader3' style='text-align: center; vertical-align: middle' title='".$link_description."'>";
$text .= $link_button ? "<img src='".e_IMAGE."icons/".$link_button."' alt='' /> ":
"";
$text .= "</td><td class='forumheader3' title='".$link_description."'>
<table cellspacing='0' cellpadding='0' border='0' style='width: 100%'>
<tr>
".$subindent."
<td style='".($indent ? "" : "font-weight:bold;")."width: 100%'>".$link_name."</td>
</tr>
</table>
</td>";
$text .= "<td style='text-align:center; white-space: nowrap' class='forumheader3'>";
$text .= "<a href='".e_SELF."?create.sub.{$link_id}'><img src='".e_IMAGE."admin_images/sublink_16.png' title='".LINKLAN_10."' alt='".LINKLAN_10."' /></a>&nbsp;";
$text .= "<a href='".e_SELF."?create.edit.{$link_id}'>".ADMIN_EDIT_ICON."</a>&nbsp;";
$text .= "<input type='image' title='".LAN_DELETE."' name='main_delete_{$link_id}' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(LCLAN_58." [ $link_name ]")."') \" />";
$text .= "</td>";
$text .= "<td style='text-align:center' class='forumheader3'>".r_userclass("link_class[".$link_id."]", $link_class, "off", "public,guest,nobody,member,admin,classes")."</td>";
$text .= "<td style='text-align:center; white-space: nowrap' class='forumheader3'>";
$text .= "<input type='image' src='".e_IMAGE."admin_images/up.png' title='".LCLAN_30."' value='".$link_id.".".$link_order."' name='inc' />";
$text .= "<input type='image' src='".e_IMAGE."admin_images/down.png' title='".LCLAN_31."' value='".$link_id.".".$link_order."' name='dec' />";
$text .= "</td>";
$text .= "<td style='text-align:center' class='forumheader3'>";
$text .= "<select name='link_order[]' class='tbox'>\n";
$text .= $this->genOpts( $this->aIdOptPrep, $this->aIdOptTest, $link_order, $link_id );
$text .= "</select>";
$text .= "</td>";
$text .= "</tr>";
return $text;
}
function show_message($message) {
global $ns;
$ns->tablerender(LAN_UPDATE, "<div style='text-align:center'><b>".$message."</b></div>");
}
function create_link($sub_action, $id) {
global $sql, $rs, $ns, $pst,$tp;
$preset = $pst->read_preset("admin_links");
extract($preset);
if ($sub_action == "edit" && !$_POST['submit'])
{
if ($sql->db_Select("links", "*", "link_id='$id' "))
{
$row = $sql->db_Fetch();
extract($row);
}
}
if("sub" == $sub_action)
{
$link_parent = $id;
}
if(strpos($link_name, "submenu.") !== FALSE){ // 'submenu' for upgrade compatibility only.
$link_name = $this->linkName( $link_name );
}
require_once(e_HANDLER."file_class.php");
$fl = new e_file;
if($iconlist = $fl->get_files(e_IMAGE."icons/", ".jpg|.gif|.png|.JPG|.GIF|.PNG")){
sort($iconlist);
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."' id='linkform'>
<table style='".ADMIN_WIDTH."' class='fborder'>";
$text .= "<tr>
<td style='width:30%' class='forumheader3'>".LINKLAN_2.": </td>
<td style='width:70%' class='forumheader3'>
<select class='tbox' name='link_parent' >";
$text .= $this->dropdown($link_parent);
$text .= "</select></td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".LCLAN_15.": </td>
<td style='width:70%' class='forumheader3'>
<input class='tbox' type='text' name='link_name' size='60' value='$link_name' maxlength='100' />
</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".LCLAN_16.": </td>
<td style='width:70%' class='forumheader3'>
<input class='tbox' type='text' name='link_url' size='60' value='".$tp->replaceConstants($link_url,TRUE)."' maxlength='200' />";
if(e_MENU == "debug")
{
$text .= $link_url;
}
$text .= "
</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".LCLAN_17.": </td>
<td style='width:70%' class='forumheader3'>
<textarea class='tbox' name='link_description' cols='59' rows='3'>$link_description</textarea>
</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".LCLAN_18.": </td>
<td style='width:70%' class='forumheader3'>
<input class='tbox' type='text' id='link_button' name='link_button' size='42' value='$link_button' maxlength='100' />
<input class='button' type ='button' style='cursor:hand' size='30' value='".LCLAN_39."' onclick='expandit(this)' />
<div id='linkicn' style='display:none;{head}'>";
foreach($iconlist as $icon)
{
$filepath = str_replace(e_IMAGE."icons/","",$icon['path'].$icon['fname']);
$text .= "<a href=\"javascript:insertext('".$filepath."','link_button','linkicn')\"><img src='".$icon['path'].$icon['fname']."' style='border:0' alt='' /></a> ";
}
// 1 = _blank
// 2 = _parent not in use.
// 3 = _top not in use.
$linkop[0] = LCLAN_20; // 0 = same window
$linkop[1] = LCLAN_23;
$linkop[4] = LCLAN_24; // 4 = miniwindow 600x400
$linkop[5] = LINKLAN_1; // 5 = miniwindow 800x600
$text .= "</div></td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".LCLAN_19.": </td>
<td style='width:70%' class='forumheader3'>
<select name='linkopentype' class='tbox'>\n";
foreach($linkop as $key=>$val){
$selectd = ($link_open == $key) ? "selected='selected'" : "";
$text .= "<option value='$key' $selectd>".$val."</option>\n";
}
$text .="</select>
</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".LCLAN_12.": </td>
<td style='width:70%' class='forumheader3'>
<select name='linkrender' class='tbox'>";
$rentype = array("","Main","Alt","Alt", "Alt");
for ($i=1; $i<count($rentype); $i++) {
$sel = ($link_category == $i) ? "selected='selected'" : "";
$text .="<option value='$i' $sel>$i - ".$rentype[$i]."</option>";
};
$text .="</select><span class='smalltext'> ".LCLAN_96." {SITELINKS=flat:[rendertype number]}</span>
</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".LCLAN_25.":<br /><span class='smalltext'>(".LCLAN_26.")</span></td>
<td style='width:70%' class='forumheader3'>".r_userclass("link_class", $link_class, "off", "public,guest,nobody,member,admin,classes")."
</td></tr>
<tr style='vertical-align:top'>
<td colspan='2' style='text-align:center' class='forumheader'>";
if ($id && $sub_action == "edit") {
$text .= "<input class='button' type='submit' name='add_link' value='".LCLAN_27."' />\n
<input type='hidden' name='link_id' value='$link_id' />";
} else {
$text .= "<input class='button' type='submit' name='add_link' value='".LCLAN_28."' />";
}
$text .= "</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(LCLAN_29, $text);
}
function submit_link($sub_action, $id) {
global $sql, $e107cache, $tp;
if(!is_object($tp)) {
$tp=new e_parse;
}
$parent_id = ($_POST['link_parent']) ? intval($_POST['link_parent']) : 0;
$link_name = $tp->toDB($_POST['link_name']);
$link_url = $tp->createConstants($_POST['link_url']);
$link_url = str_replace("&","&amp;",$link_url); // xhtml compliant links.
$link_description = $tp->toDB($_POST['link_description']);
$link_button = $tp->toDB($_POST['link_button']);
$link_t = $sql->db_Count("links", "(*)");
if ($id) {
$sql->db_Update("links", "link_parent='$parent_id', link_name='$link_name', link_url='$link_url', link_description='$link_description', link_button= '$link_button', link_category='".$_POST['linkrender']."', link_open='".$_POST['linkopentype']."', link_class='".$_POST['link_class']."' WHERE link_id='$id'");
//rename all sublinks to eliminate old embedded 'submenu' etc hierarchy.
// this is for upgrade compatibility only. Current hierarchy uses link_parent.
$e107cache->clear("sitelinks");
$this->show_message(LCLAN_3);
} else {
$sql->db_Insert("links", "0, '$link_name', '$link_url', '$link_description', '$link_button', ".$_POST['linkrender'].", ".($link_t+1).", ".$parent_id.", ".$_POST['linkopentype'].", ".$_POST['link_class']);
$e107cache->clear("sitelinks");
$this->show_message(LCLAN_2);
}
}
function show_pref_options() {
global $pref, $ns;
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?".e_QUERY."'>\n
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:70%' class='forumheader3'>
".LCLAN_78."<br />
<span class='smalltext'>".LCLAN_79."</span>
</td>
<td class='forumheader3' style='width:30%;text-align:center'>". ($pref['linkpage_screentip'] ? "<input type='checkbox' name='linkpage_screentip' value='1' checked='checked' />" : "<input type='checkbox' name='linkpage_screentip' value='1' />")."
</td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>
".LCLAN_80."<br />
<span class='smalltext'>".LCLAN_81."</span>
</td>
<td class='forumheader3' style='width:30%;text-align:center'>". ($pref['sitelinks_expandsub'] ? "<input type='checkbox' name='sitelinks_expandsub' value='1' checked='checked' />" : "<input type='checkbox' name='sitelinks_expandsub' value='1' />")."
</td>
</tr>
<tr style='vertical-align:top'>
<td colspan='2' style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='updateoptions' value='".LAN_UPDATE."' />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(LCLAN_88, $text);
}
function delete_link($linkInfo) {
global $sql;
if ($sql->db_Select("links", "link_id", "link_order > '{$linkInfo['link_order']}'")){
$linkList = $sql->db_getList();
foreach($linkList as $l){
$sql->db_Update("links", "link_order = link_order -1 WHERE link_id = '{$l['link_id']}'");
}
}
if ($sql->db_Delete("links", "link_id='".$linkInfo['link_id']."'")){
// Update ophaned sublinks.
$sql->db_Update("links", "link_name = SUBSTRING_INDEX(link_name, '.', -1) , link_parent = '0', link_class='255' WHERE link_parent= '".$linkInfo['link_id']."'");
return LCLAN_53." #".$linkInfo['link_id']." ".LCLAN_54."<br />";
}else{
return DELETED_FAILED;
}
}
// -------------------------- Sub links generator ------------->
function show_sublink_generator() {
global $ns,$sql;
$sublinks = $this->sublink_list();
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?".e_QUERY."'>\n
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:50%' class='forumheader3'>
".LINKLAN_6."<br />
</td>
<td class='forumheader3' style='width:50%;text-align:center'>
<select name='sublink_type' class='tbox'>\n
<option value=''></option>";
foreach($sublinks as $key=>$type){
$text .= "<option value='$key'>".$type['title']."</option>\n";
}
$text .="</select>\n
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>
".LINKLAN_7."<br />
</td>
<td class='forumheader3' style='width:50%;text-align:center'>
<select name='sublink_parent' class='tbox'>\n
<option value=''></option>";
$sql -> db_Select("links", "*", "link_parent='0' ORDER BY link_name ASC");
while($row = $sql-> db_Fetch()){
$text .= "<option value='".$row['link_id']."'>".$row['link_name']."</option>\n";
}
$text .="</select>\n
</td>
</tr>
<tr style='vertical-align:top'>
<td colspan='2' style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='generate_sublinks' value='".LINKLAN_5."' />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender("Sublinks Generator", $text);
}
function sublink_list($name=""){
global $sql,$PLUGINS_DIRECTORY;
$sublink_type['news']['title'] = LINKLAN_8; // "News Categories";
$sublink_type['news']['table'] = "news_category";
$sublink_type['news']['query'] = "category_id !='-2' ORDER BY category_name ASC";
$sublink_type['news']['url'] = "news.php?cat.#";
$sublink_type['news']['fieldid'] = "category_id";
$sublink_type['news']['fieldname'] = "category_name";
$sublink_type['news']['fieldicon'] = "category_icon";
$sublink_type['downloads']['title'] = LINKLAN_9; //"Download Categories";
$sublink_type['downloads']['table'] = "download_category";
$sublink_type['downloads']['query'] = "download_category_parent ='0' ORDER BY download_category_name ASC";
$sublink_type['downloads']['url'] = "download.php?list.#";
$sublink_type['downloads']['fieldid'] = "download_category_id";
$sublink_type['downloads']['fieldname'] = "download_category_name";
$sublink_type['downloads']['fieldicon'] = "download_category_icon";
if ($sql -> db_Select("plugin", "plugin_path", "plugin_installflag = '1'")) {
while ($row = $sql -> db_Fetch()) {
$sublink_plugs[] = $row['plugin_path'];
}
}
foreach ($sublink_plugs as $plugin_id) {
if (is_readable(e_PLUGIN.$plugin_id.'/e_linkgen.php')) {
require_once(e_PLUGIN.$plugin_id.'/e_linkgen.php');
}
}
if($name){
return $sublink_type[$name];
}
return $sublink_type;
}
function prepOpts($aData)
{
//
// Prepare an array that can rapidly (no looping)
// generate an HTML option string, with one item possibly selected.
// prepOpts returns a prepared array containing the possible values in this form:
//
// <option value="xxxxx"
// >text for first</option><option value="yyyy"
// >text for next</option>
//
// $aData is an array containing value/text pairs:
// each entry is array( 'val'=>value, 'txt'=>text )
//
$i=0;
foreach($aData as $aVal)
{
$sVal = $aVal['val'];
$sTxt = $aVal['txt'];
$sOut="";
if ($i) $sOut = '>'.$sTxtPrev.'</option>';
$sOut .= '<option value="'.$sVal.'"';
$aPrep[$i++] = $sOut;
$sTxtPrev = $sTxt;
}
if ($i) { // terminate final option
$aPrep[$i] = '>'.$sTxtPrev.'</option>';
}
return $aPrep;
}
function genOpts($aPrep, $aTest,$sSelected, $sId)
{
//
// Generate an HTML option string, with one item possibly selected.
// aGen is a prepared array containing the possible values in this form.
// if sSelected matches an aTest entry, that entry is selected.
// aTest can be any array that matches one-for-one with the options
//
// if $sId is nonblank, a global search/replace is done to change all "|||" to $sId.
$iKey = array_search( $sSelected, $aTest);
if ($iKey !== FALSE) {
$aNew = $aPrep;
$aNew[$iKey] .= " selected='selected'";
$sOut = implode($aNew);
}
else {
$sOut = implode($aPrep);
}
if (strlen($sId)) $sOut = str_replace("|||",$sId,$sOut);
return $sOut;
}
}
function links_adminmenu() {
global $action;
if ($action == "") {
$action = "main";
}
$var['main']['text'] = LCLAN_62;
$var['main']['link'] = e_SELF;
$var['create']['text'] = LCLAN_63;
$var['create']['link'] = e_SELF."?create";
$var['opt']['text'] = LAN_OPTIONS;
$var['opt']['link'] = e_SELF."?opt";
$var['sub']['text'] = LINKLAN_4;
$var['sub']['link'] = e_SELF."?sublinks";
show_admin_menu(LCLAN_68, $action, $var);
}
?>

848
e107_admin/mailout.php Normal file
View File

@@ -0,0 +1,848 @@
<?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_admin/mailout.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:25 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
$e_sub_cat = 'mail';
if (!isset($_POST['submit'])) {
$e_wysiwyg = "email_body";
}
set_time_limit(180);
session_write_close();
require_once(e_ADMIN."auth.php");
require_once(e_HANDLER."ren_help.php");
if (!getperms("W")) {
header("location:".e_BASE."index.php");
exit;
}
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_users.php");
require_once(e_HANDLER."userclass_class.php");
if (isset($_POST['testemail'])) {
if(trim($_POST['testaddress']) == ""){
$message = MAILAN_19;
}else{
$mailheader_e107id = USERID;
require_once(e_HANDLER."mail.php");
$add = ($pref['mailer']) ? " (".strtoupper($pref['mailer']).")" : " (PHP)";
$sendto = trim($_POST['testaddress']);
if (!sendemail($sendto, PRFLAN_66." ".SITENAME.$add, PRFLAN_67,USERNAME)) {
$message = ($pref['mailer'] == "smtp") ? PRFLAN_75 : PRFLAN_68;
} else {
$message = PRFLAN_69. "(".$sendto.")";
}
}
}
$sql->db_Delete("generic", "gen_type='sendmail' AND gen_datestamp < ".(time()-86400));
if (isset($_POST['save_email'])){
$qry = "0,'massmail', '".time()."', '".USERID."', '".$tp->toDB($_POST['email_subject'])."', '0', \"".$tp->toDB($_POST['email_body'])."\" ";
$message = $sql -> db_Insert("generic", $qry) ? LAN_SAVED : LAN_ERROR;
}
if (isset($_POST['update_email'])){
$qry = "gen_user_id = '".USERID."', gen_datestamp = '".time()."', gen_ip = '".$tp->toDB($_POST['email_subject'])."', gen_chardata= \"".$tp->toDB($_POST['email_body'])."\" WHERE gen_id = '".$_POST['update_id']."' ";
$message = $sql -> db_Update("generic", $qry) ? LAN_UPDATED : LAN_UPDATED_FAILED;
}
if (isset($_POST['delete'])){
$d_idt = array_keys($_POST['delete']);
$message = ($sql -> db_Delete("generic", "gen_id='".$d_idt[0]."'")) ? LAN_DELETED : LAN_DELETED_FAILED;
}
if (isset($_POST['edit'])){
$e_idt = array_keys($_POST['edit']);
if($sql -> db_Select("generic", "*", "gen_id='".$e_idt[0]."' ")){
$foo = $sql -> db_Fetch();
}
}
if (isset($_POST['submit'])) {
if ($_POST['email_to'] == "all" || $_POST['email_to'] == "admin") {
switch ($_POST['email_to']) {
case "admin":
$insert = "u.user_admin='1' ";
break;
case "all":
$insert = "u.user_ban='0' ";
break;
}
$qry = "SELECT u.*, ue.* FROM #user AS u LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id WHERE $insert ";
} elseif($_POST['email_to'] == "unverified"){
$qry = "SELECT u.* FROM #user AS u WHERE u.user_ban='2'";
} elseif($_POST['email_to'] == "self"){
$qry = "SELECT u.* FROM #user AS u WHERE u.user_id='".USERID."'";
} else {
$insert = "u.user_class REGEXP concat('(^|,)',{$_POST['email_to']},'(,|$)') AND u.user_ban='0' ";
$qry = "SELECT u.*, ue.* FROM #user AS u LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id WHERE $insert ";
}
$sql2 = new db;
$c = 0;
if($_POST['extended_1_name'] && $_POST['extended_1_value']){
$qry .= " AND ".$_POST['extended_1_name']." = '".$_POST['extended_1_value']."' ";
}
if($_POST['extended_2_name'] && $_POST['extended_2_value']){
$qry .= " AND ".$_POST['extended_2_name']." = '".$_POST['extended_2_value']."' ";
}
if($_POST['user_search_name'] && $_POST['user_search_value']){
$qry .= " AND u.".$_POST['user_search_name']." LIKE '%".$_POST['user_search_value']."%' ";
}
$qry .= " ORDER BY u.user_name";
$_POST['mail_id'] = time();
$sql->db_Select_gen($qry);
if (ob_get_level() == 0) {
ob_start();
}
while ($row = $sql->db_Fetch()) {
$qry = "0,'sendmail', '".$_POST['mail_id']."', '".$row['user_id']."', '', '0', \"".$tp->toDB($_POST['email_subject'])."\" ";
if($sql2 -> db_Insert("generic", $qry)){
$c++;
}
ob_flush();
flush();
}
ob_end_flush();
$debug = (e_MENU == "debug") ? "?[debug]" : "";
$text = "<div style='text-align:center'>
<form method='post' action='".e_HANDLER."phpmailer/mailout_process.php".$debug."' name='mailform' onsubmit=\"open('', 'popup','width=230,height=170,resizable=1,scrollbars=0');this.target = 'popup';return true;\" >
<div>";
foreach($_POST as $key=>$val)
{
$text .= "<input type='hidden' name='".$key."' value='".stripslashes($tp->post_toForm($val))."' />\n";
}
$text .= "</div>";
$text .= "<div>$c ".MAILAN_24."</div>";
$text .= "<div><br /><input class='button' type='submit' name='send_mails' value='".MAILAN_37."' />
<input class='button' type='submit' name='cancel_emails' value='".MAILAN_38."' />
</div>";
$text .= "</form><br /><br /></div>";
// --------------- Preview Email -------------------------->
if(is_numeric($_POST['email_to']))
{
$sql->db_Select("userclass_classes", "userclass_name", "userclass_id = '{$_POST['email_to']}'");
$row = $sql->db_Fetch();
$_to = MAILAN_23.$row['userclass_name'];
}
else
{
$_to = $_POST['email_to'];
}
$text .= "
<div>
<table class='fborder'>
<tr>
<td class='forumheader3' style='width:30%'>".MAILAN_03."</td>
<td class='forumheader3'>".$_to."&nbsp;";
if($_POST['email_to'] == "self"){
$text .= "&lt;".USEREMAIL."&gt;";
}
$text .="</td>
</tr>
<tr>
<td class='forumheader3' style='width:30%'>".MAILAN_01." / ".MAILAN_02."</td>
<td class='forumheader3'>".$_POST['email_from_name']." &lt;".$_POST['email_from_email']."&gt;</td>
</tr>
<tr>
<td class='forumheader3' style='width:20%'>".MAILAN_06."</td>
<td class='forumheader3'>".$_POST['email_subject']."&nbsp;</td>
</tr>";
$text .= ($_POST['email_cc']) ? "
<tr>
<td class='forumheader3' style='width:30%'>".MAILAN_04."</td>
<td class='forumheader3'>".$_POST['email_cc']."&nbsp;</td>
</tr>": "";
$text .= ($_POST['email_bcc']) ? "
<tr>
<td class='forumheader3' style='width:30%'>".MAILAN_05."</td>
<td class='forumheader3'>".$_POST['email_bcc']."&nbsp;</td>
</tr>": "";
$text .= ($_POST['user_search_name'] && $_POST['user_search_value']) ? "
<tr>
<td class='forumheader3' style='width:30%'>".$_POST['user_search_name']."</td>
<td class='forumheader3'>".$_POST['user_search_value']."&nbsp;</td>
</tr>": "";
$text .= ($_POST['extended_1_name'] && $_POST['extended_1_value']) ? "
<tr>
<td class='forumheader3' style='width:30%'>".$_POST['extended_1_name']."</td>
<td class='forumheader3'>".$_POST['extended_1_value']."&nbsp;</td>
</tr>": "";
$text .= ($_POST['extended_2_name'] && $_POST['extended_2_value']) ? "
<tr>
<td class='forumheader3' style='width:30%'>".$_POST['extended_2_name']."</td>
<td class='forumheader3'>".$_POST['extended_2_value']."&nbsp;</td>
</tr>": "";
$text .="
<tr>
<td class='forumheader3' colspan='2'>".stripslashes($tp->toHTML($_POST['email_body'],TRUE))."</td>
</tr>
</table>
</div>";
$ns->tablerender(MAILAN_39." ($c) ", $text);
require_once(e_ADMIN."footer.php");
exit;
}
//. Update Preferences.
if (isset($_POST['updateprefs'])) {
$pref['mailer'] = $_POST['mailer'];
$pref['sendmail'] = $_POST['sendmail'];
$pref['smtp_server'] = $tp->toDB($_POST['smtp_server']);
$pref['smtp_username'] = $tp->toDB($_POST['smtp_username']);
$pref['smtp_password'] = $tp->toDB($_POST['smtp_password']);
$pref['smtp_keepalive'] = $_POST['smtp_keepalive'];
$pref['smtp_pop3auth'] = $_POST['smtp_pop3auth'];
$pref['mail_pause'] = $_POST['mail_pause'];
$pref['mail_pausetime'] = $_POST['mail_pausetime'];
$pref['mail_bounce_email'] = $_POST['mail_bounce_email'];
$pref['mail_bounce_pop3'] = $_POST['mail_bounce_pop3'];
$pref['mail_bounce_user'] = $_POST['mail_bounce_user'];
$pref['mail_bounce_pass'] = $_POST['mail_bounce_pass'];
$pref['mail_bounce_delete'] = $_POST['mail_bounce_delete'];
save_prefs();
$message = LAN_SETSAVED;
}
if (isset($message)) {
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
// ----------------- Actions ----------------------------------------------->
if(e_QUERY == "prefs"){
show_prefs();
}
if((!e_QUERY && !$_POST['delete']) || $_POST['edit']){
show_mailform($foo);
}
if(e_QUERY == "list" || $_POST['delete'] ){
showList();
}
require_once(e_ADMIN."footer.php");
// ------------------- Display Mailout Form.--------------------------------->
function show_mailform($foo=""){
global $ns,$sql,$tp,$pref,$HANDLERS_DIRECTORY;
$email_subject = $foo['gen_ip'];
$email_body = $tp->toForm($foo['gen_chardata']);
$email_id = $foo['gen_id'];
$text = "";
if(strpos($_SERVER['SERVER_SOFTWARE'],"mod_gzip") && !is_readable(e_HANDLER."phpmailer/.htaccess")){
$warning = MAILAN_40." ".$HANDLERS_DIRECTORY."phpmailer/ ".MAILAN_41;
$ns -> tablerender(MAILAN_42, $warning);
}
$debug = (e_MENU == "debug") ? "?[debug]" : "";
$text .= "<div style='".ADMIN_WIDTH." text-align:center'>
<form method='post' action='".e_SELF.$debug."' id='mailout_form'>
<table class='fborder' style='".ADMIN_WIDTH."' cellpadding='0' cellspacing='0'>
<tr>
<td style='width:30%' class='forumheader3'>".MAILAN_01.": </td>
<td style='width:70%' class='forumheader3'>
<input type='text' name='email_from_name' class='tbox' style='width:80%' size='10' value=\"".$_POST['email_from_name']."\" />
</td>
</tr>";
$text .="
<tr>
<td class='forumheader3'>".MAILAN_02.": </td>
<td class='forumheader3'>
<input type='text' name='email_from_email' class='tbox' style='width:80%' value=\"".$_POST['email_from_email']."\" />
</td>
</tr>
<tr>
<td class='forumheader3'>".MAILAN_03.": </td>
<td class='forumheader3'>
".userclasses("email_to", $_POST['email_to'])."</td>
</tr>";
// User Search Field.
$u_array = array("user_name"=>MAILAN_43,"user_login"=>MAILAN_44,"user_email"=>MAILAN_45);
$text .= "
<tr>
<td style='width:35%' class='forumheader3'>".MAILAN_46."
<select name='user_search_name' class='tbox'>
<option value=''>&nbsp;</option>";
foreach($u_array as $key=>$val){
$text .= "<option value='$key' >".$val."</option>\n";
}
$text .= "
</select> ".MAILAN_47." </td>
<td style='width:65%' class='forumheader3'>
<input type='text' name='user_search_value' class='tbox' style='width:80%' value='' />
</td></tr>
";
// Extended Field #1.
$text .= "
<tr>
<td class='forumheader3'>".MAILAN_46."
<select name='extended_1_name' class='tbox'>
<option value=''>&nbsp;</option>";
$sql -> db_Select("user_extended_struct");
while($row = $sql-> db_Fetch()){
$text .= "<option value='ue.user_".$row['user_extended_struct_name']."' >".ucfirst($row['user_extended_struct_name'])."</option>\n";
}
$text .= "
</select> ".MAILAN_48." </td>
<td class='forumheader3'>
<input type='text' name='extended_1_value' class='tbox' style='width:80%' value='' />
</td></tr>
";
// Extended Field #2.
$text .= "
<tr>
<td class='forumheader3'>".MAILAN_46."
<select name='extended_2_name' class='tbox'>
<option value=''>&nbsp;</option>";
$sql -> db_Select("user_extended_struct");
while($row = $sql-> db_Fetch()){
$text .= "<option value='ue.user_".$row['user_extended_struct_name']."' >".ucfirst($row['user_extended_struct_name'])."</option>\n";
}
$text .= "
</select> ".MAILAN_48." </td>
<td class='forumheader3'>
<input type='text' name='extended_2_value' class='tbox' style='width:80%' value='' />
</td></tr>
";
$text .= "
<tr>
<td class='forumheader3'>".MAILAN_04.": </td>
<td class='forumheader3'>
<input type='text' name='email_cc' class='tbox' style='width:80%' value=\"".$_POST['email_cc']."\" />
</td>
</tr>
<tr>
<td class='forumheader3'>".MAILAN_05.": </td>
<td class='forumheader3'>
<input type='text' name='email_bcc' class='tbox' style='width:80%' value='$email_bcc' />
</td>
</tr>
<tr>
<td class='forumheader3'>".MAILAN_06.": </td>
<td class='forumheader3'>
<input type='text' name='email_subject' class='tbox' style='width:80%' value='$email_subject' />
</td>
</tr>";
// Attachment.
$text .= "<tr>
<td class='forumheader3'>".MAILAN_07.": </td>
<td class='forumheader3'>";
$text .= "<select class='tbox' name='email_attachment' >
<option value=''>&nbsp;</option>\n";
$sql->db_Select("download", "download_url,download_name", "download_id !='' ORDER BY download_name");
while ($row = $sql->db_Fetch()) {
extract($row);
$selected = ($_POST['email_attachment'] == $download_url) ? "selected='selected'" :
"";
$text .= "<option value=\"$download_url \" $selected>".htmlspecialchars($download_name)."</option>\n";
}
$text .= " </select>";
$text .= "</td>
</tr>";
$text .= "
<tr>
<td class='forumheader3'>".MAILAN_09.": </td>
<td class='forumheader3'>
<input type='checkbox' name='use_theme' value='1' />
</td>
</tr>
<tr>
<td colspan='2' class='forumheader3'>
<textarea rows='10' cols='20' id='email_body' name='email_body' class='tbox' style='width:100%;height:200px' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".$email_body."</textarea>
</td>
</tr>";
$text .="
<tr>
<td style='width:100%' class='forumheader3' colspan='2'>
<div style='width:100%;text-align:center;vertical-align: middle;' >";
global $eplug_bb;
$eplug_bb[] = array(
"name" => 'shortcode',
"onclick" => 'expandit',
"onclick_var" => "sc_selector",
"icon" => e_IMAGE."generic/bbcode/shortcode.png",
"helptext" => MAILAN_11,
"function" => "sc_Select",
"function_var" => "sc_selector"
);
$text .= display_help("helpb",'mailout');
if(e_WYSIWYG) {
$text .="<span style='vertical-align: super;margin-left:5%;margin-bottom:auto;margin-top:auto'><input type='button' class='button' name='usrname' value=\"".MAILAN_16."\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'|USERNAME|')\" />
<input type='button' class='button' name='usrlink' value=\"".MAILAN_17."\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'|SIGNUP_LINK|')\" />
<input type='button' class='button' name='usrid' value=\"".MAILAN_18."\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'|USERID|')\" /></span>";
}
$text .="
</div></td>
</tr>";
$text .= "<tr style='vertical-align:top'>
<td colspan='2' style='text-align:center' class='forumheader'>";
if(isset($_POST['edit'])){
$text .= "<input type='hidden' name='update_id' value='".$email_id."' />";
$text .= "<input class='button' type='submit' name='update_email' value=\"".LAN_UPDATE."\" />";
}else{
$text .= "<input class='button' type='submit' name='save_email' value=\"".LAN_SAVE."\" />";
}
$text .="&nbsp;<input class='button' type='submit' name='submit' value=\"".MAILAN_08."\" />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(MAILAN_15, $text);
}
// ------------------ Preferences -------------------------------------------->
function show_prefs(){
global $pref,$ns;
$text = "
<form method='post' action='".e_SELF."?".e_QUERY."' id='mailsettingsform'>
<div id='mail' style='text-align:center;'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:30%' class='forumheader3'><span title='".PRFLAN_64."' style='cursor:help'>".PRFLAN_63."</span><br /></td>
<td style='width:70%; text-align:right' class='forumheader3'><input class='button' type='submit' name='testemail' value=\"".PRFLAN_65."\" />
<input name='testaddress' class='tbox' type='text' value=\"".SITEADMINEMAIL."\" />
</td>
</tr>
<tr>
<td style='vertical-align:top' class='forumheader3'>".PRFLAN_70."<br /><span class='smalltext'>".PRFLAN_71."</span></td>
<td style='text-align:right' class='forumheader3'>
<select class='tbox' name='mailer' onchange='disp(this.value)'>\n";
$mailers = array("php","smtp","sendmail");
foreach($mailers as $opt){
$sel = ($pref['mailer'] == $opt) ? "selected='selected'" : "";
$text .= "<option value='$opt' $sel>$opt</option>\n";
}
$text .="</select><br />";
// SMTP. -------------->
$smtpdisp = ($pref['mailer'] != "smtp") ? "display:none;" : "";
$text .= "<div id='smtp' style='$smtpdisp text-align:right'><table style='margin-right:0px;margin-left:auto;border:0px'>";
$text .= " <tr>
<td style='text-align:right' >".PRFLAN_72.":&nbsp;&nbsp;</td>
<td style='width:50%; text-align:right' >
<input class='tbox' type='text' name='smtp_server' size='40' value='".$pref['smtp_server']."' maxlength='50' />
</td>
</tr>
<tr>
<td style='text-align:right' >".PRFLAN_73.":&nbsp;(".LAN_OPTIONAL.")&nbsp;&nbsp;</td>
<td style='width:50%; text-align:right' >
<input class='tbox' type='text' name='smtp_username' size='40' value=\"".$pref['smtp_username']."\" maxlength='50' />
</td>
</tr>
<tr>
<td style='text-align:right' >".PRFLAN_74.":&nbsp;(".LAN_OPTIONAL.")&nbsp;&nbsp;</td>
<td style='width:50%; text-align:right' >
<input class='tbox' type='password' name='smtp_password' size='40' value='".$pref['smtp_password']."' maxlength='50' />
</td>
</tr>
<tr>
<td colspan='2' style='text-align:right' >".MAILAN_57.":&nbsp;
";
$checked = (isset($pref['smtp_keepalive']) && $pref['smtp_keepalive']==1) ? "checked='checked'" : "";
$text .= "<input type='checkbox' name='smtp_keepalive' value='1' {$checked} />
</td>
</tr>
<tr>
<td colspan='2' style='text-align:right' >".MAILAN_67.":&nbsp;
";
$checked = (isset($pref['smtp_pop3auth']) && $pref['smtp_pop3auth']==1) ? "checked='checked'" : "";
$text .= "<input type='checkbox' name='smtp_pop3auth' value='1' {$checked} />
</td>
</tr>
</table></div>";
// Sendmail. -------------->
$senddisp = ($pref['mailer'] != "sendmail") ? "display:none;" : "";
$text .= "<div id='sendmail' style='$senddisp text-align:right'><table style='margin-right:0px;margin-left:auto;border:0px'>";
$text .= "
<tr>
<td >".MAILAN_20.":&nbsp;&nbsp;</td>
<td style='text-align:right' >
<input class='tbox' type='text' name='sendmail' size='60' value=\"".(!$pref['sendmail'] ? "/usr/sbin/sendmail -t -i -r ".$pref['siteadminemail'] : $pref['sendmail'])."\" maxlength='80' />
</td>
</tr>
</table></div>";
$text .="</td>
</tr>
<tr>
<td class='forumheader3'>".MAILAN_25."</td>
<td class='forumheader3' style='text-align: right;'> ".MAILAN_26."
<input class='tbox' size='3' type='text' name='mail_pause' value='".$pref['mail_pause']."' /> ".MAILAN_27.".
</td>
</tr>\n
<tr>
<td class='forumheader3'>".MAILAN_28."</td>
<td class='forumheader3' style='text-align: right;'>
<input class='tbox' size='3' type='text' name='mail_pausetime' value='".$pref['mail_pausetime']."' /> ".MAILAN_29.".<br />
<span class='smalltext'>".MAILAN_30."</span>
</td>
</tr>\n
<tr>
<td style='vertical-align:top' class='forumheader3'>".MAILAN_31."</td>
<td style=' text-align:right' class='forumheader3'>
".MAILAN_32.": <input class='tbox' size='40' type='text' name='mail_bounce_email' value=\"".$pref['mail_bounce_email']."\" /><br />
".MAILAN_33." (POP3): <input class='tbox' size='40' type='text' name='mail_bounce_pop3' value=\"".$pref['mail_bounce_pop3']."\" /><br />
".MAILAN_34.": <input class='tbox' size='40' type='text' name='mail_bounce_user' value=\"".$pref['mail_bounce_user']."\" /><br />
".MAILAN_35.": <input class='tbox' size='40' type='text' name='mail_bounce_pass' value=\"".$pref['mail_bounce_pass']."\" /><br />";
$check = ($pref['mail_bounce_delete']==1) ? "checked='checked'" : "";
$text .= MAILAN_36.": <input type='checkbox' name='mail_bounce_delete' value='1' {$check} />
</td>
</tr>
<tr>
<td style='text-align:center' colspan='2' class='forumheader'>
<input class='button' type='submit' name='updateprefs' value=\"".PRFLAN_52."\" />
</td>
</tr>
</table></div></form>";
$text .= "";
$caption = LAN_PREFS;
$ns->tablerender($caption, $text);
}
function showList()
{
global $sql,$ns,$tp;
$gen = new convert;
$qry ="SELECT g.*,u.* FROM #generic AS g LEFT JOIN #user AS u ON g.gen_user_id = u.user_id WHERE g.gen_type = 'massmail' ORDER BY g.gen_datestamp DESC";
// $count = $sql -> db_Select("generic", "*", "gen_type ='massmail' ORDER BY gen_datestamp DESC");
$count = $sql -> db_Select_gen($qry);
$text = "<div style='text-align:center'>";
if (!$count)
{
$text = "
<div class='forumheader2' style='text-align:center'>".MAILAN_22."</div>";
$ns -> tablerender("<div style='text-align:center'>".MAILAN_21."</div>", $text);
require_once(e_ADMIN."footer.php");
exit;
}
else
{
$text .= "
<form action='".e_SELF."' id='display' method='post'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:5%; text-align: center;' class='fcaption'>".MAILAN_49."</td>
<td style='width:10%' class='fcaption'>".MAILAN_50."</td>
<td style='width:40%' class='fcaption'>".MAILAN_51."</td>
<td style='width:20%; text-align: center;' class='fcaption'>".MAILAN_52."</td>
<td style='width:5%; text-align: center;' class='fcaption'>".LAN_OPTIONS."</td>
</tr>
";
$glArray = $sql -> db_getList();
foreach($glArray as $row2)
{
$datestamp = $gen->convert_date($row2['gen_datestamp'], "short");
$text .= "<tr>
<td class='forumheader3' style='; text-align: center;'>".$row2['gen_id'] ."</td>
<td class='forumheader3'>".$row2['user_name']."</td>
<td class='forumheader3'>".$row2['gen_ip']."</td>
<td class='forumheader3' style='; text-align: center;'>".$datestamp."</td>
<td style='width:50px;white-space:nowrap' class='forumheader3'>
<div>
<input type='image' name='edit[{$row2['gen_id']}]' value='edit' src='".e_IMAGE."admin_images/edit_16.png' alt='".LAN_EDIT."' title='".LAN_EDIT."' style='border:0px' />
<input type='image' name='delete[{$row2['gen_id']}]' value='del' onclick=\"return jsconfirm('".$tp->toJS(LAN_CONFIRMDEL." [".$row2['gen_ip']."]")."') \" src='".e_IMAGE."admin_images/delete_16.png' alt='".LAN_DELETE."' title='".LAN_DELETE."' style='border:0px' />
</div>
</td>
</tr>
";
}
}
$text .= "</table>\n</form><br /><br /><br /></div>";
$ns -> tablerender("<div style='text-align:center'>".MAILAN_21."</div>", $text);
}
function userclasses($name) {
global $sql;
$text .= "<select style='width:80%' class='tbox' name='$name' >
<option value='all'>".MAILAN_12."</option>
<option value='unverified'>".MAILAN_13."</option>
<option value='admin'>".MAILAN_53."</option>
<option value='self'>".MAILAN_54."</option>";
$query = "SELECT uc.*, count(u.user_id) AS members
FROM #userclass_classes AS uc
LEFT JOIN #user AS u ON u.user_class REGEXP concat('(^|,)',uc.userclass_id,'(,|$)')
GROUP BY uc.userclass_id
";
$sql->db_Select_gen($query);
while ($row = $sql->db_Fetch()) {
$public = ($row['userclass_editclass'] == 0)? "(".MAILAN_10.")" : "";
$text .= "<option value='{$row['userclass_id']}' >".MAILAN_55." - {$row['userclass_name']} $public [{$row['members']}]</option>";
}
$text .= " </select>";
return $text;
}
function mailout_adminmenu() {
$action = (e_QUERY) ? e_QUERY : "post";
if($action == "edit"){
$action = "post";
}
$var['post']['text'] = MAILAN_56;
$var['post']['link'] = e_SELF;
$var['post']['perm'] = "W";
$var['list']['text'] = LAN_SAVED;
$var['list']['link'] = e_SELF."?list";
$var['list']['perm'] = "W";
if(getperms("0")){
$var['prefs']['text'] = LAN_OPTIONS;
$var['prefs']['link'] = e_SELF."?prefs";
$var['prefs']['perm'] = "0";
}
show_admin_menu(MAILAN_15, $action, $var);
}
function sc_Select($container='sc_selector') {
$text ="
<!-- Start of Shortcode selector -->
<div style='margin-left:0px;margin-right:0px; position:relative;z-index:1000;float:right;display:none' id='{$container}'>
<div style='position:absolute; bottom:30px; right:125px'>
<table class='fborder' style='background-color: #fff'>
<tr><td class='forumheader3'>
<select class='tbox' name='sc_sel' onchange=\"addtext(this.value); expandit('{$container}')\">
<option value=''> -- </option>\n";
$sc = array(
"|USERNAME|" => MAILAN_16,
"|SIGNUP_LINK|" => MAILAN_17,
"|USERID|" => MAILAN_18
);
foreach($sc as $key=>$val){
$text .= "<option value='".$key."'>".$val."</option>\n";
}
$text .="
</select></td></tr> \n </table></div>
</div>
\n<!-- End of SC selector -->
";
return $text;
}
function headerjs()
{
$text = "
<script type='text/javascript'>
function disp(type) {
if(type == 'smtp'){
document.getElementById('smtp').style.display = '';
document.getElementById('sendmail').style.display = 'none';
return;
}
if(type =='sendmail'){
document.getElementById('smtp').style.display = 'none';
document.getElementById('sendmail').style.display = '';
return;
}
document.getElementById('smtp').style.display = 'none';
document.getElementById('sendmail').style.display = 'none';
}
</script>";
return $text;
}
?>

522
e107_admin/menus.php Normal file
View File

@@ -0,0 +1,522 @@
<?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_admin/menus.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:25 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("2")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'menus';
require_once("auth.php");
require_once(e_HANDLER."form_handler.php");
require_once(e_HANDLER."file_class.php");
$frm = new form;
if($_POST) {
$e107cache->clear("menus_");
}
$menus_equery = explode('.', e_QUERY);
if (isset($_POST['custom_select'])) {
$menus_equery[1] = $_POST['custom_select'];
//header("location:".e_SELF."?".$_POST['custom_select']);
//exit;
} else if (!isset($menus_equery[1])) {
$menus_equery[1] = '';
}
if ($menus_equery[1] == '' || $menus_equery[1] == 'default_layout') {
$menus_header = $HEADER;
$menus_footer = $FOOTER;
}
else if ($menus_equery[1] == 'custom_layout') {
$menus_header = $CUSTOMHEADER ? $CUSTOMHEADER :
$HEADER;
$menus_footer = $CUSTOMFOOTER ? $CUSTOMFOOTER :
$FOOTER;
}
else if ($menus_equery[1] == 'newsheader_layout') {
$menus_header = $NEWSHEADER ? $NEWSHEADER :
$HEADER;
$menus_footer = $FOOTER;
} else {
$menus_header = $CUSTOMHEADER[$menus_equery[1]] ? $CUSTOMHEADER[$menus_equery[1]] :
$HEADER;
$menus_footer = $CUSTOMFOOTER[$menus_equery[1]] ? $CUSTOMFOOTER[$menus_equery[1]] :
$FOOTER;
}
$layouts_str = $HEADER.$FOOTER;
if ($NEWSHEADER) {
$layouts_str .= $NEWSHEADER;
}
if ($CUSTOMPAGES) {
if (is_array($CUSTOMPAGES)) {
foreach ($CUSTOMPAGES as $custom_extract_key => $custom_extract_value) {
if ($CUSTOMHEADER[$custom_extract_key]) {
$layouts_str .= $CUSTOMHEADER[$custom_extract_key];
}
if ($CUSTOMFOOTER[$custom_extract_key]) {
$layouts_str .= $CUSTOMFOOTER[$custom_extract_key];
}
}
} else {
if ($CUSTOMHEADER) {
$layouts_str .= $CUSTOMHEADER;
}
if ($CUSTOMFOOTER) {
$layouts_str .= $CUSTOMFOOTER;
}
}
}
$menu_array = parseheader($layouts_str, 'check');
sort($menu_array, SORT_NUMERIC);
$menu_check = 'set';
foreach ($menu_array as $menu_value) {
if ($menu_value != $menu_check) {
$menu_areas[] = $menu_value;
}
$menu_check = $menu_value;
}
// Cams Bit ----------- Activate Multiple Menus ---
if($_POST['menuActivate'])
{
foreach ($_POST['menuActivate'] as $k => $v)
{
if (trim($v))
{
$location = $k;
}
}
$menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location='$location' ");
foreach($_POST['menuselect'] as $sel_mens)
{
$sql->db_Update("menus", "menu_location='$location', menu_order='".($menu_count+1)."' WHERE menu_id='$sel_mens' ");
$menu_count++;
}
}
// =============
foreach ($_POST['menuAct'] as $k => $v) {
if (trim($v)) {
$id = $k;
list($menu_act, $location, $position, $newloc) = explode(".", $_POST['menuAct'][$k]);
}
}
if ($menu_act == 'config') {
if($newloc)
{
$newloc = ".".$newloc;
}
$newurl = $PLUGINS_DIRECTORY.$location."/{$position}{$newloc}.php";
$newurl = SITEURL.str_replace("//", "/", $newurl);
echo "<script> top.location.href = '$newurl'; </script> ";
exit;
}
if ($menu_act == "adv") {
require_once(e_HANDLER."userclass_class.php");
$sql->db_Select("menus", "*", "menu_id='$id' ");
$row = $sql->db_Fetch();
extract($row);
$listtype = substr($menu_pages, 0, 1);
$menu_pages = substr($menu_pages, 2);
$menu_pages = str_replace("|", "\n", $menu_pages);
$text = "<div style='text-align:center;'>
<form method='post' action='".e_SELF."?configure.".$menus_equery[1]."'>\n
<table style='width:40%'>
<tr>
<td>
<input type='hidden' name='menuAct[$menu_id]' value='sv.$menu_id' />
".MENLAN_4." ".
r_userclass('menu_class', $menu_class, "off", "public,member,guest,admin,main,classes,nobody")."
</td>
</tr>
<tr><td><br />";
$checked = ($listtype == 1) ? " checked='checked' " :
"";
$text .= "<input type='radio' {$checked} name='listtype' value='1' /> ".MENLAN_26."<br />";
$checked = ($listtype == 2) ? " checked='checked' " :
"";
$text .= "<input type='radio' {$checked} name='listtype' value='2' /> ".MENLAN_27."<br /><br />".MENLAN_28."<br />";
$text .= "<textarea name='pagelist' cols='60' rows='10' class='tbox'>$menu_pages</textarea>";
$text .= "
<tr>
<td style='text-align:center'><br />
<input class='button' type='submit' name='class_submit' value='".MENLAN_6."' />
</td>
</tr>
</table>
</form>
</div>";
$caption = MENLAN_7." ".$menu_name;
$ns->tablerender($caption, $text);
}
unset($message);
if ($menu_act == "sv") {
$pagelist = explode("\r\n", $_POST['pagelist']);
for ($i = 0 ; $i < count($pagelist) ; $i++) {
$pagelist[$i] = trim($pagelist[$i]);
}
$plist = implode("|", $pagelist);
$pageparms = $_POST['listtype'].'-'.$plist;
$pageparms = preg_replace("#\|$#", "", $pageparms);
$pageparms = (trim($_POST['pagelist']) == '') ? '' :
$pageparms;
$sql->db_Update("menus", "menu_class='".$_POST['menu_class']."', menu_pages='{$pageparms}' WHERE menu_id='$id' ");
$message = "<br />".MENLAN_8."<br />";
}
if ($menu_act == "move") {
$menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location='$newloc' ");
$sql->db_Update("menus", "menu_location='$newloc', menu_order='".($menu_count+1)."' WHERE menu_id='$id' ");
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='$location' AND menu_order > $position");
}
if ($menu_act == "deac") {
$sql->db_Update("menus", "menu_location='0', menu_order='0' WHERE menu_id='$id' ");
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='$location' AND menu_order > $position");
}
if ($menu_act == "bot") {
$menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location='$location' ");
$sql->db_Update("menus", "menu_order=".($menu_count+1)." WHERE menu_order='$position' AND menu_location='$location' ");
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='$location' AND menu_order > $position");
}
if ($menu_act == "top") {
$sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_location='$location' AND menu_order < $position");
$sql->db_Update("menus", "menu_order=1 WHERE menu_id='$id' ");
}
if ($menu_act == "dec") {
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_order='".($position+1)."' AND menu_location='$location' ");
$sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_id='$id' AND menu_location='$location' ");
}
if ($menu_act == "inc") {
$sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_order='".($position-1)."' AND menu_location='$location' ");
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_id='$id' AND menu_location='$location' ");
}
if (strpos(e_QUERY, 'configure') === FALSE)
{
$efile = new e_file;
$fileList = $efile->get_files(e_PLUGIN,"_menu\.php$",'standard',2);
foreach($fileList as $file) {
list($parent_dir) = explode('/',str_replace(e_PLUGIN,"",$file['path']));
$file['path'] = str_replace(e_PLUGIN,"",$file['path']);
$file['fname'] = str_replace(".php","",$file['fname']);
if (!$sql->db_Count("menus", "(*)", "WHERE menu_name='{$file['fname']}'")) {
if (file_exists(e_PLUGIN.$parent_dir."/plugin.php")) {
include(e_PLUGIN.$parent_dir."/plugin.php");
if ($sql->db_Select("plugin", "*", "plugin_path='".$eplug_folder."' AND plugin_installflag='1' ")) {
$sql->db_Insert("menus", " 0, '{$file['fname']}', 0, 0, 0, '' ,'{$file['path']}'");
$message .= "<b>".MENLAN_10." - ".$file['fname']."</b><br />";
}
} else {
$sql->db_Insert("menus", " 0, '{$file['fname']}', 0, 0, 0, '' ,'{$file['path']}'");
$message .= "<b>".MENLAN_10." - ".$file['fname']."</b><br />";
}
}
$menustr .= "&".str_replace(".php", "", $file['fname']);
}
$sql2 = new db;
foreach ($menu_areas as $menu_act) {
if ($sql->db_Select("menus", "*", "menu_location='$menu_act' ORDER BY menu_order ASC")) {
$c = 1;
while ($row = $sql->db_Fetch()) {
extract($row);
$sql2->db_Update("menus", "menu_order='$c' WHERE menu_id='$menu_id' ");
$c++;
}
}
}
$sql->db_Select("menus", "*", "menu_path NOT REGEXP('[0-9]+') ");
while (list($menu_id, $menu_name, $menu_location, $menu_order) = $sql->db_Fetch())
{
if (stristr($menustr, $menu_name) === FALSE)
{
$sql2->db_Delete("menus", "menu_name='$menu_name'");
$message .= "<b>".MENLAN_11." - ".$menu_name."</b><br />";
}
}
}
foreach ($menu_areas as $menu_act) {
$menus_sql[] = "menu_location!='".$menu_act."'";
}
if ($message != "")
{
echo $ns -> tablerender('Updated', "<div style='text-align:center'><b>".$message."</b></div><br /><br />");
}
if (strpos(e_QUERY, 'configure') === FALSE)
{
$cnt = $sql->db_Select("menus", "*", "menu_location='1' ORDER BY menu_name "); // calculate height to remove vertical scroll-bar.
$text = "<iframe src='".e_SELF."?configure' width='100%' style='width: 100%; height: ".(($cnt*80)+600)."px; border: 0px' frameborder='0' scrolling='auto' ></iframe>";
echo $ns -> tablerender(MENLAN_35, $text, 'menus_config');
}
else
{
$menus_query = implode(' && ', $menus_sql);
$sql->db_Update("menus", "menu_location='0', menu_order='0' WHERE ".$menus_query);
if ($CUSTOMPAGES) {
if ($menu_act != 'adv') {
$text = "<form method='post' action='".e_SELF."?configure.".$menus_equery[1]."'><div style='width: 100%'>
<table class='fborder' style='".ADMIN_WIDTH."'>
<tr>
<td class='forumheader3' style='width: 90%'>
".MENLAN_30."
</td>
<td class='forumheader3' style='width: 10%; text-align: center;'>";
$text .= $frm->form_select_open('custom_select', 'onchange="this.form.submit()"');
if ($menus_equery[1] == '' || $menus_equery[1] == 'default_layout') {
$text .= $frm->form_option(MENLAN_31, 'selected', 'default_layout');
} else {
$text .= $frm->form_option(MENLAN_31, FALSE, 'default_layout');
}
if ($NEWSHEADER) {
if ($menus_equery[1] == 'newsheader_layout') {
$text .= $frm->form_option(MENLAN_32, 'selected', 'newsheader_layout');
} else {
$text .= $frm->form_option(MENLAN_32, FALSE, 'newsheader_layout');
}
}
if ($CUSTOMPAGES) {
if (is_array($CUSTOMPAGES)) {
foreach ($CUSTOMPAGES as $custom_pages_key => $custom_pages_value) {
if ($menus_equery[1] == $custom_pages_key) {
$text .= $frm->form_option($custom_pages_key, 'selected', $custom_pages_key);
} else {
$text .= $frm->form_option($custom_pages_key, FALSE, $custom_pages_key);
}
}
} else {
if ($menus_equery[1] == 'custom_layout') {
$text .= $frm->form_option(MENLAN_33, 'selected', 'custom_layout');
} else {
$text .= $frm->form_option(MENLAN_33, FALSE, 'custom_layout');
}
}
}
$text .= $frm->form_select_close();
$text .= "</td>
</tr>
</table></div>
</form>";
$ns->tablerender(MENLAN_29, $text);
}
}
parseheader($menus_header);
echo "<div style='text-align:center'>";
echo $frm->form_open("post", e_SELF."?configure.".$menus_equery[1], "menuActivation");
$text = "<table style='margin-left:auto;margin-right:auto'>";
$sql->db_Select("menus", "*", "menu_location='0' ORDER BY menu_name ");
$text .= "<tr><td style='width:50%;text-align:center;padding-bottom:4px'>".MENLAN_36."...</td><td style='width:50%;padding-bottom:4px;text-align:center'>...".MENLAN_37."</td></tr>";
$text .= "<tr><td style='width:50%;vertical-align:top;text-align:center'>";
$text .= "<select name='menuselect[]' class='tbox' multiple='multiple' style='height:200px;width:95%'>";
while ($row = $sql->db_Fetch())
{
extract($row);
if($menu_pages == "dbcustom")
{
$menu_name .= " [custom]";
}
else
{
$menu_name = preg_replace("#_menu#i", "", $menu_name);
}
$text .= "<option value='$menu_id'>$menu_name</option>\n";
}
$text .= "</select>";
$text .= "<br /><br /><span class='smalltext'>".MENLAN_38."</span>";
$text .= "</td><td style='width:50%;vertical-align:top;text-align:center'><br />";
foreach ($menu_areas as $menu_act) {
$text .= "<input type='submit' class='button' id='menuAct_".trim($menu_act)."' name='menuActivate[".trim($menu_act)."]' value='".MENLAN_13." ".trim($menu_act)."' /><br /><br />\n";
}
$text .= "</td>";
$text .= "</tr></table>";
echo $ns -> tablerender(MENLAN_22, $text);
echo $frm->form_close();
echo "</div>";
parseheader($menus_footer);
}
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function parseheader($LAYOUT, $check = FALSE) {
$tmp = explode("\n", $LAYOUT);
for ($c = 0; $c < count($tmp); $c++) {
if (preg_match("/[\{|\}]/", $tmp[$c])) {
if ($check) {
if (strstr($tmp[$c], "{MENU=")) {
$str[] = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $tmp[$c]);
}
} else {
checklayout($tmp[$c]);
}
} else {
if (!$check) {
echo $tmp[$c];
}
}
}
if ($check) {
return $str;
}
}
function checklayout($str) {
global $pref, $menu_areas, $ns, $PLUGINS_DIRECTORY, $frm, $sc_style, $tp;
if (strstr($str, "LOGO")) {
echo $tp -> parseTemplate("{LOGO}");
}
else if(strstr($str, "SITENAME")) {
echo "<div style='padding: 2px'>[SiteName]</div>";
}
else if (strstr($str, "SITETAG")) {
echo "<div style='padding: 2px'>[SiteTag]</div>";
}
else if (strstr($str, "SITELINKS")) {
echo "<div style='padding: 2px; text-align: center'>[SiteLinks]</div>";
}
else if (strstr($str, "CUSTOM")) {
$cust = preg_replace("/\W*\{CUSTOM=(.*?)(\+.*)?\}\W*/si", "\\1", $str);
echo "<div style='padding: 2px'>[".$cust."]</div>";
}
// Display embedded Plugin information.
else if (strstr($str, "PLUGIN")){
$plug = preg_replace("/\{PLUGIN=(.*?)\}/si", "\\1", $str);
$plug = trim($plug);
if (file_exists((e_PLUGIN."{$plug}/{$plug}_config.php"))){
$link = e_PLUGIN."{$plug}/{$plug}_config.php";
}
if(file_exists((e_PLUGIN.$plug."/config.php"))){
$link = e_PLUGIN.$plug."/config.php";
}
$plugtext = ($link) ? "(".MENLAN_34.":<a href='$link' title='".MENLAN_16."'>".MENLAN_16."</a>)" : "(".MENLAN_34.")" ;
echo "<br />";
$ns -> tablerender($plug, $plugtext);
}
else if (strstr($str, "MENU")) {
$ns = new e107table;
$menu = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $str);
if (isset($sc_style['MENU']['pre']) && strpos($str, 'ret') !== false) {
echo $sc_style['MENU']['pre'];
}
echo "<div style='text-align:center; font-size:14px' class='fborder'><div class='forumheader'><b>".MENLAN_14." ".$menu."</b></div></div><br />";
$text = "&nbsp;";
$sql9 = new db;
if ($sql9->db_Count("menus", "(*)", " WHERE menu_location='$menu' ")) {
unset($text);
echo $frm->form_open("post", e_SELF."?configure.".$menus_equery[1], "frm_menu_".intval($menu));
$sql9->db_Select("menus", "*", "menu_location='$menu' ORDER BY menu_order");
$menu_count = $sql9->db_Rows();
while (list($menu_id, $menu_name, $menu_location, $menu_order, $menu_class, $menu_pages, $menu_path) = $sql9->db_Fetch()) {
$menu_name = preg_replace("#_menu#i", "", $menu_name);
$vis = ($menu_class || strlen($menu_pages) > 1) ? " <span style='color:red'>*</span> " :
"";
$caption = "<div style='text-align:center'>{$menu_name}{$vis}</div>";
$menu_info = "{$menu_location}.{$menu_order}";
$text = "";
$conf = '';
if (file_exists(e_PLUGIN."{$menu_path}/{$menu_name}_menu_config.php"))
{
$conf = "config.{$menu_path}.{$menu_name}_menu_config";
}
if($conf == '' && file_exists(e_PLUGIN."{$menu_path}/config.php"))
{
$conf = "config.{$menu_path}.config";
}
$text .= "<select id='menuAct_$menu_id' name='menuAct[$menu_id]' class='tbox' onchange='this.form.submit()' >";
$text .= $frm->form_option(MENLAN_25, TRUE, " ");
$text .= $frm->form_option(MENLAN_15, "", "deac.{$menu_info}");
if ($conf) {
$text .= $frm->form_option(MENLAN_16, "", $conf);
}
if ($menu_order != 1) {
$text .= $frm->form_option(MENLAN_17, "", "inc.{$menu_info}");
$text .= $frm->form_option(MENLAN_24, "", "top.{$menu_info}");
}
if ($menu_count != $menu_order) {
$text .= $frm->form_option(MENLAN_18, "", "dec.{$menu_info}");
$text .= $frm->form_option(MENLAN_23, "", "bot.{$menu_info}");
}
foreach ($menu_areas as $menu_act) {
if ($menu != $menu_act) {
$text .= $frm->form_option(MENLAN_19." ".$menu_act, "", "move.{$menu_info}.".$menu_act);
}
}
$text .= $frm->form_option(MENLAN_20, "", "adv.{$menu_info}");
$text .= $frm->form_select_close();
$ns->tablerender($caption, $text);
echo "<div><br /></div>";
}
echo $frm->form_close();
}
if(isset($sc_style['MENU']['post']) && strpos($str, 'ret') !== false) {
echo $sc_style['MENU']['post'];
}
}
else if (strstr($str, "SETSTYLE")) {
$tmp = explode("=", $str);
$style = preg_replace("/\{SETSTYLE=(.*?)\}/si", "\\1", $str);
}
else if (strstr($str, "SITEDISCLAIMER")) {
echo "[Sitedisclaimer]";
}
}
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
require_once("footer.php");
?>

191
e107_admin/message.php Normal file
View File

@@ -0,0 +1,191 @@
<?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_admin/message.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:25 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
$e_sub_cat = 'message';
require_once("auth.php");
$gen = new convert;
$messageTypes = array("Broken Download", "Dev Team Message");
$queryString = "";
foreach($messageTypes as $types) {
$queryString .= " gen_type='$types' OR";
}
$queryString = substr($queryString, 0, -3);
if(isset($_POST['delete_message']))
{
if(preg_match("/\s[0-9]+/si", $_POST['delete_message'], $match))
{
$id = $match[0];
$sql->db_Delete("generic", "gen_id=$id");
$message = MESSLAN_3;
}
}
if(isset($_POST['delete_all']) && isset($_POST['deleteconfirm']))
{
$sql->db_Delete("generic", $queryString);
$message = MESSLAN_6;
}
if (isset($message)) {
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
if($amount = $sql -> db_Select("generic", "*", $queryString))
{
$text = "<table style='width: 98%;' class='fborder'>\n<form method='post' action='".e_SELF."'>\n";
$messages = $sql -> db_getList();
foreach($messages as $message)
{
extract($message);
$sql -> db_Select("user", "user_name", "user_id=$gen_user_id");
$user = $sql -> db_Fetch();
$user = "<a href='".e_BASE."user.php?id.$gen_user_id'>".$user['user_name']."</a>";
switch($gen_type)
{
case "Broken Download":
$link = "<a href='".e_BASE."download.php?view.$gen_intdata' rel='external' title='".MESSLAN_11."'>$gen_ip</a>";
$link .= " [<a href='".e_ADMIN."download.php?create.edit.".$gen_intdata."'>".LAN_EDIT."</a>]";
break;
case "Dev Team Message":
$link = "";
break;
}
$text .= "<tr>
<td style='width: 100%;' class='forumheader3'><b>".MESSLAN_8."</b>: $gen_type<br />
<b>".MESSLAN_9."</b>: ".$gen->convert_date($gen_datestamp, 'long')."<br />
<b>".MESSLAN_10."</b>: $user<br />
<b>".MESSLAN_13."</b>: $link ";
($gen_chardata ? "<br /><b>".MESSLAN_12."</b>: $gen_chardata" : "")."<br /><input class='button' type='submit' name='delete_message' value='".MESSLAN_2." $gen_id' />
</td>\n</tr>\n";
}
$text .= "
<tr>
<td><br /><input class='button' type='submit' name='delete_all' value='".MESSLAN_4."' />
<input type='checkbox' name='deleteconfirm' value='1' /> ".MESSLAN_5."
</td>
</tr>
</form></table>";
}
else
{
$text = MESSLAN_7;
}
$ns->tablerender(MESSLAN_1, $text);
require_once("footer.php");
/*
if ($action != "edit") {
$text = $rs->form_open("post", e_SELF, "ban_form")."<div style='text-align:center'>".$rs->form_hidden("ban_secure", "1")."<div style='padding : 1px; ".ADMIN_WIDTH."; height : 170px; overflow : auto; margin-left: auto; margin-right: auto;'>\n";
if (!$ban_total = $sql->db_Select("banlist")) {
$text .= "<div style='text-align:center'>".BANLAN_2."</div>";
} else {
$text .= "<table class='fborder' style='width:99%;'>
<tr>
<td style='width:70%' class='fcaption'>".BANLAN_10."</td>
<td style='width:30%' class='fcaption'>".BANLAN_11."</td>
</tr>";
$count = 0;
while ($row = $sql->db_Fetch()) {
extract($row);
$text .= "<tr><td style='width:70%' class='forumheader3'>$banlist_ip<br />".BANLAN_7.": $banlist_reason</td>
<td style='width:30%; text-align:center' class='forumheader3'>".$rs->form_button("submit", "main_edit_$count", BANLAN_12, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?edit-$banlist_ip'\"").$rs->form_button("submit", "main_delete_$count", BANLAN_4, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?remove-$banlist_ip'\"")."</td>\n</tr>";
$count++;
}
$text .= "</table>\n";
}
$text .= "</div></div>".$rs->form_close();
$ns->tablerender(BANLAN_3, $text);
}
if ($action == "edit") {
$sql2->db_Select("banlist", "*", "banlist_ip='$sub_action'");
$row = $sql2->db_Fetch();
extract($row);
} else {
unset($banlist_ip, $banlist_reason);
if (e_QUERY && strpos($_SERVER["HTTP_REFERER"], "userinfo")) {
$banlist_ip = $action;
}
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:30%' class='forumheader3'>".BANLAN_5.": </td>
<td style='width:70%' class='forumheader3'>
<input class='tbox' type='text' name='ban_ip' size='40' value='".$banlist_ip."' maxlength='200' />
</td>
</tr>
<tr>
<td style='width:20%' class='forumheader3'>".BANLAN_7.": </td>
<td style='width:80%' class='forumheader3'>
<textarea class='tbox' name='ban_reason' cols='50' rows='4'>$banlist_reason</textarea>
</td>
</tr>
<tr style='vertical-align:top'>
<td colspan='2' style='text-align:center' class='forumheader'>".
($action == "edit" ? "<input type='hidden' name='old_ip' value='$banlist_ip' /><input class='button' type='submit' name='update_ban' value='".BANLAN_13."' />" : "<input class='button' type='submit' name='add_ban' value='".BANLAN_8."' />")."
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(BANLAN_9, $text);
require_once("footer.php");
*/
?>

141
e107_admin/meta.php Normal file
View File

@@ -0,0 +1,141 @@
<?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_admin/meta.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:25 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("T")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'meta';
require_once("auth.php");
$current_lang = ($sql->mySQLlanguage != "") ? $sql->mySQLlanguage : $pref['sitelanguage'];
if (isset($_POST['metasubmit'])) {
$tmp = $pref['meta_tag'];
$langs = explode(",",e_LANLIST);
foreach($langs as $lan){
$meta_tag[$lan] = $tmp[$lan];
$meta_diz[$lan] = $pref['meta_description'][$lan];
$meta_keywords[$lan] = $pref['meta_keywords'][$lan];
$meta_copyright[$lan] = $pref['meta_copyright'][$lan];
$meta_author[$lan] = $pref['meta_author'][$lan];
}
$meta_tag[$current_lang] = strip_if_magic(chop($_POST['meta']));
$meta_diz[$current_lang] = strip_if_magic(chop($_POST['meta_description']));
$meta_keywords[$current_lang] = strip_if_magic(chop($_POST['meta_keywords']));
$meta_copyright[$current_lang] = strip_if_magic(chop($_POST['meta_copyright']));
$meta_author[$current_lang] = strip_if_magic(chop($_POST['meta_author']));
$pref['meta_news_summary'] = $_POST['meta_news_summary'];
$pref['meta_tag'] = $meta_tag;
$pref['meta_description'] = $meta_diz;
$pref['meta_keywords'] = $meta_keywords;
$pref['meta_copyright'] = $meta_copyright;
$pref['meta_author'] = $meta_author;
/*
if($pref['meta_tag'][$current_lang] == ""){
unset($meta_tag[$current_lang]);
}*/
save_prefs();
$message = METLAN_1;
}
if ($message) {
$ns->tablerender(METLAN_4, "<div style='text-align:center'>".METLAN_1." (".$current_lang.").</div>");
}
$meta = $pref['meta_tag'];
$meta_diz = $pref['meta_description'];
$meta_keywords = $pref['meta_keywords'];
$meta_copyright = $pref['meta_copyright'];
$meta_author = $pref['meta_author'];
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."' id='dataform'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:25%' class='forumheader3'>".METLAN_9."</td>
<td style='width:75%' class='forumheader3'>
<input class='tbox' style='width:90%' size='70' type='text' name='meta_description' value='".$meta_diz[$current_lang]."' />
</td>
</tr>
<tr>
<td style='width:25%' class='forumheader3'>".METLAN_10."</td>
<td style='width:75%' class='forumheader3'>
<input class='tbox' style='width:90%' size='70' type='text' name='meta_keywords' value='".$meta_keywords[$current_lang]."' />
</td>
</tr>
<tr>
<td style='width:25%' class='forumheader3'>".METLAN_11."</td>
<td style='width:75%' class='forumheader3'>
<input class='tbox' style='width:90%' size='70' type='text' name='meta_copyright' value='".$meta_copyright[$current_lang]."' />
</td>
</tr>
<tr>
<td style='width:25%' class='forumheader3'>".METLAN_13."</td>
<td style='width:75%' class='forumheader3'>
<input class='tbox' style='width:90%' size='70' type='text' name='meta_author' value=\"".$meta_author[$current_lang]."\" />
</td>
</tr>
<tr>
<td style='width:25%' class='forumheader3'>".METLAN_2.":
<span class='smalltext'><br /><br />eg.
&lt;meta name='author' content='your name' /&gt; </span>
</td>
<td style='width:75%' class='forumheader3'>
<textarea class='tbox' title=\"eg. <meta name='author' content='your name' />\" id='meta' name='meta' cols='70'
rows='10' style='width:90%' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".str_replace("<","&lt;",$tp->toForm($meta[$current_lang]))."</textarea>
<br />";
$text .= "</td>
</tr>
<tr>
<td style='width:25%' class='forumheader3'>".METLAN_12."</td>
<td class='forumheader3' style='text-align:left;width:75%' >";
$checked = ($pref['meta_news_summary']) ? "checked='checked'" : "";
$text .= "
<input type='checkbox' name='meta_news_summary' value='1' {$checked} />
</td>
</tr>
<tr><td colspan='2' style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='metasubmit' value='".METLAN_3."' />
</td>
</tr>
</table>
</form>
</div>";
$ns -> tablerender(METLAN_8." (".$current_lang.")", $text);
require_once("footer.php");
?>

179
e107_admin/modcomment.php Normal file
View File

@@ -0,0 +1,179 @@
<?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_admin/modcomment.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:25 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("B")) {
header("location:".e_BASE."index.php");
exit;
}
require_once("auth.php");
require_once(e_HANDLER."comment_class.php");
$cobj = new comment;
global $tp;
$tmp = explode(".", e_QUERY);
$table = $tmp[0];
$id = intval($tmp[1]);
$editid = intval($tmp[2]);
$type = $cobj -> getCommentType($table);
if (isset($_POST['moderate'])) {
if (isset($_POST['comment_comment'])) {
$sql->db_Update("comments", "comment_comment='".$tp -> todb($_POST['comment_comment'])."' WHERE comment_id='$editid' ");
header("location: ".e_ADMIN."modcomment.php?{$table}.{$id}"); exit;
}
if (isset($_POST['comment_lock']) && $_POST['comment_lock'] == "1" && $_POST['comment_lock'] != $_POST['current_lock']) {
$sql->db_Update("comments", "comment_lock='1' WHERE comment_item_id='$id' ");
}
if ((!isset($_POST['comment_lock']) || $_POST['comment_lock'] == "0") && $_POST['comment_lock'] != $_POST['current_lock']) {
$sql->db_Update("comments", "comment_lock='0' WHERE comment_item_id='$id' ");
}
if (is_array($_POST['comment_blocked'])) {
while (list ($key, $cid) = each ($_POST['comment_blocked'])) {
$sql->db_Update("comments", "comment_blocked='1' WHERE comment_id='$cid' ");
}
}
if (is_array($_POST['comment_unblocked'])) {
while (list ($key, $cid) = each ($_POST['comment_unblocked'])) {
$sql->db_Update("comments", "comment_blocked='0' WHERE comment_id='$cid' ");
}
}
if (is_array($_POST['comment_delete'])) {
while (list ($key, $cid) = each ($_POST['comment_delete'])) {
if ($sql->db_Select("comments", "*", "comment_id='$cid' ")) {
$row = $sql->db_Fetch();
delete_children($row, $cid);
}
}
}
$e107cache->clear("comment");
$e107cache->clear("news");
$e107cache->clear($table);
$message = MDCLAN_1;
}
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."?".e_QUERY."'>
<table class='fborder' style='".ADMIN_WIDTH."'>";
if ($editid)
{
if (!$sql->db_Select("comments", "*", "comment_id=$editid")) {
$text .= "<tr><td class='forumheader3' style='text-align:center'>".MDCLAN_2.".</td></tr>";
}
else
{
$row = $sql->db_Fetch();
$text .= "<tr><td><textarea class='tbox' name='comment_comment' cols='1' rows='15' style='width:100%;'>".$row['comment_comment']."</textarea></td></tr>";
$text .= "<tr><td colspan='5' class='forumheader' style='text-align:center'><input class='button' type='submit' name='moderate' value='".MDCLAN_8."' /></td></tr>";
}
$text .= "</table></form></div>";
$ns->tablerender(MDCLAN_8, $text);
require_once("footer.php"); exit;
}
if (!$sql->db_Select("comments", "*", "(comment_type='".$type."' OR comment_type='".$table."') AND comment_item_id=$id")) {
$text .= "<tr><td class='forumheader3' style='text-align:center'>".MDCLAN_2.".</td></tr>";
} else {
$con = new convert;
$commentArray = $sql -> db_getList();
$total_comments = count($commentArray);
$comments = "";
foreach($commentArray as $row)
{
$comment_lock = $row['comment_lock'];
$total_blocked += $row['comment_blocked'];
$datestamp = $con->convert_date($row['comment_datestamp'], "short");
$comment_author_id = substr($row['comment_author'], 0, strpos($row['comment_author'], "."));
if ($comment_author_id) {
$sql->db_Select("user", "*", "user_id='$comment_author_id' ");
$rowu = $sql->db_Fetch();
$comment_nick = "<a href='".e_BASE."user.php?id.".$rowu['user_id']."'>".$rowu['user_name']."</a>";
$comment_str = MDCLAN_3." #".$rowu['user_id'];
} else {
$comment_str = MDCLAN_4;
$comment_nick = preg_replace("#[0-9]+\.#", "", $row['comment_author']);
}
$row['comment_comment'] = $tp->toHTML($row['comment_comment'], TRUE, "");
$comments .= "
<tr>
<td class='forumheader3' style='width:5%; text-align:center;'>".($row['comment_blocked'] ? "<img src='".e_IMAGE."admin_images/blocked.png' />" : "&nbsp;")."</td>
<td class='forumheader3' style='width:15%;'>".$datestamp."</td>
<td class='forumheader3' style='width:15%;'><b>".$comment_nick."</b><br />".$comment_str."</td>
<td class='forumheader3' style='width:40%;'>".$row['comment_comment']."</td>
<td class='forumheader3' style='width:25%;'>
<a href='".e_ADMIN."modcomment.php?{$table}.{$id}.".$row['comment_id']."'><img src='".e_IMAGE."admin_images/edit_16.png' alt='".LAN_EDIT."' title='".LAN_EDIT."' style='border:none' /></a>"
."&nbsp;".($row['comment_blocked'] ? "<input type='checkbox' name='comment_unblocked[]' value='".$row['comment_id']."' /> ".MDCLAN_5."" : "<input type='checkbox' name='comment_blocked[]' value='".$row['comment_id']."' /> ".MDCLAN_6."")
."&nbsp;<input type='checkbox' name='comment_delete[]' value='".$row['comment_id']."' /> ".LAN_DELETE."
</td>
</tr>";
}
$text .= "
<tr><td colspan='5' class='fcaption'>".MDCLAN_10."</td></tr>
<tr>
<td class='forumheader3' style='text-align:right' colspan='4'>".MDCLAN_14.":</td>
<td style='width:25%;' class='forumheader3'>
<input type='radio' name='comment_lock' value='0' ".(!$comment_lock ? " checked='checked'" : "")." /> ".MDCLAN_15."
<input type='radio' name='comment_lock' value='1' ".($comment_lock ? " checked='checked'" : "")." /> ".MDCLAN_16."
<input type='hidden' name='current_lock' value='".$comment_lock."' />
</td>
</tr>
<tr><td colspan='5' class='fcaption'>comments (".$total_comments." ".($total_comments == "1" ? MDCLAN_11 : MDCLAN_12).", ".$total_blocked." ".MDCLAN_13.")</td></tr>
".$comments."
<tr><td colspan='5' class='forumheader' style='text-align:center'>".MDCLAN_9."</td></tr>
<tr><td colspan='5' class='forumheader' style='text-align:center'><input class='button' type='submit' name='moderate' value='".MDCLAN_8."' /></td></tr>
";
}
$text .= "</table></form></div>";
$ns->tablerender(MDCLAN_8, $text);
require_once("footer.php");
function delete_children($row, $cid) {
global $sql, $sql2, $table;
$tmp = explode(".", $row['comment_author']);
$u_id = $tmp[0];
if ($u_id >= 1) {
$sql->db_Update("user", "user_comments=user_comments-1 WHERE user_id='$u_id'");
}
if($table == "news"){
$sql->db_Update("news", "news_comment_total=news_comment_total-1 WHERE news_id='".$row['comment_item_id']."'");
}
if ($sql2->db_Select("comments", "*", "comment_pid='".$row['comment_id']."'")) {
while ($row2 = $sql2->db_Fetch()) {
delete_children($row2, $row2['comment_id']);
}
}
$c_del[] = $cid;
while (list ($key, $cid) = each ($c_del)) {
$sql->db_Delete("comments", "comment_id='$cid'");
}
}
?>

1105
e107_admin/newspost.php Normal file

File diff suppressed because it is too large Load Diff

187
e107_admin/notify.php Normal file
View File

@@ -0,0 +1,187 @@
<?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_admin/notify.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:26 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once('../class2.php');
if (!getperms('O')) {
header('location:'.e_BASE.'index.php');
exit;
}
$e_sub_cat = 'notify';
require_once('auth.php');
require_once(e_HANDLER.'userclass_class.php');
require_once(e_HANDLER.'form_handler.php');
$rs = new form;
$nc = new notify_config;
if (isset($_POST['update'])) {
$nc -> update();
}
$nc -> config();
class notify_config {
var $notify_prefs;
function notify_config() {
global $sysprefs, $eArrayStorage, $tp, $sql,$pref;
$this -> notify_prefs = $sysprefs -> get('notify_prefs');
$this -> notify_prefs = $eArrayStorage -> ReadArray($this -> notify_prefs);
// load every e_notify.php file.
foreach($pref['e_notify_list'] as $val)
{
if (!isset($this -> notify_prefs['plugins'][$val]))
{
$this -> notify_prefs['plugins'][$val] = TRUE;
if (is_readable(e_PLUGIN.$val."/e_notify.php"))
{
require_once(e_PLUGIN.$val.'/e_notify.php');
foreach ($config_events as $event_id => $event_text)
{
$this -> notify_prefs['event'][$event_id] = array('type' => 'off', 'class' => '254', 'email' => '');
}
$recalibrate = true;
}
}
}
if ($recalibrate) {
$s_prefs = $tp -> toDB($this -> notify_prefs);
$s_prefs = $eArrayStorage -> WriteArray($s_prefs);
$sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'");
}
}
function config() {
global $ns, $rs;
$text = "<div style='text-align: center'>
<form action='".e_SELF."?results' method='post' id='scanform'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='fcaption' colspan='2'>".NT_LAN_2.":</td>
</tr>";
$text .= "<tr>
<td colspan='2' class='forumheader'>".NU_LAN_1."</td>
</tr>";
$text .= $this -> render_event('usersup', NU_LAN_2);
$text .= $this -> render_event('userveri', NU_LAN_3);
$text .= $this -> render_event('login', NU_LAN_4);
$text .= $this -> render_event('logout', NU_LAN_5);
$text .= "<tr>
<td colspan='2' class='forumheader'>".NS_LAN_1."</td>
</tr>";
$text .= $this -> render_event('flood', NS_LAN_2);
$text .= "<tr>
<td colspan='2' class='forumheader'>".NN_LAN_1."</td>
</tr>";
$text .= $this -> render_event('subnews', NN_LAN_2);
$text .= $this -> render_event('newspost', NN_LAN_3);
$text .= $this -> render_event('newsupd', NN_LAN_4);
$text .= $this -> render_event('newsdel', NN_LAN_5);
$text .= "<tr>
<td colspan='2' class='forumheader'>".NF_LAN_1."</td>
</tr>";
$text .= $this -> render_event('fileupload', NF_LAN_2);
foreach ($this -> notify_prefs['plugins'] as $plugin_id => $plugin_settings) {
if(is_readable(e_PLUGIN.$plugin_id.'/e_notify.php'))
{
require(e_PLUGIN.$plugin_id.'/e_notify.php');
$text .= "<tr>
<td colspan='2' class='forumheader'>".$config_category."</td>
</tr>";
foreach ($config_events as $event_id => $event_text) {
$text .= $this -> render_event($event_id, $event_text);
}
}
}
$text .= "<tr>
<td colspan='2' style='text-align:center' class='forumheader'>".$rs -> form_button('submit', 'update', LAN_UPDATE)."</td>
</tr>
</table>
</form>
</div>";
$ns -> tablerender(NT_LAN_1, $text);
}
function render_event($id, $description) {
global $rs, $tp;
$text .= "<tr>
<td class='forumheader3' style='width: 30%'>
".$description.":
</td>
<td class='forumheader3' style='width: 70%; white-space: nowrap'>
<input type='radio' name='event[".$id."][type]' value='off' ".(($this -> notify_prefs['event'][$id]['type'] == 'off' || !$this -> notify_prefs['event'][$id]['type']) ? " checked='checked'" : "")." /> ".NT_LAN_3."
<input type='radio' name='event[".$id."][type]' value='main' ".($this -> notify_prefs['event'][$id]['type'] == 'main' ? " checked='checked'" : "")." /> ".NT_LAN_4."
<input type='radio' name='event[".$id."][type]' value='class' ".($this -> notify_prefs['event'][$id]['type'] == 'class' ? " checked='checked'" : "")." /> ".NT_LAN_5.":
".r_userclass('event['.$id.'][class]', $this -> notify_prefs['event'][$id]['class'], 'off', 'member,admin,classes')."
<input type='radio' name='event[".$id."][type]' value='email' ".($this -> notify_prefs['event'][$id]['type'] == 'email' ? " checked='checked'" : "")." /> ".NT_LAN_6.":
".$rs -> form_text('event['.$id.'][email]', 17, $tp -> toForm($this -> notify_prefs['event'][$id]['email']))."
</td>
</tr>";
return $text;
}
function update() {
global $sql, $pref, $tp, $eArrayStorage;
foreach ($_POST['event'] as $key => $value) {
if ($this -> update_event($key)) {
$active = TRUE;
}
}
$s_prefs = $tp -> toDB($this -> notify_prefs);
$s_prefs = $eArrayStorage -> WriteArray($s_prefs);
$sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'");
if ($active) {
$pref['notify'] = TRUE;
} else {
$pref['notify'] = FALSE;
}
save_prefs();
}
function update_event($id) {
$this -> notify_prefs['event'][$id]['type'] = $_POST['event'][$id]['type'];
$this -> notify_prefs['event'][$id]['class'] = $_POST['event'][$id]['class'];
$this -> notify_prefs['event'][$id]['email'] = $_POST['event'][$id]['email'];
if ($this -> notify_prefs['event'][$id]['type'] != 'off') {
return TRUE;
} else {
return FALSE;
}
}
}
require_once('footer.php');
?>

34
e107_admin/phpinfo.php Normal file
View File

@@ -0,0 +1,34 @@
<?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_admin/phpinfo.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:27 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("0")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'phpinfo';
require_once("auth.php");
ob_start();
phpinfo();
$phpinfo .= ob_get_contents();
$phpinfo = preg_replace("#^.*<body>#is", "", $phpinfo);
ob_end_clean();
$ns->tablerender("PHPInfo", $phpinfo);
require_once("footer.php");
?>

575
e107_admin/plugin.php Normal file
View File

@@ -0,0 +1,575 @@
<?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_admin/plugin.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:27 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("Z")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'plug_manage';
require_once("auth.php");
require_once(e_HANDLER.'plugin_class.php');
require_once(e_HANDLER.'file_class.php');
$plugin = new e107plugin;
$tmp = explode('.', e_QUERY);
$action = $tmp[0];
$id = intval($tmp[1]);
if (isset($_POST['upload'])) {
if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
exit;
}
extract($_FILES);
/* check if e_PLUGIN dir is writable ... */
if(!is_writable(e_PLUGIN)) {
/* still not writable - spawn error message */
$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_39);
} else {
/* e_PLUGIN is writable - continue */
$pref['upload_storagetype'] = "1";
require_once(e_HANDLER."upload_handler.php");
$fileName = $file_userfile['name'][0];
$fileSize = $file_userfile['size'][0];
$fileType = $file_userfile['type'][0];
if(strstr($file_userfile['type'][0], "gzip")) {
$fileType = "tar";
} else if (strstr($file_userfile['type'][0], "zip")) {
$fileType = "zip";
} else {
/* not zip or tar - spawn error message */
$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_41);
require_once("footer.php");
exit;
}
if ($fileSize) {
$opref = $pref['upload_storagetype'];
$pref['upload_storagetype'] = 1; /* temporarily set upload type pref to flatfile */
$uploaded = file_upload(e_PLUGIN);
$pref['upload_storagetype'] = $opref;
$archiveName = $uploaded[0]['name'];
/* attempt to unarchive ... */
if($fileType == "zip") {
require_once(e_HANDLER."pclzip.lib.php");
$archive = new PclZip(e_PLUGIN.$archiveName);
$unarc = ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_PLUGIN, PCLZIP_OPT_SET_CHMOD, 0666));
} else {
require_once(e_HANDLER."pcltar.lib.php");
$unarc = ($fileList = PclTarExtract($archiveName, e_PLUGIN));
}
if(!$unarc) {
/* unarc failed ... */
if($fileType == "zip") {
$error = "PCLZIP extract error: '".$archive -> errorName(TRUE)."'";
} else {
$error = "PCLTAR extract error: ".PclErrorString().", code: ".intval(PclErrorCode());
}
$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_42." ".$archiveName." ".$error);
require_once("footer.php");
exit;
}
/* ok it looks like the unarc succeeded - continue */
/* get folder name ... */
$folderName = substr($fileList[0]['stored_filename'], 0, (strpos($fileList[0]['stored_filename'], "/")));
if(file_exists(e_PLUGIN.$folderName."/plugin.php")) {
/* upload is a plugin */
$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_43);
} else {
/* upload is a menu */
$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_45);
}
/* attempt to delete uploaded archive */
@unlink(e_PLUGIN.$archiveName);
}
}
}
if ($action == 'uninstall')
{
if(!isset($_POST['uninstall_confirm']))
{
show_uninstall_confirm();
exit;
}
$id = intval($id);
$plug = $plugin->getinfo($id);
//Uninstall Plugin
if ($plug['plugin_installflag'] == TRUE ) {
include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
$func = $eplug_folder.'_uninstall';
if (function_exists($func)) {
$text .= call_user_func($func);
}
if($_POST['delete_tables'])
{
if (is_array($eplug_table_names))
{
$result = $plugin->manage_tables('remove', $eplug_table_names);
if ($result !== TRUE)
{
$text .= EPL_ADLAN_27.' <b>'.$mySQLprefix.$result.'</b> - '.EPL_ADLAN_30.'<br />';
}
else
{
$text .= EPL_ADLAN_28."<br />";
}
}
}
else
{
$text .= "Tables not deleted during uninstall process by request<br />";
}
if (is_array($eplug_prefs)) {
$plugin->manage_prefs('remove', $eplug_prefs);
$text .= EPL_ADLAN_29."<br />";
}
if (is_array($eplug_comment_ids)) {
$text .= ($plugin->manage_comments('remove', $eplug_comment_ids)) ? EPL_ADLAN_50."<br />" : "";
}
if ($eplug_module) {
$plugin->manage_plugin_prefs('remove', 'modules', $eplug_folder);
}
if ($eplug_status) {
$plugin->manage_plugin_prefs('remove', 'plug_status', $eplug_folder);
}
if ($eplug_latest) {
$plugin->manage_plugin_prefs('remove', 'plug_latest', $eplug_folder);
}
if (is_array($eplug_array_pref))
{
foreach($eplug_array_pref as $key => $val)
{
$plugin->manage_plugin_prefs('remove', $key, $val);
}
}
if (is_array($eplug_sc))
{
$plugin->manage_plugin_prefs('remove', 'plug_sc', $eplug_folder, $eplug_sc);
}
if (is_array($eplug_bb))
{
$plugin->manage_plugin_prefs('remove', 'plug_bb', $eplug_folder, $eplug_bb);
}
if (is_array($eplug_user_prefs)) {
$sql = new db;
$sql->db_Select("core", " e107_value", " e107_name='user_entended'");
$row = $sql->db_Fetch();
$user_entended = unserialize($row[0]);
$user_entended = array_values(array_diff($user_entended, array_keys($eplug_user_prefs)));
if ($user_entended == NULL) {
$sql->db_Delete("core", "e107_name='user_entended'");
} else {
$tmp = addslashes(serialize($user_entended));
$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
}
while (list($key, $e_user_pref) = each($eplug_user_prefs)) {
unset($user_pref[$key]);
}
save_prefs("user");
}
if ($eplug_menu_name) {
$sql->db_Delete('menus', "menu_name='$eplug_menu_name' ");
}
if ($eplug_link) {
$plugin->manage_link('remove', '', $eplug_link_name);
}
if ($eplug_userclass) {
$plugin->manage_userclass('remove', $eplug_userclass);
}
$plugin -> manage_search('remove', $eplug_folder);
$plugin -> manage_notify('remove', $eplug_folder);
$sql->db_Update('plugin', "plugin_installflag=0, plugin_version='{$eplug_version}' WHERE plugin_id='{$id}' ");
if($_POST['delete_files'])
{
include_once(e_HANDLER."file_class.php");
$fi = new e_file;
$result = $fi->rmtree(e_PLUGIN.$eplug_folder);
$text .= ($result ? "<br />All files removed from ".e_PLUGIN.$eplug_folder : '<br />File deletion failed<br />'.EPL_ADLAN_31.' <b>'.e_PLUGIN.$eplug_folder.'</b> '.EPL_ADLAN_32);
}
else
{
$text .= '<br />'.EPL_ADLAN_31.' <b>'.e_PLUGIN.$eplug_folder.'</b> '.EPL_ADLAN_32;
}
$ns->tablerender(EPL_ADLAN_1.' '.$tp->toHtml($eplug_name,"","defs,emotes_off, no_make_clickable"), $text);
$text = "";
$plugin -> save_addon_prefs();
}
}
if ($action == 'install') {
$plugin->install_plugin(intval($id));
$plugin ->save_addon_prefs();
}
if ($action == 'upgrade') {
$plug = $plugin->getinfo($id);
include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
$func = $eplug_folder.'_upgrade';
if (function_exists($func)) {
$text .= call_user_func($func);
}
if (is_array($upgrade_alter_tables)) {
$result = $plugin->manage_tables('upgrade', $upgrade_alter_tables);
if (!$result) {
$text .= EPL_ADLAN_9.'<br />';
} else {
$text .= EPL_ADLAN_7."<br />";
}
}
if ($eplug_module) {
$plugin->manage_plugin_prefs('add', 'modules', $eplug_folder);
} else {
$plugin->manage_plugin_prefs('remove', 'modules', $eplug_folder);
}
if ($eplug_status) {
$plugin->manage_plugin_prefs('add', 'plug_status', $eplug_folder);
} else {
$plugin->manage_plugin_prefs('remove', 'plug_status', $eplug_folder);
}
if ($eplug_latest) {
$plugin->manage_plugin_prefs('add', 'plug_latest', $eplug_folder);
} else {
$plugin->manage_plugin_prefs('remove', 'plug_latest', $eplug_folder);
}
if (is_array($upgrade_add_eplug_sc))
{
$plugin->manage_plugin_prefs('add', 'plug_sc', $eplug_folder, $eplug_sc);
}
if (is_array($upgrade_remove_eplug_sc))
{
$plugin->manage_plugin_prefs('remove', 'plug_sc', $eplug_folder, $eplug_sc);
}
if (is_array($upgrade_add_eplug_bb))
{
$plugin->manage_plugin_prefs('add', 'plug_bb', $eplug_folder, $eplug_bb);
}
if (is_array($upgrade_remove_eplug_bb))
{
$plugin->manage_plugin_prefs('remove', 'plug_bb', $eplug_folder, $eplug_bb);
}
if (is_array($upgrade_add_prefs)) {
$plugin->manage_prefs('add', $upgrade_add_prefs);
$text .= EPL_ADLAN_8.'<br />';
}
if (is_array($upgrade_remove_prefs)) {
$plugin->manage_prefs('remove', $upgrade_remove_prefs);
}
if (is_array($upgrade_add_user_prefs)) {
$sql = new db;
$sql->db_Select("core", " e107_value", " e107_name='user_entended'");
$row = $sql->db_Fetch();
$user_entended = unserialize($row[0]);
while (list($key, $e_user_pref) = each($eplug_user_prefs)) {
$user_entended[] = $e_user_pref;
}
$tmp = addslashes(serialize($user_entended));
if ($sql->db_Select("core", " e107_value", " e107_name='user_entended'")) {
$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
} else {
$sql->db_Insert("core", "'user_entended', '$tmp' ");
}
$text .= EPL_ADLAN_8."<br />";
}
if (is_array($upgrade_remove_user_prefs)) {
$sql = new db;
$sql->db_Select("core", " e107_value", " e107_name='user_entended'");
$row = $sql->db_Fetch();
$user_entended = unserialize($row[0]);
$user_entended = array_values(array_diff($user_entended, $eplug_user_prefs));
if ($user_entended == NULL) {
$sql->db_Delete("core", "e107_name='user_entended'");
} else {
$tmp = addslashes(serialize($user_entended));
$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
}
}
$plugin -> manage_search('upgrade', $eplug_folder);
$plugin -> manage_notify('upgrade', $eplug_folder);
$eplug_addons = $plugin -> getAddons($eplug_folder);
$text .= (isset($eplug_upgrade_done)) ? '<br />'.$eplug_upgrade_done : "<br />".LAN_UPGRADE_SUCCESSFUL;
$sql->db_Update('plugin', "plugin_version ='{$eplug_version}', plugin_addons='{$eplug_addons}' WHERE plugin_id='$id' ");
$ns->tablerender(EPL_ADLAN_34, $text);
$plugin -> save_addon_prefs();
}
// Check for new plugins, create entry in plugin table ...
$plugin->update_plugins_table();
// ----------------------------------------------------------
// render plugin information ...
/* plugin upload form */
if(!is_writable(e_PLUGIN)) {
$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_44);
} else {
$text = "<div style='text-align:center'>
<form enctype='multipart/form-data' method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td class='forumheader3' style='width: 50%;'>".EPL_ADLAN_37."</td>
<td class='forumheader3' style='width: 50%;'>
<input type='hidden' name='MAX_FILE_SIZE' value='1000000' />
<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
<input class='tbox' type='file' name='file_userfile[]' size='50' />
</td>
</tr>
<tr>
<td colspan='2' style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='upload' value='".EPL_ADLAN_38."' />
</td>
</tr>
</table>
</form>
<br />\n";
}
// Uninstall and Install sorting should be fixed once and for all now !
$installed = $plugin->getall(1);
$uninstalled = $plugin->getall(0);
$text .= "<table style='".ADMIN_WIDTH."' class='fborder'>";
$text .= "<tr><td class='fcaption' colspan='3'>".EPL_ADLAN_22."</td></tr>";
$text .= render_plugs($installed);
$text .= "<tr><td class='fcaption' colspan='3'>".EPL_ADLAN_23."</td></tr>";
$text .= render_plugs($uninstalled);
function render_plugs($pluginList){
global $tp;
foreach($pluginList as $plug) {
//Unset any possible eplug_ variables set by last plugin.php
$defined_vars = array_keys(get_defined_vars());
foreach($defined_vars as $varname) {
if (substr($varname, 0, 6) == 'eplug_' || substr($varname, 0, 8) == 'upgrade_') {
unset($$varname);
}
}
include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
if ($eplug_conffile || is_array($eplug_table_names) || is_array($eplug_prefs) || is_array($eplug_user_prefs) || is_array($eplug_sc) || is_array($eplug_bb) || $eplug_module || $eplug_userclass || $eplug_status || $eplug_latest) {
$img = (!$plug['plugin_installflag'] ? "<img src='".e_IMAGE."admin_images/uninstalled.png' alt='' />" : "<img src='".e_IMAGE."admin_images/installed.png' alt='' />");
} else {
$img = "<img src='".e_IMAGE."admin_images/noinstall.png' alt='' />";
}
if ($plug['plugin_version'] != $eplug_version && $plug['plugin_installflag']) {
$img = "<img src='".e_IMAGE."admin_images/upgrade.png' alt='' />";
}
$plugin_icon = $eplug_icon ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px;vertical-align: bottom; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
if ($eplug_conffile && $plug['plugin_installflag'] == TRUE) {
$conf_title = LAN_CONFIGURE.' '.$tp->toHtml($eplug_name,"","defs,emotes_off, no_make_clickable");
$plugin_icon = "<a title='{$conf_title}' href='".e_PLUGIN.$eplug_folder.'/'.$eplug_conffile."' >".$plugin_icon.'</a>';
}
$text .= "
<tr>
<td class='forumheader3' style='width:160px; text-align:center; vertical-align:top'>
<table style='width:100%'><tr><td style='text-align:left;width:40px;vertical-align:top'>
".$plugin_icon."
</td><td>
$img <b>".$tp->toHTML($plug['plugin_name'],FALSE,"defs,emotes_off, no_make_clickable")."</b><br />".EPL_ADLAN_11." {$plug['plugin_version']}
<br />";
$text .="</td>
</tr></table>
</td>
<td class='forumheader3' style='vertical-align:top'>
<table cellspacing='3' style='width:98%'>
<tr><td style='vertical-align:top;width:15%'><b>".EPL_ADLAN_12."</b>:</td><td style='vertical-align:top'><a href='mailto:$eplug_email' title='$eplug_email'>$eplug_author</a>&nbsp;";
if($eplug_url){
$text .= "&nbsp;&nbsp;[ <a href='$eplug_url' title='$eplug_url' >".EPL_WEBSITE."</a> ] ";
}
$text .="</td></tr>
<tr><td style='vertical-align:top'><b>".EPL_ADLAN_14."</b>:</td><td style='vertical-align:top'> $eplug_description&nbsp;";
if ($eplug_readme) {
$text .= "[ <a href='".e_PLUGIN.$eplug_folder."/".$eplug_readme."'>".$eplug_readme."</a> ]";
}
$text .="</td></tr>
<tr><td style='vertical-align:top'><b>".EPL_ADLAN_13."</b>:</td><td style='vertical-align:top'><span style='vertical-align:top'> $eplug_compatible&nbsp;</span>";
if ($eplug_compliant) {
$text .= "&nbsp;&nbsp;<img src='".e_IMAGE."generic/valid-xhtml11_small.png' alt='' style='margin-top:0px' />";
}
$text .="</td></tr>\n";
$text .= "</table></td>";
$text .= "<td class='forumheader3' style='width:70px;text-align:center'>";
if ($eplug_conffile || $eplug_module || is_array($eplug_table_names) || is_array($eplug_prefs) || is_array($eplug_user_prefs) || is_array($eplug_sc) || is_array($eplug_bb) || $eplug_status || $eplug_latest) {
$text .= ($plug['plugin_installflag'] ? "<input type='button' class='button' onclick=\"location.href='".e_SELF."?uninstall.{$plug['plugin_id']}'\" title='".EPL_ADLAN_1."' value='".EPL_ADLAN_1."' /> " : "<input type='button' class='button' onclick=\"location.href='".e_SELF."?install.{$plug['plugin_id']}'\" title='".EPL_ADLAN_0."' value='".EPL_ADLAN_0."' />");
} else {
if ($eplug_menu_name) {
$text .= EPL_NOINSTALL.str_replace("..", "", e_PLUGIN.$plug['plugin_path'])."/ ".EPL_DIRECTORY;
} else {
$text .= EPL_NOINSTALL_1.str_replace("..", "", e_PLUGIN.$plug['plugin_path'])."/ ".EPL_DIRECTORY;
if($plug['plugin_installflag'] == FALSE){
global $sql;
$sql->db_Delete('plugin', "plugin_installflag=0 AND (plugin_path='{$plug['plugin_path']}' OR plugin_path='{$plug['plugin_path']}/' ) ");
}
}
}
if ($plug['plugin_version'] != $eplug_version && $plug['plugin_installflag']) {
$text .= "<br /><input type='button' class='button' onclick=\"location.href='".e_SELF."?upgrade.{$plug['plugin_id']}'\" title='".EPL_UPGRADE." to v".$eplug_version."' value='".EPL_UPGRADE."' />";
}
$text .="</td>";
$text .= "</tr>";
}
return $text;
}
$text .= "</table>
<div style='text-align:center'><br />
<img src='".e_IMAGE."admin_images/uninstalled.png' alt='' /> ".EPL_ADLAN_23."&nbsp;&nbsp;
<img src='".e_IMAGE."admin_images/installed.png' alt='' /> ".EPL_ADLAN_22."&nbsp;&nbsp;
<img src='".e_IMAGE."admin_images/upgrade.png' alt='' /> ".EPL_ADLAN_24."&nbsp;&nbsp;
<img src='".e_IMAGE."admin_images/noinstall.png' alt='' /> ".EPL_ADLAN_25."</div></div>";
$ns->tablerender(EPL_ADLAN_16, $text);
// ----------------------------------------------------------
require_once("footer.php");
exit;
function show_uninstall_confirm()
{
global $plugin, $tp, $id, $ns;
$id = intval($id);
$plug = $plugin->getinfo($id);
if ($plug['plugin_installflag'] == TRUE )
{
include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
}
if(is_writable(e_PLUGIN.$plug['plugin_path']))
{
$del_text = "
<select class='tbox' name='delete_files'>
<option value='0'>".LAN_NO."</option>
<option value='1'>".LAN_YES."</option>
</select>
";
}
else
{
$del_text = "
".EPL_ADLAN_53."
<input type='hidden' name='delete_files' value='0' />
";
}
$text = "
<form action='".e_SELF."?".e_QUERY."' method='post'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td colspan='2' class='forumheader'>".EPL_ADLAN_54." ".$tp->toHtml($eplug_name,"","defs,emotes_off, no_make_clickable")."</td>
</tr>
<tr>
<td class='forumheader3'>".EPL_ADLAN_55."</td>
<td class='forumheader3'>".LAN_YES."</td>
</tr>
<tr>
<td class='forumheader3' style='width:75%'>
".EPL_ADLAN_57."<div class='smalltext'>".EPL_ADLAN_58."</div>
</td>
<td class='forumheader3'>
<select class='tbox' name='delete_tables'>
<option value='1'>".LAN_YES."</option>
<option value='0'>".LAN_NO."</option>
</select>
</td>
</tr>
<tr>
<td class='forumheader3'>".EPL_ADLAN_59."<div class='smalltext'>".EPL_ADLAN_60."</div></td>
<td class='forumheader3'>{$del_text}</td>
</tr>
<tr>
<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='uninstall_confirm' value=\"".EPL_ADLAN_3."\" />&nbsp;&nbsp;<input class='button' type='submit' name='uninstall_cancel' value='".EPL_ADLAN_62."' onclick=\"location.href='".e_SELF."'; return false;\"/></td>
</tr>
</table>
</form>
";
$ns->tablerender(EPL_ADLAN_63." ".$tp->toHtml($eplug_name,"","defs,emotes_off, no_make_clickable"), $text);
require_once(e_ADMIN."footer.php");
exit;
}
?>

981
e107_admin/prefs.php Normal file
View File

@@ -0,0 +1,981 @@
<?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_admin/prefs.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:28 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
include_once(e_HANDLER."userclass_class.php");
include_once(e_HANDLER."user_extended_class.php");
$ue = new e107_user_extended;
if (isset($_POST['newver'])) {
header("location:http://e107.org/index.php");
exit;
}
if (!getperms("1")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'prefs';
if (!$pref['timezone']) {
$pref['timezone'] = "GMT";
}
require_once(e_HANDLER."form_handler.php");
$rs = new form;
if ($_POST['submit_resetdisplaynames'])
{
$sql -> db_Update("user", "user_name=user_loginname");
$message = PRFLAN_157;
}
if (isset($_POST['updateprefs']))
{
unset($_POST['updateprefs']);
$_POST['cookie_name'] = str_replace(array(" ","."), "_", $_POST['cookie_name']);
$_POST['cookie_name'] = preg_replace("#[^a-zA-Z0-9_]#", "", $_POST['cookie_name']);
$_POST['siteurl'] = trim($_POST['siteurl']) ? trim($_POST['siteurl']) : SITEURL;
$_POST['siteurl'] = substr($_POST['siteurl'], -1) == "/" ? $_POST['siteurl'] : $_POST['siteurl']."/";
foreach($_POST as $key => $value)
{
$pref[$key] = $tp->toDB($value);
}
$e107cache->clear();
save_prefs();
$sql -> db_Select_gen("TRUNCATE ".MPREFIX."online");
header("location:".e_ADMIN."prefs.php?u");
exit;
}
if($sql->db_Select("plugin", "plugin_path", "plugin_installflag='1' AND plugin_path = 'alt_auth'"))
{
$authlist[] = "e107";
$handle=opendir(e_PLUGIN."alt_auth");
while ($file = readdir($handle))
{
if(preg_match("/^(.*)_auth\.php/",$file,$match))
{
$authlist[] = $match[1];
}
}
}
if ($authlist) {
$auth_dropdown .= "<select class='tbox' name='auth_method'>\n";
foreach($authlist as $a) {
$s = ($pref['auth_method'] == $a ? " selected='selected' " : "");
$auth_dropdown .= "<option {$s}>".$a."</option>\n";
}
$auth_dropdown .= "</select>\n";
} else {
$auth_dropdown = "<input type='hidden' name='auth_method' value='' />".PRFLAN_151;
$pref['auth_method'] = "";
}
require_once("auth.php");
if (isset($message)) {
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
if(e_QUERY == "u") {
$ns->tablerender("", "<div style='text-align:center'><b>".PRFLAN_106."</b></div>");
}
$handle = opendir(e_ADMIN.'includes/');
while ($file = readdir($handle)) {
if ($file != "." && $file != "..") {
$file = str_replace(".php", "", $file);
$adminlist[] = $file;
}
}
closedir($handle);
$text = "<script type=\"text/javascript\">
<!--
var hideid=\"main\";
function showhideit(showid){
if (hideid!=showid){
show=document.getElementById(showid).style;
hide=document.getElementById(hideid).style;
show.display=\"\";
hide.display=\"none\";
hideid = showid;
}
}
//-->
</script>
<div style='text-align:center'>
<div style='text-align:center; ".ADMIN_WIDTH."; margin-left: auto; margin-right: auto'>
<form method='post' action='".e_SELF."'>
<div id='main' style='text-align:center'>
<table style='width:100%' class='fborder'>
<tr>
<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_1."</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_2."</td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input class='tbox' type='text' name='sitename' size='50' value='".$pref['sitename']."' maxlength='100' />
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_3."</td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input class='tbox' type='text' name='siteurl' size='50' value='".$pref['siteurl']."' maxlength='150' /><br />
".($pref['siteurl'] == SITEURL ? "" : "<br />( ".PRFLAN_159.": <b>".SITEURL."</b> )")."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_134."<br /><span class='smalltext'>".PRFLAN_135."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='redirectsiteurl' value='1'".($pref['redirectsiteurl'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='redirectsiteurl' value='0'".(!$pref['redirectsiteurl'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_4."</td>
<td style='width:50%; text-align:right' class='forumheader3'>";
$param = "sitebutton,".e_IMAGE.",".SITEBUTTON.",81px,30px,";
$text .= $tp->parseTemplate("{IMAGESELECTOR={$param}}");
$text .= "
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_5."</td>
<td style='width:50%; text-align:right' class='forumheader3'>
<textarea class='tbox' name='sitetag' cols='59' rows='3'>".$pref['sitetag']."</textarea>
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_6."</td>
<td style='width:50%; text-align:right' class='forumheader3'>
<textarea class='tbox' name='sitedescription' cols='59' rows='6'>".$pref['sitedescription']."</textarea>
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_7."</td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input class='tbox' type='text' name='siteadmin' size='50' value='".SITEADMIN."' maxlength='100' />
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_8."</td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input class='tbox' type='text' name='siteadminemail' size='50' value='".SITEADMINEMAIL."' maxlength='100' />
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_162."<br /><span class='smalltext'>".PRFLAN_163."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<textarea class='tbox' name='sitecontactinfo' cols='59' rows='6'>".$pref['sitecontactinfo']."</textarea>
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_168."<br /><span class='smalltext'>".PRFLAN_169."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>".r_userclass("sitecontacts",$pref['sitecontacts'],"off","nobody main admin userclasses")."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_164."<br /><span class='smalltext'>".PRFLAN_165."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='contact_emailcopy' value='1'".($pref['contact_emailcopy'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='contact_emailcopy' value='0'".(!$pref['contact_emailcopy'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_9."</td>
<td style='width:50%; text-align:right' class='forumheader3'>
<textarea class='tbox' name='sitedisclaimer' cols='59' rows='6'>".$pref['sitedisclaimer']."</textarea>
</td>
</tr>
";
$text .= pref_submit();
$text .= "</table>
</div>
<div id='display' style='display:none; text-align:center'>
<table style='width:100%' class='fborder'>
<tr>
<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_13."</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_14." </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='displaythemeinfo' value='1'".($pref['displaythemeinfo'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='displaythemeinfo' value='0'".(!$pref['displaythemeinfo'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_15." </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='displayrendertime' value='1'".($pref['displayrendertime'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='displayrendertime' value='0'".(!$pref['displayrendertime'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_16." </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='displaysql' value='1'".($pref['displaysql'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='displaysql' value='0'".(!$pref['displaysql'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
";
if(function_exists("memory_get_usage")){
$text .= "
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_137." </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='display_memory_usage' value='1'".($pref['display_memory_usage'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='display_memory_usage' value='0'".(!$pref['display_memory_usage'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
";
}
$text .= pref_submit();
$text .= "</table></div>";
// Admin Display Areas. .
$text .= "<div id='admindisp' style='display:none; text-align:center'>
<table style='width:100%' class='fborder'>
<tr>
<td class='fcaption' title='".PRFLAN_80."' style='; text-align:left;' colspan='2'>".PRFLAN_77."</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_95."<br /><span class='smalltext'>".PRFLAN_96."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='admin_alerts_ok' value='1'".($pref['admin_alerts_ok'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='admin_alerts_ok' value='0'".(!$pref['admin_alerts_ok'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>";
$text .= "<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_97."<br /><span class='smalltext'>".PRFLAN_98."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='admin_alerts_uniquemenu' value='1'".($pref['admin_alerts_uniquemenu'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='admin_alerts_uniquemenu' value='0'".(!$pref['admin_alerts_uniquemenu'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>";
$text .= pref_submit();
$text .= "</table></div>";
// Date options.
$text .= "<div id='date' style='display:none; text-align:center'>
<table style='width:100%' class='fborder'>
<tr>
<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_21."</td>
</tr>
<tr>";
$ga = new convert;
$date1 = $ga->convert_date(time(), "short");
$date2 = $ga->convert_date(time(), "long");
$date3 = $ga->convert_date(time(), "forum");
$text .= "<td style='width:50%' class='forumheader3'>".PRFLAN_22.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input class='tbox' type='text' name='shortdate' size='40' value='".$pref['shortdate']."' maxlength='50' />
<br />".PRFLAN_83.": $date1
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_23.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input class='tbox' type='text' name='longdate' size='40' value='".$pref['longdate']."' maxlength='50' />
<br />".PRFLAN_83.": $date2
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_24."<br /><span class='smalltext'>".PRFLAN_25." <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>".PRFLAN_93."</a></span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input class='tbox' type='text' name='forumdate' size='40' value='".$pref['forumdate']."' maxlength='50' />
<br />".PRFLAN_83.": $date3
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_26."<br /><span class='smalltext'>".PRFLAN_27."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<select name='time_offset' class='tbox'>\n";
$toffset = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "0", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+10", "+11", "+12", "+13", "+14", "+15", "+16");
if(!isset($pref['time_offset']))
{
$pref['time_offset'] = "0";
}
foreach($toffset as $o)
{
if (!isset($pref['time_offset']) || $o == $pref['time_offset']) {
$text .= "<option selected='selected'>".$o."</option>\n";
} else {
$text .= "<option>".$o."</option>\n";
}
}
$text .= "</select>
</td></tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_56.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input class='tbox' type='text' name='timezone' size='20' value='".$pref['timezone']."' maxlength='50' />
</td>
</tr>";
$text .= pref_submit();
$text .= "</table></div>";
// =========== Registration Preferences. ==================
$text .= "<div id='registration' style='display:none; text-align:center'><table style='width:100%' class='fborder'>
<tr>
<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_28."</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_29."<br /><span class='smalltext'>".PRFLAN_30."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='user_reg' value='1'".($pref['user_reg'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='user_reg' value='0'".(!$pref['user_reg'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_141."<br /></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='xup_enabled' value='1'".($pref['xup_enabled'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='xup_enabled' value='0'".(!$pref['xup_enabled'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_154."</td>
<td style='width:50%; text-align:right' class='forumheader3'>
<select name='user_reg_veri' class='tbox'>";
$veri_list[0] = PRFLAN_152;
$veri_list[1] = PRFLAN_31;
$veri_list[2] = PRFLAN_153;
foreach($veri_list as $v => $v_title){
$sel = ($pref['user_reg_veri'] == $v) ? "selected='selected'" : "";
$text .= "<option value='$v' $sel>".$v_title."</option>\n";
}
$text .="</select></td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_160."<br /></td>
<td class='forumheader3' style='width:50%;text-align:right' >
<input type='radio' name='signup_remote_emailcheck' value='1'".($pref['signup_remote_emailcheck'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='signup_remote_emailcheck' value='0'".(!$pref['signup_remote_emailcheck'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_167."<br /></td>
<td class='forumheader3' style='width:50%;text-align:right' >
<input type='radio' name='disable_emailcheck' value='1'".($pref['disable_emailcheck'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='disable_emailcheck' value='0'".(!$pref['disable_emailcheck'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_32."<br /><span class='smalltext'>".PRFLAN_33."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='anon_post' value='1'".($pref['anon_post'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='anon_post' value='0'".(!$pref['anon_post'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_45."<br /><span class='smalltext'>".PRFLAN_46." <a href='http://www.cdt.org/legislation/105th/privacy/coppa.html'>".PRFLAN_94."</a></span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='use_coppa' value='1'".($pref['use_coppa'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='use_coppa' value='0'".(!$pref['use_coppa'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_58."<br /><span class='smalltext'>".PRFLAN_59."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='membersonly_enabled' value='1'".($pref['membersonly_enabled'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='membersonly_enabled' value='0'".(!$pref['membersonly_enabled'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".CUSTSIG_16."<br /><span class='smalltext'>".PRFLAN_78."</span></td>
<td class='forumheader3' style='width:50%;text-align:right' >
<input type='text' class='tbox' size='3' name='signup_pass_len' value='".$pref['signup_pass_len']."' />
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_136."</td>
<td class='forumheader3' style='width:50%;text-align:right' >
<input type='text' class='tbox' size='3' name='signup_maxip' value='".$pref['signup_maxip']."' />
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".CUSTSIG_18."<br /><span class='smalltext'>".CUSTSIG_19."</span></td>
<td class='forumheader3' style='width:50%;text-align:right' >
<textarea class='tbox' name='signup_disallow_text' cols='1' rows='3' style='width: 80%;'>".$pref['signup_disallow_text']."</textarea>
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_155.":</td>
<td class='forumheader3' style='width:50%;text-align:right' >
".r_userclass('displayname_class',$pref['displayname_class'],'off','nobody, public, admin, classes')."
<input class='button' type='submit' name='submit_resetdisplaynames' value='".PRFLAN_156."' />
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_158.":</td>
<td class='forumheader3' style='width:50%;text-align:right' >
<input type='text' class='tbox' size='3' name='displayname_maxlength' value='".$pref['displayname_maxlength']."' />
</td>
</tr>
";
$text .= pref_submit();
$text .= "</table></div>";
// Signup options ===========================.
$text .= "<div id='signup' style='display:none; text-align:center'>
<table style='width:100%' class='fborder'>
<tr>
<td class='fcaption' style='text-align:left;' colspan='2'>".PRFLAN_19."</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_126."</td>
<td style='width:50%' class='forumheader3'><textarea class='tbox' name='signup_text' cols='1' rows='3' style='width: 100%;'>".$pref['signup_text']."</textarea>
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_140."</td>
<td style='width:50%' class='forumheader3'><textarea class='tbox' name='signup_text_after' cols='1' rows='3' style='width: 100%;'>".$pref['signup_text_after']."</textarea>
</td>
</tr>
<tr>
<td class='forumheader'>".CUSTSIG_13."</td>
<td class='forumheader'>".CUSTSIG_14."</td>
</tr>";
$signup_option_title = array(CUSTSIG_2, CUSTSIG_6, CUSTSIG_7, CUSTSIG_8, CUSTSIG_17);
$signup_option_names = array("signup_option_realname", "signup_option_signature", "signup_option_image", "signup_option_timezone", "signup_option_class");
foreach($signup_option_names as $key => $value)
{
$text .= "
<tr>
<td style='width:50%' class='forumheader3'>".$signup_option_title[$key]."</td>
<td style='width:50%' class='forumheader3'>".
(!$pref[$value] ? "<input type='radio' name='{$value}' value='0' checked='checked' /> ".CUSTSIG_12 : "<input type='radio' name='{$value}' value='0' /> ".CUSTSIG_12)."&nbsp;&nbsp;".
( $pref[$value] == "1" ? "<input type='radio' name='{$value}' value='1' checked='checked' /> ".CUSTSIG_14 : "<input type='radio' name='{$value}' value='1' /> ".CUSTSIG_14)."&nbsp;&nbsp;".
( $pref[$value] == "2" ? "<input type='radio' name='{$value}' value='2' checked='checked' /> ".CUSTSIG_15 : "<input type='radio' name='{$value}' value='2' /> ".CUSTSIG_15)."&nbsp;&nbsp;
</td>
</tr>";
}
// Custom Fields.
$text .= pref_submit();
$text .= "</table></div>";
/* text render options */
if(!isset($pref['post_html']))
{
$pref['post_html'] = '250';
save_prefs();
}
$text .= "<div id='textpost' style='display:none; text-align:center'>
<table style='width:100%' class='fborder'>
<tr>
<td class='fcaption' style='text-align:left;' colspan='2'>".PRFLAN_101."</td>
</tr>
<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_127.": <div class='smalltext'>".PRFLAN_128."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
<input type='radio' name='make_clickable' value='1'".($pref['make_clickable'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='make_clickable' value='0'".(!$pref['make_clickable'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_102."?: <div class='smalltext'>".PRFLAN_103."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
<input type='radio' name='link_replace' value='1'".($pref['link_replace'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='link_replace' value='0'".(!$pref['link_replace'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_145."?: <div class='smalltext'>".PRFLAN_146."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
<input type='radio' name='links_new_window' value='1'".($pref['links_new_window'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='links_new_window' value='0'".(!$pref['links_new_window'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_104.": <div class='smalltext'>".PRFLAN_105."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
<input class='tbox' type='text' name='link_text' size='50' value='".$tp -> post_toForm($pref['link_text'])."' maxlength='200' />
</td>
</tr>
<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_107.": <div class='smalltext'>".PRFLAN_108."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
<input class='tbox' type='text' name='email_text' size='50' value='".$tp -> post_toForm($pref['email_text'])."' maxlength='200' />
</td>
</tr>
<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_109.": <div class='smalltext'>".PRFLAN_110."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
<input class='tbox' type='text' name='main_wordwrap' size='5' value='".$pref['main_wordwrap']."' maxlength='3' />
</td>
</tr>
<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_111.": <div class='smalltext'>".PRFLAN_110."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
<input class='tbox' type='text' name='menu_wordwrap' size='5' value='".$pref['menu_wordwrap']."' maxlength='3' />
</td>
</tr>
<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_116.": <div class='smalltext'>".PRFLAN_117."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
".r_userclass('post_html',$pref['post_html'],'off','nobody, public, member, admin, main, classes')."
</td>
</tr>\n
<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_122.": <div class='smalltext'>".PRFLAN_123."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
<input type='radio' name='wysiwyg' value='1'".($pref['wysiwyg'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='wysiwyg' value='0'".(!$pref['wysiwyg'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>\n
<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_124.": <div class='smalltext'>".PRFLAN_125."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
<input type='radio' name='old_np' value='1'".($pref['old_np'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='old_np' value='0'".(!$pref['old_np'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_131.": <div class='smalltext'>".PRFLAN_132."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
".r_userclass('php_bbcode',$pref['php_bbcode'],'off','nobody, admin, classes')."
</td>
</tr>\n
";
if(file_exists(e_PLUGIN."geshi/geshi.php")) {
$text .= "<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_118."?: <div class='smalltext'>".PRFLAN_119."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
<input type='radio' name='useGeshi' value='1'".($pref['useGeshi'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='useGeshi' value='0'".(!$pref['useGeshi'] ? " checked='checked'" : "")." /> ".PRFLAN_113."<br />
</td>
</tr>
<tr>
<td class='forumheader3' style='width:50%;'>".PRFLAN_120."?: <div class='smalltext'>".PRFLAN_121."</div></td>
<td class='forumheader3' style='width:50%; text-align: right;'>
<input class='tbox' type='text' name='defaultLanGeshi' size='10' value='".($pref['defaultLanGeshi'] ? $pref['defaultLanGeshi'] : "php")."' maxlength='20' />
</td>
</tr>
";
}
$text .= pref_submit();
$text .= "</table></div>";
// Security Options. .
$hasGD = extension_loaded("gd");
$text .= "<div id='security' style='display:none; text-align:center'>
<table style='width:100%' class='fborder'>
<tr>
<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_47."</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_60."<br /><span class='smalltext'>".PRFLAN_61."</span> </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='ssl_enabled' value='1'".($pref['ssl_enabled'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='ssl_enabled' value='0'".(!$pref['ssl_enabled'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_76.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
";
if($hasGD)
{
$text .= "
<input type='radio' name='signcode' value='1'".($pref['signcode'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='signcode' value='0'".(!$pref['signcode'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
";
}
else
{
$text .= PRFLAN_133;
}
$text .= "
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_81.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
";
if($hasGD)
{
$text .= "
<input type='radio' name='logcode' value='1'".($pref['logcode'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='logcode' value='0'".(!$pref['logcode'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
";
}
else
{
$text .= PRFLAN_133;
}
$text .= "
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_138.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
";
if($hasGD)
{
$text .= "
<input type='radio' name='fpwcode' value='1'".($pref['fpwcode'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='fpwcode' value='0'".(!$pref['fpwcode'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
";
}
else
{
$text .= PRFLAN_133;
}
$text .= "
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_92.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='user_reg_secureveri' value='1'".($pref['user_reg_secureveri'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='user_reg_secureveri' value='0'".(!$pref['user_reg_secureveri'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_129.":<br /><span class='smalltext'>".PRFLAN_130."</span> </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='disallowMultiLogin' value='1'".($pref['disallowMultiLogin'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='disallowMultiLogin' value='0'".(!$pref['disallowMultiLogin'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_48.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>". ($pref['user_tracking'] == "cookie" ? "<input type='radio' name='user_tracking' value='cookie' checked='checked' /> ".PRFLAN_49 : "<input type='radio' name='user_tracking' value='cookie' /> ".PRFLAN_49). ($pref['user_tracking'] == "session" ? "<input type='radio' name='user_tracking' value='session' checked='checked' /> ".PRFLAN_50 : "<input type='radio' name='user_tracking' value='session' /> ".PRFLAN_50)."
<br />
".PRFLAN_55.": <input class='tbox' type='text' name='cookie_name' size='20' value='".$pref['cookie_name']."' maxlength='20' />
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_40."<br /><span class='smalltext'>".PRFLAN_41."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='profanity_filter' value='1'".($pref['profanity_filter'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='profanity_filter' value='0'".(!$pref['profanity_filter'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_42.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input class='tbox' type='text' name='profanity_replace' size='30' value='".$pref['profanity_replace']."' maxlength='20' />
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_43.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<textarea class='tbox' name='profanity_words' cols='59' rows='2' style='width:100%'>".$pref['profanity_words']."</textarea>
<br />".PRFLAN_44."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_35.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='antiflood1' value='1'".($pref['antiflood1'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='antiflood1' value='0'".(!$pref['antiflood1'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_36.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input class='tbox' type='text' name='antiflood_timeout' size='3' value='".$pref['antiflood_timeout']."' maxlength='3' />
<br />
<b class=\"smalltext\" >".PRFLAN_38."</b>
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_37."<br /><span class='smalltext'>".PRFLAN_91."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<select name='autoban' class='tbox'>";
$autoban_list[0] = PRFLAN_113;
$autoban_list[1] = PRFLAN_144;
$autoban_list[2] = PRFLAN_142;
$autoban_list[3] = PRFLAN_143;
foreach($autoban_list as $ab=>$ab_title){
$sel = ($pref['autoban'] == $ab) ? "selected='selected'" : "";
$text .= "<option value='$ab' $sel>".$ab_title."</option>\n";
}
$text .="</select></td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_170."<br /><span class='smalltext'>".PRFLAN_171."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='enable_rdns' value='1'".(varsettrue($pref['enable_rdns']) ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='enable_rdns' value='0'".(!varsettrue($pref['enable_rdns']) ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_139.":</td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='adminpwordchange' value='1'".($pref['adminpwordchange'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='adminpwordchange' value='0'".(!$pref['adminpwordchange'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
";
$text .= pref_submit();
$text .= "</table></div>";
$text .= "<div id='comments' style='display:none; text-align:center'>
<table style='width:100%' class='fborder'>
<tr>
<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_87."</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_89.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='comments_icon' value='1'".($pref['comments_icon'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='comments_icon' value='0'".(!$pref['comments_icon'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_88.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='nested_comments' value='1'".($pref['nested_comments'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='nested_comments' value='0'".(!$pref['nested_comments'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_90.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='allowCommentEdit' value='1'".($pref['allowCommentEdit'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='allowCommentEdit' value='0'".(!$pref['allowCommentEdit'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_161.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='comments_disabled' value='1'".($pref['comments_disabled'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='comments_disabled' value='0'".(!$pref['comments_disabled'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_166.": </td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='comments_emoticons' value='1'".($pref['comments_emoticons'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='comments_emoticons' value='0'".(!$pref['comments_emoticons'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
";
$text .= pref_submit();
$text .= "</table></div>";
//Advanced Features
$text .= "<div id='advanced' style='display:none; text-align:center'>
<table style='width:100%' class='fborder'>
<tr>
<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_149."</td>
</tr>";
$text .= "<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_147.":<br /><span class='smalltext'>".PRFLAN_148."</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='developer' value='1'".($pref['developer'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='developer' value='0'".(!$pref['developer'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_17."<br /><span class='smalltext'>&nbsp;</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>
<input type='radio' name='compress_output' value='1'".($pref['compress_output'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
<input type='radio' name='compress_output' value='0'".(!$pref['compress_output'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".PRFLAN_150."<br /><span class='smalltext'>&nbsp;</span></td>
<td style='width:50%; text-align:right' class='forumheader3'>{$auth_dropdown}</td>
</tr>
";
$text .= pref_submit();
$text .= "</table></div>";
// END Advanced Features
$text .= "</form></div></div>";
$ns->tablerender(PRFLAN_53, $text);
require_once("footer.php");
function pref_submit() {
$text = "<tr>
<td colspan='2' style='text-align:center' class='forumheader'>";
// ML
/* if(e_MLANG == 1){
//$text .="<input class='fcaption' type='submit' name='updateprefs' value='".PRFLAN_52."' />
$but_typ = array(""); // empty = submit
$but_nam = array("updateprefs"); // empty = autobutX with X autoincrement
$but_val = array("updateprefs"); // empty = Submit
$but_class = array("caption"); // empty = button
$butjs = array(""); // empty = ""
$buttitle = array(""); // empty = ""
$text .= e107ml_adpanel(1,$but_typ,$but_nam,$but_val,$but_class,$butjs,$buttitle);
}else{*/
$text .= "<input class='button' type='submit' name='updateprefs' value='".PRFLAN_52."' />";
// }
$text .= "</td>
</tr>";
// END ML
return $text;
}
function prefs_adminmenu() {
$var['main']['text'] = PRFLAN_1;
$var['display']['text'] = PRFLAN_13;
$var['admindisp']['text'] = PRFLAN_77;
$var['date']['text'] = PRFLAN_21;
$var['registration']['text'] = PRFLAN_28;
$var['signup']['text'] = PRFLAN_19;
$var['textpost']['text'] = PRFLAN_101;
$var['security']['text'] = PRFLAN_47;
$var['comments']['text'] = PRFLAN_87;
$var['advanced']['text'] = PRFLAN_149;
show_admin_menu(LAN_OPTIONS, $action, $var, TRUE);
}
?>

23
e107_admin/review.php Normal file
View File

@@ -0,0 +1,23 @@
<?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_admin/review.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:28 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
header('Location: admin.php');
exit;
?>

410
e107_admin/search.php Normal file
View File

@@ -0,0 +1,410 @@
<?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_admin/search.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:28 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once('../class2.php');
if (!getperms('X')) {
header('location:'.e_BASE.'index.php');
exit;
}
$e_sub_cat = 'search';
require_once('auth.php');
require_once(e_HANDLER.'userclass_class.php');
$query = explode('.', e_QUERY);
$search_prefs = $sysprefs -> getArray('search_prefs');
$search_handlers['news'] = ADLAN_0;
$search_handlers['comments'] = SEALAN_6;
$search_handlers['users'] = SEALAN_7;
$search_handlers['downloads'] = ADLAN_24;
$search_handlers['pages'] = SEALAN_39;
preg_match("/^(.*?)($|-)/", mysql_get_server_info(), $mysql_version);
if (version_compare($mysql_version[1], '4.0.1', '<')) {
$mysql_supported = false;
} else {
$mysql_supported = true;
}
foreach($pref['e_search_list'] as $file)
{
if (is_readable(e_PLUGIN.$file."/e_search.php") && !isset($search_prefs['plug_handlers'][$file]))
{
$search_prefs['plug_handlers'][$file] = array('class' => 0, 'pre_title' => 1, 'pre_title_alt' => '', 'chars' => 150, 'results' => 10);
$save_search = TRUE;
}
if (is_readable(e_PLUGIN.$file.'/search/search_comments.php') && !isset($search_prefs['comments_handlers'][$file]))
{
include_once(e_PLUGIN.$file.'/search/search_comments.php');
$search_prefs['comments_handlers'][$file] = array('id' => $comments_type_id, 'class' => '0', 'dir' => $file);
unset($comments_type_id);
$save_search = TRUE;
}
}
if (!isset($search_prefs['boundary'])) {
$search_prefs['boundary'] = 1;
$save_search = TRUE;
}
if ($save_search) {
$serialpref = addslashes(serialize($search_prefs));
$sql -> db_Update("core", "e107_value='".$serialpref."' WHERE e107_name='search_prefs'");
}
if (isset($_POST['update_main'])) {
foreach($search_handlers as $s_key => $s_value) {
$search_prefs['core_handlers'][$s_key]['class'] = $_POST['core_handlers'][$s_key]['class'];
$search_prefs['core_handlers'][$s_key]['order'] = $_POST['core_handlers'][$s_key]['order'];
}
foreach ($search_prefs['plug_handlers'] as $plug_dir => $active) {
$search_prefs['plug_handlers'][$plug_dir]['class'] = $_POST['plug_handlers'][$plug_dir]['class'];
$search_prefs['plug_handlers'][$plug_dir]['order'] = $_POST['plug_handlers'][$plug_dir]['order'];
}
foreach ($search_prefs['comments_handlers'] as $key => $value) {
$search_prefs['comments_handlers'][$key]['class'] = $_POST['comments_handlers'][$key]['class'];
}
$search_prefs['google'] = $_POST['google'];
$tmp = addslashes(serialize($search_prefs));
admin_update($sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'"));
}
if (isset($_POST['update_handler'])) {
if ($query[1] == 'c') {
$handler_type = 'core_handlers';
} else if ($query[1] == 'p') {
$handler_type = 'plug_handlers';
}
$search_prefs[$handler_type][$query[2]]['class'] = $_POST['class'];
$search_prefs[$handler_type][$query[2]]['chars'] = $tp -> toDB($_POST['chars']);
$search_prefs[$handler_type][$query[2]]['results'] = $tp -> toDB($_POST['results']);
$search_prefs[$handler_type][$query[2]]['pre_title'] = $_POST['pre_title'];
$search_prefs[$handler_type][$query[2]]['pre_title_alt'] = $tp -> toDB($_POST['pre_title_alt']);
$tmp = addslashes(serialize($search_prefs));
admin_update($sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'"));
}
if (isset($_POST['update_prefs'])) {
$search_prefs['relevance'] = $_POST['relevance'];
$search_prefs['user_select'] = $_POST['user_select'];
$search_prefs['multisearch'] = $_POST['multisearch'];
$search_prefs['selector'] = $_POST['selector'];
$search_prefs['time_restrict'] = $_POST['time_restrict'];
$search_prefs['time_secs'] = $_POST['time_secs'] > 300 ? 300 : $tp -> toDB($_POST['time_secs']);
if ($_POST['search_sort'] == 'mysql') {
if ($mysql_supported) {
$search_prefs['mysql_sort'] = TRUE;
} else {
$search_prefs['mysql_sort'] = FALSE;
$ns -> tablerender(LAN_ERROR, "<div style='text-align:center'><b>".SEALAN_33."<br />".SEALAN_34." ".$mysql_version[1]."</b></div>");
}
} else {
$search_prefs['mysql_sort'] = FALSE;
}
$search_prefs['php_limit'] = $tp -> toDB($_POST['php_limit']);
$search_prefs['boundary'] = $_POST['boundary'];
$tmp = addslashes(serialize($search_prefs));
admin_update($sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'"));
$pref['search_restrict'] = $_POST['search_restrict'];
$pref['search_highlight'] = $_POST['search_highlight'];
save_prefs();
}
require_once(e_HANDLER."form_handler.php");
$rs = new form;
$handlers_total = count($search_prefs['core_handlers']) + count($search_prefs['plug_handlers']);
if ($query[0] == 'settings') {
$text = "<form method='post' action='".e_SELF."?settings'><div style='text-align:center'>
<table style='".ADMIN_WIDTH."' class='fborder'>";
$text .= "<tr>
<td class='fcaption' colspan='2'>".SEALAN_20."</td>
</tr>";
$text .= "<tr>
<td style='width:50%' class='forumheader3'>".SEALAN_15.": </td>
<td style='width:50%' class='forumheader3'>
".r_userclass("search_restrict", $pref['search_restrict'], "off", "public,guest,nobody,member,admin,classes")."
</td>
</tr>";
$text .= "<tr>
<td style='width:50%' class='forumheader3'>".SEALAN_30."</td>
<td style='width:50%;' colspan='2' class='forumheader3'>
<input type='radio' name='search_highlight' value='1'".($pref['search_highlight'] ? " checked='checked'" : "")." /> ".SEALAN_16."&nbsp;&nbsp;
<input type='radio' name='search_highlight' value='0'".(!$pref['search_highlight'] ? " checked='checked'" : "")." /> ".SEALAN_17."
</td>
</tr>";
$text .= "<tr>
<td style='width:50%' class='forumheader3'>".SEALAN_10."</td>
<td style='width:50%;' colspan='2' class='forumheader3'>
<input type='radio' name='relevance' value='1'".($search_prefs['relevance'] ? " checked='checked'" : "")." /> ".SEALAN_16."&nbsp;&nbsp;
<input type='radio' name='relevance' value='0'".(!$search_prefs['relevance'] ? " checked='checked'" : "")." /> ".SEALAN_17."
</td>
</tr>";
$text .= "<tr>
<td style='width:50%' class='forumheader3'>".SEALAN_11."</td>
<td style='width:50%;' colspan='2' class='forumheader3'>
<input type='radio' name='user_select' value='1'".($search_prefs['user_select'] ? " checked='checked'" : "")." /> ".SEALAN_16."&nbsp;&nbsp;
<input type='radio' name='user_select' value='0'".(!$search_prefs['user_select'] ? " checked='checked'" : "")." /> ".SEALAN_17."
</td>
</tr>";
$text .= "<tr>
<td style='width:50%' class='forumheader3'>".SEALAN_19."</td>
<td style='width:50%;' colspan='2' class='forumheader3'>
<input type='radio' name='multisearch' value='1'".($search_prefs['multisearch'] ? " checked='checked'" : "")." /> ".SEALAN_16."&nbsp;&nbsp;
<input type='radio' name='multisearch' value='0'".(!$search_prefs['multisearch'] ? " checked='checked'" : "")." /> ".SEALAN_17."
</td>
</tr>";
$text .= "<tr>
<td style='width:50%' class='forumheader3'>".SEALAN_35."</td>
<td style='width:50%;' colspan='2' class='forumheader3'>
<input type='radio' name='selector' value='2'".($search_prefs['selector'] == '2' ? " checked='checked'" : "")." /> ".SEALAN_36."&nbsp;&nbsp;
<input type='radio' name='selector' value='1'".($search_prefs['selector'] == '1' ? " checked='checked'" : "")." /> ".SEALAN_37."&nbsp;&nbsp;
<input type='radio' name='selector' value='0'".($search_prefs['selector'] == '0' ? " checked='checked'" : "")." /> ".SEALAN_38."
</td>
</tr>";
$text .= "<tr>
<td style='width:50%' class='forumheader3'>".SEALAN_12."</td>
<td style='width:50%' colspan='2' class='forumheader3'>
<input type='radio' name='time_restrict' value='0'".(!$search_prefs['time_restrict'] ? " checked='checked'" : "")." /> ".SEALAN_17."&nbsp;&nbsp;
<input type='radio' name='time_restrict' value='1'".($search_prefs['time_restrict'] ? " checked='checked'" : "")." />
".SEALAN_13." ".$rs -> form_text("time_secs", 3, $tp -> toForm($search_prefs['time_secs']), 3)." ".SEALAN_14."</td>
</tr>";
$text .= "<tr>
<td class='forumheader3' style='width:50%'>".SEALAN_3."<br />".SEALAN_49."</td>
<td colspan='2' class='forumheader3' style='width:50%'>
".$rs -> form_radio('search_sort', 'mysql', ($search_prefs['mysql_sort'] == TRUE ? 1 : 0), 'MySql', ($mysql_supported ? "" : "disabled='true'"))."MySql<br />
".$rs -> form_radio('search_sort', 'php', ($search_prefs['mysql_sort'] == TRUE ? 0 : 1)).SEALAN_31."
".$rs -> form_text("php_limit", 5, $tp -> toForm($search_prefs['php_limit']), 5)." ".SEALAN_32."
</td>
</tr>";
$text .= "<tr>
<td style='width:50%' class='forumheader3'>".SEALAN_47."<br />".SEALAN_48."</td>
<td style='width:50%;' colspan='2' class='forumheader3'>
<input type='radio' name='boundary' value='1'".($search_prefs['boundary'] ? " checked='checked'" : "")." /> ".SEALAN_16."&nbsp;&nbsp;
<input type='radio' name='boundary' value='0'".(!$search_prefs['boundary'] ? " checked='checked'" : "")." /> ".SEALAN_17."
</td>
</tr>";
$text .= "<tr>
<td colspan='2' style='text-align:center' class='forumheader'>".$rs -> form_button("submit", "update_prefs", LAN_UPDATE)."</td>
</tr>";
$text .= "</table>
</div></form>";
} else if ($query[0] == 'edit') {
if ($query[1] == 'c') {
$handlers = $search_handlers;
$handler_type = 'core_handlers';
} else if ($query[1] == 'p') {
$handlers = $search_prefs['plug_handlers'];
$handler_type = 'plug_handlers';
}
$text = "<form method='post' action='".e_SELF."?main.".$query[1].".".$query[2]."'>
<div style='text-align:center'>
<table style='".ADMIN_WIDTH."' class='fborder'>";
$text .= "<tr>
<td class='fcaption' colspan='2'>".SEALAN_43.": ".$handlers[$query[2]]."</td>
</tr>";
$text .= "<tr>
<td style='width:50%' class='forumheader3'>".SEALAN_44.":</td>
<td style='width:50%' class='forumheader3'>";
$text .= r_userclass("class", $search_prefs[$handler_type][$query[2]]['class'], "off", "public,guest,nobody,member,admin,classes");
$text .= "</td>
</tr><tr>
<td style='width:50%' class='forumheader3'>".SEALAN_45.":</td>
<td style='width:5%' class='forumheader3'>".$rs -> form_text("results", 4, $tp -> toForm($search_prefs[$handler_type][$query[2]]['results']), 4)."</td>
</tr><tr>
<td style='width:50%' class='forumheader3'>".SEALAN_46.":</td>
<td style='width:5' class='forumheader3'>".$rs -> form_text("chars", 4, $tp -> toForm($search_prefs[$handler_type][$query[2]]['chars']), 4)."</td>
</tr><tr>
<td style='width:50%' class='forumheader3'>".SEALAN_26.":</td>
<td style='width:35%' class='forumheader3'>
<input type='radio' name='pre_title' value='1'".(($search_prefs[$handler_type][$query[2]]['pre_title'] == 1) ? " checked='checked'" : "")." /> ".SEALAN_22."<br />
<input type='radio' name='pre_title' value='0'".(($search_prefs[$handler_type][$query[2]]['pre_title'] == 0) ? " checked='checked'" : "")." /> ".SEALAN_17."<br />
<input type='radio' name='pre_title' value='2'".(($search_prefs[$handler_type][$query[2]]['pre_title'] == 2) ? " checked='checked'" : "")." /> ".SEALAN_23."&nbsp;&nbsp;
".$rs -> form_text("pre_title_alt", 20, $tp -> toForm($search_prefs[$handler_type][$query[2]]['pre_title_alt']))."
</td>
</tr>";
$text .= "<tr>
<td colspan='2' style='text-align:center' class='forumheader'>".$rs -> form_button("submit", "update_handler", LAN_UPDATE)."</td>
</tr>";
$text .= "</table>
</div>
</form>";
} else {
$text = "<form method='post' action='".e_SELF."'><div style='text-align:center'>
<table style='".ADMIN_WIDTH."' class='fborder'>";
$text .= "<tr>
<td class='fcaption' colspan='4'>".SEALAN_21."</td>
</tr>";
$text .= "<tr>
<td class='forumheader'>".SEALAN_24."</td>
<td class='forumheader'>".SEALAN_25."</td>
<td class='forumheader'>".LAN_ORDER."</td>
<td class='forumheader'>".LAN_EDIT."</td>
</tr>";
foreach($search_handlers as $key => $value) {
$text .= "<tr>
<td style='width:55%; white-space:nowrap' class='forumheader3'>".$value."</td>
<td style='width:25%' class='forumheader3'>";
$text .= r_userclass("core_handlers[".$key."][class]", $search_prefs['core_handlers'][$key]['class'], "off", "public,guest,nobody,member,admin,classes");
$text .= "</td>";
$text .= "<td style='width:10%; text-align:center' class='forumheader3'>";
$text .= "<select name='core_handlers[".$key."][order]' class='tbox'>";
for($a = 1; $a <= $handlers_total; $a++) {
$text .= ($search_prefs['core_handlers'][$key]['order'] == $a) ? "<option value='".$a."' selected='selected'>".$a."</option>" : "<option value='".$a."'>".$a."</option>";
}
$text .= "</select>
</td>
<td style='width:10%; text-align:center' class='forumheader3'>
<a href='".e_SELF."?edit.c.".$key."'>".ADMIN_EDIT_ICON."</a>
</td>
</tr>";
}
foreach ($search_prefs['plug_handlers'] as $plug_dir => $active) {
if(is_readable(e_PLUGIN.$plug_dir."/e_search.php")){
require_once(e_PLUGIN.$plug_dir."/e_search.php");
}
$text .= "<tr>
<td style='width:55%; white-space:nowrap' class='forumheader3'>".$search_info[0]['qtype']."</td>
<td style='width:25%' class='forumheader3'>";
$text .= r_userclass("plug_handlers[".$plug_dir."][class]", $search_prefs['plug_handlers'][$plug_dir]['class'], "off", "public,guest,nobody,member,admin,classes");
unset($search_info);
$text .= "</td>";
$text .= "<td style='width:10%; text-align:center' class='forumheader3'>";
$text .= "<select name='plug_handlers[".$plug_dir."][order]' class='tbox'>";
for($a = 1; $a <= $handlers_total; $a++) {
$text .= ($search_prefs['plug_handlers'][$plug_dir]['order'] == $a) ? "<option value='".$a."' selected='selected'>".$a."</option>" : "<option value='".$a."'>".$a."</option>";
}
$text .= "</select>
</td>
<td style='width:10%; text-align:center' class='forumheader3'>
<a href='".e_SELF."?edit.p.".$plug_dir."'>".ADMIN_EDIT_ICON."</a>
</td>
</tr>";
}
$text .= "<tr>
<td style='white-space:nowrap' class='forumheader3'>Google</td>
<td colspan='3' class='forumheader3'>";
$sel = (isset($search_prefs['google']) && $search_prefs['google']) ? " checked='checked'" : "";
$text .= r_userclass("google", $search_prefs['google'], "off", "public,guest,nobody,member,admin,classes");
$text .= "</td>
</tr>";
$text .= "<tr>
<td colspan='4' style='text-align:center' class='forumheader'>".$rs -> form_button("submit", "update_main", LAN_UPDATE)."</td>
</tr>";
$text .= "</table>
</div><br />";
$text .= "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."' class='fborder'>";
$text .= "<tr>
<td class='fcaption' colspan='2'>".SEALAN_18."</td>
</tr>";
$text .= "<tr>
<td class='forumheader'>".SEALAN_24."</td>
<td class='forumheader'>".SEALAN_25."</td>
</tr>";
foreach ($search_prefs['comments_handlers'] as $key => $value) {
$path = ($value['dir'] == 'core') ? e_HANDLER.'search/comments_'.$key.'.php' : e_PLUGIN.$value['dir'].'/search/search_comments.php';
if(is_readable($path)){
require_once($path);
}
$text .= "<tr>
<td style='width:55%; white-space:nowrap' class='forumheader3'>".$comments_title."</td>
<td style='width:45%' class='forumheader3'>";
$text .= r_userclass("comments_handlers[".$key."][class]", $search_prefs['comments_handlers'][$key]['class'], "off", "public,guest,nobody,member,admin,classes");
$text .= "</td>
</tr>";
unset($comments_title);
}
$text .= "<tr>
<td colspan='2' style='text-align:center' class='forumheader'>".$rs -> form_button("submit", "update_main", LAN_UPDATE)."</td>
</tr>";
$text .= "</table>
</div>
</form>";
}
$ns -> tablerender(SEALAN_1, $text);
require_once("footer.php");
function search_adminmenu() {
global $query;
if ($query[0] == '' || $query[0] == 'main') {
$action = "main";
} else if ($query[0] == 'settings') {
$action = "settings";
}
$var['main']['text'] = SEALAN_41;
$var['main']['link'] = e_SELF;
$var['settings']['text'] = SEALAN_42;
$var['settings']['link'] = e_SELF."?settings";
show_admin_menu(SEALAN_40, $action, $var);
}
?>

300
e107_admin/sql/core_pg.php Normal file
View File

@@ -0,0 +1,300 @@
<?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_admin/sql/core_pg.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:33 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
header("location:../index.php");
exit;
?>
CREATE SEQUENCE banner_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE chatbox_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE comments_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE content_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE download_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE download_category_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE forum_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE forum_t_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE headlines_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE links_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE menus_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE news_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE news_category_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE plugin_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE poll_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE rate_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE TABLE banlist (
banlist_ip varchar(100) NOT NULL,
banlist_admin int4 DEFAULT '0' NOT NULL,
banlist_reason text NOT NULL,
CONSTRAINT banlist_pkey PRIMARY KEY (banlist_ip)
);
CREATE TABLE banner (
banner_id int4 NOT NULL,
banner_clientname varchar(100) DEFAULT '' NOT NULL,
banner_clientlogin varchar(20) DEFAULT '' NOT NULL,
banner_clientpassword varchar(50) DEFAULT '' NOT NULL,
banner_image varchar(150) DEFAULT '' NOT NULL,
banner_clickurl varchar(150) DEFAULT '' NOT NULL,
banner_impurchased int4 DEFAULT '0' NOT NULL,
banner_startdate int4 DEFAULT '0' NOT NULL,
banner_enddate int4 DEFAULT '0' NOT NULL,
banner_active int2 DEFAULT '0' NOT NULL,
banner_clicks int4 DEFAULT '0' NOT NULL,
banner_impressions int4 DEFAULT '0' NOT NULL,
banner_ip text NOT NULL,
banner_campaign varchar(150) DEFAULT '' NOT NULL,
CONSTRAINT banner_pkey PRIMARY KEY (banner_id)
);
CREATE TABLE chatbox (
cb_id int4 NOT NULL,
cb_nick varchar(30) DEFAULT '' NOT NULL,
cb_message text NOT NULL,
cb_datestamp int4 DEFAULT '0' NOT NULL,
cb_blocked int2 DEFAULT '0' NOT NULL,
cb_ip varchar(15) DEFAULT '' NOT NULL,
CONSTRAINT chatbox_pkey PRIMARY KEY (cb_id)
);
CREATE TABLE comments (
comment_id int4 DEFAULT '0' NOT NULL,
comment_pid int4 DEFAULT '0' NOT NULL,
comment_item_id int4 DEFAULT '0' NOT NULL,
comment_subject varchar(100) DEFAULT '' NOT NULL,
comment_author varchar(100) DEFAULT '' NOT NULL,
comment_author_email varchar(200) DEFAULT '' NOT NULL,
comment_datestamp int4 DEFAULT '0' NOT NULL,
comment_comment text NOT NULL,
comment_blocked int2 DEFAULT '0' NOT NULL,
comment_ip varchar(20) DEFAULT '' NOT NULL,
comment_type varchar(10) DEFAULT '' NOT NULL,
CONSTRAINT comments_pkey PRIMARY KEY (comment_id)
);
CREATE TABLE content (
content_id int4 DEFAULT '0' NOT NULL,
content_heading text NOT NULL,
content_subheading text NOT NULL,
content_content text NOT NULL,
content_parent int4 DEFAULT '0' NOT NULL,
content_datestamp int4 DEFAULT '0' NOT NULL,
content_author varchar(200) DEFAULT '' NOT NULL,
content_comment int2 DEFAULT '0' NOT NULL,
content_summary text NOT NULL,
content_type int2 DEFAULT '0' NOT NULL,
content_review_score int2 DEFAULT '0' NOT NULL,
content_pe_icon int2 DEFAULT '0' NOT NULL,
content_class int2 DEFAULT '0' NOT NULL,
CONSTRAINT content_pkey PRIMARY KEY (content_id)
);
CREATE TABLE core (
e107_name varchar(20) DEFAULT '' NOT NULL,
e107_value text NOT NULL,
CONSTRAINT core_pkey PRIMARY KEY (e107_name)
);
CREATE TABLE download (
download_id int4 DEFAULT '0' NOT NULL,
download_name varchar(100) DEFAULT '' UNIQUE NOT NULL,
download_url varchar(150) DEFAULT '' NOT NULL,
download_author varchar(100) DEFAULT '' NOT NULL,
download_author_email varchar(200) DEFAULT '' NOT NULL,
download_author_website varchar(200) DEFAULT '' NOT NULL,
download_description text NOT NULL,
download_filesize varchar(20) DEFAULT '' NOT NULL,
download_requested int4 DEFAULT '0' NOT NULL,
download_category int4 DEFAULT '0' NOT NULL,
download_active int2 DEFAULT '0' NOT NULL,
download_datestamp int4 DEFAULT '0' NOT NULL,
download_thumb varchar(150) DEFAULT '' NOT NULL,
download_image varchar(150) DEFAULT '' NOT NULL,
download_comment int2 DEFAULT '0' NOT NULL,
CONSTRAINT download_pkey PRIMARY KEY (download_id)
);
CREATE TABLE download_category (
download_category_id int4 DEFAULT '0' NOT NULL,
download_category_name varchar(100) DEFAULT '' NOT NULL,
download_category_description text NOT NULL,
download_category_icon varchar(100) DEFAULT '' NOT NULL,
download_category_parent int4 DEFAULT '0' NOT NULL,
download_category_class varchar(100) DEFAULT '' NOT NULL,
CONSTRAINT download_category_pkey PRIMARY KEY (download_category_id)
);
CREATE TABLE flood (
flood_url text NOT NULL,
flood_time int4 DEFAULT '0' NOT NULL,
);
CREATE TABLE forum (
forum_id int4 DEFAULT '0' NOT NULL,
forum_name varchar(250) DEFAULT '' NOT NULL,
forum_description text NOT NULL,
forum_parent int4 DEFAULT '0' NOT NULL,
forum_datestamp int4 DEFAULT '0' NOT NULL,
forum_moderators text NOT NULL,
forum_threads int4 DEFAULT '0' NOT NULL,
forum_replies int4 DEFAULT '0' NOT NULL,
forum_lastpost varchar(200) DEFAULT '' NOT NULL,
forum_class varchar(100) DEFAULT '' NOT NULL,
forum_order int4 DEFAULT '0' NOT NULL,
CONSTRAINT forum_pkey PRIMARY KEY (forum_id)
);
CREATE TABLE forum_t (
thread_id int4 DEFAULT '0' NOT NULL,
thread_name varchar(250) DEFAULT '' NOT NULL,
thread_thread text NOT NULL,
thread_forum_id int4 DEFAULT '0' NOT NULL,
thread_datestamp int4 DEFAULT '0' NOT NULL,
thread_parent int4 DEFAULT '0' NOT NULL,
thread_user varchar(250) DEFAULT '' NOT NULL,
thread_views int4 DEFAULT '0' NOT NULL,
thread_active int2 DEFAULT '0' NOT NULL,
thread_lastpost int4 DEFAULT '0' NOT NULL,
thread_s int2 DEFAULT '0' NOT NULL,
CONSTRAINT forum_t_pkey PRIMARY KEY (thread_id)
);
CREATE TABLE headlines (
headline_id int4 DEFAULT '0' NOT NULL,
headline_url varchar(150) DEFAULT '' NOT NULL,
headline_data text NOT NULL,
headline_timestamp int4 DEFAULT '0' NOT NULL,
headline_description text NOT NULL,
headline_image varchar(100) DEFAULT '' NOT NULL,
headline_active int2 DEFAULT '0' NOT NULL,
CONSTRAINT headlines_pkey PRIMARY KEY (headline_id)
);
CREATE TABLE links (
link_id int4 DEFAULT '0' NOT NULL,
link_name varchar(100) DEFAULT '' NOT NULL,
link_url varchar(200) DEFAULT '' NOT NULL,
link_description text NOT NULL,
link_button varchar(100) DEFAULT '' NOT NULL,
link_category int2 DEFAULT '0' NOT NULL,
link_order int4 DEFAULT '0' NOT NULL,
link_refer int4 DEFAULT '0' NOT NULL,
link_open int2 DEFAULT '0' NOT NULL,
link_class int2 DEFAULT '0' NOT NULL,
CONSTRAINT links_pkey PRIMARY KEY (link_id)
);
CREATE TABLE menus (
menu_id int4 DEFAULT '0' NOT NULL,
menu_name varchar(100) DEFAULT '' NOT NULL,
menu_location int2 DEFAULT '0' NOT NULL,
menu_order int2 DEFAULT '0' NOT NULL,
menu_class int2 DEFAULT '0' NOT NULL,
menu_pages text NOT NULL,
CONSTRAINT menus_pkey PRIMARY KEY (menu_id)
);
CREATE TABLE news (
news_id int4 DEFAULT '0' NOT NULL,
news_title varchar(200) DEFAULT '' NOT NULL,
news_body text NOT NULL,
news_extended text NOT NULL,
news_datestamp int4 DEFAULT '0' NOT NULL,
news_author int4 DEFAULT '0' NOT NULL,
news_category int2 DEFAULT '0' NOT NULL,
news_allow_comments int2 DEFAULT '0' NOT NULL,
news_start int4 DEFAULT '0' NOT NULL,
news_end int4 DEFAULT '0' NOT NULL,
news_class int2 DEFAULT '0' NOT NULL,
news_render_type int2 DEFAULT '0' NOT NULL,
news_comment_total int4 DEFAULT '0' NOT NULL,
CONSTRAINT news_pkey PRIMARY KEY (news_id)
);
CREATE TABLE news_category (
category_id int4 DEFAULT '0' NOT NULL,
category_name varchar(200) DEFAULT '' NOT NULL,
category_icon varchar(250) DEFAULT '' NOT NULL,
CONSTRAINT news_category_pkey PRIMARY KEY (category_id)
);
CREATE TABLE online (
online_timestamp int4 DEFAULT '0' NOT NULL,
online_flag int2 DEFAULT '0' NOT NULL,
online_user_id varchar(100) DEFAULT '' NOT NULL,
online_ip varchar(15) DEFAULT '' NOT NULL,
online_location varchar(100) DEFAULT '' NOT NULL,
online_pagecount tinyint(3) int2 DEFAULT '0' NOT NULL,
online_active int4 DEFAULT '0' NOT NULL,
);
CREATE TABLE plugin (
plugin_id int4 DEFAULT '0' NOT NULL,
plugin_name varchar(100) DEFAULT '' NOT NULL,
plugin_version varchar(10) DEFAULT '' NOT NULL,
plugin_path varchar(100) DEFAULT '' NOT NULL,
plugin_installflag int2 DEFAULT '0' NOT NULL,
CONSTRAINT plugin_pkey PRIMARY KEY (plugin_id)
);
CREATE TABLE poll (
poll_id int4 DEFAULT '0' NOT NULL,
poll_datestamp int4 DEFAULT '0' NOT NULL,
poll_end_datestamp int4 DEFAULT '0' NOT NULL,
poll_admin_id int4 DEFAULT '0' NOT NULL,
poll_title varchar(250) DEFAULT '' NOT NULL,
poll_option_1 varchar(250) DEFAULT '' NOT NULL,
poll_option_2 varchar(250) DEFAULT '' NOT NULL,
poll_option_3 varchar(250) DEFAULT '' NOT NULL,
poll_option_4 varchar(250) DEFAULT '' NOT NULL,
poll_option_5 varchar(250) DEFAULT '' NOT NULL,
poll_option_6 varchar(250) DEFAULT '' NOT NULL,
poll_option_7 varchar(250) DEFAULT '' NOT NULL,
poll_option_8 varchar(250) DEFAULT '' NOT NULL,
poll_option_9 varchar(250) DEFAULT '' NOT NULL,
poll_option_10 varchar(250) DEFAULT '' NOT NULL,
poll_votes_1 int4 DEFAULT '0' NOT NULL,
poll_votes_2 int4 DEFAULT '0' NOT NULL,
poll_votes_3 int4 DEFAULT '0' NOT NULL,
poll_votes_4 int4 DEFAULT '0' NOT NULL,
poll_votes_5 int4 DEFAULT '0' NOT NULL,
poll_votes_6 int4 DEFAULT '0' NOT NULL,
poll_votes_7 int4 DEFAULT '0' NOT NULL,
poll_votes_8 int4 DEFAULT '0' NOT NULL,
poll_votes_9 int4 DEFAULT '0' NOT NULL,
poll_votes_10 int4 DEFAULT '0' NOT NULL,
poll_ip text NOT NULL,
poll_active int2 DEFAULT '0' NOT NULL,
poll_comment int2 DEFAULT '1' NOT NULL,
CONSTRAINT poll_pkey PRIMARY KEY (poll_id)
);
CREATE TABLE rate (
rate_id int4 DEFAULT '0' NOT NULL,
rate_table varchar(100) DEFAULT '' NOT NULL,
rate_itemid int4 DEFAULT '0' NOT NULL,
rate_rating int4 DEFAULT '0' NOT NULL,
rate_votes int4 DEFAULT '0' NOT NULL,
rate_voters text NOT NULL,
CONSTRAINT rate_pkey PRIMARY KEY (rate_id)
);

569
e107_admin/sql/core_sql.php Normal file
View File

@@ -0,0 +1,569 @@
<?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_admin/sql/core_sql.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:33 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
header("location:../index.php");
exit;
?>
#
# +---------------------------------------------------------------+
# | e107 website system
# | /files/sql.php
# |
# | ?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).
# +---------------------------------------------------------------+
# Database : <variable>
# --------------------------------------------------------
#
# Table structure for table `banlist`
#
CREATE TABLE banlist (
banlist_ip varchar(100) NOT NULL default '',
banlist_admin smallint(5) unsigned NOT NULL default '0',
banlist_reason tinytext NOT NULL,
PRIMARY KEY (banlist_ip)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `banner`
#
CREATE TABLE banner (
banner_id int(10) unsigned NOT NULL auto_increment,
banner_clientname varchar(100) NOT NULL default '',
banner_clientlogin varchar(20) NOT NULL default '',
banner_clientpassword varchar(50) NOT NULL default '',
banner_image varchar(150) NOT NULL default '',
banner_clickurl varchar(150) NOT NULL default '',
banner_impurchased int(10) unsigned NOT NULL default '0',
banner_startdate int(10) unsigned NOT NULL default '0',
banner_enddate int(10) unsigned NOT NULL default '0',
banner_active tinyint(3) unsigned NOT NULL default '0',
banner_clicks int(10) unsigned NOT NULL default '0',
banner_impressions int(10) unsigned NOT NULL default '0',
banner_ip text NOT NULL,
banner_campaign varchar(150) NOT NULL default '',
PRIMARY KEY (banner_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `comments`
#
CREATE TABLE comments (
comment_id int(10) unsigned NOT NULL auto_increment,
comment_pid int(10) unsigned NOT NULL default '0',
comment_item_id int(10) unsigned NOT NULL default '0',
comment_subject varchar(100) NOT NULL default '',
comment_author varchar(100) NOT NULL default '',
comment_author_email varchar(200) NOT NULL default '',
comment_datestamp int(10) unsigned NOT NULL default '0',
comment_comment text NOT NULL,
comment_blocked tinyint(3) unsigned NOT NULL default '0',
comment_ip varchar(20) NOT NULL default '',
comment_type varchar(10) NOT NULL default '0',
comment_lock tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (comment_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `core`
#
CREATE TABLE core (
e107_name varchar(100) NOT NULL default '',
e107_value text NOT NULL,
PRIMARY KEY (e107_name)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `dblog`
#
CREATE TABLE dblog (
dblog_id int(10) unsigned NOT NULL auto_increment,
dblog_type varchar(60) NOT NULL default '',
dblog_datestamp int(10) unsigned NOT NULL default '0',
dblog_user_id int(10) unsigned NOT NULL default '0',
dblog_ip varchar(80) NOT NULL default '',
dblog_title varchar(255) NOT NULL default '',
dblog_remarks text NOT NULL,
PRIMARY KEY (dblog_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `download`
#
CREATE TABLE download (
download_id int(10) unsigned NOT NULL auto_increment,
download_name varchar(100) NOT NULL default '',
download_url varchar(150) NOT NULL default '',
download_author varchar(100) NOT NULL default '',
download_author_email varchar(200) NOT NULL default '',
download_author_website varchar(200) NOT NULL default '',
download_description text NOT NULL,
download_filesize varchar(20) NOT NULL default '',
download_requested int(10) unsigned NOT NULL default '0',
download_category int(10) unsigned NOT NULL default '0',
download_active tinyint(3) unsigned NOT NULL default '0',
download_datestamp int(10) unsigned NOT NULL default '0',
download_thumb varchar(150) NOT NULL default '',
download_image varchar(150) NOT NULL default '',
download_comment tinyint(3) unsigned NOT NULL default '0',
download_class varchar(255) NOT NULL default '0',
download_mirror text NOT NULL,
download_mirror_type tinyint(1) unsigned NOT NULL default '0',
download_visible varchar(255) NOT NULL default '0',
PRIMARY KEY (download_id),
UNIQUE KEY download_name (download_name),
KEY download_category (download_category)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `download_category`
#
CREATE TABLE download_category (
download_category_id int(10) unsigned NOT NULL auto_increment,
download_category_name varchar(100) NOT NULL default '',
download_category_description text NOT NULL,
download_category_icon varchar(100) NOT NULL default '',
download_category_parent int(10) unsigned NOT NULL default '0',
download_category_class varchar(255) NOT NULL default '0',
download_category_order int(10) unsigned NOT NULL default '0',
PRIMARY KEY (download_category_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `download_mirror`
#
CREATE TABLE download_mirror (
mirror_id int(10) unsigned NOT NULL auto_increment,
mirror_name varchar(200) NOT NULL default '',
mirror_url varchar(200) NOT NULL default '',
mirror_image varchar(200) NOT NULL default '',
mirror_location varchar(100) NOT NULL default '',
mirror_description text NOT NULL,
mirror_count int(10) unsigned NOT NULL default '0',
PRIMARY KEY (mirror_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `download_requests`
#
CREATE TABLE download_requests (
download_request_id int(10) unsigned NOT NULL auto_increment,
download_request_userid int(10) unsigned NOT NULL default '0',
download_request_ip varchar(30) NOT NULL default '',
download_request_download_id int(10) unsigned NOT NULL default '0',
download_request_datestamp int(10) unsigned NOT NULL default '0',
PRIMARY KEY (download_request_id),
KEY download_request_userid (download_request_userid),
KEY download_request_download_id (download_request_download_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `flood`
#
CREATE TABLE flood (
flood_url text NOT NULL,
flood_time int(10) unsigned NOT NULL default '0'
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `headlines`
#
CREATE TABLE headlines (
headline_id int(10) unsigned NOT NULL auto_increment,
headline_url varchar(150) NOT NULL default '',
headline_data text NOT NULL,
headline_timestamp int(10) unsigned NOT NULL default '0',
headline_description text NOT NULL,
headline_image varchar(100) NOT NULL default '',
headline_active tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (headline_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `links`
#
CREATE TABLE links (
link_id int(10) unsigned NOT NULL auto_increment,
link_name varchar(100) NOT NULL default '',
link_url varchar(200) NOT NULL default '',
link_description text NOT NULL,
link_button varchar(100) NOT NULL default '',
link_category tinyint(3) unsigned NOT NULL default '0',
link_order int(10) unsigned NOT NULL default '0',
link_parent int(10) unsigned NOT NULL default '0',
link_open tinyint(1) unsigned NOT NULL default '0',
link_class varchar(255) NOT NULL default '0',
PRIMARY KEY (link_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `menus`
#
CREATE TABLE menus (
menu_id int(10) unsigned NOT NULL auto_increment,
menu_name varchar(100) NOT NULL default '',
menu_location tinyint(3) unsigned NOT NULL default '0',
menu_order tinyint(3) unsigned NOT NULL default '0',
menu_class varchar(255) NOT NULL default '0',
menu_pages text NOT NULL,
menu_path varchar(100) NOT NULL default '',
PRIMARY KEY (menu_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `news`
#
CREATE TABLE news (
news_id int(10) unsigned NOT NULL auto_increment,
news_title varchar(200) NOT NULL default '',
news_body text NOT NULL,
news_extended text NOT NULL,
news_datestamp int(10) unsigned NOT NULL default '0',
news_author int(10) unsigned NOT NULL default '0',
news_category tinyint(3) unsigned NOT NULL default '0',
news_allow_comments tinyint(3) unsigned NOT NULL default '0',
news_start int(10) unsigned NOT NULL default '0',
news_end int(10) unsigned NOT NULL default '0',
news_class varchar(255) NOT NULL default '0',
news_render_type tinyint(3) unsigned NOT NULL default '0',
news_comment_total int(10) unsigned NOT NULL default '0',
news_summary text NOT NULL,
news_thumbnail text NOT NULL,
news_sticky tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (news_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `news_category`
#
CREATE TABLE news_category (
category_id int(10) unsigned NOT NULL auto_increment,
category_name varchar(200) NOT NULL default '',
category_icon varchar(250) NOT NULL default '',
PRIMARY KEY (category_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `online`
#
CREATE TABLE online (
online_timestamp int(10) unsigned NOT NULL default '0',
online_flag tinyint(3) unsigned NOT NULL default '0',
online_user_id varchar(100) NOT NULL default '',
online_ip varchar(15) NOT NULL default '',
online_location varchar(100) NOT NULL default '',
online_pagecount tinyint(3) unsigned NOT NULL default '0',
online_active int(10) unsigned NOT NULL default '0'
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `page`
#
CREATE TABLE page (
page_id int(10) unsigned NOT NULL auto_increment,
page_title varchar(250) NOT NULL default '',
page_text mediumtext NOT NULL,
page_author int(10) unsigned NOT NULL default '0',
page_datestamp int(10) unsigned NOT NULL default '0',
page_rating_flag tinyint(1) unsigned NOT NULL default '0',
page_comment_flag tinyint(1) unsigned NOT NULL default '0',
page_password varchar(50) NOT NULL default '',
page_class varchar(250) NOT NULL default '',
page_ip_restrict text NOT NULL,
page_theme varchar(50) NOT NULL default '',
PRIMARY KEY (page_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `plugin`
#
CREATE TABLE plugin (
plugin_id int(10) unsigned NOT NULL auto_increment,
plugin_name varchar(100) NOT NULL default '',
plugin_version varchar(10) NOT NULL default '',
plugin_path varchar(100) NOT NULL default '',
plugin_installflag tinyint(1) unsigned NOT NULL default '0',
plugin_addons text NOT NULL,
PRIMARY KEY (plugin_id),
UNIQUE KEY plugin_path (plugin_path)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `rate`
#
CREATE TABLE preset (
preset_id int(10) unsigned NOT NULL auto_increment,
preset_name varchar(80) NOT NULL default '',
preset_field varchar(80) NOT NULL default '',
preset_value varchar(255) NOT NULL default '',
PRIMARY KEY (preset_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `rate`
#
CREATE TABLE rate (
rate_id int(10) unsigned NOT NULL auto_increment,
rate_table varchar(100) NOT NULL default '',
rate_itemid int(10) unsigned NOT NULL default '0',
rate_rating int(10) unsigned NOT NULL default '0',
rate_votes int(10) unsigned NOT NULL default '0',
rate_voters text NOT NULL,
PRIMARY KEY (rate_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `rbinary`
#
CREATE TABLE rbinary (
binary_id int(10) unsigned NOT NULL auto_increment,
binary_name varchar(200) NOT NULL default '',
binary_filetype varchar(100) NOT NULL default '',
binary_data longblob NOT NULL,
PRIMARY KEY (binary_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `session`
#
CREATE TABLE session (
session_id varchar(32) NOT NULL default '',
session_expire int(10) unsigned NOT NULL default '0',
session_datestamp int(10) unsigned NOT NULL default '0',
session_ip varchar(200) NOT NULL default '',
session_data text NOT NULL
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `submitnews`
#
CREATE TABLE submitnews (
submitnews_id int(10) unsigned NOT NULL auto_increment,
submitnews_name varchar(100) NOT NULL default '',
submitnews_email varchar(100) NOT NULL default '',
submitnews_title varchar(200) NOT NULL default '',
submitnews_category tinyint(3) unsigned NOT NULL default '0',
submitnews_item text NOT NULL,
submitnews_datestamp int(10) unsigned NOT NULL default '0',
submitnews_ip varchar(15) NOT NULL default '',
submitnews_auth tinyint(3) unsigned NOT NULL default '0',
submitnews_file varchar(100) NOT NULL default '',
PRIMARY KEY (submitnews_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `tmp`
#
CREATE TABLE tmp (
tmp_ip varchar(20) NOT NULL default '',
tmp_time int(10) unsigned NOT NULL default '0',
tmp_info text NOT NULL,
KEY tmp_ip (tmp_ip)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `upload`
#
CREATE TABLE upload (
upload_id int(10) unsigned NOT NULL auto_increment,
upload_poster varchar(100) NOT NULL default '',
upload_email varchar(100) NOT NULL default '',
upload_website varchar(100) NOT NULL default '',
upload_datestamp int(10) unsigned NOT NULL default '0',
upload_name varchar(100) NOT NULL default '',
upload_version varchar(10) NOT NULL default '',
upload_file varchar(100) NOT NULL default '',
upload_ss varchar(100) NOT NULL default '',
upload_description text NOT NULL,
upload_demo varchar(100) NOT NULL default '',
upload_filesize int(10) unsigned NOT NULL default '0',
upload_active tinyint(3) unsigned NOT NULL default '0',
upload_category tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (upload_id),
KEY upload_active (upload_active)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `user`
#
CREATE TABLE user (
user_id int(10) unsigned NOT NULL auto_increment,
user_name varchar(100) NOT NULL default '',
user_loginname varchar(100) NOT NULL default '',
user_customtitle varchar(100) NOT NULL default '',
user_password varchar(32) NOT NULL default '',
user_sess varchar(100) NOT NULL default '',
user_email varchar(100) NOT NULL default '',
user_signature text NOT NULL,
user_image varchar(100) NOT NULL default '',
user_timezone varchar(3) NOT NULL default '',
user_hideemail tinyint(3) unsigned NOT NULL default '0',
user_join int(10) unsigned NOT NULL default '0',
user_lastvisit int(10) unsigned NOT NULL default '0',
user_currentvisit int(10) unsigned NOT NULL default '0',
user_lastpost int(10) unsigned NOT NULL default '0',
user_chats int(10) unsigned NOT NULL default '0',
user_comments int(10) unsigned NOT NULL default '0',
user_forums int(10) unsigned NOT NULL default '0',
user_ip varchar(20) NOT NULL default '',
user_ban tinyint(3) unsigned NOT NULL default '0',
user_prefs text NOT NULL,
user_new text NOT NULL,
user_viewed text NOT NULL,
user_visits int(10) unsigned NOT NULL default '0',
user_admin tinyint(3) unsigned NOT NULL default '0',
user_login varchar(100) NOT NULL default '',
user_class text NOT NULL,
user_perms text NOT NULL,
user_realm text NOT NULL,
user_pwchange int(10) unsigned NOT NULL default '0',
user_xup varchar(100) NOT NULL default '',
PRIMARY KEY (user_id),
UNIQUE KEY user_name (user_name),
KEY user_ban_index (user_ban)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `userclass_classes`
#
CREATE TABLE userclass_classes (
userclass_id tinyint(3) unsigned NOT NULL default '0',
userclass_name varchar(100) NOT NULL default '',
userclass_description varchar(250) NOT NULL default '',
userclass_editclass tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (userclass_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `e107_user_extended`
#
CREATE TABLE user_extended (
user_extended_id int(10) unsigned NOT NULL default '0',
user_hidden_fields text NOT NULL,
PRIMARY KEY (user_extended_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `e107_user_extended_struct`
#
CREATE TABLE user_extended_struct (
user_extended_struct_id int(10) unsigned NOT NULL auto_increment,
user_extended_struct_name varchar(255) NOT NULL default '',
user_extended_struct_text varchar(255) NOT NULL default '',
user_extended_struct_type tinyint(3) unsigned NOT NULL default '0',
user_extended_struct_parms varchar(255) NOT NULL default '',
user_extended_struct_values text NOT NULL,
user_extended_struct_default varchar(255) NOT NULL default '',
user_extended_struct_read tinyint(3) unsigned NOT NULL default '0',
user_extended_struct_write tinyint(3) unsigned NOT NULL default '0',
user_extended_struct_required tinyint(3) unsigned NOT NULL default '0',
user_extended_struct_signup tinyint(3) unsigned NOT NULL default '0',
user_extended_struct_applicable tinyint(3) unsigned NOT NULL default '0',
user_extended_struct_order int(10) unsigned NOT NULL default '0',
user_extended_struct_parent int(10) unsigned NOT NULL default '0',
PRIMARY KEY (user_extended_struct_id)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `generic`
#
CREATE TABLE generic (
gen_id int(10) unsigned NOT NULL auto_increment,
gen_type varchar(80) NOT NULL default '',
gen_datestamp int(10) unsigned NOT NULL default '0',
gen_user_id int(10) unsigned NOT NULL default '0',
gen_ip varchar(80) NOT NULL default '',
gen_intdata int(10) unsigned NOT NULL default '0',
gen_chardata text NOT NULL,
PRIMARY KEY (gen_id),
KEY gen_type (gen_type)
) TYPE=MyISAM;
# --------------------------------------------------------

View File

View File

@@ -0,0 +1,271 @@
<?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_admin/sql/extended_country.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:34 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
header("location:../index.php");
exit;
?>
CREATE TABLE user_extended_country (
country_code char(3) NOT NULL default '',
country_name char(52) NOT NULL default '',
country_continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia',
country_region char(26) NOT NULL default '',
country_iso char(2) NOT NULL default '',
PRIMARY KEY (country_code),
KEY country_iso (country_iso)
) TYPE=MyISAM;
INSERT INTO user_extended_country VALUES('AFG', 'Afghanistan', 'Asia', 'Southern and Central Asia', 'AF');
INSERT INTO user_extended_country VALUES('NLD', 'Netherlands', 'Europe', 'Western Europe', 'NL');
INSERT INTO user_extended_country VALUES('ANT', 'Netherlands Antilles', 'North America', 'Caribbean', 'AN');
INSERT INTO user_extended_country VALUES('ALB', 'Albania', 'Europe', 'Southern Europe', 'AL');
INSERT INTO user_extended_country VALUES('DZA', 'Algeria', 'Africa', 'Northern Africa', 'DZ');
INSERT INTO user_extended_country VALUES('ASM', 'American Samoa', 'Oceania', 'Polynesia', 'AS');
INSERT INTO user_extended_country VALUES('AND', 'Andorra', 'Europe', 'Southern Europe', 'AD');
INSERT INTO user_extended_country VALUES('AGO', 'Angola', 'Africa', 'Central Africa', 'AO');
INSERT INTO user_extended_country VALUES('AIA', 'Anguilla', 'North America', 'Caribbean', 'AI');
INSERT INTO user_extended_country VALUES('ATG', 'Antigua and Barbuda', 'North America', 'Caribbean', 'AG');
INSERT INTO user_extended_country VALUES('ARE', 'United Arab Emirates', 'Asia', 'Middle East', 'AE');
INSERT INTO user_extended_country VALUES('ARG', 'Argentina', 'South America', 'South America', 'AR');
INSERT INTO user_extended_country VALUES('ARM', 'Armenia', 'Asia', 'Middle East', 'AM');
INSERT INTO user_extended_country VALUES('ABW', 'Aruba', 'North America', 'Caribbean', 'AW');
INSERT INTO user_extended_country VALUES('AUS', 'Australia', 'Oceania', 'Australia and New Zealand', 'AU');
INSERT INTO user_extended_country VALUES('AZE', 'Azerbaijan', 'Asia', 'Middle East', 'AZ');
INSERT INTO user_extended_country VALUES('BHS', 'Bahamas', 'North America', 'Caribbean', 'BS');
INSERT INTO user_extended_country VALUES('BHR', 'Bahrain', 'Asia', 'Middle East', 'BH');
INSERT INTO user_extended_country VALUES('BGD', 'Bangladesh', 'Asia', 'Southern and Central Asia', 'BD');
INSERT INTO user_extended_country VALUES('BRB', 'Barbados', 'North America', 'Caribbean', 'BB');
INSERT INTO user_extended_country VALUES('BEL', 'Belgium', 'Europe', 'Western Europe', 'BE');
INSERT INTO user_extended_country VALUES('BLZ', 'Belize', 'North America', 'Central America', 'BZ');
INSERT INTO user_extended_country VALUES('BEN', 'Benin', 'Africa', 'Western Africa', 'BJ');
INSERT INTO user_extended_country VALUES('BMU', 'Bermuda', 'North America', 'North America', 'BM');
INSERT INTO user_extended_country VALUES('BTN', 'Bhutan', 'Asia', 'Southern and Central Asia', 'BT');
INSERT INTO user_extended_country VALUES('BOL', 'Bolivia', 'South America', 'South America', 'BO');
INSERT INTO user_extended_country VALUES('BIH', 'Bosnia and Herzegovina', 'Europe', 'Southern Europe', 'BA');
INSERT INTO user_extended_country VALUES('BWA', 'Botswana', 'Africa', 'Southern Africa', 'BW');
INSERT INTO user_extended_country VALUES('BRA', 'Brazil', 'South America', 'South America', 'BR');
INSERT INTO user_extended_country VALUES('GBR', 'United Kingdom', 'Europe', 'British Islands', 'GB');
INSERT INTO user_extended_country VALUES('VGB', 'Virgin Islands, British', 'North America', 'Caribbean', 'VG');
INSERT INTO user_extended_country VALUES('BRN', 'Brunei', 'Asia', 'Southeast Asia', 'BN');
INSERT INTO user_extended_country VALUES('BGR', 'Bulgaria', 'Europe', 'Eastern Europe', 'BG');
INSERT INTO user_extended_country VALUES('BFA', 'Burkina Faso', 'Africa', 'Western Africa', 'BF');
INSERT INTO user_extended_country VALUES('BDI', 'Burundi', 'Africa', 'Eastern Africa', 'BI');
INSERT INTO user_extended_country VALUES('CYM', 'Cayman Islands', 'North America', 'Caribbean', 'KY');
INSERT INTO user_extended_country VALUES('CHL', 'Chile', 'South America', 'South America', 'CL');
INSERT INTO user_extended_country VALUES('COK', 'Cook Islands', 'Oceania', 'Polynesia', 'CK');
INSERT INTO user_extended_country VALUES('CRI', 'Costa Rica', 'North America', 'Central America', 'CR');
INSERT INTO user_extended_country VALUES('DJI', 'Djibouti', 'Africa', 'Eastern Africa', 'DJ');
INSERT INTO user_extended_country VALUES('DMA', 'Dominica', 'North America', 'Caribbean', 'DM');
INSERT INTO user_extended_country VALUES('DOM', 'Dominican Republic', 'North America', 'Caribbean', 'DO');
INSERT INTO user_extended_country VALUES('ECU', 'Ecuador', 'South America', 'South America', 'EC');
INSERT INTO user_extended_country VALUES('EGY', 'Egypt', 'Africa', 'Northern Africa', 'EG');
INSERT INTO user_extended_country VALUES('SLV', 'El Salvador', 'North America', 'Central America', 'SV');
INSERT INTO user_extended_country VALUES('ERI', 'Eritrea', 'Africa', 'Eastern Africa', 'ER');
INSERT INTO user_extended_country VALUES('ESP', 'Spain', 'Europe', 'Southern Europe', 'ES');
INSERT INTO user_extended_country VALUES('ZAF', 'South Africa', 'Africa', 'Southern Africa', 'ZA');
INSERT INTO user_extended_country VALUES('ETH', 'Ethiopia', 'Africa', 'Eastern Africa', 'ET');
INSERT INTO user_extended_country VALUES('FLK', 'Falkland Islands', 'South America', 'South America', 'FK');
INSERT INTO user_extended_country VALUES('FJI', 'Fiji Islands', 'Oceania', 'Melanesia', 'FJ');
INSERT INTO user_extended_country VALUES('PHL', 'Philippines', 'Asia', 'Southeast Asia', 'PH');
INSERT INTO user_extended_country VALUES('FRO', 'Faroe Islands', 'Europe', 'Nordic Countries', 'FO');
INSERT INTO user_extended_country VALUES('GAB', 'Gabon', 'Africa', 'Central Africa', 'GA');
INSERT INTO user_extended_country VALUES('GMB', 'Gambia', 'Africa', 'Western Africa', 'GM');
INSERT INTO user_extended_country VALUES('GEO', 'Georgia', 'Asia', 'Middle East', 'GE');
INSERT INTO user_extended_country VALUES('GHA', 'Ghana', 'Africa', 'Western Africa', 'GH');
INSERT INTO user_extended_country VALUES('GIB', 'Gibraltar', 'Europe', 'Southern Europe', 'GI');
INSERT INTO user_extended_country VALUES('GRD', 'Grenada', 'North America', 'Caribbean', 'GD');
INSERT INTO user_extended_country VALUES('GRL', 'Greenland', 'North America', 'North America', 'GL');
INSERT INTO user_extended_country VALUES('GLP', 'Guadeloupe', 'North America', 'Caribbean', 'GP');
INSERT INTO user_extended_country VALUES('GUM', 'Guam', 'Oceania', 'Micronesia', 'GU');
INSERT INTO user_extended_country VALUES('GTM', 'Guatemala', 'North America', 'Central America', 'GT');
INSERT INTO user_extended_country VALUES('GIN', 'Guinea', 'Africa', 'Western Africa', 'GN');
INSERT INTO user_extended_country VALUES('GNB', 'Guinea-Bissau', 'Africa', 'Western Africa', 'GW');
INSERT INTO user_extended_country VALUES('GUY', 'Guyana', 'South America', 'South America', 'GY');
INSERT INTO user_extended_country VALUES('HTI', 'Haiti', 'North America', 'Caribbean', 'HT');
INSERT INTO user_extended_country VALUES('HND', 'Honduras', 'North America', 'Central America', 'HN');
INSERT INTO user_extended_country VALUES('HKG', 'Hong Kong', 'Asia', 'Eastern Asia', 'HK');
INSERT INTO user_extended_country VALUES('SJM', 'Svalbard and Jan Mayen', 'Europe', 'Nordic Countries', 'SJ');
INSERT INTO user_extended_country VALUES('IDN', 'Indonesia', 'Asia', 'Southeast Asia', 'ID');
INSERT INTO user_extended_country VALUES('IND', 'India', 'Asia', 'Southern and Central Asia', 'IN');
INSERT INTO user_extended_country VALUES('IRQ', 'Iraq', 'Asia', 'Middle East', 'IQ');
INSERT INTO user_extended_country VALUES('IRN', 'Iran', 'Asia', 'Southern and Central Asia', 'IR');
INSERT INTO user_extended_country VALUES('IRL', 'Ireland', 'Europe', 'British Islands', 'IE');
INSERT INTO user_extended_country VALUES('ISL', 'Iceland', 'Europe', 'Nordic Countries', 'IS');
INSERT INTO user_extended_country VALUES('ISR', 'Israel', 'Asia', 'Middle East', 'IL');
INSERT INTO user_extended_country VALUES('ITA', 'Italy', 'Europe', 'Southern Europe', 'IT');
INSERT INTO user_extended_country VALUES('TMP', 'East Timor', 'Asia', 'Southeast Asia', 'TP');
INSERT INTO user_extended_country VALUES('AUT', 'Austria', 'Europe', 'Western Europe', 'AT');
INSERT INTO user_extended_country VALUES('JAM', 'Jamaica', 'North America', 'Caribbean', 'JM');
INSERT INTO user_extended_country VALUES('JPN', 'Japan', 'Asia', 'Eastern Asia', 'JP');
INSERT INTO user_extended_country VALUES('YEM', 'Yemen', 'Asia', 'Middle East', 'YE');
INSERT INTO user_extended_country VALUES('JOR', 'Jordan', 'Asia', 'Middle East', 'JO');
INSERT INTO user_extended_country VALUES('CXR', 'Christmas Island', 'Oceania', 'Australia and New Zealand', 'CX');
INSERT INTO user_extended_country VALUES('YUG', 'Serbia and Montenegro', 'Europe', 'Southern Europe', 'YU');
INSERT INTO user_extended_country VALUES('KHM', 'Cambodia', 'Asia', 'Southeast Asia', 'KH');
INSERT INTO user_extended_country VALUES('CMR', 'Cameroon', 'Africa', 'Central Africa', 'CM');
INSERT INTO user_extended_country VALUES('CAN', 'Canada', 'North America', 'North America', 'CA');
INSERT INTO user_extended_country VALUES('CPV', 'Cape Verde', 'Africa', 'Western Africa', 'CV');
INSERT INTO user_extended_country VALUES('KAZ', 'Kazakstan', 'Asia', 'Southern and Central Asia', 'KZ');
INSERT INTO user_extended_country VALUES('KEN', 'Kenya', 'Africa', 'Eastern Africa', 'KE');
INSERT INTO user_extended_country VALUES('CAF', 'Central African Republic', 'Africa', 'Central Africa', 'CF');
INSERT INTO user_extended_country VALUES('CHN', 'China', 'Asia', 'Eastern Asia', 'CN');
INSERT INTO user_extended_country VALUES('KGZ', 'Kyrgyzstan', 'Asia', 'Southern and Central Asia', 'KG');
INSERT INTO user_extended_country VALUES('KIR', 'Kiribati', 'Oceania', 'Micronesia', 'KI');
INSERT INTO user_extended_country VALUES('COL', 'Colombia', 'South America', 'South America', 'CO');
INSERT INTO user_extended_country VALUES('COM', 'Comoros', 'Africa', 'Eastern Africa', 'KM');
INSERT INTO user_extended_country VALUES('COG', 'Congo', 'Africa', 'Central Africa', 'CG');
INSERT INTO user_extended_country VALUES('COD', 'Congo, The Democratic Republic of the', 'Africa', 'Central Africa', 'CD');
INSERT INTO user_extended_country VALUES('CCK', 'Cocos (Keeling) Islands', 'Oceania', 'Australia and New Zealand', 'CC');
INSERT INTO user_extended_country VALUES('PRK', 'North Korea', 'Asia', 'Eastern Asia', 'KP');
INSERT INTO user_extended_country VALUES('KOR', 'South Korea', 'Asia', 'Eastern Asia', 'KR');
INSERT INTO user_extended_country VALUES('GRC', 'Greece', 'Europe', 'Southern Europe', 'GR');
INSERT INTO user_extended_country VALUES('HRV', 'Croatia', 'Europe', 'Southern Europe', 'HR');
INSERT INTO user_extended_country VALUES('CUB', 'Cuba', 'North America', 'Caribbean', 'CU');
INSERT INTO user_extended_country VALUES('KWT', 'Kuwait', 'Asia', 'Middle East', 'KW');
INSERT INTO user_extended_country VALUES('CYP', 'Cyprus', 'Asia', 'Middle East', 'CY');
INSERT INTO user_extended_country VALUES('LAO', 'Laos', 'Asia', 'Southeast Asia', 'LA');
INSERT INTO user_extended_country VALUES('LVA', 'Latvia', 'Europe', 'Baltic Countries', 'LV');
INSERT INTO user_extended_country VALUES('LSO', 'Lesotho', 'Africa', 'Southern Africa', 'LS');
INSERT INTO user_extended_country VALUES('LBN', 'Lebanon', 'Asia', 'Middle East', 'LB');
INSERT INTO user_extended_country VALUES('LBR', 'Liberia', 'Africa', 'Western Africa', 'LR');
INSERT INTO user_extended_country VALUES('LBY', 'Libyan Arab Jamahiriya', 'Africa', 'Northern Africa', 'LY');
INSERT INTO user_extended_country VALUES('LIE', 'Liechtenstein', 'Europe', 'Western Europe', 'LI');
INSERT INTO user_extended_country VALUES('LTU', 'Lithuania', 'Europe', 'Baltic Countries', 'LT');
INSERT INTO user_extended_country VALUES('LUX', 'Luxembourg', 'Europe', 'Western Europe', 'LU');
INSERT INTO user_extended_country VALUES('ESH', 'Western Sahara', 'Africa', 'Northern Africa', 'EH');
INSERT INTO user_extended_country VALUES('MAC', 'Macao', 'Asia', 'Eastern Asia', 'MO');
INSERT INTO user_extended_country VALUES('MDG', 'Madagascar', 'Africa', 'Eastern Africa', 'MG');
INSERT INTO user_extended_country VALUES('MKD', 'Macedonia', 'Europe', 'Southern Europe', 'MK');
INSERT INTO user_extended_country VALUES('MWI', 'Malawi', 'Africa', 'Eastern Africa', 'MW');
INSERT INTO user_extended_country VALUES('MDV', 'Maldives', 'Asia', 'Southern and Central Asia', 'MV');
INSERT INTO user_extended_country VALUES('MYS', 'Malaysia', 'Asia', 'Southeast Asia', 'MY');
INSERT INTO user_extended_country VALUES('MLI', 'Mali', 'Africa', 'Western Africa', 'ML');
INSERT INTO user_extended_country VALUES('MLT', 'Malta', 'Europe', 'Southern Europe', 'MT');
INSERT INTO user_extended_country VALUES('MAR', 'Morocco', 'Africa', 'Northern Africa', 'MA');
INSERT INTO user_extended_country VALUES('MHL', 'Marshall Islands', 'Oceania', 'Micronesia', 'MH');
INSERT INTO user_extended_country VALUES('MTQ', 'Martinique', 'North America', 'Caribbean', 'MQ');
INSERT INTO user_extended_country VALUES('MRT', 'Mauritania', 'Africa', 'Western Africa', 'MR');
INSERT INTO user_extended_country VALUES('MUS', 'Mauritius', 'Africa', 'Eastern Africa', 'MU');
INSERT INTO user_extended_country VALUES('MYT', 'Mayotte', 'Africa', 'Eastern Africa', 'YT');
INSERT INTO user_extended_country VALUES('MEX', 'Mexico', 'North America', 'Central America', 'MX');
INSERT INTO user_extended_country VALUES('FSM', 'Micronesia, Federated States of', 'Oceania', 'Micronesia', 'FM');
INSERT INTO user_extended_country VALUES('MDA', 'Moldova', 'Europe', 'Eastern Europe', 'MD');
INSERT INTO user_extended_country VALUES('MCO', 'Monaco', 'Europe', 'Western Europe', 'MC');
INSERT INTO user_extended_country VALUES('MNG', 'Mongolia', 'Asia', 'Eastern Asia', 'MN');
INSERT INTO user_extended_country VALUES('MSR', 'Montserrat', 'North America', 'Caribbean', 'MS');
INSERT INTO user_extended_country VALUES('MOZ', 'Mozambique', 'Africa', 'Eastern Africa', 'MZ');
INSERT INTO user_extended_country VALUES('MMR', 'Myanmar', 'Asia', 'Southeast Asia', 'MM');
INSERT INTO user_extended_country VALUES('NAM', 'Namibia', 'Africa', 'Southern Africa', 'NA');
INSERT INTO user_extended_country VALUES('NRU', 'Nauru', 'Oceania', 'Micronesia', 'NR');
INSERT INTO user_extended_country VALUES('NPL', 'Nepal', 'Asia', 'Southern and Central Asia', 'NP');
INSERT INTO user_extended_country VALUES('NIC', 'Nicaragua', 'North America', 'Central America', 'NI');
INSERT INTO user_extended_country VALUES('NER', 'Niger', 'Africa', 'Western Africa', 'NE');
INSERT INTO user_extended_country VALUES('NGA', 'Nigeria', 'Africa', 'Western Africa', 'NG');
INSERT INTO user_extended_country VALUES('NIU', 'Niue', 'Oceania', 'Polynesia', 'NU');
INSERT INTO user_extended_country VALUES('NFK', 'Norfolk Island', 'Oceania', 'Australia and New Zealand', 'NF');
INSERT INTO user_extended_country VALUES('NOR', 'Norway', 'Europe', 'Nordic Countries', 'NO');
INSERT INTO user_extended_country VALUES('CIV', 'Côte d’Ivoire', 'Africa', 'Western Africa', 'CI');
INSERT INTO user_extended_country VALUES('OMN', 'Oman', 'Asia', 'Middle East', 'OM');
INSERT INTO user_extended_country VALUES('PAK', 'Pakistan', 'Asia', 'Southern and Central Asia', 'PK');
INSERT INTO user_extended_country VALUES('PLW', 'Palau', 'Oceania', 'Micronesia', 'PW');
INSERT INTO user_extended_country VALUES('PAN', 'Panama', 'North America', 'Central America', 'PA');
INSERT INTO user_extended_country VALUES('PNG', 'Papua New Guinea', 'Oceania', 'Melanesia', 'PG');
INSERT INTO user_extended_country VALUES('PRY', 'Paraguay', 'South America', 'South America', 'PY');
INSERT INTO user_extended_country VALUES('PER', 'Peru', 'South America', 'South America', 'PE');
INSERT INTO user_extended_country VALUES('PCN', 'Pitcairn', 'Oceania', 'Polynesia', 'PN');
INSERT INTO user_extended_country VALUES('MNP', 'Northern Mariana Islands', 'Oceania', 'Micronesia', 'MP');
INSERT INTO user_extended_country VALUES('PRT', 'Portugal', 'Europe', 'Southern Europe', 'PT');
INSERT INTO user_extended_country VALUES('PRI', 'Puerto Rico', 'North America', 'Caribbean', 'PR');
INSERT INTO user_extended_country VALUES('POL', 'Poland', 'Europe', 'Eastern Europe', 'PL');
INSERT INTO user_extended_country VALUES('GNQ', 'Equatorial Guinea', 'Africa', 'Central Africa', 'GQ');
INSERT INTO user_extended_country VALUES('QAT', 'Qatar', 'Asia', 'Middle East', 'QA');
INSERT INTO user_extended_country VALUES('FRA', 'France', 'Europe', 'Western Europe', 'FR');
INSERT INTO user_extended_country VALUES('GUF', 'French Guiana', 'South America', 'South America', 'GF');
INSERT INTO user_extended_country VALUES('PYF', 'French Polynesia', 'Oceania', 'Polynesia', 'PF');
INSERT INTO user_extended_country VALUES('REU', 'Réunion', 'Africa', 'Eastern Africa', 'RE');
INSERT INTO user_extended_country VALUES('ROM', 'Romania', 'Europe', 'Eastern Europe', 'RO');
INSERT INTO user_extended_country VALUES('RWA', 'Rwanda', 'Africa', 'Eastern Africa', 'RW');
INSERT INTO user_extended_country VALUES('SWE', 'Sweden', 'Europe', 'Nordic Countries', 'SE');
INSERT INTO user_extended_country VALUES('SHN', 'Saint Helena', 'Africa', 'Western Africa', 'SH');
INSERT INTO user_extended_country VALUES('KNA', 'Saint Kitts and Nevis', 'North America', 'Caribbean', 'KN');
INSERT INTO user_extended_country VALUES('LCA', 'Saint Lucia', 'North America', 'Caribbean', 'LC');
INSERT INTO user_extended_country VALUES('VCT', 'Saint Vincent and the Grenadines', 'North America', 'Caribbean', 'VC');
INSERT INTO user_extended_country VALUES('SPM', 'Saint Pierre and Miquelon', 'North America', 'North America', 'PM');
INSERT INTO user_extended_country VALUES('DEU', 'Germany', 'Europe', 'Western Europe', 'DE');
INSERT INTO user_extended_country VALUES('SLB', 'Solomon Islands', 'Oceania', 'Melanesia', 'SB');
INSERT INTO user_extended_country VALUES('ZMB', 'Zambia', 'Africa', 'Eastern Africa', 'ZM');
INSERT INTO user_extended_country VALUES('WSM', 'Samoa', 'Oceania', 'Polynesia', 'WS');
INSERT INTO user_extended_country VALUES('SMR', 'San Marino', 'Europe', 'Southern Europe', 'SM');
INSERT INTO user_extended_country VALUES('STP', 'Sao Tome and Principe', 'Africa', 'Central Africa', 'ST');
INSERT INTO user_extended_country VALUES('SAU', 'Saudi Arabia', 'Asia', 'Middle East', 'SA');
INSERT INTO user_extended_country VALUES('SEN', 'Senegal', 'Africa', 'Western Africa', 'SN');
INSERT INTO user_extended_country VALUES('SYC', 'Seychelles', 'Africa', 'Eastern Africa', 'SC');
INSERT INTO user_extended_country VALUES('SLE', 'Sierra Leone', 'Africa', 'Western Africa', 'SL');
INSERT INTO user_extended_country VALUES('SGP', 'Singapore', 'Asia', 'Southeast Asia', 'SG');
INSERT INTO user_extended_country VALUES('SVK', 'Slovakia', 'Europe', 'Eastern Europe', 'SK');
INSERT INTO user_extended_country VALUES('SVN', 'Slovenia', 'Europe', 'Southern Europe', 'SI');
INSERT INTO user_extended_country VALUES('SOM', 'Somalia', 'Africa', 'Eastern Africa', 'SO');
INSERT INTO user_extended_country VALUES('LKA', 'Sri Lanka', 'Asia', 'Southern and Central Asia', 'LK');
INSERT INTO user_extended_country VALUES('SDN', 'Sudan', 'Africa', 'Northern Africa', 'SD');
INSERT INTO user_extended_country VALUES('FIN', 'Finland', 'Europe', 'Nordic Countries', 'FI');
INSERT INTO user_extended_country VALUES('SUR', 'Suriname', 'South America', 'South America', 'SR');
INSERT INTO user_extended_country VALUES('SWZ', 'Swaziland', 'Africa', 'Southern Africa', 'SZ');
INSERT INTO user_extended_country VALUES('CHE', 'Switzerland', 'Europe', 'Western Europe', 'CH');
INSERT INTO user_extended_country VALUES('SYR', 'Syria', 'Asia', 'Middle East', 'SY');
INSERT INTO user_extended_country VALUES('TJK', 'Tajikistan', 'Asia', 'Southern and Central Asia', 'TJ');
INSERT INTO user_extended_country VALUES('TWN', 'Taiwan', 'Asia', 'Eastern Asia', 'TW');
INSERT INTO user_extended_country VALUES('TZA', 'Tanzania', 'Africa', 'Eastern Africa', 'TZ');
INSERT INTO user_extended_country VALUES('DNK', 'Denmark', 'Europe', 'Nordic Countries', 'DK');
INSERT INTO user_extended_country VALUES('THA', 'Thailand', 'Asia', 'Southeast Asia', 'TH');
INSERT INTO user_extended_country VALUES('TGO', 'Togo', 'Africa', 'Western Africa', 'TG');
INSERT INTO user_extended_country VALUES('TKL', 'Tokelau', 'Oceania', 'Polynesia', 'TK');
INSERT INTO user_extended_country VALUES('TON', 'Tonga', 'Oceania', 'Polynesia', 'TO');
INSERT INTO user_extended_country VALUES('TTO', 'Trinidad and Tobago', 'North America', 'Caribbean', 'TT');
INSERT INTO user_extended_country VALUES('TCD', 'Chad', 'Africa', 'Central Africa', 'TD');
INSERT INTO user_extended_country VALUES('CZE', 'Czech Republic', 'Europe', 'Eastern Europe', 'CZ');
INSERT INTO user_extended_country VALUES('TUN', 'Tunisia', 'Africa', 'Northern Africa', 'TN');
INSERT INTO user_extended_country VALUES('TUR', 'Turkey', 'Asia', 'Middle East', 'TR');
INSERT INTO user_extended_country VALUES('TKM', 'Turkmenistan', 'Asia', 'Southern and Central Asia', 'TM');
INSERT INTO user_extended_country VALUES('TCA', 'Turks and Caicos Islands', 'North America', 'Caribbean', 'TC');
INSERT INTO user_extended_country VALUES('TUV', 'Tuvalu', 'Oceania', 'Polynesia', 'TV');
INSERT INTO user_extended_country VALUES('UGA', 'Uganda', 'Africa', 'Eastern Africa', 'UG');
INSERT INTO user_extended_country VALUES('UKR', 'Ukraine', 'Europe', 'Eastern Europe', 'UA');
INSERT INTO user_extended_country VALUES('HUN', 'Hungary', 'Europe', 'Eastern Europe', 'HU');
INSERT INTO user_extended_country VALUES('URY', 'Uruguay', 'South America', 'South America', 'UY');
INSERT INTO user_extended_country VALUES('NCL', 'New Caledonia', 'Oceania', 'Melanesia', 'NC');
INSERT INTO user_extended_country VALUES('NZL', 'New Zealand', 'Oceania', 'Australia and New Zealand', 'NZ');
INSERT INTO user_extended_country VALUES('UZB', 'Uzbekistan', 'Asia', 'Southern and Central Asia', 'UZ');
INSERT INTO user_extended_country VALUES('BLR', 'Belarus', 'Europe', 'Eastern Europe', 'BY');
INSERT INTO user_extended_country VALUES('WLF', 'Wallis and Futuna', 'Oceania', 'Polynesia', 'WF');
INSERT INTO user_extended_country VALUES('VUT', 'Vanuatu', 'Oceania', 'Melanesia', 'VU');
INSERT INTO user_extended_country VALUES('VAT', 'Holy See (Vatican City State)', 'Europe', 'Southern Europe', 'VA');
INSERT INTO user_extended_country VALUES('VEN', 'Venezuela', 'South America', 'South America', 'VE');
INSERT INTO user_extended_country VALUES('RUS', 'Russian Federation', 'Europe', 'Eastern Europe', 'RU');
INSERT INTO user_extended_country VALUES('VNM', 'Vietnam', 'Asia', 'Southeast Asia', 'VN');
INSERT INTO user_extended_country VALUES('EST', 'Estonia', 'Europe', 'Baltic Countries', 'EE');
INSERT INTO user_extended_country VALUES('USA', 'United States', 'North America', 'North America', 'US');
INSERT INTO user_extended_country VALUES('VIR', 'Virgin Islands, U.S.', 'North America', 'Caribbean', 'VI');
INSERT INTO user_extended_country VALUES('ZWE', 'Zimbabwe', 'Africa', 'Eastern Africa', 'ZW');
INSERT INTO user_extended_country VALUES('PSE', 'Palestine', 'Asia', 'Middle East', 'PS');
INSERT INTO user_extended_country VALUES('ATA', 'Antarctica', 'Antarctica', 'Antarctica', 'AQ');
INSERT INTO user_extended_country VALUES('BVT', 'Bouvet Island', 'Antarctica', 'Antarctica', 'BV');
INSERT INTO user_extended_country VALUES('IOT', 'British Indian Ocean Territory', 'Africa', 'Eastern Africa', 'IO');
INSERT INTO user_extended_country VALUES('SGS', 'South Georgia and the South Sandwich Islands', 'Antarctica', 'Antarctica', 'GS');
INSERT INTO user_extended_country VALUES('HMD', 'Heard Island and McDonald Islands', 'Antarctica', 'Antarctica', 'HM');
INSERT INTO user_extended_country VALUES('ATF', 'French Southern territories', 'Antarctica', 'Antarctica', 'TF');
INSERT INTO user_extended_country VALUES('UMI', 'United States Minor Outlying Islands', 'Oceania', 'Micronesia/Caribbean', 'UM');

39
e107_admin/theme.php Normal file
View File

@@ -0,0 +1,39 @@
<?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_admin/theme.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:28 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("1")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'theme_manage';
require_once("auth.php");
require_once(e_HANDLER."theme_handler.php");
$themec = new themeHandler;
$themec -> showThemes();
require_once("footer.php");
?>

80
e107_admin/ugflag.php Normal file
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_admin/ugflag.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:28 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("9")) {
header("location:".e_BASE."index.php");
exit;
}
require_once(e_HANDLER."ren_help.php");
if (isset($_POST['updatesettings'])) {
$pref['maintainance_flag'] = intval($_POST['maintainance_flag']);
$pref['maintainance_text'] = $tp->toDB($_POST['maintainance_text']);
save_prefs();
header("location:".e_SELF."?u");
exit;
}
require_once("auth.php");
if (e_QUERY == "u") {
$ns->tablerender("", "<div style='text-align:center'><b>".UGFLAN_1.".</b></div>");
}
$maintainance_flag = $pref['maintainance_flag'];
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."' id='dataform'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:30%' class='forumheader3'>".UGFLAN_2.": </td>
<td style='width:70%' class='forumheader3'>";
if ($maintainance_flag == 1) {
$text .= "<input type='checkbox' name='maintainance_flag' value='1' checked='checked' />";
} else {
$text .= "<input type='checkbox' name='maintainance_flag' value='1' />";
}
$text .= "</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UGFLAN_5."<br /><span class='smalltext'>".UGFLAN_6."</span></td>
<td style='width:70%' class='forumheader3'>
<textarea id='maintainance_text' class='tbox' name='maintainance_text' cols='63' style='max-width:80%' rows='10' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".$pref['maintainance_text']."</textarea>
<br />".display_help("","maintenance")." </td>
</tr>
<tr style='vertical-align:top'>
<td colspan='2' style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='updatesettings' value='".UGFLAN_3."' />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(UGFLAN_4, $text);
require_once("footer.php");
?>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,73 @@
<?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_admin/updateadmin.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:29 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once('../class2.php');
$e_sub_cat = 'admin_pass';
require_once('auth.php');
if (isset($_POST['update_settings'])) {
if ($_POST['ac'] == md5(ADMINPWCHANGE)) {
if ($_POST['a_password'] != "" && $_POST['a_password2'] != "" && ($_POST['a_password'] == $_POST['a_password2'])) {
if (admin_update($sql -> db_Update("user", "user_password='".md5($_POST['a_password'])."', user_pwchange='".time()."' WHERE user_name='".ADMINNAME."'"), 'update', UDALAN_3." ".ADMINNAME)) {
$e_event -> trigger('adpword');
}
} else {
$ns->tablerender(LAN_UPDATED_FAILED, "<div style='text-align:center'><b>".UDALAN_1."</b></div>");
}
}
} else {
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>\n
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:30%' class='forumheader3'>".UDALAN_4.": </td>
<td style='width:70%' class='forumheader3'>
".ADMINNAME."
</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UDALAN_5.": </td>
<td style='width:70%' class='forumheader3'>
<input class='tbox' type='password' name='a_password' size='60' value='' maxlength='20' />
</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UDALAN_6.": </td>
<td style='width:70%' class='forumheader3'>
<input class='tbox' type='password' name='a_password2' size='60' value='' maxlength='20' />
</td>
</tr>
<tr>
<td colspan='2' style ='text-align:center' class='forumheader'>
<input class='button' type='submit' name='update_settings' value='".UDALAN_7."' />
<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(UDALAN_8." ".ADMINNAME, $text);
}
require_once('footer.php');
?>

333
e107_admin/upload.php Normal file
View File

@@ -0,0 +1,333 @@
<?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_admin/upload.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:30 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("V")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'upload';
if (e_QUERY) {
$tmp = explode(".", e_QUERY);
$action = $tmp[0];
$id = $tmp[1];
}
if ($action == "dis" && isset($_POST['updelete']['upload_'.$id]) ) {
$res = $sql -> db_Select("upload", "*", "upload_id='".intval($id)."'");
$row = $sql -> db_Fetch();
if (preg_match("#Binary (.*?)/#", $row['upload_file'], $match)) {
$sql -> db_Delete("rbinary", "binary_id='".$tp -> toDB($match[1])."'");
} else if ($row['upload_file'] && file_exists(e_FILE."public/".$row['upload_file'])) {
unlink(e_FILE."public/".$row['upload_file']);
}
if (preg_match("#Binary (.*?)/#", $row['upload_ss'], $match)) {
$sql -> db_Delete("rbinary", "binary_id='".$tp -> toDB($match[1])."'");
} else if ($row['upload_ss'] && file_exists(e_FILE."public/".$row['upload_ss'])) {
unlink(e_FILE."public/".$row['upload_ss']);
}
$message = ($sql->db_Delete("upload", "upload_id='".intval($id)."'")) ? UPLLAN_1 : LAN_DELETED_FAILED;
}
if ($action == "dlm") {
header("location: ".e_ADMIN."download.php?dlm.".$id);
exit;
}
if ($action == "news") {
header("location: ".e_ADMIN."newspost.php?create.upload.".$id);
exit;
}
if ($action == "dl") {
$id = str_replace("%20", " ", $id);
if (preg_match("/Binary\s(.*?)\/.*/", $id, $result)) {
$bid = $result[1];
$result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id='$bid' ");
$binary_data = @mysql_result($result, 0, "binary_data");
$binary_filetype = @mysql_result($result, 0, "binary_filetype");
$binary_name = @mysql_result($result, 0, "binary_name");
header("Content-type: ".$binary_filetype);
header("Content-length: ".$download_filesize);
header("Content-Disposition: attachment; filename=".$binary_name);
header("Content-Description: PHP Generated Data");
echo $binary_data;
exit;
} else {
header("location:".e_FILE."public/".str_replace("dl.", "", e_QUERY));
exit;
}
}
require_once("auth.php");
require_once(e_HANDLER."userclass_class.php");
$gen = new convert;
require_once(e_HANDLER."form_handler.php");
$rs = new form;
if (isset($_POST['optionsubmit'])) {
$pref['upload_storagetype'] = $_POST['upload_storagetype'];
$pref['upload_maxfilesize'] = $_POST['upload_maxfilesize'];
$pref['upload_class'] = $_POST['upload_class'];
$pref['upload_enabled'] = (FILE_UPLOADS ? $_POST['upload_enabled'] : 0);
if ($pref['upload_enabled'] && !$sql->db_Select("links", "*", "link_url='upload.php' ")) {
$sql->db_Insert("links", "0, '".UPLLAN_44."', 'upload.php', '', '', 1,0,0,0,0");
}
if (!$pref['upload_enabled'] && $sql->db_Select("links", "*", "link_url='upload.php' ")) {
$sql->db_Delete("links", "link_url='upload.php' ");
}
save_prefs();
$message = UPLLAN_2;
}
if (isset($message)) {
require_once(e_HANDLER."message_handler.php");
message_handler("ADMIN_MESSAGE", $message);
}
if (!FILE_UPLOADS) {
message_handler("ADMIN_MESSAGE", UPLLAN_41);
}
// view -------------------------------------------------------------------------------------------------------------------------------------------------------------------
if ($action == "view") {
$sql->db_Select("upload", "*", "upload_id='$id'");
$row = $sql->db_Fetch();
extract($row);
$post_author_id = substr($upload_poster, 0, strpos($upload_poster, "."));
$post_author_name = substr($upload_poster, (strpos($upload_poster, ".")+1));
$poster = (!$post_author_id ? "<b>".$post_author_name."</b>" : "<a href='".e_BASE."user.php?id.".$post_author_id."'><b>".$post_author_name."</b></a>");
$upload_datestamp = $gen->convert_date($upload_datestamp, "long");
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:30%' class='forumheader3'>".UPLLAN_3."</td>
<td style='width:70%' class='forumheader3'>$upload_id</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".LAN_DATE."</td>
<td style='width:70%' class='forumheader3'>$upload_datestamp</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UPLLAN_5."</td>
<td style='width:70%' class='forumheader3'>$poster</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UPLLAN_6."</td>
<td style='width:70%' class='forumheader3'><a href='mailto:$upload_email'>$upload_email</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UPLLAN_7."</td>
<td style='width:70%' class='forumheader3'>".($upload_website ? "<a href='$upload_website'>$upload_website</a>" : " - ")."</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UPLLAN_8."</td>
<td style='width:70%' class='forumheader3'>".($upload_name ? $upload_name: " - ")."</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UPLLAN_9."</td>
<td style='width:70%' class='forumheader3'>".($upload_version ? $upload_version : " - ")."</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UPLLAN_10."</td>
<td style='width:70%' class='forumheader3'>".(is_numeric($upload_file) ? "Binary file ID ".$upload_file : "<a href='".e_SELF."?dl.$upload_file'>$upload_file</a>")."</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UPLLAN_11."</td>
<td style='width:70%' class='forumheader3'>".parsesize($upload_filesize)."</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UPLLAN_12."</td>
<td style='width:70%' class='forumheader3'>".($upload_ss ? "<a href='".e_BASE."request.php?upload.".$upload_id."'>".$upload_ss."</a>" : " - ")."</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UPLLAN_13."</td>
<td style='width:70%' class='forumheader3'>$upload_description</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".UPLLAN_14."</td>
<td style='width:70%' class='forumheader3'>".($upload_demo ? $upload_demo : " - ")."</td>
</tr>
<tr>
<td style='width:30%' class='forumheader3'>".LAN_OPTIONS."</td>
<td style='width:70%' class='forumheader3'><a href='".e_SELF."?dlm.$upload_id'>".UPLAN_COPYTODLM."</a> | <a href='".e_SELF."?news.$upload_id'>".UPLLAN_16."</a> | <a href='".e_SELF."?dis.$upload_id'>".UPLLAN_17."</a></td>
</tr>
</table>
</div>";
$ns->tablerender(UPLLAN_18, $text);
}
// list -------------------------------------------------------------------------------------------------------------------------------------------------------------------
$imgd = e_BASE.$IMAGES_DIRECTORY;
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:5%' class='fcaption'>".UPLLAN_22."</td>
<td style='width:10%' class='fcaption'>".LAN_DATE."</td>
<td style='width:20%' class='fcaption'>".UPLLAN_5."</td>
<td style='width:20%' class='fcaption'>".UPLLAN_23."</td>
<td style='width:30%' class='fcaption'>".UPLLAN_24."</td>
<td style='width:18px' class='fcaption'>".UPLLAN_42."</td>
</tr>";
$text .= "<tr><td class='forumheader3' style='text-align:center' colspan='6'>";
if (!$active_uploads = $sql->db_Select("upload", "*", "upload_active=0 ORDER BY upload_id ASC")) {
$text .= UPLLAN_19.".\n</td>\n</tr>";
} else {
$activeUploads = $sql -> db_getList();
$text .= UPLLAN_20." ".($active_uploads == 1 ? UPLAN_IS : UPLAN_ARE).$active_uploads." ".($active_uploads == 1 ? UPLLAN_21 : UPLLAN_27)." ...";
$text .= "</td></tr>";
foreach($activeUploads as $row)
{
extract($row);
$post_author_id = substr($upload_poster, 0, strpos($upload_poster, "."));
$post_author_name = substr($upload_poster, (strpos($upload_poster, ".")+1));
$poster = (!$post_author_id ? "<b>".$post_author_name."</b>" : "<a href='".e_BASE."user.php?id.".$post_author_id."'><b>".$post_author_name."</b></a>");
$upload_datestamp = $gen->convert_date($upload_datestamp, "short");
$text .= "<tr>
<td style='width:5%' class='forumheader3'>".$upload_id ."</td>
<td style='width:20%' class='forumheader3'>".$upload_datestamp."</td>
<td style='width:15%' class='forumheader3'>".$poster."</td>
<td style='width:20%' class='forumheader3'><a href='".e_SELF."?view.".$upload_id."'>".$upload_name ."</a></td>
<td style='width:20%' class='forumheader3'>".$upload_file ."</td>
<td style='width:50px;white-space:nowrap' class='forumheader3'>
<form action='".e_SELF."?dis.$upload_id' id='uploadform_{$upload_id}' method='post'>
<div><a href='".e_SELF."?dlm.$upload_id'><img src='".e_IMAGE."admin_images/downloads_16.png' alt='".UPLAN_COPYTODLS."' title='".UPLAN_COPYTODLS."' style='border:0' /></a>
<a href='".e_SELF."?news.$upload_id'><img src='".e_IMAGE."admin_images/news_16.png' alt='".UPLLAN_16."' title='".UPLLAN_16."' style='border:0' /></a>
<input type='image' title='".LAN_DELETE."' name='updelete[upload_{$upload_id}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(UPLLAN_45." [ $upload_name ]")."') \"/>
</div></form></td>
</tr>";
}
}
$text .= "</table>\n</div>";
$ns->tablerender(UPLLAN_43, $text);
// options -------------------------------------------------------------------------------------------------------------------------------------------------------------------
if (is_readable(e_ADMIN.'filetypes.php')) {
$allowed_filetypes = trim(file_get_contents(e_ADMIN.'filetypes.php'));
}
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:50%' class='forumheader3'>".UPLLAN_25."<br />
<span class='smalltext'>".UPLLAN_26."</span></td>
<td style='width:50%' class='forumheader3'>". ($pref['upload_enabled'] == 1 ? $rs->form_radio("upload_enabled", 1, 1)." ".LAN_YES.$rs->form_radio("upload_enabled", 0)." ".LAN_NO : $rs->form_radio("upload_enabled", 1)." ".LAN_YES.$rs->form_radio("upload_enabled", 0, 1)." ".LAN_NO)."
</td>
</tr>
<tr>
<td style='width:50%' class='forumheader3'>".UPLLAN_29."<br />
<span class='smalltext'>".UPLLAN_30."</span></td>
<td style='width:50%' class='forumheader3'>". ($pref['upload_storagetype'] == 1 ? $rs->form_radio("upload_storagetype", 1, 1)." ".UPLLAN_31."<br />".$rs->form_radio("upload_storagetype", 2)." ".UPLLAN_32 : $rs->form_radio("upload_storagetype", 1)." ".UPLLAN_31."<br />".$rs->form_radio("upload_storagetype", 2, 1)." ".UPLLAN_32)."
</td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>".UPLLAN_33."<br />
<span class='smalltext'>".UPLLAN_34." ".ini_get('upload_max_filesize')." )</span></td>
<td style='width:30%' class='forumheader3'>". $rs->form_text("upload_maxfilesize", 10, $pref['upload_maxfilesize'], 10)."
</td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>".UPLLAN_35."<br />
<span class='smalltext'>".UPLLAN_48."</span></td>
<td style='width:30%' class='forumheader3'>".$allowed_filetypes."
</td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>".UPLLAN_37."<br />
<span class='smalltext'>".UPLLAN_38."</span></td>
<td style='width:30%' class='forumheader3'>".r_userclass("upload_class", $pref['upload_class'],"off","nobody,public,guest,member,admin,classes")."
</td>
</tr>
<tr>
<td colspan='2' class='forumheader' style='text-align:center'>". $rs->form_button("submit", "optionsubmit", UPLLAN_39)."
</td>
</tr>
</table>". $rs->form_close()."
</div>";
$ns->tablerender(LAN_OPTIONS, $text);
function parsesize($size) {
$kb = 1024;
$mb = 1024 * $kb;
$gb = 1024 * $mb;
$tb = 1024 * $gb;
if ($size < $kb) {
return $size." b";
}
else if($size < $mb) {
return round($size/$kb, 2)." kb";
}
else if($size < $gb) {
return round($size/$mb, 2)." mb";
}
else if($size < $tb) {
return round($size/$gb, 2)." gb";
} else {
return round($size/$tb, 2)." tb";
}
}
require_once("footer.php");
?>

135
e107_admin/userclass.php Normal file
View File

@@ -0,0 +1,135 @@
<?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_admin/userclass.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:30 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("4")) {
header("location:".e_BASE."index.php");
exit;
}
if (!e_QUERY) {
header("location:".e_ADMIN."admin.php");
exit;
} else {
$qs = explode(".", e_QUERY);
$id = $qs[0];
}
$sql->db_Select("userclass_classes");
$c = 0;
while ($row = $sql->db_Fetch()) {
if (getperms("0") || check_class($row['userclass_editclass'])) {
$class[$c][0] = $row['userclass_id'];
$class[$c][1] = $row['userclass_name'];
$class[$c][2] = $row['userclass_description'];
$c++;
}
}
if (isset($_POST['updateclass'])) {
$remuser = TRUE;
$classcount = count($_POST['userclass'])-1;
for($a = 0; $a <= $classcount; $a++) {
check_allowed($_POST['userclass'][$a]);
$svar .= $_POST['userclass'][$a];
$svar .= ($a < $classcount ) ? "," : "";
}
$sql->db_Update("user", "user_class='$svar' WHERE user_id='$id' ");
$message = UCSLAN_9;
$sql->db_Select("user", "*", "user_id='$id' ");
$row = $sql->db_Fetch();
if ($_POST['notifyuser']) {
$message .= "<br />".UCSLAN_1.":</b> ".$row['user_name']."<br />";
require_once(e_HANDLER."mail.php");
unset($messaccess);
for($a = 0; $a <= (count($class)-1); $a++) {
if (check_class($class[$a][0], $row['user_class'])) {
$messaccess .= $class[$a][1]." - " . $class[$a][2]. "\n";
}
}
$send_to = $row['user_email'];
$subject = UCSLAN_2;
$message = UCSLAN_3." " . $row['user_name']. ",\n\n".UCSLAN_4." ".SITENAME."\n( ".SITEURL . " )\n\n".UCSLAN_5.": \n\n".$messaccess."\n".UCSLAN_10."\n".SITEADMIN."\n( ".SITENAME." )";
sendemail($send_to, $subject, $message);
}
header("location: ".$_POST['adminreturn']);
echo "location redirect failed.";
exit;
}
$e_sub_cat = 'userclass';
require_once("auth.php");
$sql->db_Select("user", "*", "user_id='$id' ");
$row = $sql->db_Fetch();
$caption = UCSLAN_6." <b>".$row['user_name']."</b> (".$row['user_class'].")";
$text = " <div style='text-align:center'>
<form method='post' action='".e_SELF."?".e_QUERY."'>
<table style='".ADMIN_WIDTH."' class='fborder'>";
for($a = 0; $a <= (count($class)-1); $a++) {
$text .= "<tr><td style='width:30%' class='forumheader3'>";
if (check_class($class[$a][0], $row['user_class'])) {
$text .= "<input type='checkbox' name='userclass[]' value='".$class[$a][0]."' checked='checked' />".$class[$a][1]." ";
} else {
$text .= "<input type='checkbox' name='userclass[]' value='".$class[$a][0]."' />".$class[$a][1]." ";
}
$text .= "</td><td style='width:70%' class='forumheader3'> ".$class[$a][2]."</td></tr>";
}
$adminreturn = e_ADMIN."users.php?cu".($qs[2] ? ".{$qs[2]}.{$qs[3]}.{$qs[4]}" : "");
$text .= " <tr><td class='forumheader' colspan='2' style='text-align:center'>
<input type='hidden' name='adminreturn' value='$adminreturn' />
<input type='checkbox' name='notifyuser' value='1' /> ".UCSLAN_8."&nbsp;&nbsp;
<input class='button' type='submit' name='updateclass' value='".UCSLAN_7."' />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender($caption, $text);
require_once("footer.php");
// ----------------------------------------------------------
function check_allowed($class_id) {
global $sql;
if (!$sql->db_Select("userclass_classes", "*", "userclass_id = {$class_id}")) {
header("location:".SITEURL);
exit;
}
$row = $sql->db_Fetch();
extract($row);
if (!getperms("0") && !check_class($userclass_editclass)) {
header("location:".SITEURL);
exit;
}
}
?>

400
e107_admin/userclass2.php Normal file
View File

@@ -0,0 +1,400 @@
<?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_admin/userclass2.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:30 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("4")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'userclass';
require_once("auth.php");
require_once(e_HANDLER."userclass_class.php");
$uclass = new e_userclass;
function check_allowed($class_id)
{
global $sql;
if (!$sql->db_Select('userclass_classes', '*', "userclass_id = {$class_id}"))
{
header("location:".SITEURL);
exit;
}
$row = $sql->db_Fetch();
if (!getperms('0') && !check_class($row['userclass_editclass']))
{
header("location:".SITEURL);
exit;
}
}
if (strstr(e_QUERY, 'clear'))
{
$tmp = explode('.', e_QUERY);
$class_id = $tmp[1];
check_allowed($class_id);
if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$class_id}' OR user_class REGEXP('^{$class_id},') OR user_class REGEXP(',{$class_id},') OR user_class REGEXP(',{$class_id}$')"))
{
while ($row = $sql->db_Fetch())
{
$uidList[$row['user_id']] = $row['user_class'];
}
$uclass->class_remove($class_id, $uidList);
$message = UCSLAN_1;
}
}
elseif(e_QUERY)
{
$tmp2 = explode('-', e_QUERY);
$class_id = $tmp2[0];
check_allowed($class_id);
$message = UCSLAN_2;
if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$class_id}' OR user_class REGEXP('^{$class_id},') OR user_class REGEXP(',{$class_id},') OR user_class REGEXP(',{$class_id}$')"))
{
while ($row = $sql->db_Fetch())
{
$uidList[$row['user_id']] = $row['user_class'];
}
$uclass->class_remove($class_id, $uidList);
}
unset($uidList);
if ($sql->db_Select('user', 'user_id, user_class', "user_id IN({$tmp2[1]})"))
{
while ($row = $sql->db_Fetch())
{
$uidList[$row['user_id']] = $row['user_class'];
}
$uclass->class_add($class_id, $uidList);
}
}
if (isset($_POST['delete']))
{
$class_id = $_POST['existing'];
check_allowed($class_id);
if ($_POST['confirm']) {
$sql->db_Delete('userclass_classes', "userclass_id='".$_POST['existing']."' ");
if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$class_id}' OR user_class REGEXP('^{$class_id},') OR user_class REGEXP(',{$class_id},') OR user_class REGEXP(',{$class_id}$')"))
{
while ($row = $sql->db_Fetch())
{
$uidList[$row['user_id']] = $row['user_class'];
}
$uclass->class_remove($class_id, $uidList);
}
if (isset($pref['frontpage'][$class_id]))
{
unset($pref['frontpage'][$class_id]);
save_prefs();
}
$message = UCSLAN_3;
}
else
{
$message = UCSLAN_4;
}
}
if(isset($_POST['edit']))
{
check_allowed($_POST['existing']);
$sql->db_Select('userclass_classes', '*', "userclass_id='".$_POST['existing']."' ");
$row = $sql->db_Fetch();
extract($row);
}
if (isset($_POST['updateclass']))
{
check_allowed($_POST['userclass_id']);
$_POST['userclass_name'] = $tp->toDB($_POST['userclass_name']);
$_POST['userclass_description'] = $tp->toDB($_POST['userclass_description']);
$sql->db_Update('userclass_classes', "userclass_editclass={$_POST['userclass_editclass']}, userclass_name='".$_POST['userclass_name']."', userclass_description='".$_POST['userclass_description']."' WHERE userclass_id='".$_POST['userclass_id']."' ");
$message = UCSLAN_5;
}
if (isset($_POST['createclass']))
{
if($_POST['userclass_name'])
{
$_POST['userclass_name'] = $tp->toDB($_POST['userclass_name']);
$_POST['userclass_description'] = $tp->toDB($_POST['userclass_description']);
if (getperms("0") || check_class($_POST['userclass_editclass']) && $_POST['userclass_editclass']) {
$editclass = $_POST['userclass_editclass'];
$i = 1;
while ($sql->db_Select('userclass_classes', '*', "userclass_id='".$i."' ") && $i < 255)
{
$i++;
}
if ($i < 255)
{
$sql->db_Insert("userclass_classes", $i.", '".strip_tags($_POST['userclass_name'])."', '".$_POST['userclass_description']."',{$editclass} ");
}
if (!isset($pref['frontpage'][$i]))
{
$pref['frontpage'][$i] = $pref['frontpage'][e_UC_GUEST];
save_prefs();
}
$message = UCSLAN_6;
}
else
{
header("location:".SITEURL);
exit;
}
}
}
if (isset($message))
{
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
$class_total = $sql->db_Select("userclass_classes", "*", "ORDER BY userclass_name", "nowhere");
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."' id='classForm'>
<table class='fborder' style='".ADMIN_WIDTH."'>
<tr>
<td class='fcaption' style='text-align:center' colspan='2'>";
if ($class_total == "0")
{
$text .= UCSLAN_7;
}
else
{
$text .= "<span class='defaulttext'>".UCSLAN_8.":</span>
<select name='existing' class='tbox'>";
while ($row = $sql->db_Fetch())
{
if (check_class($row['userclass_editclass']) || getperms("0"))
{
$text .= "<option value='{$row['userclass_id']}'>{$row['userclass_name']}</option>";
}
}
$text .= "</select>
<input class='button' type='submit' name='edit' value='".LAN_EDIT."' />
<input class='button' type='submit' name='delete' value='".LAN_DELETE."' />
<input type='checkbox' name='confirm' value='1' /><span class='smalltext'> ".UCSLAN_11."</span>
</td>
</tr>";
}
$text .= "
<tr>
<td class='forumheader3' style='width:30%'>".UCSLAN_12."</td>
<td class='forumheader3' style='width:70%'>
<input class='tbox' type='text' size='30' maxlength='25' name='userclass_name' value='$userclass_name' /></td>
</tr>
<tr>
<td class='forumheader3'>".UCSLAN_13."</td>
<td class='forumheader3' style='width:70%'><input class='tbox' type='text' size='60' maxlength='85' name='userclass_description' value='$userclass_description' /></td>
</tr>
";
if(!isset($userclass_editclass))
{
$userclass_editclass = e_UC_ADMIN;
}
$text .= "
<tr>
<td class='forumheader3'>".UCSLAN_24."</td>
<td class='forumheader3'>".r_userclass("userclass_editclass", $userclass_editclass, "off", "main,admin,classes,matchclass,public,nobody")."</td>
</tr>
";
$text .= "
<tr><td colspan='2' style='text-align:center' class='forumheader'>";
if(isset($_POST['edit']))
{
$text .= "<input class='button' type='submit' name='updateclass' value='".UCSLAN_14."' />
<input type='hidden' name='userclass_id' value='$userclass_id' />";
}
else
{
$text .= "<input class='button' type='submit' name='createclass' value='".UCSLAN_15."' />";
}
$text .= "</td></tr></table>";
if(isset($_POST['edit']))
{
$sql->db_Select("user", "user_id, user_name, user_class, user_login", "ORDER BY user_name", "no-where");
$c = 0;
$d = 0;
while ($row = $sql->db_Fetch())
{
extract($row);
if (check_class($userclass_id, $user_class))
{
$in_userid[$c] = $user_id;
$in_username[$c] = $user_name;
$in_userlogin[$c] = $user_login ? "(".$user_login.")" : "";
$c++;
}
else
{
$out_userid[$d] = $user_id;
$out_username[$d] = $user_name;
$out_userlogin[$d] = $user_login ? "(".$user_login.")" : "";
$d++;
}
}
$text .= "<br /><table class='fborder' style='".ADMIN_WIDTH."'>
<tr>
<td class='fcaption' style='text-align:center;width:30%'>".UCSLAN_16."</td></tr>
<tr>
<td class='forumheader3' style='width:70%; text-align:center'>
<table style='width:90%'>
<tr>
<td style='width:45%; vertical-align:top'>
".UCSLAN_22."<br />
<select class='tbox' id='assignclass1' name='assignclass1' size='10' style='width:220px' multiple='multiple' onchange='moveOver();'>";
for ($a = 0; $a <= ($d-1); $a++)
{
$text .= "<option value=".$out_userid[$a].">".$out_username[$a]." ".$out_userlogin[$a]."</option>";
}
$text .= "</select>
</td>
<td style='width:45%; vertical-align:top'>
".UCSLAN_23."<br />
<select class='tbox' id='assignclass2' name='assignclass2' size='10' style='width:220px' multiple='multiple'>";
for($a = 0; $a <= ($c-1); $a++)
{
$text .= "<option value=".$in_userid[$a].">".$in_username[$a]." ".$in_userlogin[$a]."</option>";
}
$text .= "</select><br /><br />
<input class='button' type='button' value='".UCSLAN_17."' onclick='removeMe();' />
<input class='button' type='button' value='".UCSLAN_18."' onclick='clearMe($userclass_id);' />
<input type='hidden' name='class_id' value='$userclass_id' />
</td></tr></table>
</td></tr>
<tr><td colspan='2' style='text-align:center' class='forumheader'>
<input class='button' type='button' value='".UCSLAN_19." ".$userclass_name." ".UCSLAN_20."' onclick='saveMe($userclass_id);' />
</tr>
</td>
</table>";
}
$text .= "</form>
</div>";
$ns->tablerender(UCSLAN_21, $text);
require_once("footer.php");
function headerjs()
{
$script_js = "<script type=\"text/javascript\">
//<![CDATA[
// Adapted from original: Kathi O'Shea (Kathi.O'Shea@internet.com)
function moveOver() {
var boxLength = document.getElementById('assignclass2').length;
var selectedItem = document.getElementById('assignclass1').selectedIndex;
var selectedText = document.getElementById('assignclass1').options[selectedItem].text;
var selectedValue = document.getElementById('assignclass1').options[selectedItem].value;
var i;
var isNew = true;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
thisitem = document.getElementById('assignclass2').options[i].text;
if (thisitem == selectedText) {
isNew = false;
break;
}
}
}
if (isNew) {
newoption = new Option(selectedText, selectedValue, false, false);
document.getElementById('assignclass2').options[boxLength] = newoption;
document.getElementById('assignclass1').options[selectedItem].text = '';
}
document.getElementById('assignclass1').selectedIndex=-1;
}
function removeMe() {
var boxLength = document.getElementById('assignclass2').length;
var boxLength2 = document.getElementById('assignclass1').length;
arrSelected = new Array();
var count = 0;
for (i = 0; i < boxLength; i++) {
if (document.getElementById('assignclass2').options[i].selected) {
arrSelected[count] = document.getElementById('assignclass2').options[i].value;
var valname = document.getElementById('assignclass2').options[i].text;
for (j = 0; j < boxLength2; j++) {
if (document.getElementById('assignclass1').options[j].value == arrSelected[count]){
document.getElementById('assignclass1').options[j].text = valname;
}
}
// document.getElementById('assignclass1').options[i].text = valname;
}
count++;
}
var x;
for (i = 0; i < boxLength; i++) {
for (x = 0; x < arrSelected.length; x++) {
if (document.getElementById('assignclass2').options[i].value == arrSelected[x]) {
document.getElementById('assignclass2').options[i] = null;
}
}
boxLength = document.getElementById('assignclass2').length;
}
}
function clearMe(clid) {
location.href = document.location + \"?clear.\" + clid;
}
function saveMe(clid) {
var strValues = \"\";
var boxLength = document.getElementById('assignclass2').length;
var count = 0;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
if (count == 0) {
strValues = document.getElementById('assignclass2').options[i].value;
} else {
strValues = strValues + \",\" + document.getElementById('assignclass2').options[i].value;
}
count++;
}
}
if (strValues.length == 0) {
//alert(\"You have not made any selections\");
}
else {
location.href = document.location + \"?\" + clid + \"-\" + strValues;
}
}
//]]>
</script>\n";
return $script_js;
}
?>

71
e107_admin/userinfo.php Normal file
View File

@@ -0,0 +1,71 @@
<?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_admin/userinfo.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:30 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("4")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'users';
require_once("auth.php");
if (!e_QUERY) {
$text = "<div style=\"text-align:center\">".USFLAN_1."</div>";
$ns->tablerender(LAN_ERROR, $text);
require_once("footer.php");
exit;
} else {
$ipd = e_QUERY;
}
if (isset($ipd)) {
if(!defined("BULLET")) define("BULLET", "bullet2.gif");
$obj = new convert;
$sql->db_Select("chatbox", "*", "cb_ip='$ipd' LIMIT 0,20");
$host = $e107->get_host_name($ipd);
$text = USFLAN_3." <b>".$ipd."</b> [ ".USFLAN_4.": $host ]<br />
<i><a href=\"banlist.php?".$ipd."\">".USFLAN_5."</a></i>
<br /><br />";
while (list($cb_id, $cb_nick, $cb_message, $cb_datestamp, $cb_blocked, $cb_ip ) = $sql->db_Fetch()) {
$datestamp = $obj->convert_date($cb_datestamp, "short");
$post_author_id = substr($cb_nick, 0, strpos($cb_nick, "."));
$post_author_name = substr($cb_nick, (strpos($cb_nick, ".")+1));
$text .= "<img src='".THEME_ABS."images/".BULLET."' alt='bullet' />
<span class=\"defaulttext\"><i>".$post_author_name." (".USFLAN_6.": ".$post_author_id.")</i></span>\n<div class=\"mediumtext\">".$datestamp."<br />". $cb_message."
</div><br />";
}
$text .= "<hr />";
$sql->db_Select("comments", "*", "comment_ip='$ipd' LIMIT 0,20");
while (list($comment_id, $comment_item_id, $comment_author, $comment_author_email, $comment_datestamp, $comment_comment, $comment_blocked, $comment_ip) = $sql->db_Fetch()) {
$datestamp = $obj->convert_date($comment_datestamp, "short");
$post_author_id = substr($comment_author, 0, strpos($comment_author, "."));
$post_author_name = substr($comment_author, (strpos($comment_author, ".")+1));
$text .= "<img src='".THEME_ABS."images/".BULLET."' alt='bullet' />
<span class=\"defaulttext\"><i>".$post_author_name." (".USFLAN_6.": ".$post_author_id.")</i></span>\n<div class=\"mediumtext\">".$datestamp."<br />". $comment_comment."</div><br />";
}
}
$ns->tablerender(USFLAN_7, $text);
require_once("footer.php");
?>

1083
e107_admin/users.php Normal file

File diff suppressed because it is too large Load Diff

1011
e107_admin/users_extended.php Executable file

File diff suppressed because it is too large Load Diff

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_admin/users_extended_predefined.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:32 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
function get_extended_predefined()
{
$ue_field['location'] = array(
"text" => EXTLAN_PRE1,
"type" => "textbox",
"include_text" => "class='tbox' size='80' maxlength='254'"
);
$ue_field['aim'] = array(
"text" => EXTLAN_PRE2,
"type" => "textbox",
"include_text" => "class='tbox' size='40' maxlength='254'"
);
$ue_field['icq'] = array(
"text" => EXTLAN_PRE3,
"type" => "textbox",
"include_text" => "class='tbox' size='40' maxlength='254'"
);
$ue_field['yahoo'] = array(
"text" => EXTLAN_PRE4,
"type" => "textbox",
"include_text" => "class='tbox' size='40' maxlength='254'"
);
$ue_field['homepage'] = array(
"text" => EXTLAN_PRE5,
"type" => "textbox",
"include_text" => "class='tbox' size='40' maxlength='254'",
"regex validation" => "#^[a-z0-9]+://#si"
);
return $ue_field;
}

24
e107_admin/ver.php Normal file
View File

@@ -0,0 +1,24 @@
<?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_admin/ver.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:32 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
$e107info['e107_version'] = "0.7.7";
?>

231
e107_admin/wmessage.php Normal file
View File

@@ -0,0 +1,231 @@
<?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_admin/wmessage.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:32 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
require_once("../class2.php");
if (!getperms("M")) {
header("location:".e_BASE."index.php");
exit;
}
$e_sub_cat = 'wmessage';
$e_wysiwyg = "data";
require_once(e_HANDLER."preset_class.php");
$pst = new e_preset;
$pst->form = "wmform";
$pst->page = "wmessage.php?create";
$pst->id = "admin_wmessage";
require_once("auth.php");
$pst->save_preset(); // save and render result
require_once(e_HANDLER.'form_handler.php');
require_once(e_HANDLER.'userclass_class.php');
require_once(e_HANDLER."ren_help.php");
$rs = new form;
if (e_QUERY) {
$tmp = explode('.', e_QUERY);
$action = $tmp[0];
$sub_action = $tmp[1];
$id = $tmp[2];
unset($tmp);
}
if($_POST)
{
$e107cache->clear("wmessage");
}
if (isset($_POST['wm_update'])) {
$data = $tp->toDB($_POST['data']);
$wm_title = $tp->toDB($_POST['wm_caption']);
$message = ($sql->db_Update("generic", "gen_chardata ='$data',gen_ip ='$wm_title', gen_intdata='".$_POST['wm_active']."' WHERE gen_id='".$_POST['wm_id']."' ")) ? LAN_UPDATED : LAN_UPDATED_FAILED;
}
if (isset($_POST['wm_insert'])) {
$wmtext = $tp->toDB($_POST['data']);
$wmtitle = $tp->toDB($_POST['wm_caption']);
$message = ($sql->db_Insert("generic", "0, 'wmessage', '".time()."', ".USERID.", '{$wmtitle}', '{$_POST['wm_active']}', '{$wmtext}' ")) ? LAN_CREATED : LAN_CREATED_FAILED ;
}
if (isset($_POST['updateoptions'])) {
$pref['wm_enclose'] = $_POST['wm_enclose'];
$pref['wmessage_sc'] = $_POST['wmessage_sc'];
save_prefs();
$message = LAN_SETSAVED;
}
if (isset($_POST['main_delete'])) {
$del_id = array_keys($_POST['main_delete']);
$message = ($sql->db_Delete("generic", "gen_id='".$del_id[0]."' ")) ? LAN_DELETED : LAN_DELETED_FAILED ;
}
if (isset($message)) {
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
// Show Existing -------
if ($action == "main" || $action == "") {
if ($wm_total = $sql->db_Select("generic", "*", "gen_type='wmessage' ORDER BY gen_id ASC")) {
$wmList = $sql->db_getList();
$text = $rs->form_open("post", e_SELF, "myform_{$gen_id}", "", "");
$text .= "<div style='text-align:center'>
<table class='fborder' style='".ADMIN_WIDTH."'>
<tr>
<td class='fcaption' style='width:5%'>ID</td>
<td class='fcaption' style='width:70%'>".WMLAN_02."</td>
<td class='fcaption' style='width:20%'>".WMLAN_03."</td>
<td class='fcaption' style='width:15%'>".LAN_OPTIONS."</td>
</tr>";
foreach($wmList as $row) {
$text .= "
<tr>
<td class='forumheader3' style='width:5%; text-align: center; vertical-align: middle'>".$row['gen_id']."</td>
<td style='width:70%' class='forumheader3'>".strip_tags($tp->toHTML($row['gen_ip']))."</td>
<td style='width:70%' class='forumheader3'>".r_userclass_name($row['gen_intdata'])."</td>
<td style='width:15%; text-align:center; white-space: nowrap' class='forumheader3'>
<a href='".e_SELF."?create.edit.{$row['gen_id']}'>".ADMIN_EDIT_ICON."</a>
<input type='image' title='".LAN_DELETE."' name='main_delete[".$row['gen_id']."]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".LAN_CONFIRMDEL." [ID: {$row['gen_id']} ]')\"/>
</td>
</tr>";
}
$text .= "</table></div>";
$text .= $rs->form_close();
} else {
$text .= "<div style='text-align:center'>".WMLAN_09."</div>";
}
$ns->tablerender(WMLAN_00, $text);
}
// Create and Edit
if ($action == "create" || $action == "edit")
{
if ($sub_action == "edit")
{
$sql->db_Select("generic", "gen_intdata, gen_ip, gen_chardata", "gen_id = $id");
$row = $sql->db_Fetch();
}
if ($sub_action != 'edit')
{
$preset = $pst->read_preset("admin_wmessage");
extract($preset);
}
$text = "
<div style='text-align:center'>
<form method='post' action='".e_SELF."' id='wmform'>
<table style='".ADMIN_WIDTH."' class='fborder'>
";
$text .= "
<tr>
<td style='width:20%' class='forumheader3'>".WMLAN_10."</td>
<td style='width:60%' class='forumheader3'>
<input type='text' class='tbox' id='wm_caption' name='wm_caption' maxlength='80' style='width:95%' value=\"".$tp->toForm($row['gen_ip'])."\" />
</td>
</tr>";
$text .= "<tr>
<td style='width:20%' class='forumheader3'>".WMLAN_04."</td>
<td style='width:60%' class='forumheader3'>
<textarea class='tbox' id='data' name='data' cols='70' rows='15' style='width:95%' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this)'>".$tp->toForm($row['gen_chardata'])."</textarea>
<br />";
$text .= display_help("helpb", "admin");
$text .= "
</td>
</tr>
<tr><td class='forumheader3'>".WMLAN_03."</td>
<td class='forumheader3'>".r_userclass("wm_active", $row['gen_intdata'], "off", "public,guest,nobody,member,admin,classes")."</td></tr>";
$text .= "
<tr style='vertical-align:top'>
<td colspan='2' class='forumheader' style='text-align:center'>";
$text .= ($sub_action == "edit") ? "<input class='button' type='submit' name='wm_update' value='".LAN_UPDATE."' />" :
"<input class='button' type='submit' name='wm_insert' value='".LAN_CREATE."' />" ;
$text .= "<input type='hidden' name='wm_id' value='".$id."' />";
$text .= "</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(WMLAN_01, $text);
}
if ($action == "opt") {
global $pref, $ns;
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?".e_QUERY."'>\n
<table style='".ADMIN_WIDTH."' class='fborder'>
<tr>
<td style='width:70%' class='forumheader3'>
".WMLAN_05."<br />
<span class='smalltext'>".WMLAN_06."</span>
</td>
<td class='forumheader3' style='width:30%;text-align:center'>". ($pref['wm_enclose'] ? "<input type='checkbox' name='wm_enclose' value='1' checked='checked' />" : "<input type='checkbox' name='wm_enclose' value='1' />")."
</td>
</tr>
<tr>
<td style='width:70%' class='forumheader3'>
".WMLAN_07."
</td>
<td class='forumheader3' style='width:30%;text-align:center'>". ($pref['wmessage_sc'] ? "<input type='checkbox' name='wmessage_sc' value='1' checked='checked' />" : "<input type='checkbox' name='wmessage_sc' value='1' />")."
</td>
</tr>
<tr style='vertical-align:top'>
<td colspan='2' style='text-align:center' class='forumheader'>
<input class='button' type='submit' name='updateoptions' value='".LAN_SAVE."' />
</td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(WMLAN_00.": ".LAN_PREFS, $text);
}
function wmessage_adminmenu() {
global $action;
if ($action == "") {
$action = "main";
}
$var['main']['text'] = WMLAN_00;
$var['main']['link'] = e_SELF;
$var['create']['text'] = WMLAN_01;
$var['create']['link'] = e_SELF."?create";
$var['opt']['text'] = LAN_PREFS;
$var['opt']['link'] = e_SELF."?opt";
show_admin_menu(LAN_OPTIONS, $action, $var);
}
require_once("footer.php");
?>

210
e107_docs/README.html Normal file
View File

@@ -0,0 +1,210 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Version Info:
$Source: /cvs_backup/e107_0.8/e107_docs/README.html,v $
$Revision: 1.1.1.1 $
$Date: 2006-12-02 04:33:35 $
$Author: mcfly_e107 $
-->
<title>e107 Readme</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="content-style-type" content="text/css" />
</head>
<body>
<div id='mainbox'> <a href="http://e107.org"><img src="../e107_images/logo.png" alt="Logo" style="border:0" /></a> <br />
<br />
<span class="smalltext">© Steve Dunstan 2002. See gpl.txt for license details.</span><br />
<br />
<br />
<a href="#requirements">Requirements</a> | <a href="#installing">Installing</a> | <a href="#upgrading">Upgrading</a> | <a href="#security">Security</a> | <a href="#backup">Backing Up and Restoring Your Database</a> | <a href="#problems">Common Problems</a> | <a href="#support">Support</a> | <a href="#development">Development</a> | <a href="#thankyou">Thank You</a> | <a href="#disclaimer">Disclaimer</a><br />
<br />
<br />
<a id='requirements'></a><span class="headertext">Requirements</span>
<ul>
<li>e107 requires a webserver that has PHP 4.3 (or newer) and MySQL 3.22 (or newer), contact your host if you're not sure if you have these installed.</li>
<li>If you host your own site you can download <a href="http://php.net">PHP</a> and <a href="http://mysql.com">MySQL</a> and install them yourself, both are free.</li>
<li>You will need your MySQL username and password, and a database for content storage. Don't worry if you only have one database, e107 is happy to share it's database with other applications.</li>
<li>A complete e107 install requires approximately 9MB of disk space on your server, although this should be reduced dramatically for most users by removing the plugins and themes they won't be using, simply by removing the relevant folder.</li>
</ul>
<br />
<a id='installing'></a><span class="headertext">Installing</span>
<ul>
<li>After downloading and unzipping the package, you need to upload the files to your server using an FTP client. e107 will happily run in your webserver root or in a sub-directory ... <br />
<ul>
<li>Open your FTP client and connect to your webserver</li>
<li>Move into the folder on your webserver where web pages are stored, generally it's 'public_html', 'www' or 'html'</li>
<li>Copy all the files from the unzipped e107 package onto your webserver - this could take a while, time for a cup of coffee!<br />
</li>
</ul>
</li>
<li>If you have the correct permissions on your server you can use an alternative (and much quicker) method to upload the files ... <br />
<ul>
<li>Download e107 in tar.gz format from <a href='http://e107.org'>e107.org</a></li>
<li>Using your FTP client, upload the tar.gz to your webserver without unzipping it first</li>
<li>Now open a shell prompt, and navigate to the folder where you uploaded the e107 tar.gz</li>
<li>type tar xvzf file.tar.gz to unpack the archive</li>
</ul>
</li>
</ul>
<ul>
<li>You now need to set the file permissions of some files for e107 to access them correctly. Set the file permissions to 0777 (readable writable by the server), if a series of checkboxes appear tick every box. Here is a list of the files you need to ensure the server can read / write to...<br /><br />
<ul>
<li>e107_config.php</li>
<li>e107_files/public/</li>
<li>e107_files/cache/</li>
<li>e107_files/public/avatars/</li>
<li>e107_plugins/</li>
<li>e107_themes/</li>
</ul>
</li>
</ul>
<ul>
<li>Now open your web browser and navigate to install.php, for example <i>http://yourwebspace.com/install.php</i> or <i>http://yourwebspace.com/e107/install.php</i><br />
<ul>
<li>If all the files have been uploaded successfully, you will see the first page of the install script. Choose the language you wish to use during the procedure and click the button to continue</li>
<li>e107 will now carry out a series of tests to see if requirements are met and all files that need permissions set are ok to be written to. If you get a warning about MySQL don't worry too much, some versions of MySQL don't return the correct version, or return nothing at all. Click on the button to continue if all criteria have been met, or else repair the problem and retest. </li>
<li>Next you have to enter your MySQL details. Enter your server name (generally 'localhost'), username and password. If you don't know your username and/or password contact your webhosts. Now enter the name of the database you want e107 to use. If you have the correct permissions you can create the database directly from the install script should you want to</li>
<li>If all is well e107 should now connect to your MySQL database, if any error messages are shown return to the previous page and make sure you entered your details correctly</li>
<li>Now you have to enter your main admin details. Enter your username, password and email address, you can change your email address and password at a later stage but your username cannot be changed, so make sure you enter it correctly
</li>
<li>e107 will now create the MySQL database tables and populate them with settings etc</li>
<li>If all is well, the last button will take you to your new website. There, all done, that wasn't too bad was it?!</li>
</ul>
</li>
</ul>
<ul>
<li>You must now set the file permissions of the main config file back to 0644 ...<br />
<ul>
<li>Using your FTP client, select the e107_config.php file</li>
<li>Set its file permission (using the method explained above) to 0644</li>
</ul>
</li>
<li><b>Now delete the install.php file from your server, if you do not it could pose a potential security risk to your site</b></li>
</ul>
<br />
<br />
<a id='upgrading'></a><span class="headertext">Upgrading</span><br />
<br />
<a href='README_UPGRADE.html'>Please click here for instructions on upgrading your 0.6175 website to 0.7.</a>
<br /><br /><br />
<a id='backup'></a><span class="headertext">Using phpMyAdmin to backup your database</span><br />
<br />
<ul>
<li>First, navigate to your phpMyAdmin page and log in</li>
<li>From the dropdown box on the left (or the text link) click on your e107 database</li>
<li>In the main page, click on the 'Export' tab</li>
<li>In the right box, make sure 'Add drop table', 'Add AUTO_INCREMENT value' and 'Enclose table and field names with backquotes' are ticked</li>
<li>Make sure the main 'Structure' and 'Data' boxes are ticked</li>
<li>Tick 'Save as file'</li>
<li>If you want the backup file compressed, tick either 'zipped' or 'gzipped'</li>
<li>Click 'Go'</li>
</ul>
<ul>
<li>To restore a backup, Click on the 'SQL' tab at the top and browse to your backup, you may need to empty your existing database before you can restore the backup</li>
</ul>
<br />
<a id='security'></a><span class="headertext">Security</span><br />
<br />
Security has been a primary concern since the first released versions of e107, and for this reason there are some very easy measures you can take to make your site more secure ...
<ul>
<li>Rename your e107_admin directory: this will make it less obvious to other e107 users where your admin files are.<br /><br /></li>
<li><strong>The procedure to change your directory names has changed. The definitions have been moved to e107_config.php.</strong><br /><br /></li>
<li>If you are <span style="text-decoration: underline;"><b>UPGRADING</b></span> from a very old version of e107 (e.g. less than v.615), you will need to open class2.php and find the following lines.<br /><br />
<div class='indent'> // If you need to change the names of any of your directories, change the value here then rename the respective folder on your server ...<br />
$ADMIN_DIRECTORY = "e107_admin/";<br />
$FILES_DIRECTORY = "e107_files/";<br />
$IMAGES_DIRECTORY = "e107_images/";<br />
$THEMES_DIRECTORY = "e107_themes/";<br />
$PLUGINS_DIRECTORY = "e107_plugins/";<br />
$HANDLERS_DIRECTORY = "e107_handlers/";<br />
$LANGUAGES_DIRECTORY = "e107_languages/";<br />
$HELP_DIRECTORY = "e107_docs/help/";<br />
$DOWNLOADS_DIRECTORY = "e107_files/downloads/";</div><br />
</li>
<li>Cut these lines from <span style="text-decoration: underline;">class2.php</span> and paste them into <span style="text-decoration: underline;">e107_config.php</span>. Now you can change the folder names from here.<br /><br /></li>
<li>If this is a <span style="text-decoration: underline;"><b>NEW INSTALL</b></span> the folder names are already in e107_config.php. They have been left in class2.php for backwards compatibility. They will be removed from there in the future.<br /><br /></li>
<li>This procedure depends on you completing the steps above and making sure the file paths are located in e107_config.php now.</li>
<li>To rename your e107_admin directory (or any of your other directories), first rename the folder in the usual manner using your FTP client. Then open e107_config.php from the root directory of your e107 installation in a text editor, and find the following line near the top of the file ...<br />
<i>$ADMIN_DIRECTORY = "e107_admin/";</i><br />
... and change <i>e107_admin/</i> to the name you've renamed it on your server </li>
<li>You can change the name of all your e107 directories using this method</li>
<li>There are some security settings that you can change from your admin area. Go to the preferences page and you'll see a section marked Security</li>
</ul>
<br />
<a id='problems'></a><span class="headertext">Common Problems</span><br />
<br />
<ul>
<li>If for any reason you get a critical error message concerning your core settings, you can easily reset them to default using the resetcore utility. You can find this in your e107_files folder, use your web browser to navigate to http://yoursite.com/e107_files/resetcore/resetcore.php and follow the instructions. This will not affect any content on your site; it will merely reset your core settings, so your site theme etc will revert to default. You can make a backup of your core at any time and restore this from the resetcore utility, to backup your core go to your admin section, click on Database ten click on Backup Core</li>
<li>If after installing e107 you get a blank page, check your error_reporting level in your php.ini file. This is generally caused by an error on your site not being reported because your error reporting is set too low, or turned off completely. If you don't have access to your php.ini contact your web host</li>
<li>If you are seeing Undefined Variable or Notice errors on your site, your error_reporting is set too high. Make sure it's set to E_ERROR | E_WARNING | E_PARSE in your php.ini, again if you don't have access contact your web hosts and ask them to change it</li>
</ul>
<br />
<a id='support'></a><span class="headertext">Support</span><br />
<br />
All these places are very friendly, please don't hesitate to use them even if you think your question is trivial, you'll get a polite reply.
<ul>
<li><b>e107 forums</b><br />
<a href='http://e107.org/forum.php'>http://e107.org/forum.php</a></li>
<li><b>e107 faq</b><br />
<a href='http://e107faq.bkwon.net'>http://e107faq.bkwon.net</a></li>
<li><b>IRC channel</b><br />
#e107 on <a href='irc://freenode.net'>irc.freenode.net</a><br /></li>
<li><b>Third party plugin support: e107coders</b><br />
<a href='http://e107coders.org'>http://e107coders.org/</a><br /></li>
<li><b>Third party theme support: e107themes</b><br />
<a href='http://e107themes.org'>http://e107themes.org/</a></li>
</ul>
<p><br />
<a id='development'></a><span class="headertext">Development</span><br />
<br />
e107 has been tested, and developed on Apache 1 and 2, IIS, and PHP 4.3+ (Including 5.0).<br />
It is developed by the e107 dev team (Jalist, McFly, Cameron, Streaky, SweetAs, Asperon, Que, Lolo, Chavo, Lisa, MrPete).<br />
<br />
If you have made changes to the core you think might benefit others please let us know about them in the forums at e107.org :)<br />
<br />
<br />
<a id='thankyou'></a><span class="headertext">Thank you</span><br />
<br />
Thanks first to jalist for starting this whole thing out and sticking with it for so long. </p>
<ul>
<li>Thanks mainly to Terrence, Damon, que, nalenb, Dawn, HeX0R, JuhaH, bkwon, Knight, Aldrin for their unstinting support.</li>
<li>Also to everyone else who has assisted and submitted translations/fixes etc</li>
<li>Thanks to CraHan, NeXTer, Kuhndog, wols, [steev], rootrider, Claymore, demigod, maaneeack, Schmots, dreamer, galois and the others in [#ls.g] for their friendship.</li>
<li>Thanks to Jérôme C. Meijers and Craig Bramscher</li>
<li>e107.net for donated hosting</li>
<li>Thanks to all of you who have taken the time to create plugins/themes/hacks, answer questions in the forums and IRC channel etc. We have a wonderful community here and it's because of people like you.</li>
<li>And thanks to you for trying e107, I hope you like it and it fits your website needs. If it doesn't try <a href='http://opensourcecms.com'>OpenSourceCMS</a> for a full list of alternative systems.</li>
<li>A couple of third-party scripts have been integrated into e107 to make your life easier, so thank you to ...<br />
<ul>
<li>MagpieRSS (<a href='http://magpierss.sourceforge.net'>http://magpierss.sourceforge.net</a>) MagpieRSS provides an XML-based (expat) RSS parser in PHP.</li>
<li>PCLZip (<a href='http://www.phpconcept.net/pclzip/'>http://www.phpconcept.net/pclzip/</a>) PclZip library offers compression and extraction functions for Zip formatted archives (WinZip, PKZIP).</li>
<li>PCLTar (<a href='http://www.phpconcept.net/pcltar/'>http://www.phpconcept.net/pcltar/</a>) PclTar offer the ability to archive a list of files or directories with or without compression. The archives created by PclTar are readable by most of gzip/tar applications and by the Windows WinZip application.</li>
<li>TinyMCE (<a href='http://tinymce.moxiecode.com'>http://tinymce.moxiecode.com</a>) TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</li>
<li>Nuvolo Icons (<a href='http://www.icon-king.com'>http://www.icon-king.com</a>) Icons used in e107</li>
<li>PHPMailer (<a href='http://phpmailer.sourceforge.net'>http://phpmailer.sourceforge.net</a>) Full featured email transfer class for PHP</li>
<li>Brainjar DHTML Menu (<a href='http://www.brainjar.com/dhtml/menubar/'>http://www.brainjar.com/dhtml/menubar/</a>) Menu system used in several themes</li>
<li>DHTML / JavaScript Calendar (<a href='http://www.dynarch.com/projects/'>http://www.dynarch.com/projects/</a>) Popup calendar widget</li>
<li>FPDF (<a href='http://www.fpdf.org'>http://www.fpdf.org</a>) PDF support</li>
<li>UFPDF (<a href='http://www.acko.net/node/56'>http://www.acko.net/node/56</a>) UTF-8 PDF support</li>
</ul>
<br />
Both these scripts are released under the GPL license and as stated the copyright information has been left intact in the scripts themselves, if you want to use these scripts in your own code you must abide by the GPL license.</li>
</ul>
<br />
<a id='disclaimer'></a><span class="headertext">Disclaimer</span><br />
<br />
This software is free and as such comes without warranty as stated in the GNU GPL License (included in this package). Any problems encountered due to deficiencies in this software are not the responsibility of the author. <br />
</div>
</body>
</html>

View File

@@ -0,0 +1,150 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Version Info:
$Source: /cvs_backup/e107_0.8/e107_docs/README_UPGRADE.html,v $
$Revision: 1.1.1.1 $
$Date: 2006-12-02 04:33:35 $
$Author: mcfly_e107 $
-->
<title>e107 Readme</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="content-style-type" content="text/css" />
</head>
<body>
<div id='mainbox'> <a href="http://e107.org"><img src="../e107_images/logo.png" alt="Logo" style="border:0" /></a> <br />
<br />
<span class="smalltext">© Steve Dunstan 2002. See gpl.txt for license details.</span><br />
<br />
<br />
<a id='upgrading'></a><span class="headertext">Upgrading</span><br />
<br />
0.6175 -> .7 Upgrade Guide
<pre>
e107 has undergone a lot of changes from .617 to .7 and bkwon has compiled a comprehensive list of these over
at click to open link in new window .
Essential Points
* If you are upgrading an English site from .617 you will need the separate English iso-8859-1 language pack, as the
default core English language pack is now in the UTF character set. If you do not do this some characters in your
database content will display corrupted.
* If your .617 site is non English you will need to make sure the .7 lan pack in your language is both available and in the same
character set as your current .617 language pack. If it is not in the same character set as your original,
some characters in your content, if not all, will display corrupted.
* The plugins you currently use on your .617 site may not work with .7 so you must check this before upgrading your site.
* .7 is almost a complete rewrite of .617 and so there are many database changes. For this reason it is essential
that you make a backup of your site using PhpMyAdmin or another third party SQL backup - do not use the e107 core
database backup system in e107 as this does not work. I know everyone always says you should backup - but for once this
time it's really meant as we will not be able to help you if you lose content or it gets corrupted and with such
heavy database changes this could be possible.
Warning!
There are files related to htmlArea, the WYSIWYG system in the 0.6xx branch of e107 that are known to be exploitable. These must be
removed immediately. Please delete the following directories and all their contents from your server:
e107_handlers/htmlarea/
e107_admin/htmlarea/
Upgrade process
1. Download the .7 core zip and your required .7 language pack (English iso-8859-1 for English sites).
2. Login to your site and go to the admin area and set your maintenance flag to true (Admin => Maintenance).
This will close your site off to visitors whilst you perform the upgrade.
3. Check your database validity by using the tool located at Admin => Database => Check Database Validity. If you have
any errors do not continue with the upgrade process as these must be fixed first.
4. Go back to your admin area frontpage.
5. Extract the contents of the core zip and upload the files to your server - overwriting the existing .617 files.
6. Extract the contents of the language pack (in this release its just one file - English.php) and upload the file(s) to
your server - overwriting the existing one(s).
7. Refresh your admin front page in your browser and you will see an update available button appear.
Click this to take to you to the update page (Alternatively you can reach the update page through Admin =>Database =>
Check For Updates).
8. Click the .617 to .7 core update button. This will run the first step in the upgrade process.
When it finishes you will see several new buttons appear for the upgrade routines for forum, content
and statistics. Even if you do not use these e107 features, run each update anyway.
9. Once all updates have been processed you should no longer have buttons on the updates page and you have completed
the upgrade process.
10. Go back to the database validity tool and check once again that everything passes ok.
You may notice some e107 elements have gone missing - forum, chatbox, content, links, etc... well don't worry
they haven't really! A large part of the e107 core has been 'pluginfied' and you will find all these elements are
now stand alone plugins and can be located under Admin => Plugins. A point to note with links is that your existing
links page links have been separated from the main 'site links' and the upgrade routine has moved them to the new
links page plugin.
Reviews, articles and content have also been pluginfied and incorporated into one plugin called 'Content Management'.
If you used any of these features in 0.6xx or want to use this new plugin for new content, you will need to
change some additional directory permissions for the new plugin. Please see the relevant entry regards this under
'Permissions'.
Version .7 comes with a new theme, Jayya, which has been designed for the admin area of the site and is intended to
make administration more user friendly, implementing several new features for this job. If you would like to try it
out, go to Admin => Theme Manager and change the admin area theme to 'Jayya'.
Because of the huge number of changes in .7 and on the basis it's an almost total rewrite, there may be some
problems when you upgrade. If you find a specific bug please post this in the bugtracker here on e107.org so that
we may fix the issue in the next release of the system. Thanks.
Permissions: Core
The following permissions should be set for using e107 core (most of these will have already been set this way
from your previous 0.6xx install):
chmod 777: e107_themes/
chmod 777: e107_plugins/
chmod 777: e107_files/public/
chmod 777: e107_files/public/avatars/
chmod 777: e107_files/cache/
Permissions: Plugins
The following permissions will need to be set if you were using statistics in your 0.6xx site or wish to use the new
Statistic Logging plugin at some point in the future:
chmod 777: e107_plugins/log/logs/
The following permissions will need to be set if you were using the links page in your 0.6xx site or wish to use the new
links page plugin at some point in the future:
chmod 777: e107_plugins/links_page/cat_images/
chmod 777: e107_plugins/links_page/link_images/
The following permissions will need to be set if you were using Reviews / Articles or Content in your 0.6xx site or
wish to use the new Content Management plugin at some point in the future:
chmod 777: e107_plugins/content/images/cat/
chmod 777: e107_plugins/content/images/cat/16/
chmod 777: e107_plugins/content/images/cat/48/
chmod 777: e107_plugins/content/images/file/
chmod 777: e107_plugins/content/images/file/tmp/
chmod 777: e107_plugins/content/images/icon/
chmod 777: e107_plugins/content/images/icon/tmp/
chmod 777: e107_plugins/content/images/image/
chmod 777: e107_plugins/content/images/image/tmp/
chmod 777: e107_plugins/content/menus/
Troubleshooting
If you have any problems with the upgrade such as being locked out of your site please clear your cache by deleting
the php files in e107_files/cache/.
CVS Users
If you have upgraded your 0.6xx install to 0.7 using a CVS nightly build or downloading directly from the CVS
repository, you need to check what character set you are currently using. You will find this information displayed
on your admin area front page under the 'Site Info' menu where it says 'Charset'. If under Charset it says you are
using 'utf-8' then you need only download the main core zip and upgrade with that. Your charset is the default that
0.7 runs with and so is included in the main zip. However, if the Charset says iso-8859-1 and you run an English site
then you must download the separate English iso-8858-1 language pack alongside the main core zip and overwrite the
language files in the core zip with those you find in the iso-8858-1 zip. For non English sites make sure to get your
language in the same Charset as is listed on the admin area frontpage under Site Info.
</pre>
<a id='disclaimer'></a><span class="headertext">Disclaimer</span><br />
<br />
This software is free and as such comes without warranty as stated in the GNU GPL License (included in this package). Any problems encountered due to deficiencies in this software are not the responsibility of the author. <br />
</div>
</body>
</html>

342
e107_docs/gpl.txt Normal file
View File

@@ -0,0 +1,342 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@@ -0,0 +1,6 @@
Q> What are permissions?
A> These allow you to give administrators different access levels to the admin section. For example you might only want to let a certain admin post news items; using permissions you can do this. There are some admin functions that are only accessible to the main site admin, this is for security reasons.
Q> I want to make an existing registered member into an administrator - how?
A> Click on Users in your admin section and search for the registered member, then click on Make Admin. You should then go immediately to the Administrators section and set his permissions. You can also remove admin status from someone in this way.

View File

@@ -0,0 +1,12 @@
Q> What's BBCode?
A> A BBCode is a shortcut to an HTML tag, for example entering &#91;b] I am bold text! &#91;/b] in any of your admin textboxes will make the text inside the &#91;b] and &#91;/b] appear in bold text, so [b]I am bold text![/b] would appear on the screen.
Q> But what's it for?
A> It saves you time when entering HTML tags. You can use normal HTML tags in your text entry boxes but using BBCode will really speed up your text entry.
Q> When I click one of the BBCode buttons to enter the code, it enters it at the end of my text, not where the cursor is - why?
A> There is a bug in Internet Explorer that can cause it to crash if e107 tries to enter the code at the cursor position, so in the interests of compatibility the code is entered at the end of your text.
Q> What BBCodes can I use?
A> Hover your mouse pointer above any of the bbcode boxes; you'll see a small explanation appear just above the buttons. There are also codes for links &#91;url] &#91;/url] and email &#91;email] &#91;/email], although again using normal HTML tags is ok. All web addresses and email addresses entered are automatically made into clickable hyperlinks.

View File

@@ -0,0 +1,6 @@
Q> What's this section for?
A> This page allows you to ban visitors to your site, either by their IP address and/or email address.
Q> Why do I have to give a reason?
A> You don't, that textbox is there so that other administrators can see the reason for the ban, or they might remove it by mistake.

View File

@@ -0,0 +1,18 @@
Q> I defined a new banner from the admin area but it's not showing up - why?
A> The theme you're using needs to know to display a banner. Open the theme.php of the theme and make sure you have {BANNER} or {BANNER=yourcampaignname} in the $HEADER section.
Q> I want to one set of banners in one area and a different set in another area - how?
A> You can group your banners under 'campaigns', and then set up your theme to show banners from certain campaigns. For example, if you had two campaigns, called cam_1 and cam_2, putting {BANNER=cam1} in one area of your $HEADER section in the theme.php will show only cam_1 banners, and putting {BANNER=cam_2} in another area will only show cam_2 banners. Putting {BANNER} (no campaign name) in your theme.php will show random banners from all campaigns.
Q> What's the client login and client password for?
A> You can define a login and password for your banner clients, they can then use these to access information about how their banners are performing by going to http://yoursite.com/banner.php and entering the name and pass.
Q> How can I have a 'tower' type banner in a menu item?
A> First you need to define the campaign for the tower type banners (this will keep them separate from bar type banners) ...
1. Go to your admin area and click on banners.
2. Enter your tower-type banner(s), make sure you use a new campaign name, for example 'towers'.
3. Now go to your Menus area, and activate the Banner_menu into one of your menu areas.
4. Click on the 'Configure' link in the menu item.
5. Enter the caption title (by default it's 'Advertisement'), and enter the campaign name you defined before.
6. Leave your admin area and you'll see your tower-type banner(s) in the area you assigned them to.

View File

@@ -0,0 +1,9 @@
Q> What's this section for?
A> Setting Cache Status to on will save certain areas of your site in your database. This reduces calls to MySQL, and vastly speeds up your site.
Q> I made some alterations to the theme I'm using but it hasn't changed - is it because it's cached.
A> Most probably. When you change themes the cache is cleared but altering code in your theme.php won't clear the cache. Set Cache Status to off until you're finished.
Q> Can I save the cache to files on the hard drive?
A> Yes. Just make sure that your e107_files/cache directory is writable (chmod 777). And then click the option on the cache page.

View File

@@ -0,0 +1,9 @@
Q> What is the Replace Links section for?
A> You can convert any links entered in your chatbox to other text, or an image. This keeps your chatbox from overflowing with long website addresses. To use an image, tick Replace Links, and in the box below enter &lt;img src='path_to_your_image' alt='' />, now any links entered will be converted to the image you entered.
Q> What's Wordwrap for?
A> If someone entered a very long word in your chatbox it could disrupt the layout of your site. If you were to enter 40 in the Wordwrap box, any works longer than 40 characters would be wrapped so the column wouldn't be extended. You may have to change this value corresponding to the theme you are using, and the width of the column your chatbox is in.
Q> My site is for all ages yet someone keeps swearing in the chatbox - how can I stop this?
A> Go to the Preferences screen in your admin section, and find the Protection of minors options. You can add a list of words here that will be replaced by a word or sentence of your choice, for example CENSORED! Now anytime that work is encountered on your site it will be replaced with the text you entered.

View File

@@ -0,0 +1,5 @@
Q> What are these user-classes I keep seeing? What are they for?
A> User classes restrict access to certain areas or functions of your site. If you define a class and then add certain users to it, you can choose to make things visible to only the users in that class.
For example, there is a class already created by default when you install e107 called PRIVATEFORUM. Adding users to this class then creating a forum under that class will make only the users in that class able to access that forum. You can restrict other areas and functions by class, like news items, links, downloads, etc.

View File

@@ -0,0 +1,6 @@
Q> What's a download parent?
A> This allows you to group your downloads into different categories.
Q> I want to add a download but the file doesn't appear in the list - why?
A> Only files in the e107_files/downloads folder appear in the dropdown list. Copy the file into this folder and it will appear. The same applies to images; they must be in the e107_files/downloadimages folder.

View File

@@ -0,0 +1,6 @@
Q> What are emoticons?
A> Emoticons are the smiley images you see on other websites. If you enable emoticons on your site, any time someone enters a smiley, for example &#58;), it will be replaced by the image equivalent :)
Q> Can I enter new emoticon codes?
A> Yes, from the emoticon screen you can enter new, edit existing or delete emoticons.

View File

@@ -0,0 +1,3 @@
Q> I'm getting some errors on a certain page, what do I do about it?
A> Browse the Problems forum at e107.org and see if anyone else is getting the same problem. If you think it's a bug please post the error on the bugtracker at e107.org.

View File

@@ -0,0 +1,15 @@
Q> What are forum parents?
A> A parent is a heading to group other forums under, this makes it easier to navigate your forums.
Q> I want to make a certain administrator a forum moderator but his name isn't in the list - why?
A> Administrators will only be listed if they have the correct permission set to be a forum moderator. Go to the Administrators section and edit the admin in question, and make sure 'Moderate forums' is ticked.
Q> What's tracking?
A> If you have this enabled, it allows users to track a forum thread; they will receive an email when someone replies to the thread.
Q> What's pruning?
A> This allows you to remove old threads that haven't received a reply in a certain time. Please be careful with this function, once threads are deleted they cannot be retrieved.
Q> What are reported posts?
A> Users can report posts that they find to contain objectionable material. You can open the reported thread and moderate as you wish.

View File

@@ -0,0 +1,6 @@
Q> What's this section for?
A> This screen allows you to set what appears on the front page of your site, by default it's set to news.
Q> What other pages can I display?
A> Any. You can either tick the preset ones (forum, downloads, etc.) or enter the address to the page you want to use.

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