code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231 values | license stringclasses 13 values | size int64 1 2.01M |
|---|---|---|---|---|---|
<html>
<head>
<title>$bbname - Powered by Discuz! Board</title>
<meta http-equiv="Content-Type" content="text/html; charset=$charset" />
<style type="text/css">
body {margin: 10px 80px;}
body,table {font-size: {FONTSIZE}; font-family: {FONT};}
</style>
<script type="text/javascript" src="include/javascript/common.js"></script>
<script type="text/javascript" src="include/javascript/menu.js"></script>
</head>
<body>
<img src="{BOARDIMG}" alt="Board logo" border="0" /><br /><br />
<b>{lang subject}: </b>$thread[subject] <b><a href="###" onclick="this.style.visibility='hidden';window.print();this.style.visibility='visible'">[{lang thread_print}]</a></b></span><br />
<!--{loop $postlist $post}-->
<hr noshade size="2" width="100%" color="#808080">
<b>{lang author}: </b><!--{if $post['author'] && !$post['anonymous']}-->$post[author]<!--{else}-->{lang anonymous}<!--{/if}--> <b>{lang time}: </b>$post[dateline]
<!--{if $post['subject']}--> <b>{lang subject}: </b>$post[subject]<!--{/if}-->
<br /><br />
<!--{if $adminid != 1 && $bannedmessages && (($post['authorid'] && !$post['username']) || ($post['groupid'] == 4 || $post['groupid'] == 5))}-->
{lang message_banned}
<!--{elseif $adminid != 1 && $post['status'] == 1}-->
{lang message_single_banned}
<!--{elseif $post['first'] && isset($threadpay)}-->
{lang pay_comment}
<!--{else}-->
$post[message]
<!--{loop $post['attachments'] $attach}-->
<br /><br />$attach[attachicon]
<!--{if !$attach['attachimg'] || !$allowgetattach}-->
{lang attachment}: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <b>$attach[filename]</b> ($attach[dateline], $attach[attachsize]) / {lang attach_download_count} $attach[downloads]<br />{$boardurl}attachment.php?aid=$attach[aid]
<!--{else}-->
{lang attach_img}: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <b>$attach[filename]</b> ($attach[dateline], $attach[attachsize]) / {lang attach_download_count} $attach[downloads]<br />{$boardurl}attachment.php?aid=$attach[aid]
<!--{if !$attach['price'] || $attach['payed']}--><br /><br /><img src="$attach[url]/$attach[attachment]" border="0" onload="if(this.width >screen.width*0.8) this.width=screen.width*0.8" alt="" /><!--{/if}-->
<!--{/if}-->
<!--{/loop}-->
<!--{/if}-->
<!--{/loop}-->
<br /><br /><br /><br /><hr noshade size="2" width="100%" color="{BORDERCOLOR}">
<table cellspacing="0" cellpadding="0" border="0" width="95%" align="center" style="font-size: {SMFONTSIZE}; font-family: {SMFONT}">
<tr><td>{lang welcometo} $bbname ($boardurl)</td>
<td align="right">
Powered by Discuz! $version</td></tr></table>
</body>
</html> | zyyhong | trunk/jiaju001/bbs/templates/default/viewthread_printable.htm | HTML | asf20 | 2,743 |
<!--{if !empty($jsmenu[2])}-->
<ul class="popupmenu_popup headermenu_popup" id="memcp_menu" style="display: none">
<li><a href="memcp.php">{lang memcp_home}</a></li>
<li><a href="memcp.php?action=profile">{lang memcp_profile}</a></li>
<!--{if $exchangestatus || $transferstatus || $ec_ratio}-->
<li><a href="memcp.php?action=credits">{lang memcp_credits}</a></li>
<!--{/if}-->
<li><a href="memcp.php?action=creditslog">{lang memcp_credits_log}</a></li>
<li><a href="memcp.php?action=usergroups">{lang memcp_usergroups}</a></li>
<!--{if $spacestatus}-->
<li><a href="memcp.php?action=spacemodule" target="_blank">{lang space_settings}</a></li>
<!--{/if}-->
<!--{if $supe['status'] && !$xspacestatus}-->
<li><a href="$supe[siteurl]/?uid/$discuz_uid" target="_blank">{lang space_upgrade_space}</a></li>
<!--{/if}-->
</ul>
<!--{/if}-->
<!--{if !empty($plugins['jsmenu'])}-->
<ul class="popupmenu_popup headermenu_popup" id="plugin_menu" style="display: none">
<!--{loop $plugins['jsmenu'] $module}-->
<!--{if !$module['adminid'] || ($module['adminid'] && $adminid > 0 && $module['adminid'] >= $adminid)}-->
<li>$module[url]</li>
<!--{/if}-->
<!--{/loop}-->
</ul>
<!--{/if}-->
<!--{if !empty($jsmenu[3])}-->
<ul class="popupmenu_popup headermenu_popup" id="stats_menu" style="display: none">
<li><a href="stats.php">{lang stats_main}</a></li>
<!--{if $statstatus}-->
<li><a href="stats.php?type=views">{lang stats_views}</a></li><li><a href="stats.php?type=agent">{lang stats_agent}</a></li><li><a href="stats.php?type=posts">{lang stats_posthist}</a></li>
<!--{/if}-->
<li><a href="stats.php?type=forumsrank">{lang stats_forums_rank}</a></li><li><a href="stats.php?type=threadsrank">{lang stats_threads_rank}</a></li><li><a href="stats.php?type=postsrank">{lang stats_posts_rank}</a></li><li><a href="stats.php?type=creditsrank">{lang stats_credits_rank}</a></li>
<li><a href="stats.php?type=trade">{lang stats_trade_rank}</a></li>
<!--{if $oltimespan}--><li><a href="stats.php?type=onlinetime">{lang stats_onlinetime}</a></li><!--{/if}-->
<li><a href="stats.php?type=team">{lang stats_team}</a></li>
<!--{if $modworkstatus}--><li><a href="stats.php?type=modworks">{lang stats_modworks}</a></li><!--{/if}-->
</ul>
<!--{/if}-->
<!--{if $discuz_uid && $jsmenu[4]}-->
<ul class="popupmenu_popup headermenu_popup" id="my_menu" style="display: none">
<li><a href="my.php?item=threads">{lang show_mytopics}</a></li>
<li><a href="my.php?item=favorites&type=thread">{lang my_favorites}</a></li>
<li><a href="my.php?item=subscriptions">{lang my_subscriptions}</a></li>
<li><a href="my.php?item=grouppermission">{lang my_permissions}</a></li>
<li><a href="my.php?item=polls&type=poll">{lang my_polls}</a></li>
<li><a href="my.php?item=tradestats">{lang my_trades}</a></li>
<li><a href="my.php?item=reward&type=stats">{lang my_rewards}</a></li>
<li><a href="my.php?item=activities&type=orig&ended=no">{lang my_activities}</a></li>
<li><a href="my.php?item=debate&type=debate">{lang my_debate}</a></li>
<!--{if $videoopen}-->
<li><a href="my.php?item=video">{lang my_video}</a></li>
<!--{/if}-->
<li><a href="my.php?item=buddylist">{lang my_buddylist}</a></li>
<!--{if $creditspolicy['promotion_visit'] || $creditspolicy['promotion_register']}-->
<li><a href="my.php?item=promotion">{lang post_my_advisit}</a></li>
<!--{/if}-->
<!--{if $supe['status'] && $xspacestatus}-->
<li><a href="$supe[siteurl]/?uid/$discuz_uid" target="_blank">{lang space}</a></li>
<!--{elseif $spacestatus}-->
<li><a href="space.php?uid=$discuz_uid" target="_blank">{lang space}</a></li>
<!--{/if}-->
</ul>
<!--{/if}--> | zyyhong | trunk/jiaju001/bbs/templates/default/jsmenu.htm | HTML | asf20 | 3,764 |
{template header}
<div style="width: 400px" class="popupmenu_option" id="ajax_explain_menu">
<a href="###" onclick="hideMenu()"><img align="right" src="{IMGDIR}/close.gif" border="0" alt="" /></a><br />
<form method="post" id="explainform_$id" action="eccredit.php?action=explain&inajax=1&explainsubmit=yes">
<input type="hidden" name="formhash" value="{FORMHASH}" />
<input type="hidden" name="id" value="$id" />
<textarea name="explanation" rows="5" cols="50" style="width: 98%;overflow: hidden" /></textarea><br /><br />
<button class="submit" type="button" name="explainsubmit" value="true" onclick="ajaxpost('explainform_$id', '$ajaxmenuid')">{lang submit}</button>
</form>
</div>
{template footer} | zyyhong | trunk/jiaju001/bbs/templates/default/ec_explain.htm | HTML | asf20 | 714 |
{template header}
<div id="nav"><a href="$indexname">$bbname</a> » {lang search}</div>
<div class="mainbox threadlist">
<h1>{lang search}</h1>
<table summary="{lang search}" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th>{lang subject}</th>
<td class="forum">{lang forum}</td>
<td class="author">{lang author}</td>
<td class="nums">{lang replies}/{lang views}</td>
<td class="lastpost">{lang lastpost}</td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="5" height="600">
<iframe frameborder="0" scrolling="yes" name="main" src="$url" style="height: 100%; visibility: inherit; width: 100%; z-index: 1;overflow: auto;"></iframe>
</td>
</tr>
</tbody>
</table>
</div>
{template footer} | zyyhong | trunk/jiaju001/bbs/templates/default/search_qihoo.htm | HTML | asf20 | 766 |
{template header}
<div id="nav"><a href="$indexname">$bbname</a> » <a href="stats.php">{lang stats}</a> » {lang stats_main}</div>
<div class="container">
<div class="side">
{template stats_navbar}
</div>
<div class="content">
<div class="mainbox">
<h3>{lang stats_main_member}</h3>
<table summary="{lang stats_main_member}" cellspacing="0" cellpadding="0">
<tr>
<th>{lang stats_main_members}</th><td>$members</td>
<th>{lang stats_main_posters}</th><td>$mempost</td>
</tr>
<tr>
<th>{lang stats_main_admins}</th><td>$admins</td>
<th>{lang stats_main_nonposters}</th><td>$memnonpost</td>
</tr>
<tr>
<th>{lang stats_main_new}</th><td>$lastmember</td>
<th>{lang stats_main_posters_percent}</th><td>$mempostpercent%</td>
</tr>
<tr>
<th>{lang stats_main_topposter}</th><td>$bestmem <em title="{lang stats_main_total_posted}">($bestmemposts)</em></td>
<th>{lang stats_main_posts_avg}</th><td>$mempostavg</td>
</tr>
</table>
</div>
<div class="mainbox">
<h3>{lang stats}</h3>
<table summary="{lang stats}" cellspacing="0" cellpadding="0">
<tr>
<th>{lang stats_main_forums_count}</th><td>$forums</td>
<th>{lang stats_main_nppd}</th><td>$postsaddavg</td>
<th>{lang stats_main_hot_forum}</th><td><a href="forumdisplay.php?fid=$hotforum[fid]" target="_blank">$hotforum[name]</a></td>
</tr>
<tr>
<th>{lang stats_main_threads_count}</th><td>$threads</td>
<th>{lang stats_main_nmpd}</th><td>$membersaddavg</td>
<th>{lang stats_main_threads_count}</th><td>$hotforum[threads]</td>
</tr>
<tr>
<th>{lang stats_main_posts_count}</th><td>$posts</td>
<th>{lang stats_main_todays_newposts}</th><td>$postsaddtoday</td>
<th>{lang stats_main_posts_count}</th><td>$hotforum[posts]</td>
</tr>
<tr>
<th>{lang stats_main_rpt}</th><td>$threadreplyavg</td>
<th>{lang stats_main_members_count}</th><td>$membersaddtoday</td>
<th>{lang stats_main_board_activity}</th><td>$activeindex</td>
</tr>
</table>
</div>
<!--{if $statstatus}-->
<div class="mainbox">
<h3>{lang stats_main_pageview}</h3>
<table summary="{lang stats_main_pageview}" cellspacing="0" cellpadding="0">
<tr>
<th>{lang stats_main_total_pageview}</th><td>$stats_total[hits]</td>
<th>{lang stats_main_maxpv_month}</th><td>$maxmonth_year {lang year} $maxmonth_month {lang month}</td>
</tr>
<tr>
<th>{lang stats_main_total_visitors}</th><td>$stats_total[visitors] {lang stats_main_person_time}</td>
<th>{lang stats_main_total_pageview_month}</th><td>$maxmonth</td>
</tr>
<tr>
<th>{lang member}</th><td>$stats_total[members]</td>
<th>{lang stats_main_period_of_time}</th><td>$maxhourfrom - $maxhourto</td>
</tr>
<tr>
<th>{lang guest}</th><td>$stats_total[guests]</td>
<th>{lang stats_main_total_pageview_time}</th><td>$maxhour</td>
</tr>
<tr>
<th>{lang stats_main_pv_avg}</th><td>$pageviewavg</td>
<th> </th><td> </td>
</tr>
</table>
</div>
<!--{/if}-->
<div class="mainbox">
<h3>{lang stats_main_month}</h3>
<table summary="{lang stats_main_month}" cellpadding="0" cellspacing="0">
<!--{if $statstatus}-->
$statsbar_month
<!--{else}-->
<thead>
<td colspan="2">{lang stats_month_posts}</td>
</thead>
$statsbar_monthposts
<thead>
<td colspan="2">{lang stats_day_posts}</td>
</thead>
$statsbar_dayposts
<!--{/if}-->
</table>
</div>
<div class="notice">{lang stats_update}</div>
</div>
</div>
{template footer} | zyyhong | trunk/jiaju001/bbs/templates/default/stats_main.htm | HTML | asf20 | 3,925 |
<?php
// Message Pack for Discuz! Version 1.0.0
// Created by Crossday
$language = array
(
'discuz_lang' => 'templates',
'ban_member' => '禁止用户',
'input_invalid' => '填写无效',
'title_none' => '无标题',
'title' => '标题',
'leaveword' => '留言',
'status' => '状态',
'confirm' => '批准',
'never' => '从未',
'onlines' => '人在线',
'on' => '于',
'update' => '更新',
'total' => '共',
'top' => '顶部',
'admin' => '论坛管理员',
'supermod' => '超级版主',
'moderator' => '版主',
'member' => '会员',
'onlinemember' => '在线会员',
'guest' => '游客',
'anonymous' => '匿名',
'forum' => '版块',
'refresh' => '刷 新',
'show' => '查看',
'orderby' => '排序方式',
'submit' => '提交',
'cancel' => '取消',
'close' => '关闭',
'target_blank' => '新窗口打开',
'disable' => '禁用',
'enable' => '启用',
'disabled' => '禁用',
'enabled' => '可用',
'select' => '选择',
'reply' => '回复',
'download' => '下载',
'forward' => '转发',
'delete' => '删除',
'delete_wait' => '待删除',
'audit_wait' => '待审核',
'reason' => '理由',
'advertisement' => '广告',
'keyword' => '关键字',
'content' => '内容',
'plugin' => '插件',
'time' => '时间',
'time_now' => '当前时区 GMT$timenow[offset], 现在时间是 $timenow[time]',
'visited_forums' => '最近访问的版块 ...',
'announcement' => '论坛公告',
'width' => '宽',
'height' => '高',
'edit' => '编辑',
'space' => '个人空间',
'trade' => '商品',
'hot_blog' => '热门BLOG',
'supe_updateusers' => '最近更新个人空间',
'supe_updateitems' => 'X-Space个人空间热点导读',
'supe_home' => '首页',
'supe_news' => '资讯',
'supe_blog' => '日志',
'supe_image' => '图片',
'supe_goods' => '商品',
'supe_file' => '文件',
'supe_link' => '书签',
'supe_bbs' => '版块',
'supe_circle' => '圈子',
'supe_video' => '影音',
'payment_unit' => '家居币',
'yes' => '是',
'no' => '否',
'big' => '大',
'middle' => '中',
'small' => '小',
'my_threads_common' => '正常',
'common' => '正常',
'expiration' => '已结束',
'noexpiration' => '未结束',
'online' => '当前在线',
'offline' => '当前离线',
'action' => '操作',
'options' => '选项',
'seccode' => '验证码',
'secqaa' => '验证问答',
'seccode_comment' => '请在空白处输入图片中的数字',
'secqaa_comment' => '您必须正确回答下面的问题才能通过注册:',
'uid' => 'UID',
'username' => '用户名',
'nickname' => '昵称',
'email' => 'Email',
'old_password' => '原密码',
'password' => '密码',
'password_confirm' => '确认密码',
'new_password' => '新密码',
'new_password_confirm' => '确认新密码',
'gender' => '性别',
'alipay' => '支付宝账号',
'homepage' => '个人网站',
'location' => '来自',
'taobao' => '阿里旺旺',
'regip' => '注册 IP',
'lastip' => '上次访问 IP',
'lastupdate' => '上次更新',
'regdate' => '注册日期',
'lastvisit' => '上次访问',
'credits' => '积分',
'credits_tax' => '积分交易税',
'credits_detail' => '详细积分',
'posts' => '帖子',
'digestposts' => '精华',
'avatar' => '头像',
'enter' => '进入',
'male' => '男',
'female' => '女',
'secret' => '保密',
'birthday' => '生日',
'admin_status' => '管理头衔',
'medals' => '勋章',
'usergroup' => '用户组',
'extgroups' => '扩展用户组',
'rank' => '发帖数级别',
'pm' => '短消息',
'register' => '注册',
'register_check_username' => '检查用户名',
'register_email_comment' => '请确保信箱有效,我们将发送激活说明到这个地址',
'register_email_censor' => '请不要使用以 $censoremail 结尾的信箱',
'register_message' => '注册原因',
'register_email_recommend' => '<a href="#" onclick="msnoperate(\'reghotmail\')">免费注册5G超大Hotmail邮箱</a>',
'register_msn_download' => '<a href="#" onclick="msnoperate(\'download\')">下载最新版MSN Messenger</a>',
'register_from' => '推荐人',
'register_now' => '立即注册',
'memberlist' => '会员',
'login' => '登录',
'logout' => '退出',
'search' => '搜索',
'statistics' => '统计',
'memcp' => '控制面板',
'admincp' => '系统设置',
'faq' => '帮助',
'style' => '界面风格',
'tpp' => '每页主题数',
'ppp' => '每页帖数',
'timeformat' => '时间格式',
'dateformat' => '日期格式',
'timeoffset' => '时差设定',
'pmsound' => '短消息提示音',
'custom_status' => '自定义头衔',
'bio' => '自我介绍',
'biotrade' => '店铺介绍',
'signature' => '个人签名',
'bytes_limited' => '字节以内',
'lower_than' => '小于',
'more_than' => '大于',
'equal_to' => '等于',
'size_no_limit' => '大小不限制',
'eg' => '例如',
'sample' => '样例',
'etc' => '等',
'return' => '返回',
'goback_home' => '返回',
'timenow' => '现在时间是',
'welcometo' => '欢迎光临',
'your_lastvisit' => '您上次访问是在',
'use_default' => '- 使用默认 -',
'please_select' => '- 请选择 -',
'default' => '默认',
'customize' => '自定义',
'or' => '或',
'to' => '发送到',
'lento' => '到',
'from' => '来自',
'year' => '年',
'month' => '月',
'day' => '日',
'hour' => '小时',
'hours' => '小时',
'level' => '级别',
'none' => '无',
'all' => '全部',
'checkall' => '全选',
'icon' => '图标',
'author' => '作者',
'subject' => '标题',
'description' => '描述',
'replies' => '回复',
'views' => '查看',
'downloads' => '下载次数',
'dateline' => '发布时间',
'lastpost' => '最后发表',
'message' => '内容',
'message_banned' => '提示: <em>作者被禁止或删除 内容自动屏蔽</em>',
'message_single_banned' => '提示: <em>该帖被管理员或版主屏蔽</em>',
'admin_message_banned' => '提示: <em>作者被禁止或删除 内容自动屏蔽,只有管理员可见</em>',
'admin_message_single_banned' => '提示: <em>该帖被管理员或版主屏蔽,只有管理员可见</em>',
'poston' => '发表于',
'attachment' => '附件',
'attachments' => '附件',
'attachment_viewthread' => '本贴附件',
'attachment_size' => '文件尺寸',
'attachment_new' => '上传附件',
'attachment_date' => '更新日期',
'attachment_allow_exts' => '可用扩展名',
'attachment_reply_show' => '本帖附件需要回复才可下载或查看',
'attachment_buy' => '购买',
'attachment_buy_not' => '目前没有用户购买此附件。',
'spread' => '收起/展开',
'ajax_post' => '正在提交数据...',
'reprint' => '转帖',
'copy' => '复制',
'send' => '发送',
'bytes' => '字节',
'optional' => '可选',
'clear_cookies' => '清除 Cookies',
'contactus' => '联系我们',
'board_allowed' => '系统限制',
'board_message' => '提示信息',
'agree' => '同 意',
'disagree' => '不同意',
'go_back' => '返回上一页',
'delete_check' => '删?',
'add_new' => '新增:',
'required_info' => '基本信息 ( * 为必填项)',
'required' => '必填',
'maxnum' => '最大值',
'minnum' => '最小值',
'maxlength' => '最大长度',
'unchangeable' => '不可修改',
'optional_info' => '扩展信息',
'board_options' => '论坛个性化设置',
'other_options' => '其他选项',
'online_invisible' => '在线列表中隐身',
'show_email_addr' => 'Email 地址可见',
'allow_newsletter' => '同意接收论坛通知 (Email 或短消息)',
'announcements' => '论坛公告',
'starttime' => '起始时间',
'endtime' => '结束时间',
'unlimited' => '不限',
'discount' => '折',
'rss_subscribe_all' => 'RSS 订阅全部版块',
'rss_subscribe_this' => 'RSS 订阅当前版块',
'rulemessage' => '请仔细阅读以上的注册许可协议',
'emailfriend' => '推荐给朋友',
'emailinvite' => '发送邀请码给朋友',
'emailfriend_your_name' => '您的名字',
'emailfriend_your_email' => '您的 Email',
'emailfriend_receiver_name' => '接收者名字',
'emailfriend_receiver_email' => '接收者 Email',
'emailfriend_message' => '你好!我在 $bbname 看到了这篇帖子,认为很有价值,特推荐给你。{LF}{LF}$thread[subject]{LF}地址 $threadurl{LF}{LF}希望你能喜欢。',
'emailinvite_message' => '你好!我发现一个很好的论坛 $bbname 特推荐给你。{LF}{LF}地址{LF}$threadurl{LF}{LF}通过这个链接注册,您将获得一定数量的积分。{LF}{LF}希望你能喜欢。',
'forum_modedby' => '版主',
'forum_category_modedby' => '分区版主',
'forum_opening' => '*空缺中*',
'forum_viewall' => '全部',
'forum_viewdigest' => '查看本版精华',
'forum_moderate' => '审核',
'forum_moderate_threads' => '新主题',
'forum_moderate_replies' => '新回复',
'forum_recyclebin' => '回收站',
'forum_rules' => '本版规则',
'forum_activeusers' => '正在浏览此版块的会员',
'forum_normal_threads' => '版块主题',
'forum_nothreads' => '本版块或指定的范围内尚无主题。',
'forum_jump' => '版块跳转 ...',
'forum_password_require' => '本版块需要密码,您必须在下面输入正确的密码才能浏览这个版块。',
'forum_recommend' => '版主推荐',
'forum_recommend_admin' => '管理',
'digest' => '精华区',
'digest_posts' => '精华',
'digest_forum' => '以下版块精华区',
'threads_all' => '全部主题',
'last_1_days' => '1 天以来主题',
'last_2_days' => '2 天以来主题',
'last_7_days' => '1 周以来主题',
'last_30_days' => '1 个月以来主题',
'last_90_days' => '3 个月以来主题',
'last_180_days' => '6 个月以来主题',
'last_356_days' => '1 年以来主题',
'order_lastpost' => '回复时间',
'order_starttime' => '发布时间',
'order_replies' => '回复数量',
'order_views' => '浏览次数',
'order_desc' => '按降序排列',
'order_asc' => '按升序排列',
'thread_moved' => '移动',
'thread_digest' => '精华',
'thread_poll' => '投票',
'thread_trade' => '商品',
'thread_activity' => '活动',
'thread_debate' => '辩论',
'thread_video' => '视频',
'debate_starttime' => '开始时间',
'debate_backgroup' => '背景资料',
'debate_endtime' => '结束时间',
'debate_umpire' => '裁判',
'debate_subject' => '辩论主题',
'thread_reward' => '悬赏',
'thread_rewardend' => '悬赏已解决',
'thread_keywords' => '搜索更多相关主题的帖子:',
'thread_more_related_threads' => '更多相关主题',
'thread_newposts' => '有新回复',
'thread_nonewpost' => '无新回复',
'thread_more_replies' => '热门主题',
'thread_closed' => '关闭主题',
'thread_mod' => '主题操作记录',
'thread_mod_by' => '本主题由 $lastmod[modusername] 于 $lastmod[moddateline] $lastmod[modaction]',
'thread_blog' => '本主题被作者加入到个人文集中',
'thread_rate' => '参与评分',
'thread_rate_log_lately' => '本帖最近评分记录',
'thread_printable' => '打印',
'thread_email_friend' => '推荐',
'thread_subscribe' => '订阅',
'thread_favorite' => '收藏',
'thread_stick' => '置顶',
'thread_removerate' => '撤销评分',
'forum_favorite' => '收藏本版',
'thread_print' => '打印本页',
'thread_moderations' => '主题操作记录',
'thread_moderations_username' => '操作者',
'thread_moderations_cron' => '任务系统',
'thread_moderations_action' => '操作',
'thread_moderations_expiration' => '有效期',
'thread_moderations_expiration_comment' => '本操作的有效期限,格式为 yyyy-mm-dd,范围 <u>$expirationmin</u> 至 <u>$expirationmax</u>,留空为不限制',
'thread_moderations_expiration_unlimit' => '永久有效',
'thread_show_author' => '只看该作者',
'thread_show_all' => '显示全部帖子',
'three_days' => '3天',
'five_days' => '5天',
'seven_days' => '7天',
'fourteen_days' => '14天',
'one_month' => '1个月',
'three_months' => '3个月',
'half_year' => '半年',
'one_year' => '1年',
'trade_expiration_forever' => '不填表示永久有效',
'readperm' => '阅读权限',
'readperm_thread' => '所需阅读权限',
'price' => '售价',
'price_thread' => '浏览需支付',
'post_subject_toolong' => '您的标题超过 80 个字符的限制。',
'post_type_isnull' => '请选择主题对应的分类。',
'post_subject_and_message_isnull' => '请完成标题或内容栏。',
'post_message_length_invalid' => '您的帖子长度不符合要求。',
'post_curlength' => '当前长度',
'post_seccode' => '请输入验证码以便最终发表',
'post_secqaa' => '请回答下面的问题以便最终发表',
'post_fastpost' => '快速发新话题',
'post_fastreply' => '快速回复主题',
'post_fastreply_author' => '回复 # 的帖子',
'post_zero_is_nopermission' => '0或空为不限制',
'post_price_refunded' => '本主题被强制退款',
'post_price_free' => '本主题自发表起已超过最长出售时限',
'post_price_comment' => '最高 $maxprice {$extcredits[$creditstrans][unit]}',
'post_price_income_comment' => ',单一主题作者最高收入 $maxincperthread {$extcredits[$creditstrans][unit]}',
'post_price_charge_comment' => ',最高出售时限 $maxchargespan 小时',
'post_price_free_comment' => '您可以使用 <code><strong>[free]</strong>message<strong>[/free]</strong></code> 代码发表无需付费也能查看的免费信息',
'post_parseurl' => 'URL 识别',
'post_html' => 'Html 代码',
'post_copylink' => '复制帖子链接到剪贴板',
'post_anonymous' => '使用匿名发帖',
'post_smilies' => '表情',
'post_smilies_more' => '更多表情',
'post_autosave_none' => '没有可以恢复的数据!',
'post_autosave_confirm' => '此操作将覆盖当前帖子内容,确定要恢复数据吗?',
'post_autosave_restore' => '恢复数据',
'post_autosave_last_restore' => '恢复上次自动保存的数据',
'post_discuzcode' => 'Discuz! 代码',
'post_discuzcode_listitem' => '输入一个列表项目.\r\n留空或者点击取消完成此列表.',
'post_discuzcode_linkurl' => '请输入链接的地址:',
'post_discuzcode_imageurl' => '请输入图片链接地址:',
'post_discuzcode_emaillink' => '请输入此链接的邮箱地址:',
'post_discuzcode_tablerows' => '表格行数:',
'post_discuzcode_tablecolumns' => '表格列数:',
'post_discuzcode_tablewidth' => '表格宽度:',
'post_discuzcode_tablebgcolor' => '背景颜色:',
'post_discuzcode_removeformat' => '清除文本格式',
'post_discuzcode_undo' => '撤销',
'post_discuzcode_redo' => '重做',
'post_discuzcode_bold' => '粗体',
'post_discuzcode_italic' => '斜体',
'post_discuzcode_underline' => '下划线',
'post_discuzcode_fontname' => '字体',
'post_discuzcode_fontoptions' => '"仿宋_GB2312", "黑体", "楷体_GB2312", "宋体", "新宋体", "微软雅黑", "Trebuchet MS", "Tahoma", "Arial", "Impact", "Verdana", "Times New Roman"',
'post_discuzcode_fontsize' => '大小',
'post_discuzcode_forecolor' => '颜色',
'post_discuzcode_left' => '居左',
'post_discuzcode_center' => '居中',
'post_discuzcode_right' => '居右',
'post_discuzcode_floatleft' => '左浮动',
'post_discuzcode_floatright' => '右浮动',
'post_discuzcode_orderedlist' => '排序的列表',
'post_discuzcode_unorderedlist' => '未排序列表',
'post_discuzcode_outdent' => '减少缩进',
'post_discuzcode_indent' => '增加缩进',
'post_discuzcode_contract' => '收缩编辑框',
'post_discuzcode_expand' => '扩展编辑框',
'post_discuzcode_url' => '插入链接',
'post_discuzcode_unlink' => '移除链接',
'post_discuzcode_email' => '插入邮箱链接',
'post_discuzcode_image' => '插入图片',
'post_discuzcode_quote' => '插入引用',
'post_discuzcode_code' => '插入代码',
'post_discuzcode_table' => '插入表格',
'post_discuzcode_free' => '插入免费信息',
'post_discuzcode_hide' => '插入隐藏内容',
'post_discuzcode_media' => '插入多媒体文件',
'post_discuzcode_media_url' => '请输入多媒体文件的地址',
'post_discuzcode_media_autostart' => '自动播放',
'post_discuzcode_input_code' => '请输入要插入的代码',
'post_discuzcode_input_quote' => '请输入要插入的引用',
'post_discuzcode_input_free' => '请输入要插入的免费信息',
'post_discuzcode_input_hide' => '请输入要插入的隐藏内容',
'post_attachment_insertlink' => '插入',
'post_attachment_deletelink' => '删除',
'post_attachment_insert' => '点击这里将本附件插入帖子内容中当前光标的位置',
'post_attachment_comment' => '<strong>技巧提示:</strong> 您可以在帖子中使用 [attach]aid[/attach] 标签将附件显示于帖子内容的指定位置,而不按照默认方式排列在内容的尾部。点击 aid 数字可以在当前光标位置自动插入此代码。',
'post_attachment_ext_notallowed' => '对不起,不支持上传此类扩展名的附件。',
'post_attachment_img_invalid' => '无效的图片文件。',
'post_imgcode' => '[img] 代码',
'post_show_sig' => '使用个人签名',
'post_email_notify' => '接收新回复邮件通知',
'post_topicsubmit' => '发表帖子',
'post_previewpost' => '预览帖子',
'post_topicreset' => '清空内容',
'post_thread_review' => '主题回顾',
'post_replies_toolong' => '本主题回复较多,请 <a href="viewthread.php?fid=$fid&tid=$tid">点击这里</a> 查看。',
'post_submit_hotkey' => '[完成后可按 Ctrl+Enter 发布]',
'post_newthread' => '发新话题',
'post_newthreadpoll' => '发布投票',
'post_newthreadtrade' => '发布商品',
'post_newthreadreward' => '发布悬赏',
'post_newthreadactivity' => '发布活动',
'post_newthreaddebate' => '发布辩论',
'post_newthreadvideo' => '发布视频',
'post_newreply' => '发表回复',
'post_editpost' => '编辑帖子',
'post_editpost_poll' => '编辑投票主题',
'post_editpost_reward' => '编辑悬赏主题',
'post_editpost_activity' => '编辑活动主题',
'post_editpost_trade' => '编辑商品主题',
'post_editpost_tradegoods' => '编辑商品',
'post_editpost_debate' => '编辑辩论主题',
'post_newthread_poll' => '发新投票',
'post_newthread_reward' => '发起悬赏',
'post_newthread_activity' => '创建活动',
'post_newthread_trade' => '发布商品主题',
'post_newthread_debate' => '发表辩论',
'post_poll_options' => '投票选项',
'post_poll_comment' => '每行填写 1 个选项<br />最多可填写 $maxpolloptions 个选项',
'post_poll_allowmultiple' => '多选投票',
'post_trade_paymethod' => '交易方式',
'post_trade_paymethod_online' => '支付宝在线交易',
'post_trade_paymethod_offline' => '线下交易',
'post_trade_seller' => '支付宝账户',
'post_trade_supportalipay' => '此商品支持支付宝,您可以先验货后付款',
'post_trade_name' => '商品名称',
'post_trade_price' => '商品现价',
'post_trade_costprice' => '商品原价',
'post_trade_picture' => '商品图片',
'post_trade_number' => '商品数量',
'post_trade_locus' => '所在地点',
'post_trade_transport' => '物流方式',
'post_trade_transport_fee' => '运费',
'post_trade_buynumber' => '累计售出',
'post_trade_transport_none' => '无运费',
'post_trade_transport_seller' => '卖家承担运费',
'post_trade_transport_buyer' => '买家承担运费',
'post_trade_transport_comment' => '通过运费承担方选择注明该交易是由买卖哪方承担运费。<br />如果是买家承担运费,请选择可以提供的物流方式以及相应费用。',
'post_trade_transport_mail' => '平邮',
'post_trade_transport_mail_unit' => '不填表示不提供平邮',
'post_trade_transport_express' => '快递',
'post_trade_transport_express_unit' => '不填表示不提供快递',
'post_trade_transport_virtual' => '虚拟物品或无需邮递',
'post_trade_description' => '商品描述',
'post_trade_transport_physical' => '买家收到货物后直接支付给物流公司',
'post_trade_sticklist' => '推荐商品',
'post_trade_alllist' => '柜台商品',
'post_trade_totalnumber' => '商品数',
'post_trade_counterinfo' => '柜台信息',
'post_trade_counterdesc' => '柜台商品介绍',
'post_trade_aboutcounter' => '柜台介绍',
'trade_type_transport_physical' => '支付给物流公司',
'post_trade_transport_ems_unit' => '不填表示不提供 EMS',
'trade_start' => '启动交易',
'post_check_length' => '字数检查',
'post_delpost' => '!删除本帖',
'post_stick_thread' => '主题置顶',
'post_digest_thread' => '精华帖子',
'post_blog_thread' => '加入文集',
'post_tradeinfo' => '交易信息',
'post_goodsinfo' => '商品信息',
'post_otherinfo' => '其他信息',
'post_tag' => '标签(TAG)',
'trade_credits_total' => '支付总额',
'trade_units' => '家居币',
'trade_buy' => '购买商品',
'trade_confirm_buy' => '确认购买信息',
'trade_seller' => '卖家',
'trade_buyer' => '买家',
'trade_new' => '全新',
'trade_old' => '二手',
'trade_type' => '商品类型',
'trade_type_buy' => '商品',
'trade_type_service' => '服务',
'trade_type_auction' => '拍卖',
'trade_type_donate' => '捐赠',
'trade_type_compensate' => '邮费',
'trade_type_bonus' => '奖金',
'trade_favourable' => '优惠价格',
'trade_nums' => '购买数量',
'trade_message' => '留言',
'trade_seller_contact' => '买家联系方式',
'trade_seller_contact_comment' => '请填写邮件地址、QQ、电话号码等资料方便卖家与您联系。',
'trade_buy_confirm' => '确认购买',
'trade_seller_remark' => '备注信息',
'trade_seller_remark_comment' => '200 字以内',
'trade_guest_alarm' => '您目前为游客,购买后您无法在本版块查看交易状态,请到支付网站查询。',
'trade_discount' => '支付{$extcredits[$creditstrans][title]} <span id="discountcredit">$discountcredit</span> {$extcredits[$creditstrans][unit]}享受优惠',
'trade_price' => '商品价格 $mintradeprice - $maxtradeprice',
'trade_buy' => '立即购买!',
'trade_show_log' => '商品交易单',
'trade_order' => '交易单',
'trade_order_no' => '交易单号',
'trade_status' => '交易状态',
'trade_payment' => '交易金额',
'trade_payment_comment' => '(点击下方的“更新交易单”按钮重新计算交易金额)',
'trade_baseprice' => '商品基价',
'trade_last_update' => '最后交易变更时间',
'trade_order_status' => '查看并确认支付宝交易单状态',
'trade_alipay_tradeurl' => '支付宝交易单',
'trade_submit_order' => '更新交易单',
'trade_online_pay' => '使用支付宝在线支付',
'trade_buyername' => '收货人姓名',
'trade_buyercontact' => '收货地址',
'trade_buyerzip' => '收货人邮编',
'trade_buyerphone' => '收货人电话',
'trade_buyermobile' => '收货人手机',
'trade_transportfee' => '运费',
'trade_paymethod' => '交易方式',
'trade_pay_alipay' => '支付宝在线交易',
'trade_pay_offline' => '线下交易',
'trade_displayorder' => '柜台商品管理',
'trade_show_order' => '显示顺序',
'trade_update_order' => '更新商品摆放顺序',
'trade_add_post' => '添加商品',
'trade_steptoadd_post' => '下一步: 添加商品',
'trade_remain' => '剩余',
'trade_remaindays' => '剩余时间',
'trade_day' => '天',
'trade_hour' => '小时',
'trade_timeout' => '成交结束',
'trade_update_stick' => '推荐',
'trade_update_stickmax' => '您最多可推荐的商品数:',
'trade_viewthread' => '商品主题',
'trade_viewtrade' => '查看商品',
'trade_viewreply' => '查看回复',
'trade_threadinfo' => '主题介绍',
'trade_password' => '论坛登录密码',
'trade_rate' => '信用评价',
'trade_buyer_rate' => '买家信用评价',
'trade_seller_rate' => '卖家信用评价',
'trade_view_all' => '查看当前柜台',
'trade_view_space' => '查看卖家店铺',
'trade_nogoods' => '*** 本商品主题尚未开放 ***',
'seccode_click' => '点击输入框显示验证码',
'seccode_refresh' => '如果看不清验证码,请点图片刷新',
'seccode_animator_refresh' => '请确认您的浏览器支持动画的显示,如果看不清验证码,请点图片刷新',
'seccode_animator_flashrefresh' => '请确认您的浏览器支持 Flash 的显示,如果看不清验证码,请点<a href="###" onclick="updateseccode()">这里</a>刷新',
'my' => '我的',
'my_admin' => '个人管理',
'my_favorites' => '我的收藏',
'my_blogs' => '我的文集',
'my_polls' => '我的投票',
'my_trades' => '我的商品',
'my_subscriptions' => '我的订阅',
'my_permissions' => '我的权限',
'my_activities' => '我的活动',
'my_trade_notice' => '交易提醒',
'my_trade_stat' => '交易统计',
'my_trade_buys' => '我是买家',
'my_trade_selles' => '我是卖家',
'my_trade_threads' => '商品主题',
'my_trade_show' => '查看交易',
'my_trade_sale_quantity' => '售出数',
'my_trade_stock_quantity' => '库存数',
'my_trade_amount_all' => '销售额(币)',
'my_trade_last' => '最后交易',
'my_trade_goods_name' => '商品名称',
'my_trade_thread' => '相关主题',
'my_trade_buyer' => '买家',
'my_trade_seller' => '卖家',
'my_trade_amount' => '交易金额(币)',
'my_trade_status' => '交易状态',
'my_trade_orderall' => '查看所有订单',
'my_trade_nonexistence' => '目前没有交易记录。',
'my_trade_all' => '全部交易',
'my_trade_attention' => '关注的交易',
'my_trade_eccredit' => '评价的交易',
'my_trade_trading' => '进行中的交易',
'my_trade_success' => '成功的交易',
'my_trade_closed' => '失败的交易',
'my_trade_refund' => '退款的交易',
'my_trade_unstart' => '未生效的交易',
'my_trade_view_sell' => '交易中的商品',
'my_trade_view_buy' => '我买入的商品',
'my_trade_view_all' => '查看所有交易单',
'my_trade_view_allthread' => '查看所有商品',
'my_trade_view_thread' => '出售中的商品',
'my_trade_success_count' => '销售总数',
'my_trade_success_amount' => '销售总额',
'my_trade_noexist_buy' => '目前没有成功买入的交易。',
'my_trade_noexist_sell' => '目前没有成功卖出的交易。',
'my_trade_need_attend_buy' => '您有 $buyerattend 个交易需要关注',
'my_trade_need_attend_sell' => '您有 $sellerattend 个交易需要关注',
'my_trade_buyer_info' => '买家提醒区',
'my_trade_seller_info' => '卖家提醒区',
'my_trade_buyer_trading' => '您有 $goodsbuyer 个正在进行中的交易',
'my_trade_seller_trading' => '您有 $goodsseller 个正在出售中的商品',
'my_trade_include' => '包括如下内容',
'my_trade_include_1' => '个交易,等待您付款',
'my_trade_include_5' => '个交易,卖家已发货,等待您确认收货',
'my_trade_include_11' => '个交易,卖家拒绝您的条件,等待您确认意见',
'my_trade_include_12' => '个交易,卖家同意退款,等待您退货',
'my_trade_include_2' => '个交易,等待您确认',
'my_trade_include_4' => '个交易,买家已付款,等待您发货',
'my_trade_include_10' => '个交易申请退款',
'my_trade_include_13' => '个交易,等待您接收退货',
'my_trade_need_buyer_eccredit' => '您有 $eccreditbuyer 个需要评价的交易',
'my_trade_need_seller_eccredit' => '您有 $eccreditseller 个需要评价的交易',
'my_trade_buyer_total' => '买入商品总数',
'my_trade_buyer_sum' => '买入成交总额',
'my_trade_seller_total' => '售出商品总数',
'my_trade_seller_sum' => '销售成交总额',
'my_trade_more' => '更多',
'my_favorite' => '我的收藏',
'my_threads' => '我的主题',
'my_threads_last_five' => '最近的五条主题',
'my_replys' => '我的回复',
'my_replys_last_five' => '最近的五条回复',
'my_rewards' => '我的悬赏',
'my_reward_questions' => '我的问题',
'my_reward_answers' => '我的回答',
'my_reward_stat' => '悬赏统计',
'my_reward_nonexistence' => '目前没有悬赏记录。',
'my_favorite_forums' => '收藏的版块',
'my_favorite_threads' => '收藏的主题',
'my_subscription_threads' => '订阅的主题',
'my_activity_orig' => '发起的活动',
'my_activity_apply' => '申请的活动',
'my_activity_nonexistence' => '目前没有活动记录。',
'my_debate' => '我的辩论',
'my_debate_orig' => '我发起的辩论',
'my_debate_apply' => '我参与的辩论',
'my_poll' => '我的投票',
'my_poll_orig' => '我发起的投票',
'my_poll_apply' => '我参与的投票',
'my_video' => '我的视频',
'forums_navigation' => '论坛导航',
'getpassword' => '重置密码',
'lostpassword' => '忘记密码',
'index_status' => '头衔',
'index_threads' => '主题',
'index_posts' => '帖子',
'index_today' => '今日',
'index_yesterday' => '昨日',
'index_maxday' => '最高日',
'index_activeusers' => '在线用户',
'index_members' => '会员',
'index_invisibles' => '隐身',
'index_guests' => '位游客',
'index_mostonlines' => '最高记录是',
'index_users' => '人',
'show_newthreads' => '查看新帖',
'show_mytopics' => '我的话题',
'mark_read' => '标记已读',
'welcome_newmember' => '欢迎新会员',
'index_announcements' => '公告',
'index_noannouncement' => '到目前为止没有论坛公告',
'forum_name' => '版块',
'forum_threads' => '主题',
'forum_posts' => '帖数',
'forum_todayposts' => '今日',
'forum_lastpost' => '最后发表',
'forum_lastpost_in' => '标题',
'forum_lastpost_by' => 'by',
'forum_moderators' => '版主',
'forum_newposts' => '有新帖的版块',
'forum_nonewpost' => '无新帖的版块',
'forum_subforums' => '子版块',
'board_links' => '联盟论坛',
'todays_birthdays' => '今日生日',
'todays_birthdays_none' => '今天没有过生日的用户',
'todays_birthdays_members' => '今日生日会员列表',
'private_forum' => '私密版块',
'member_login' => '会员登录',
'member_logout' => '退出登录',
'credits_policy' => '积分策略说明',
'credits_policy_view' => '查看积分策略说明',
'credits_policy_post' => '发新主题',
'credits_policy_forum_post' => '本版发新主题',
'credits_policy_reply' => '发表回复',
'credits_policy_forum_reply' => '本版发表回复',
'credits_policy_digest' => '加入精华',
'credits_policy_forum_digest' => '本版加入精华',
'credits_policy_postattach' => '发表附件',
'credits_policy_forum_postattach' => '本版发表附件',
'credits_policy_getattach' => '下载附件',
'credits_policy_forum_getattach' => '本版下载附件',
'credits_policy_pm' => '发短消息',
'credits_policy_search' => '搜索',
'credits_policy_promotion_visit' => '访问推广',
'credits_policy_promotion_register' => '注册推广',
'credits_policy_lowerlimit' => '积分下限',
'credits_policy_lowerlimit_comment' => '当您该项积分低于此下限设置的数值时,将无法执行积分策略中涉及扣减此项积分的操作',
'credits_policy_formula' => '总积分计算公式',
'credits_policy_trade' => '成功交易',
'credits_policy_poll' => '参与投票',
'credits_now' => '当前积分',
'credit_exchange' => '换',
'credit_pre_account' => '预算',
'credit_taxed' => '税后可得',
'credit_promotion' => '积分推广可以根据管理员设置的积分规则,通过访问相应连接获得积分',
'credit_promotion_visit' => '访问者通过用户提供的推广链接访问论坛,将获得',
'credit_promotion_register' => '访问者通过用户提供的推广链接访问论坛并注册新会员,将获得',
'login_permanent' => '永久',
'login_one_month' => '一个月',
'login_one_day' => '一天',
'login_one_hour' => '一小时',
'login_this_task' => '浏览器进程',
'login_related_faq' => '相关帮助',
'login_invisible' => '隐身登录',
'login_normal_mode' => '正常模式',
'login_switch_invisible_mode' => '切换到隐身模式',
'login_switch_normal_mode' => '切换到正常模式',
'login_invisible_mode' => '隐身模式',
'login_cookie_time' => '登录有效期',
'login_secques' => '请选择您设置的安全提问,并回答正确后才能登录。',
'login_secques_comment' => '如果您设置了安全提问,请回答正确的答案',
'login_timeoffset' => '注意:\n\n您本地计算机的时间设定与论坛时间相差超过 24 个小时,\n这可能会影响您的正常登录,请调整本地计算机设置。\n\n当前论坛时间是: $thetimenow\n如果您认为论坛时间不准确,请与论坛管理员联系。',
'security_question' => '安全提问',
'security_answer' => '回答',
'security_question_0' => '无安全提问',
'security_question_1' => '母亲的名字',
'security_question_2' => '爷爷的名字',
'security_question_3' => '父亲出生的城市',
'security_question_4' => '您其中一位老师的名字',
'security_question_5' => '您个人计算机的型号',
'security_question_6' => '您最喜欢的餐馆名称',
'security_question_7' => '驾驶执照的最后四位数字',
'member_list' => '会员列表',
'group_expiry' => '用户组有效期',
'group_expiry_time' => '到期时间',
'group_expiry_type' => '类型',
'group_expiry_type_main' => '主用户组',
'group_expiry_type_ext' => '扩展用户组',
'group_expiry_comment' => '<ul><li>此处仅列出具有有效期限制的用户组列表,详细的用户组归属关系请到控制面板的“公众用户组”中设定和查看。<li>如果用户组名称被删除线覆盖,说明此用户组已经过期,即日起您将不拥有该组的任何权限。',
'memcp_welcome' => '您好 $discuz_userss ,欢迎进入控制面板,这里提供相关的资料设定与论坛快捷功能等。',
'memcp_home' => '控制面板首页',
'memcp_info' => '帐号信息',
'memcp_email_reverify' => '重新验证 Email 有效性',
'memcp_validating' => '账户审核',
'memcp_validating_info' => '管理员设置了新注册用户需要人工验证,您的帐号已提交过 <strong>$validating[submittimes]</strong> 次验证请求,目前尚未通过验证。',
'memcp_validating_status' => '当前状态',
'memcp_validating_status_0' => '等待管理人员进行审核',
'memcp_validating_status_1' => '审核被拒绝,您可以修改注册原因后再次提交',
'memcp_validating_admin' => '审核管理员',
'memcp_validating_time' => '审核时间',
'memcp_validating_remark' => '管理员给您的留言',
'memcp_last_5_pm' => '最近的五条短消息',
'memcp_nopm' => '目前收件箱中没有消息。',
'memcp_last_5_creditslog' => '最近的五条转账与兑换记录',
'memcp_nosubs' => '目前没有被订阅的主题。',
'memcp_nofavs' => '目前没有被收藏的主题或版块。',
'memcp_avatar_list' => '论坛头像列表',
'memcp_profile' => '编辑个人资料',
'memcp_profile_preview' => '预览',
'memcp_nocustomizebbcode' => '不支持自定义 Discuz! 代码',
'memcp_profile_type_1' => '论坛登录',
'memcp_profile_type_2' => '基本资料',
'memcp_profile_type_3' => '扩展资料',
'memcp_profile_type_4' => '个性化资料',
'memcp_profile_type_5' => '论坛选项',
'memcp_profile_old_passwd_comment' => '如不需要更改密码或 Email 或安全提问,此处请留空',
'memcp_profile_passwd_comment' => '如不需要更改密码,此处请留空',
'memcp_profile_email_comment' => '!如更改地址,系统将修改您的密码并重新验证其有效性,请慎用',
'memcp_profile_security_keep' => '保持原有的安全提问和答案',
'memcp_profile_security_comment' => '如果您启用安全提问,登录时需填入相应的项目才能登录',
'memcp_profile_security_answer_comment' => '如您设置新的安全提问,请在此输入答案',
'memcp_profile_unchangeable_comment' => '请认真填写本项目,一旦确定将不可修改',
'memcp_profile_sig_toolong' => '您的签名长度超过 $maxsigsize 字符的限制,请返回修改。',
'memcp_profile_bio_toolong' => '您的自我介绍长度超过 $maxbiosize 字符的限制,请返回修改。',
'memcp_profile_biotrade_toolong' => '您的店铺介绍长度超过 $maxbiotradesize 字符的限制,请返回修改。',
'memcp_credits' => '积分交易',
'memcp_credits_currently' => '当前积分',
'memcp_credits_income' => '接收者收入',
'memcp_credits_confirm' => '积分操作不能恢复,您确认吗?',
'memcp_credits_transfer' => '积分转账',
'memcp_credits_transfer_message' => '附言',
'memcp_credits_transfer_message_comment' => '如果输入附言,系统将自动向接收者发送短消息通知',
'memcp_credits_transfer_comment' => '<ul><li>积分转账可以根据论坛管理员设置的交易积分,将您的积分转让给其他用户。<li>接收者收到积分的实际数值,是被扣除交易税后计算出来的,即只要进行积分交易,就可能会产生交易损失。<li>积分交易一旦提交不可恢复,请确定无误后再进行操作。',
'memcp_credits_transfer_caculate' => '接收者的所得为',
'memcp_credits_transfer_send' => '积分转出',
'memcp_credits_transfer_receive' => '积分转入',
'memcp_credits_transfer_bank' => '银行现金转入',
'memcp_credits_transfer_min_balance' => '转账最低余额',
'memcp_credits_exchange' => '积分兑换',
'memcp_credits_exchange_amount' => '积分数量',
'memcp_credits_exchange_source' => '原积分',
'memcp_credits_exchange_target' => '目标积分',
'memcp_credits_exchange_ratio' => '兑换比率',
'memcp_credits_exchange_comment' => '<ul><li>积分兑换是根据论坛管理员设置的可兑换积分,将您自己的某种积分,兑换成另外一种积分。<li>兑换比率为该项积分对应一个单位标准积分的值。例如兑换比率为 2 的积分 1 分,相当于兑换比率为 1 的积分 2 分,即兑换比率越大,该项积分越有价值。<li>兑换成目标积分的实际数值,是按照兑换比率折算的目标积分,并扣除交易税后计算出来的,即只要进行积分交易,就可能会产生交易损失。<li>积分交易一旦提交不可恢复,请确定无误后再进行操作。',
'memcp_credits_exchange_caculate' => '兑换后所得目标积分为',
'memcp_credits_exchange_min_balance' => '兑换最低余额',
'memcp_credits_addfunds' => '积分充值',
'memcp_credits_addfunds_rules' => '充值规则',
'memcp_credits_addfunds_rules_ratio' => '人民币现金 <strong>1</strong>个',
'memcp_credits_addfunds_rules_min' => '单次最低充值',
'memcp_credits_addfunds_rules_max' => '单次最高充值',
'memcp_credits_addfunds_rules_month' => '最近 30 天最高充值',
'memcp_credits_addfunds_comment' => '您可以以人民币现金在线支付的形式,为您的交易积分账户充值用于购买帖子、用户组权限或其他虚拟消费活动。<br />积分充值不能撤销或退款,因此请您在充值前确定是否需要,及仔细核对充值的金额。<br /><strong>您成功支付后有系统可能需要几分钟的时间等待支付结果,因此可能无法瞬间入账,请注意查收系统发送的短消息。如果超过 48 小时仍未收到通知短消息,请与论坛管理员联系。</strong>',
'memcp_credits_addfunds_amount' => '账户充值数额',
'memcp_credits_addfunds_caculate' => '您需要在线支付的金额为',
'memcp_credits_addfunds_caculate_radio' => '人民币<span id="desamount">0</span>个',
'memcp_credits_log' => '积分记录',
'memcp_credits_log_transaction' => '转账与兑换记录',
'memcp_credits_log_transaction_fromto' => '来自/到',
'memcp_credits_log_transaction_outgo' => '支出',
'memcp_credits_log_transaction_income' => '收入',
'memcp_credits_log_payment' => '主题付费记录',
'memcp_credits_log_payment_dateline' => '付费时间',
'memcp_credits_log_payment_refunded' => '已退款',
'memcp_credits_log_income' => '主题收益记录',
'memcp_credits_log_income_buyer' => '购买者',
'memcp_credits_log_none' => '目前没有积分交易记录。',
'memcp_credits_info' => '积分概况',
'memcp_reward_log_payment' => '悬赏付费记录',
'memcp_reward_log_payment_answerer' => '回答者',
'memcp_reward_log_income' => '悬赏收益记录',
'memcp_reward_log_income_author' => '提问者',
'memcp_reward_log_none' => '目前没有悬赏交易记录。',
'memcp_reward_total' => '悬赏总额',
'memcp_reward_fact' => '实际付费',
'memcp_usergroups' => '公众用户组',
'memcp_usergroups_charged' => '公众用户组收费',
'memcp_usergroups_title' => '用户组头衔',
'memcp_usergroups_dailyprice' => '日价格',
'memcp_usergroups_minspan' => '最短购买时间',
'memcp_usergroups_expiry' => '到期时间',
'memcp_usergroups_join' => '加入',
'memcp_usergroups_join_ext' => '扩展用户组',
'memcp_usergroups_join_main' => '主用户组',
'memcp_usergroups_join_comment' => '您至少需要支付{$extcredits[$creditstrans][title]} $group[minamount] {$extcredits[$creditstrans][unit]}以获取 $group[minspan] 天的本用户组权限,不设上限。购买后不能退款,请付费前仔细确定是否加入本组。',
'memcp_usergroups_exit' => '退出',
'memcp_usergroups_exit_comment' => '本操作不可恢复,您退出收费公众用户组后,如需再次加入,将重新支付相应的费用,因此请在提交前仔细确定是否退出本组。',
'memcp_usergroups_comment' => '<ul><li><strong><i>粗斜体显示的用户组</i></strong>为您已经加入,但并非公众类型的用户组,如果退出,将无法再加入该组,而只能由管理员通过系统设置修改。<li><u>下划线显示的用户组</u>不具有切换用户组的权限,因此您一旦设置其为主用户组,将失去加入或离开公众用户组的权限,请务必慎用!<li>日价格为 0 的用户组为免费公众用户组,您可以自由加入或退出;日价格高于 0 的用户组为收费公众用户组,您需要支付相应的交易积分才能加入。<li>加入收费公众用户组的最低花费为: 日价格*最短购买时间。如果您希望将收费公众用户组设置为主用户组,请先将该收费用户组加为扩展用户组,之后再设置成为主用户组。',
'memcp_usergroups_days' => '天',
'memcp_usergroups_span' => '购买时间',
'memcp_nogroups' => '目前没有可加入的公众用户组。',
'memcp_subscriptions' => '订阅列表',
'memcp_favorites' => '收藏夹',
'memcp_rate_log' => '评分记录',
'memcp_novideo' => '目前没有发表的视频',
'reportpost' => '报告',
'reportpost_to' => '报告给',
'reportpost_suggestion' => '我的意见',
'reportpost_reason' => '我对这个帖子有异议,特向您报告',
'search_keywords' => '关键字',
'search_keywords_comment' => '关键字中可使用通配符 "<strong>*</strong>"<br />匹配多个关键字全部,可用<strong>空格</strong>或 "<strong>AND</strong>" 连接。如 win32 <strong>AND</strong> unix<br />匹配多个关键字其中部分,可用 "<strong>|</strong>" 或 "<strong>OR</strong>" 连接。如 win32 <strong>OR</strong> unix',
'search_username_comment' => '用户名中可使用通配符 "<strong>*</strong>",如 <strong>*user*</strong>',
'search_range' => '搜索范围',
'search_orderby' => '排序类型',
'search_all_forums' => '搜索所有开放的版块',
'search_qihoo' => '奇虎全文',
'search_title' => '标题搜索',
'search_fulltext' => '全文搜索',
'search_blog' => '搜索文集',
'search_trade' => '搜索商品',
'search_tradetype' => '商品类别',
'search_any_date' => '全部时间',
'search_option' => '搜索选项',
'search_mode' => '搜索方式',
'search_thread_range' => '主题范围',
'search_thread_range_all' => '全部主题',
'search_thread_range_digest' => '精华主题',
'search_thread_range_top' => '置顶主题',
'search_time' => '搜索时间',
'search_threadtype' => '搜索更多{$forum[threadtypes][types][$typeid]}分类信息',
'search_info' => '搜索分类信息',
'search_info_more' => '搜索更多分类信息',
'1_days_ago' => '1 天',
'2_days_ago' => '2 天',
'7_days_ago' => '1 周',
'30_days_ago' => '1 个月',
'90_days_ago' => '3 个月',
'180_days_ago' => '6 个月',
'356_days_ago' => '1 年',
'search_newer' => '以内',
'search_older' => '以前',
'search_nomatch' => '对不起,没有找到匹配结果。',
'qihoo_hot_searches' => '热门搜索',
'qihoo_topics' => '论坛专题',
'qihoo_custom_topics' => '用户专题',
'qihoo_keyword' => '输入关键词,快速搜索本论坛',
'qihoo_search_filltext' => '全文',
'qihoo_search_title' => '标题',
'qihoo_search_author' => '作者',
'qihoo_relatedthreads' => '相关主题',
'qihoo_topic_powered_by' => '本功能由奇虎提供',
'qihoo_topic_nothreads' => '目前没有与专题相关的帖子。',
'qihoo_search' => '奇虎',
'qihoo_afford' => '本功能由奇虎搜索实现',
'qihoo_webthread' => '站外',
'qihoo_relateword' => '点击阅读更多关于<span class="posttags">{$relatedkeywords}</span>的相关帖子',
'message_forward' => '如果您的浏览器没有自动跳转,请点击这里',
'message_go_back' => '[ 点击这里返回上一页 ]',
'stats' => '论坛统计',
'stats_options' => '统计选项',
'stats_rank' => '排行榜',
'stats_main' => '基本概况',
'stats_views' => '流量统计',
'stats_week' => '星期流量',
'stats_hour' => '时段流量',
'stats_agent' => '客户软件',
'stats_posthist' => '发帖量记录',
'stats_forums_rank' => '版块排行',
'stats_threads_rank' => '主题排行',
'stats_posts_rank' => '发帖排行',
'stats_credits_rank' => '积分排行',
'stats_trade_rank' => '交易排行',
'stats_onlinetime' => '在线时间',
'stats_team' => '管理团队',
'stats_modworks' => '管理统计',
'stats_main_member' => '会员统计',
'stats_main_members' => '注册会员',
'stats_main_admins' => '管理成员',
'stats_main_new' => '新会员',
'stats_main_topposter' => '今日论坛之星',
'stats_main_total_posted' => '发帖数',
'stats_main_posters' => '发帖会员',
'stats_main_nonposters' => '未发帖会员',
'stats_main_posters_percent' => '发帖会员占总数',
'stats_main_posts_avg' => '平均每人发帖数',
'stats_main_members_count' => '最近 24 小时新增会员数',
'stats_main_forums_count' => '版块数',
'stats_main_threads_count' => '主题数',
'stats_main_posts_count' => '帖子数',
'stats_main_rpt' => '平均每个主题被回复次数',
'stats_main_nppd' => '平均每日新增帖子数',
'stats_main_nmpd' => '平均每日注册会员数',
'stats_main_todays_newposts' => '最近 24 小时新增帖子数',
'stats_main_hot_forum' => '最热门的版块',
'stats_main_board_activity' => '论坛活跃指数',
'stats_main_pageview' => '流量概况',
'stats_main_total_pageview' => '总页面流量',
'stats_main_total_pageview_month' => '月份总页面流量',
'stats_main_total_pageview_time' => '时段总页面流量',
'stats_main_person_time' => '人次',
'stats_main_total_visitors' => '共计来访',
'stats_main_pv_avg' => '平均每人浏览',
'stats_main_maxpv_month' => '访问量最多的月份',
'stats_main_period_of_time' => '时段',
'stats_main_month' => '月份流量',
'stats_topics' => '主题',
'stats_posts' => '发帖',
'stats_digest_posts' => '精华帖',
'stats_posts_thismonth' => '最近 30 天发帖',
'stats_posts_today' => '最近 24 小时发帖',
'stats_os' => '操作系统',
'stats_browser' => '浏览器',
'stats_month_posts' => '每月新增帖子记录',
'stats_day_posts' => '每日新增帖子记录',
'stats_threads_most_views' => '被浏览最多的主题',
'stats_threads_most_replies' => '被回复最多的主题',
'stats_onlinetime_total' => '总在线时间排行(小时)',
'stats_onlinetime_thismonth' => '本月在线时间排行(小时)',
'stats_team_admins' => '管理员和超级版主',
'stats_team_offdays' => '离开天数',
'stats_modworks_month' => '月份',
'stats_modworks_thismonth' => '本月管理',
'stats_modworks_all' => '全体管理人员',
'stats_modworks_details' => '查看详细管理统计',
'stats_update' => '统计数据已被缓存,上次于 $lastupdate 被更新,下次将于 $nextupdate 进行更新',
'admin_modoptions' => '管理选项',
'admin_moderate' => '批量管理选项',
'admin_reason' => '操作原因',
'admin_reason_required' => '您必须输入理由才能进行操作',
'admin_reason_custom' => '请在这里输入您的理由',
'admin_pm' => '发短消息通知作者',
'admin_next' => '后续操作',
'in_thread' => '所在主题',
'admin_bump' => '提升主题',
'admin_down' => '下沉主题',
'admin_bump_down' => '提升/下沉主题',
'admin_stick' => '主题置顶',
'admin_unstick' => '解除置顶',
'admin_stick_unstick' => '置顶/解除置顶',
'admin_split' => '分割主题',
'admin_split_newsubject' => '新主题的标题',
'admin_open' => '打开主题',
'admin_close' => '关闭主题',
'admin_banpost' => '屏蔽帖子',
'admin_unbanpost' => '解除屏蔽',
'admin_repair' => '修复主题',
'admin_openclose' => '关闭/打开主题',
'admin_move' => '移动主题',
'admin_copy' => '复制主题',
'admin_type' => '主题分类',
'admin_supe_push' => '推送/解除',
'admin_supe_push_addremove' => '推送/解除推送',
'admin_type_more' => '更多分类',
'admin_highlight' => '高亮显示',
'admin_move_target' => '目标版块/分区',
'admin_move_type' => '移动方式',
'admin_move_redirect' => '移动主题并在原来的版块中保留转向',
'admin_merge' => '合并主题',
'admin_merge_tid' => '主题 tid',
'admin_merge_tid_comment' => '即将与这个主题合并的 tid,如 viewthread.php?tid=48,tid 为 48',
'admin_getip' => '查看 IP',
'admin_getip_this' => '此用户的 IP 地址是',
'admin_ban_this_ip' => '禁止此 IP',
'admin_highlight_style' => '字体样式',
'admin_highlight_color' => '字体颜色',
'admin_highlight_bold' => '粗体',
'admin_highlight_italic' => '斜体',
'admin_highlight_underline' => '下划线',
'admin_digest' => '设置精华',
'admin_digest_add' => '加入精华',
'admin_digest_remove' => '解除精华',
'admin_digest_addremove' => '加入/解除精华',
'admin_delposts' => '删除选定帖子',
'admin_delthread' => '删除主题',
'admin_delete_keep_author_credits' => '不减主题作者积分',
'admin_delete_keep_replier_credits' => '不减回复者积分',
'admin_delpost' => '删除回帖',
'admin_refund' => '强制退款',
'admin_remove_reward' => '取消悬赏',
'admin_recommend' => '推荐主题',
'admin_unrecommend' => '解除推荐',
'admin_recommend_day' => '一天',
'admin_recommend_day_three' => '三天',
'admin_recommend_day_five' => '五天',
'admin_recommend_week' => '一周',
'admin_recommend_month' => '一月',
'admin_recommend_month_three' => '三月',
'admin_recommend_month_six' => '六月',
'admin_recommend_year' => '一年',
'whosonline' => '在线用户',
'online_only_guests' => '当前只有游客或隐身会员在线',
'online_action' => '当前动作',
'online_in_forum' => '所在版块',
'online_in_thread' => '所在主题',
'online_ip' => 'IP 地址',
'post_percent' => '占全部帖子的',
'posts_per_day' => '平均每日发帖',
'personal_info' => '个人信息',
'somebodys_profile' => '$member[username] 的个人资料',
'add_to_buddylist' => '加为好友',
'search_posts' => '搜索帖子',
'edit_member' => '编辑用户',
'moderations' => '工作统计',
'valid_before' => '有效期至',
'pageviews' => '页面访问量',
'onlinetime' => '在线时间',
'onlinetime_upgrade' => '升级剩余时间 <span class="bold">$member[olupgrade]</span> 小时',
'onlinetime_total' => '总计在线',
'onlinetime_thismonth' => '本月在线',
'last_thread' => '上一主题',
'next_thread' => '下一主题',
'disable_highlight' => '取消高亮',
'unregistered' => '未注册',
'member_deleted' => '该用户已被删除',
'member_anonymous' => '该用户匿名发帖',
'member_viewpro' => '查看详细资料',
'member_homepage' => '查看个人网站',
'regtime' => '注册',
'online_status' => '状态',
'payto_author' => '用支付宝求购',
'payto_creditinfo' => '支付宝账户信用信息',
'attach_nopermission' => '您所在的用户组无法下载或查看附件',
'attach_download_count' => '该附件被下载次数',
'attach_img' => '图片附件',
'attach_pay' => '收费附件',
'image_thumb' => '点击在新窗口查看全图',
'view_profile' => '资料',
'visit_home' => '主页',
'send_pm' => '发短消息',
'edit_post' => '编辑帖子',
'reply_quote' => '引用',
'report_to_moderator' => '向版主反映这个帖子',
'rate' => '评分',
'removerate' => '撤销评分',
'rate_quota_today' => '今日还能评分 $maxratetoday[$id] {$extcredits[$id][unit]}',
'rate_this_post' => '给本帖评分',
'rate_view' => '查看评分记录',
'rate_view_post' => '原帖内容',
'pay' => '购买主题',
'pay_comment' => '本主题需向作者支付相应积分才能浏览',
'pay_buyers' => '已购买人数',
'pay_author_income' => '作者所得',
'pay_balance' => '购买后余额',
'pay_max_income' => '作者最高收入',
'pay_free_time' => '本主题购买截止日期为 $thread[endtime],到期后将免费',
'pay_free_message' => '免费信息',
'pay_replies' => '最新若干回复',
'pay_view' => '记录',
'pay_nobuyers' => '目前没有用户购买此主题。',
'pay_noreplies' => '目前尚无回复。',
'week_sun' => '日',
'week_mon' => '一',
'week_tues' => '二',
'week_wed' => '三',
'week_thurs' => '四',
'week_fri' => '五',
'week_sat' => '六',
'blog' => '文集',
'blog_new' => '发表文章',
'blog_add' => '加入文集',
'blog_remove' => '从文集移除',
'blog_add_remove' => '加入/移除文集',
'blog_search' => '搜索文集',
'blog_category' => '栏目',
'blog_home' => '文集首页',
'blog_comments' => '评论',
'blog_categories' => '栏目分类',
'blog_hot' => '最热的 5 篇文章',
'blog_post_comment' => '发表评论',
'blog_nonexistence' => '指定的时间范围内没有文章。',
'blog_closed' => '本文章已关闭或您没有权限发表评论。',
'blog_myblog' => '文集',
'pm_new_youhave' => '您有',
'pm_close' => '关闭',
'pm_new' => '<span id="newpmnum">$newpmnum</span> 条新短消息',
'pm_newannounce' => '$announcepm 条公共消息',
'pm_new_detail' => '[查看详情]',
'pm_new_ignore' => '[不再提示]',
'pm_unread' => '未读',
'pm_folders' => '文件夹',
'pm_shortcut' => '快捷方式',
'pm_send' => '发送短消息',
'pm_send_save_outbox' => '不发送,只保存到草稿箱中',
'pm_search' => '搜索短消息',
'pm_search_username' => '发信人或收信人',
'pm_search_username_comment' => '发信人或收信人用户名中可使用通配符 "*",如 *user*',
'pm_search_read' => '已读短消息',
'pm_search_unread' => '未读短消息',
'pm_search_orderby_dateline' => '按收发时间',
'pm_search_orderby_from' => '按收发信人名',
'pm_systemmessage' => '系统消息',
'pm_inbox' => '收件箱',
'pm_outbox' => '草稿箱',
'pm_track' => '已发送',
'pm_data_usage' => '空间使用',
'pm_total' => '共有短消息',
'pm_storage' => '短消息上限',
'pm_orig_message' => '原始短消息',
'pm_to_buddy' => '好友群发',
'pm_archive' => '导出短消息',
'pm_archive_delete' => '导出后删除短消息',
'pm_archive_folder' => '文件夹',
'pm_archive_from' => '时间范围',
'pm_archive_from_1_days' => '1 天',
'pm_archive_from_2_days' => '2 天',
'pm_archive_from_7_days' => '1 周',
'pm_archive_from_30_days' => '1 个月',
'pm_archive_from_90_days' => '3 个月',
'pm_archive_from_180_days' => '6 个月',
'pm_archive_from_365_days' => '1 年',
'pm_archive_from_newer' => '以来',
'pm_archive_from_older' => '以前',
'pm_archive_amount' => '导出短消息数量',
'pm_ignore' => '忽略列表',
'pm_ignore_comment' => '添加到该列表中的用户给您发送短消息时将不予接收<br />添加多个忽略人员名单时用逗号 "<strong>,</strong>" 隔开(如:张三<strong>,</strong>李四<strong>,</strong>王五)<br />如需禁止所有用户发来的短消息,请设置为 "<strong>{{ALL}}</strong>"',
'pm_mark_unread' => '标记未读',
'pm_announce' => '公共消息',
'nopermission' => '您无权进行当前操作,这可能因以下原因之一造成',
'nopermission_no_loggedin' => '您还没有登录,请填写下面的登录表单后再尝试访问。',
'nopermission_loggedin' => '您已经登录,但您的帐号或其所在的用户组无权访问当前页面。',
'faq_search' => '搜索帮助',
'faq_search_title_and_content' => '搜索帮助标题和内容',
'faq_search_title' => '搜索帮助标题',
'faq_search_content' => '搜索帮助内容',
'faq_related' => '相关帮助',
'reward_thethread' => '悬赏价格',
'reward_solved' => '已解决',
'reward_unsolved' => '未解决',
'reward_bestanswer' => '最佳答案',
'reward_set_bestanswer' => '最佳答案',
'reward_solved_time' => '解决时间',
'reward_message' => '补充资料',
'reward_solver' => '回答者',
'reward_set_bestanswer_confirm' => '您确认要把该回复选为“最佳答案”吗?',
'supe_target_forum' => '目标版块',
'supe_import_forum' => '从个人空间导入论坛',
'supe_thread_already_been_join_to_xspace' => '本帖已经被作者加入个人空间',
'supe_view_in_xspace' => '在个人空间查看',
'supe_register_xspace' => '升级个人空间',
'supe_join_xspace' => '加入个人空间',
'supe_pls_choose_forum_you_want' => '请选择您要导入的论坛!',
'supe_choose_forum' => '请选择论坛',
'supe_myxspace' => '个人空间',
'supe_signin_xspace' => '开通个人空间',
'supe_confirm' => '确定',
'supe_dialog_box' => '信息提示',
'supe_message' => '信息提示',
'supe_resource_add' => '加入资讯',
'trade_goods_info' => '商品信息',
'editor_mode_all' => '全部功能',
'editor_mode_simple' => '简单功能',
'editor_mode' => '编辑器模式',
'editor_mode_wysiwyg' => '所见即所得模式',
'editor_mode_discuzcode' => 'Discuz! 代码模式',
'permission_menu_usergroup' => '用户组',
'permission_group_search' => '用户组权限查询',
'permission_mypermission' => '我的权限',
'permission_member_group' => '会员用户组',
'permission_system_group' => '系统用户组',
'permission_special_group' => '特殊用户组',
'permission_member_level' => '用户级别',
'permission_menu_modoptions' => '管理权限',
'permission_modoptions_name' => '管理权限',
'permission_modoptions_allfourm' => '全论坛管理',
'permission_modoptions_partforum' => '部分版块管理',
'permission_modoptions_edit_post' => '允许编辑帖子',
'permission_modoptions_edit_poll' => '允许编辑投票',
'permission_modoptions_edit_stick' => '允许置顶帖子',
'permission_modoptions_edit_stick_1' => '允许置顶 I',
'permission_modoptions_edit_stick_2' => '允许置顶 I/II',
'permission_modoptions_edit_stick_3' => '允许置顶 I/II/III',
'permission_modoptions_audit_post' => '允许审核帖子',
'permission_modoptions_delete_post' => '允许删除帖子',
'permission_modoptions_delete_postlist' => '允许批量删帖',
'permission_modoptions_filter' => '允许过滤词语',
'permission_modoptions_show_ip' => '允许查看 IP',
'permission_modoptions_ban_ip' => '允许禁止 IP',
'permission_modoptions_edit_member' => '允许编辑用户',
'permission_modoptions_ban_member' => '允许禁止用户',
'permission_modoptions_audit_member' => '允许审核用户',
'permission_modoptions_add_announcements' => '允许发布公告',
'permission_modoptions_check_log' => '允许查看记录',
'permission_modoptions_post_nopermission' => '发帖不受限制',
'permission_modoptions_pushthread' => '允许收录主题',
'permission_menu_basic' => '基本权限',
'permission_basic_fourm' => '允许访问论坛',
'permission_basic_read' => '阅读权限',
'permission_basic_memberinfo' => '允许查看用户资料',
'permission_basic_invisible' => '允许隐身',
'permission_basic_search' => '允许使用搜索',
'permission_basic_disable_sarch' => '禁用搜索',
'permission_basic_search_title' => '只允许搜索标题',
'permission_basic_search_content' => '允许搜索帖子内容',
'permission_basic_face' => '允许使用头像',
'permission_basic_disable_face' => '禁用头像',
'permission_basic_forum_face' => '允许使用论坛头像',
'permission_basic_custom_face' => '允许自定义头像',
'permission_basic_blog' => '允许使用文集',
'permission_basic_nickname' => '允许使用昵称',
'permission_basic_status' => '允许自定义头衔',
'permission_basic_pm_storage' => '短消息收件箱容量',
'permission_menu_post' => '帖子相关',
'permission_post_new' => '允许发新话题',
'permission_post_replay' => '允许发表回复',
'permission_post_poll' => '允许发起投票',
'permission_post_poll_join' => '允许参与投票',
'permission_post_discuzcode' => '允许签名中使用 Discuz! 代码',
'permission_post_img' => '允许签名中使用 [img] 代码',
'permission_post_max_signature' => '最大签名长度',
'permission_post_discuzcode_bio' => '允许自我介绍中使用 Discuz! 代码',
'permission_post_img_bio' => '允许自我介绍中使用 [img] 代码',
'permission_post_max_bio' => '自我介绍最大长度',
'permission_menu_attachment' => '附件相关',
'permission_attachment_down_show' => '允许下载/查看附件',
'permission_attachment_add' => '允许发布附件',
'permission_attachment_set' => '允许设置附件权限',
'permission_attachment_maxlen' => '最大附件尺寸',
'permission_attachment_maxsize' => '每天最大附件总尺寸',
'permission_attachment_nopermission' => '没有限制',
'permission_attachment_type' => '允许附件类型',
'memcp_profile_signature_conf' => '签名显示设置',
'memcp_profile_signature' => '显示签名',
'memcp_profile_nosignature' => '不显示签名',
'memcp_profile_avatar_conf' => '头像显示设置',
'memcp_profile_avatar' => '显示头像',
'memcp_profile_noavatar' => '不显示头像',
'memcp_profile_image_conf' => '图片显示设置',
'memcp_profile_image_conf_comment' => '包括上传的附件图片和 [img] 代码图片',
'memcp_profile_image' => '显示图片',
'memcp_profile_noimage' => '不显示图片',
'memcp_profile_editor_mode' => '编辑器模式',
'memcp_profile_editor_mode_discuzcode' => 'Discuz! 代码模式',
'memcp_profile_editor_mode_wysiwyg' => '所见即所得模式',
'my_activities_all' => '全部活动',
'my_activities_noexpiration' => '未结束的活动',
'my_activities_expiration' => '已结束的活动',
'my_activities_mypost' => '我发起的活动',
'my_activities_stop_stauts' => '征集截止',
'my_activities_stop_stauts_yes' => '已截止',
'my_activities_stop_stauts_no' => '未截止',
'my_activities_join' => '我参与的活动',
'my_threads_close' => '关闭',
'my_reward_all_question' => '全部问题',
'my_reward_question_solved' => '已解决的问题',
'my_reward_question_unsolved' => '未解决的问题',
'my_reward_answer_adopted' => '被采纳的回答',
'my_reward_answer_unadopted' => '未采纳的回答',
'my_reward_answer' => '未采纳的回答',
'my_reward_question_number' => '提问总数',
'my_reward_unit' => '次',
'my_reward_question_solved_number' => '问题被解决',
'my_reward_question_solved_per' => '问题被解决率',
'my_reward_all_answer' => '全部回答',
'my_reward_question_price' => '问题付出',
'my_reward_answer_number' => '回答总数',
'my_reward_answer_adopted_number' => '回答被采纳',
'my_reward_answer_adopted_per' => '回答被采纳率',
'my_reward_anser_price' => '回答得分',
'my_reward_name' => '悬赏名称',
'my_reward_forum' => '所属版块',
'my_reward_answerer' => '回答者',
'my_reward_allprice' => '悬赏总额',
'my_reward_real_payment' => '实际支付',
'my_reward_solved' => '已解决',
'my_reward_unsolved' => '未解决',
'my_reward_questioner' => '提问者',
'my_reward_status' => '悬赏状态',
'my_reward_dateline' => '悬赏日期',
'my_reward_adopted' => '已采纳',
'my_reward_unadopted' => '未采纳',
'my_reward_nofind' => '不存在悬赏记录',
'my_threads_aduit' => '待审核',
'my_promotion_url' => '将下面任意一个链接发给您的朋友, 当您的朋友访问该链接的时候你的积分也会自动增加',
'my_buddylist' => '我的好友',
'my_buddylist_note' => '备注',
'my_buddylist_time' => '加入时间',
'special_author' => '发起人',
'post_trade_alipay_null' => '对不起,请输入支付宝账户。',
'post_trade_goodsname_null' => '对不起,请输入商品名称。',
'post_trade_price_null' => '对不起,请输入商品现价。',
'post_trade_addr_null' => '对不起,请输入商品所在地。',
'post_trade_costprice_is_number' => '对不起,商品原价必须为有效数字。',
'post_trade_price_is_number' => '对不起,商品现价必须为有效数字。',
'post_trade_amount_is_number' => '对不起,商品数量必须为数字。',
'post_activity_sort_null' => '对不起,请输入活动所属类别。',
'post_activity_fromtime_null' => '对不起,请输入活动开始时间。',
'post_activity_addr_null' => '对不起,请输入活动地点。',
'post_reward_credits_null' => '对不起,您输入悬赏积分。',
'post_my_advisit' => '我的推广',
'post_promotion_url1' => '推广连接1:',
'post_promotion_url2' => '推广连接2:',
'post_copied' => '帖子链接已经复制到剪贴板',
'auditstatuson' => '通过审核',
'poll_closed' => '已关闭',
'poll_finish' => '已结束',
'poll_submit_after' => '提交投票后结果才可见',
'poll_close' => '关闭投票',
'poll_max_options' => '最多可选项数',
'poll_show_order' => '显示顺序',
'poll_option_add' => '增加投票项',
'poll_show_voter' => '查看该项投票人',
'poll_subject' => '投票标题',
'poll_multiple' => '多选',
'poll_single' => '单选',
'poll_view_voters' => '[参与投票的会员]',
'poll_voters' => '参与投票的会员',
'poll_end' => '投票已经结束',
'poll_message' => '背景资料',
'poll_yourchoice' => '投票项目',
'poll_after_result' => '投票后结果可见',
'poll_nopermission' => '对不起,您无权投票。',
'poll_more_than' => '最多可选 $maxchoices 项',
'poll_days_valid' => '有效记票天数',
'poll_voterscount' => '参与人数',
'poll_count_down' => '距结束还有',
'poll_day' => '天',
'poll_hour' => '小时',
'poll_minute' => '分钟',
'tarde_price_bound' => '价格范围',
'trade_min_price' => '最小价格',
'trade_procedure_price' => '交易手续费',
'trade_price_exceed' => '超出价格范围',
'trade_goods_number' => '商品数目',
'trade_alipay_null' => '对不起,请输入支付宝账户。',
'trade_goodsname_null' => '对不起,请输入商品名称。',
'trade_price_null' => '对不起,请输入商品价格。',
'trade_addr_null' => '对不起,请输入商品所在地。',
'trade_price_sort' => '交易额排行',
'trade_totalprice' => '总金额',
'trace_number_sort' => '交易数排行',
'trace_sell_number' => '售出数量',
'trade_sellerinfo' => '卖家信息',
'trade_fullinfo' => '查看商品详情',
'trade_price' => '现价',
'trade_costprice' => '原价',
'trade_number' => '数量',
'trade_transport' => '运费',
'trade_locus' => '地点',
'trade_type_viewthread' => '商品类型',
'trade_goodsinfo' => '商品详情',
'special_tab_poll' => '相关回复',
'special_tab_reward' => '主题回复',
'special_tab_activity' => '主题回复',
'eccredit' => '信用评价',
'eccredit1' => '评价',
'eccredit_members' => '的信用评价',
'eccredit_buyerinfo' => '买家信用',
'eccredit_sellerinfo' => '卖家信用',
'eccredit_buyerpercent' => '买家好评率',
'eccredit_sellerpercent' => '卖家好评率',
'eccredit_offline' => '线下交易的评分不计入信用评价',
'eccredit_1week' => '最近1周',
'eccredit_1month' => '最近1个月',
'eccredit_6month' => '最近6个月',
'eccredit_6monthbefore' => '6个月前',
'eccredit_total' => '总计',
'eccredit_total' => '总计',
'eccredit_good' => '好评',
'eccredit_good_comment' => '(加1分)',
'eccredit_soso' => '中评',
'eccredit_soso_comment' => '(不加分)',
'eccredit_bad' => '差评',
'eccredit_bad_comment' => '(扣1分)',
'eccredit_explanation' => '解释',
'eccredit_s' => '的',
'eccredit_list_all' => '收到的所有评价',
'eccredit_list_buyer' => '来自买家的评价',
'eccredit_list_seller' => '来自卖家的评价',
'eccredit_list_other' => '给他人的评价',
'eccredit_content' => '评价内容',
'eccredit_goodsname_seller' => '宝贝名称/评价人',
'eccredit_tradeprice' => '成交价(个)',
'eccredit_nofound' => '没有找到相关评价!',
'eccredit_needexplanation' => '我要解释',
'eccredit_explanationexpiration' => '您可以在 $comment[expiration] 之前作出解释。',
'eccredit_post' => '发表评价',
'eccredit_retee' => '被评价人',
'eccredit_tradegoods' => '相关商品',
'eccredit_post_between' => '双方已评',
'eccredit_post_waiting' => '等待对方评价',
'eccredit_post_already' => '对方已评',
'activity_sort_null' => '对不起,请输入活动所属类别。',
'activity_fromtime_null' => '对不起,请输入活动开始时间。',
'activity_addr_null' => '对不起,请输入活动地点。',
'activity_city' => '所在城市',
'activity_specific_time' => '在一个确定的时间开始',
'activity_bound_time' => '在一个时间范围内商定',
'activity_description' => '活动说明',
'activity_join_list' => '已报名会员',
'activity_name' => '活动名称',
'activiy_sort' => '活动类别',
'activiy_linkman_input' => '请输入您的联系方式。',
'activiy_linkman_more' => '您的联系方式超过 200 个字符的限制。',
'activiy_guest_more' => '您的留言超过 200 个字符的限制。',
'activiy_linkman' => '联系方式:',
'activity_starttime' => '开始时间',
'activity_start_between' => '$activity[starttimefrom] 至 $activity[starttimeto] 商定',
'activity_space' => '活动地点',
'activity_payment' => '活动花销',
'activity_confirm_status' => '批准状态',
'activity_confirm_status_yes' => '已批准',
'activity_confirm_status_no' => '未批准',
'activity_about_payment' => '每人大约 $activity[cost] 个',
'activity_about_member' => '剩余名额',
'activity_already' => '已报名人数',
'activity_member_unit' => '人',
'activity_totime' => '征集截止日期',
'activity_wait' => '您的加入申请已发出,请等待发起者的审批',
'activity_paytype' => '支付方式',
'activity_pay_myself' => '我愿意承担自己的那部分花销',
'activity_would_payment' => '我愿意在此次活动花销中支付',
'activity_my_join' => '申请参加此活动',
'activity_already_join' => '您已经参加过此活动',
'activity_join_audit' => '您已经参加了此活动',
'activity_join_members' => '申请者',
'activity_linkman' => '联系方式',
'activity_payment' => '每人花销',
'activity_jointime' => '申请时间',
'activity_self' => '自付',
'activity_allow_join' => '允许参加',
'activity_cant_audit' => '尚未审核',
'activity_message' => '活动资料',
'activity_info' => '活动信息',
'activity_info_ext' => '活动补充信息',
'activity_new_join' => '最新报名会员',
'activity_need_member' => '需要人数',
'activity_close' => '活动已结束',
'activity_join' => '我要参加',
'reward_price_back' => '返还悬赏费用,不退还手续费。',
'reward_credits_null' => '对不起,请您输入悬赏积分。',
'reward_price' => '悬赏价格',
'reward_tax_after' => '税后支付',
'reward_tax_add' => '税后追加',
'reward_low' => '最低',
'reward_price_overflow' => '售价不能高于 32767',
'reward_price_bound' => '售价超出范围',
'reward_cant_fall' => '不能降低悬赏积分',
'register_advanced_options' => '高级选项',
'register_advanced_options_comment' => '显示高级用户设置选项',
'register_profile_seccode_invalid' => '验证码输入错误,请重新填写。',
'register_profile_secqaa_invalid' => '验证问答回答错误,请重新填写。',
'register_profile_username_toolong' => '对不起,您的用户名超过 15 个字符,请输入一个较短的用户名。',
'register_profile_profile_username_tooshort' => '对不起,您输入的用户名小于3个字符, 请输入一个较长的用户名。',
'register_profile_username_illegal' => '用户名包含敏感字符或被系统屏蔽,请重新填写。',
'register_profile_passwd_illegal' => '密码空或包含非法字符,请重新填写。',
'register_profile_passwd_notmatch' => '两次输入的密码不一致,请检查后重试。',
'register_profile_email_illegal' => 'Email 地址无效,请重新填写。',
'register_profile_email_msn' => '<a href="#" onclick="msnoperate(\\\'regliveid\\\')">把您的邮箱注册为MSN帐号</a>',
'register_profile_email_invalid' => '您只能使用以 $accessemail 结尾的信箱,请重新填写。',
'register_profile_email_censor' => '请不要使用以 $censoremail 结尾的信箱,请重新填写。',
'register_email_invalid' => '您只能使用以 $accessemail 结尾的信箱',
'supesite_import_comment' => '注意: 从个人空间导入论坛,格式会以论坛为标准,可能会与个人空间显示的效果不一致。',
'topicadmin_push_addremove' => '推送/解除推送',
'topicadmin_push_supesite' => '推送到 SupeSite',
'topicadmin_push_add' => '推送',
'topicadmin_push_remove' => '解除推送',
'xml_http_building_link' => '请等待,正在建立连接...',
'xml_http_sending' => '请等待,正在发送数据...',
'xml_http_loading' => '请等待,正在接受数据...',
'xml_http_load_failed' => '通信失败,请刷新重新尝试!',
'xml_http_data_in_processed' => '通信成功,数据正在处理中...',
'space_layout_nocenter' => '中间栏至少要有一个模块',
'space_base_settings' => '基本设置',
'space_style_settings' => '风格选择',
'space_cp' => '面板',
'space_module_settings' => '模块选择',
'space_layout_settings' => '布局选择',
'space_preview' => '预览',
'space_save' => '保存',
'space_welcome' => '欢迎您',
'space_returnboard' => '返回论坛',
'space_copylink' => '复制链接',
'space_addfav' => '加入收藏',
'space_index' => '空间首页',
'space_profile' => '个人资料',
'space_settings' => '个人空间管理',
'space_leftside' => '左侧边栏',
'space_rightside' => '右侧边栏',
'space_bothside' => '双侧边栏',
'space_my' => '我的空间',
'space_sign' => '开通个人空间',
'space_upgrade_space' => '升级个人空间',
'space_more' => '更多',
'space_name' => '空间名称',
'space_desc' => '空间描述',
'space_userspace' => '的个人空间',
'space_textsample' => '文本演示',
'space_linksample' => '链接演示',
'space_userdetails' => '详细信息',
'space_memcp' => '您现在处于编辑状态,所有的操作只有在<u>保存</u>后有效',
'space_adv' => '高级',
'space_full_version' => '查看完整版本',
'space_trade_home' => '店铺首页',
'space_trade_all' => '所有商品',
'space_trade_stick' => '推荐商品',
'space_trade_nonetype' => '无类别商品',
'magics' => '道具中心',
'magics_tips' => '道具系统已关闭,仅管理员可以正常使用',
'magics_title' => '道具',
'magics_shop' => '道具商店',
'magics_market' => '道具市场',
'magics_user' => '我的道具箱',
'magics_user_totalnum' => '总重量',
'magics_information' => '其他信息',
'magics_discount' => '折扣',
'magics_capacity' => '道具负载量',
'magics_name' => '名称',
'magics_function' => '功能',
'magics_price' => '售价',
'magics_num' => '数量',
'magics_weight' => '重量',
'magics_single_weight' => '单个重量',
'magics_seller' => '出售者',
'magics_market_my' => '我出售的道具',
'magics_market_nonexistence' => '没有道具出售',
'magics_market_order' => '没有道具出售',
'magics_market_price' => '市场价格',
'magics_shop_num' => '库存',
'magics_shop_salevolume' => '销量',
'magics_shop_nonexistence' => '没有此类道具,您可以点<a href="magic.php?action=shop">这里</a>购买相应道具。',
'magics_shop_present' => '赠送其他用户',
'magics_log' => '道具记录',
'magics_log_use' => '道具使用记录',
'magics_log_buy' => '道具购买记录',
'magics_log_present' => '道具赠送记录',
'magics_log_receive' => '道具获赠记录',
'magics_log_market' => '道具市场记录',
'magics_dateline_use' => '使用时间',
'magics_dateline_buy' => '购买时间',
'magics_dateline_present' => '赠送时间',
'magics_dateline_receive' => '获赠时间',
'magics_dateline_operation' => '操作时间',
'magics_amount_buy' => '购买数量',
'magics_amount_down' => '撤下数量',
'magics_amount_present' => '赠送数量',
'magics_amount_receive' => '获赠数量',
'magics_amount_operation' => '操作数量',
'magics_price_buy' => '购买价格',
'magics_price_operation' => '操作价格',
'magics_target' => '查看对象',
'magics_target_use' => '使用对象',
'magics_target_present' => '赠送对象用户名',
'magics_target_receive' => '赠送人',
'magics_operation' => '操作',
'magics_operation_buy' => '购买',
'magics_operation_sell' => '出售',
'magics_operation_down' => '撤下',
'magics_operation_user' => '购买',
'magics_operation_drop' => '丢弃',
'magics_operation_use' => '使用',
'magics_operation_present' => '赠送',
'magics_operation_sell' => '出售',
'magics_log_nonexistence' => '没有相关记录',
'magics_type_1' => '帖子类',
'magics_type_2' => '会员类',
'magics_type_3' => '其他类',
'magics_permission' => '是否允许使用',
'magics_permission_allforum' => '所有版块',
'magics_permission_allgroup' => '所有用户组',
'magics_permission_yes' => '允许',
'magics_permission_no' => '不允许',
'magics_permission_forum' => '允许使用版块',
'magics_permission_group' => '允许被使用的用户组',
'magics_confirm' => '确认该操作',
'magics_use' => '使用道具',
'magics_logs' => '本主题由 $lastmod[modusername] 于 $lastmod[moddateline] 使用 $lastmod[magicname] 道具',
'circle' => '圈子',
'circle_bbs' => '讨论区',
'circle_home' => '圈子首页',
'circle_oplist' => '信息列表',
'circle_oprecommend' => '推荐',
'circle_opdigest' => '精华',
'circle_member' => '成员',
'circle_admin' => '圈主管理',
'circle_join' => '+加入本圈',
'circle_input_password' => '本圈需要密码,您必须在下面输入正确的密码才能浏览这个圈子。',
'circle_lastupdate' => '最近更新的圈子',
'circle_founder' => '圈主',
'circle_membernum' => '成员',
'circle_lastpost' => '最后更新',
'circle_select_please' => '请选择圈子',
'supe_cpanel' => '快捷面板',
'supe_sitemap' => '站点地图',
'supe_friendlinks' => '友情链接',
'frameon_flat' => '平板模式',
'frameon_column' => '分栏模式',
'allow_post_reward' => '允许发表悬赏',
'allow_post_activity' => '允许发表活动',
'allow_post_trade' => '允许发表交易',
'allow_post_debate' => '允许发表辩论',
'allow_post_video' => '允许发表视频',
'special_thread' => '特殊主题',
'special_poll' => '投票主题',
'special_trade' => '商品主题',
'special_reward' => '悬赏主题',
'special_activity' => '活动主题',
'special_debate' => '辩论主题',
'special_video' => '视频主题',
'special_starttime' => '开始时间',
'msn_add' => '添加 $post[username] 为MSN好友',
'msn_chat' => '通过MSN和 $post[username] 交谈',
'leftmenu_index' => '论坛首页',
'tag' => '标签',
'hottags' => '热门标签',
'searchtags' => '可用标签',
'randtags' => '随机标签',
'tag_comment' => '(用空格隔开多个标签,最多可填写 <strong>5</strong> 个)',
'tag_nofound' => '标签信息不存在',
'tag_more' => '查看更多',
'tag_close' => '关闭',
'tag_select' => '可选标签',
'tag_parse' => '标签解析',
'invite' => '邀请注册',
'invite_buy' => '购买邀请码',
'invite_get' => '获得邀请码',
'invite_send' => '发送邀请码',
'invite_code' => '邀请码',
'invite_code_price' => '邀请码单个价格',
'invite_regsiter' => '注册人',
'invite_available' => '有效邀请码',
'invite_invalid' => '过期邀请码记录',
'invite_used' => '已用邀请码记录',
'invite_sent' => '已发送邀请码记录',
'invite_logs' => '邀请记录',
'invite_buy_num' => '购买数量',
'invite_buy_credit' => '所需金额',
'invite_buy_dateline' => '购买日期',
'invite_expiration' => '有效日期',
'invite_log_nonexistence' => '没有相关记录',
'invite_copy' => '复制',
'invite_copy_code_success' => '邀请码 {$invite[invitecode]} 复制成功',
'invite_copy_link_success' => '邀请链接 {$boardurl}$regname?invitecode={$invite[invitecode]} 复制成功',
'invite_mark' => '标记为已发送',
'invite_unmark' => '撤销已发送标记',
'invite_send' => '发送',
'invite_get_code' => '点击获得邀请码',
'invite_num_tips' => '<li>您所在的用户组 24 小时内可以购买 <strong>{$maxinvitenum}</strong> 个邀请码,已经购买了 <strong>{$myinvitenum}</strong> 个</li></ul>',
'invite_expiration_tips' => '<li>邀请码的有效期为 <strong>{$maxinviteday}</strong> 天</li>',
'poll_dateline' => '投票日期',
'debate_dateline' => '辩论日期',
'debate_square' => '正方',
'debate_opponent' => '反方',
'debate_neutral' => '中立',
'debate_square_point' => '正方观点',
'debate_opponent_point' => '反方观点',
'debate_neutra_point' => '中立观点',
'debate_support_square' => '支持正方',
'debate_support_opponent' => '支持反方',
'debate_all_point' => '全部观点',
'debate_position' => '立场',
'debate_background' => '背景资料',
'debate_winner' => '获胜',
'debate_draw' => '平局',
'debate_debaters' => '个辩手',
'debate_bestdebater' => '最佳辩手',
'debate_recommend_list' => '推荐名单',
'debate_umpirepoint' => '裁判观点',
'debate_umpirecomment' => '裁判点评',
'debate_umpirepoint_edit' => '编辑裁判观点',
'debate_umpire_end' => '结束此次辩论',
'debate_comment_dateline' => '评判时间',
'debate_poll' => '票',
'debate_poll_num' => '得票数',
'debate_poll_my' => '投我一票',
'debate_end' => '辩论已经结束',
'debate_count_down' => '距结束还有',
'debate_list_nonexistence' => '如果不在列表中,请自行填写',
'debate_bestdebater_nonexistence' => '请填写最佳辩手。',
'debate_winner_nonexistence' => '请填写获胜方。',
'debate_umpirepoint_nonexistence' => '请填写您的观点。',
'debate_day' => '天',
'debate_hour' => '小时',
'debate_minute' => '分钟',
'debate_situation' => '最新战况',
'threadtype_option' => '分类信息',
'threadtype_expiration' => '信息有效期',
'post_hide_credits' => '以下内容需要积分高于 $creditsrequire 才可浏览',
'post_hide_credits_hidden' => '本帖隐藏的内容需要积分高于 $creditsrequire 才可浏览',
'post_hide_reply' => '以下内容需要回复才能看到',
'post_hide_reply_hidden' => '本帖隐藏的内容需要回复才可以浏览',
'discuzcode_copyclipboard' => '复制内容到剪贴板',
'discuzcode_code' => '代码',
'discuzcode_quote' => '引用',
'discuzcode_free' => '免费内容',
'video_views' => '播放次数',
'video_time' => '片长',
'video_minute' => '分钟',
'video_operate' => '相关操作',
'video_view' => '查看视频',
'video_copy' => '复制播放代码',
'video_copy_code' => '视频代码已经复制到剪贴板',
'video_upload' => '发布视频',
'video_record' => '录制视频',
'video_upload_move_div' => ' (点击拖动) ',
'video_rec' => '录制视频',
'video_saving' => '正在保存数据中...',
'video_type' => '视频分类',
'video_title' => '视频标题',
'video_tag' => '视频标签',
'video_tag_tips' => '多个标签之间以空格隔开',
'video_step' => '下一步',
'video_confirm' => '确认该操作',
'video_auto' => '自动播放',
'video_share' => '允许分享',
'video_uploading' => '您还没有上传视频,或者视频还在上传中,请稍侯重试。',
'video_format_supported' => '支持格式',
'video_limit_size' => '最大上限',
'video_vclass_required' => '请您选择视频所属分类。',
'video_playurl' => '播放地址:',
'video_shareurl' => '分享地址:',
'video_flashurl' => 'Flash地址:',
'playurl_copied' => '播放地址复制成功',
'shareurl_copied' => '分享地址复制成功',
'flashurl_copied' => 'Flash地址复制成功',
'authorinfoitems_uid' => 'UID',
'authorinfoitems_posts' => '帖子',
'authorinfoitems_digest' => '精华',
'authorinfoitems_credits' => '积分',
'authorinfoitems_regtime' => '注册时间',
'authorinfoitems_lastdate' => '最后登录',
'authorinfoitems_oltime' => '在线时间',
'authorinfoitems_readperm' => '阅读权限',
'authorinfoitems_gender' => '性别',
'authorinfoitems_gender_male' => '男',
'authorinfoitems_gender_female' => '女',
'authorinfoitems_location' => '来自',
);
?> | zyyhong | trunk/jiaju001/bbs/templates/default/templates.lang.php | PHP | asf20 | 87,698 |
<form method="post" id="postform" action="pm.php?action=send&pmsubmit=yes" onSubmit="return validate(this)">
<!--{if $folder == 'outbox'}--><input type="hidden" name="pmid" value="$pmid" /><!--{/if}-->
<input type="hidden" name="formhash" value="{FORMHASH}" />
<div class="mainbox formbox">
<h1>{lang pm_send}</h1>
<ul class="tabs">
<li class="current sendpm"><a href="pm.php?action=send">{lang pm_send}</a></li>
<li><a href="pm.php?folder=inbox">{lang pm_inbox}[<span id="pm_unread">$pm_inbox_newpm</span>]</a></li>
<li><a href="pm.php?folder=outbox">{lang pm_outbox}</a></li>
<li><a href="pm.php?folder=track">{lang pm_track}</a></li>
<li><a href="pm.php?action=search">{lang pm_search}</a></li>
<li><a href="pm.php?action=archive">{lang pm_archive}</a></li>
<li><a href="pm.php?action=ignore">{lang pm_ignore}</a></li>
</ul>
<table summary="{lang pm_send}" cellspacing="0" cellpadding="0" id="pmlist">
<!--{if $seccodecheck}-->
<tr>
<th><label for="seccodeverify">{lang seccode}</label></th>
<td>
<div id="seccodeimage"></div>
<input type="text" onfocus="updateseccode();this.onfocus = null" id="seccodeverify" name="seccodeverify" size="8" maxlength="4" />
<em class="tips"><strong>{lang seccode_click}</strong> <!--{if $seccodedata['animator'] == 2}-->{lang seccode_animator_flashrefresh}<!--{elseif $seccodedata['animator'] == 1}-->{lang seccode_animator_refresh}<!--{else}-->{lang seccode_refresh}<!--{/if}--></em></td>
<script type="text/javascript">
var seccodedata = [{$seccodedata['width']}, {$seccodedata['height']}, {$seccodedata['type']}];
</script>
</tr>
<!--{/if}-->
<!--{if $secqaacheck}-->
<tr>
<th>{lang secqaa}</th>
<td><div id="secquestion"></div><input type="text" name="secanswer" size="25" maxlength="50" tabindex="1" /></td>
</tr>
<script type="text/javascript">
<!--{if ($attackevasive & 1) && $seccodecheck}-->
setTimeout("updatesecqaa()", 2001);
<!--{else}-->
updatesecqaa();
<!--{/if}-->
</script>
<!--{/if}-->
<tr>
<th><label for="msgto">{lang to}</label></th>
<td><input type="text" id="msgto" name="msgto" size="65" value="$touser" tabindex="2" /></td>
</tr>
<!--{if $buddylist}-->
<tr>
<th id="buddy"><label><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form, 'msgtobuddys')" tabindex="3" />{lang pm_to_buddy}</label></th>
<td>
<ul class="userlist">
<!--{loop $buddylist $key $buddy}-->
<li><label><input class="checkbox" type="checkbox" name="msgtobuddys[]" value="$buddy[buddyid]" /> $buddy[buddyname]</label></li>
<!--{/loop}-->
</ul>
</td>
</tr>
<!--{/if}-->
<tr>
<th><label for="subject">{lang subject}</th>
<td><input type="text" id="subject" name="subject" size="65" value="$subject" tabindex="4" /></td>
</tr>
<tr>
<th valign="top"><label for="pm_textarea">{lang message}</label>
<!--{if $smileyinsert}-->
<div id="smilieslist"></div>
<script type="text/javascript">ajaxget('post.php?action=smilies', 'smilieslist');</script>
<!--{/if}-->
</th>
<td><textarea id="pm_textarea" class="autosave" rows="15" cols="10" name="message" style="width: 95%;" onKeyDown="ctlent(event);" tabindex="5">
<!--{if $do == 'reply'}-->[b]{lang pm_orig_message}:[/b] [url={$boardurl}pm.php?action=view&folder=inbox&pmid={$pm[pmid]}]$pm[subject][/url]{LF}
<!--{elseif $do == 'forward'}-->
[b]{lang pm_orig_message}[/b] [url={$boardurl}pm.php?action=send&pmid=$pm[pmid]&do=reply]({lang reply})[/url]
[b]{lang from}:[/b] [url={$boardurl}space.php?uid={$pm[msgfromid]}]$pm[msgfrom][/url]
[b]{lang to}:[/b] [url={$boardurl}space.php?uid=$discuz_uid]$discuz_user[/url]
[b]{lang time}:[/b] $pm[dateline]{LF}{LF}
<!--{/if}-->$message</textarea>
<br /><label><input type="checkbox" name="saveoutbox" value="1"<!--{if $folder == 'outbox'}--> checked=checked""<!--{/if}--> tabindex="6" />{lang pm_send_save_outbox}</label>
</td>
</tr>
<tr class="btns">
<th> </th>
<td>
<button type="submit" class="submit" name="pmsubmit" id="postsubmit" value="true" tabindex="7">{lang submit}</button>
<em>{lang post_submit_hotkey}</em>
<a href="###" id="restoredata" onclick="loadData()" title="{lang post_autosave_last_restore}">{lang post_autosave_restore}</a>
</td>
</tr>
</table>
</div>
</form>
<script type="text/javascript" src="include/javascript/post.js"></script>
<script type="text/javascript">
var wysiwyg = bbinsert = 0;
lang['post_autosave_none'] = "{lang post_autosave_none}";
lang['post_autosave_confirm'] = "{lang post_autosave_confirm}";
function validate(theform) {
if (theform.subject.value == '' || theform.message.value == '') {
alert("{lang post_subject_and_message_isnull}");
theform.subject.focus();
return false;
} else if (theform.subject.value.length > 75) {
alert("{lang post_subject_toolong}");
theform.subject.focus();
return false;
}
theform.message.value = parseurl(theform.message.value, 'bbcode');
theform.pmsubmit.disabled = true;
return true;
}
checkFocus();
setCaretAtEnd();
var textobj = $('pm_textarea');
if(!(is_ie >= 5 || is_moz >= 2)) {
$('restoredata').style.display = 'none';
}
</script> | zyyhong | trunk/jiaju001/bbs/templates/default/pm_send.htm | HTML | asf20 | 5,367 |
<!--{eval
function userinfo($member) {
global $spacelanguage, $spacesettings, $uid;
}-->
<table class="module" cellpadding="0" cellspacing="0" border="0"><tr><td class="header"><div class="title">$spacelanguage[userinfo]</div></td></tr>
<tr><td>
<div id="module_userinfo">
<div class="status">{lang status}: <span><!--{if $member[online]}-->{lang online}<!--{else}-->{lang offline}<!--{/if}--></span></div>
<div class="info">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout: fixed; overflow: hidden">
<tr><td align="center">
<!--{if $member[avatar]}-->
<img src="$member[avatar]" width="$member[avatarwidth]" height="$member[avatarheight]" border="0" alt="" />
<!--{else}-->
<img src="images/avatars/noavatar.gif" alt="" />
<!--{/if}-->
</td></tr></table></div>
<div class="username">$member[username]<!--{if $member[nickname]}--><br />$member[nickname]<!--{/if}--></div>
<div class="operation">
<img src="mspace/$spacesettings[style]/sendmail.gif" alt="" /><a target="_blank" href="pm.php?action=send&uid=$member[uid]">{lang send_pm}</a>
<img src="mspace/$spacesettings[style]/buddy.gif" alt="" /><a target="_blank" href="my.php?item=buddylist&newbuddyid=$member[uid]&buddysubmit=yes" id="ajax_buddy" onclick="ajaxmenu(event, this.id)">{lang add_to_buddylist}</a>
</div>
<!--{if $member['bio']}-->
<div class="more">
<br />$member[bio]
</div>
<!--{/if}-->
</div>
</td></tr></table>
<!--{eval
}
}-->
<!--{if $spacesettings['side'] != 2}-->
<td id="main_layout0"><!--{eval userinfo($member)}--></td>
<!--{/if}-->
<td id="main_layout1">
<div id="module_userdetails">
<table class="module" cellpadding="0" cellspacing="0" border="0"><tr><td class="header">
<div class="title">{lang space_userdetails}</div>
<div class="more">
<!--{if $member[uid] == $discuz_uid}-->
<a href="memcp.php?action=profile" target="_blank">{lang memcp_profile}</a>
<!--{/if}-->
<a href="eccredit.php?uid=$member[uid]" target="_blank">{lang trade_rate}</a>
<!--{if $allowmagics && $magicstatus}-->
<a href="magic.php?action=user&username=$member[usernameenc]" target="_blank">{lang magics_use}</a>
<!--{/if}-->
<a href="search.php?srchuid=$member[uid]&srchfid=all&srchfrom=0&searchsubmit=yes">{lang search_posts}</a>
<!--{if $allowedituser || $allowbanuser}-->
<!--{if $adminid == 1}-->
<a href="admincp.php?action=members&username=$member[usernameenc]&searchsubmit=yes&frames=yes" target="_blank">{lang edit_member}</a>
<!--{else}-->
<a href="admincp.php?action=editmember&uid=$member[uid]&membersubmit=yes&frames=yes" target="_blank">{lang edit_member}</a>
<!--{/if}-->
<a href="admincp.php?action=banmember&uid=$member[uid]&membersubmit=yes&frames=yes" target="_blank">{lang ban_member}</a>
<!--{/if}-->
<!--{if $member['adminid'] > 0 && $modworkstatus}-->
<a href="stats.php?type=modworks&uid=$member[uid]">{lang moderations}</a>
<!--{/if}-->
</div>
</td></tr>
</table>
<table class="info" border="0" cellspacing="0" cellpadding="{TABLESPACE}" width="100%">
<tr><th>{lang uid}:</th><td>$member[uid]</td></tr>
<tr><th>{lang regdate}:</th><td>$member[regdate]</td></tr>
<!--{if $allowviewip}-->
<tr><th>{lang regip}:</th><td>$member[regip] $member[regiplocation]</td></tr>
<tr><th>{lang lastip}:</th><td>$member[lastip] $member[lastiplocation]</td></tr>
<!--{/if}-->
<tr><th>{lang lastvisit}:</th><td><!--{if $member['invisible'] && $adminid != 1}-->{lang login_invisible_mode}<!--{else}-->$member[lastvisit]<!--{/if}--></td></tr>
<tr><th>{lang lastpost}:</th><td>$member[lastpost]</td></tr>
<!--{if $pvfrequence}-->
<tr><th>{lang pageviews}:</th><td>$member[pageviews]</td></tr>
<!--{/if}-->
<!--{if $oltimespan}-->
<tr><th valign="top">{lang onlinetime}:</th><td>{lang onlinetime_total} <span class="bold">$member[totalol]</span> {lang hours}, {lang onlinetime_thismonth} <span class="bold">$member[thismonthol]</span> {lang hours} {eval showstars(ceil(($member['totalol'] + 1) / 50));}<br />{lang onlinetime_upgrade}</td></tr>
<!--{/if}-->
<!--{if $modforums}-->
<tr><th>{lang moderator}:</th><td>$modforums</td></tr>
<!--{/if}-->
<tr><td colspan="2"><hr class="line" size="0"></td></tr>
<!--{if $member['medals']}-->
<tr><th>{lang medals}:</th><td>
<!--{loop $member['medals'] $medal}-->
<img src="images/common/$medal[image]" border="0" alt="$medal[name]" />
<!--{/loop}-->
</td></tr>
<!--{/if}-->
<tr><th valign="top">{lang usergroup}:</th><td>$member[grouptitle] {eval showstars($member['groupstars']);}<!--{if $member['maingroupexpiry']}--><br /><span class="smalltxt">{lang valid_before} $member[maingroupexpiry]</span><!--{/if}--></td></tr>
<!--{if $extgrouplist}-->
<tr><th valign="top">{lang extgroups}:</th><td>
<!--{loop $extgrouplist $extgroup}-->
$extgroup[title]<!--{if $extgroup['expiry']}--> ({lang valid_before} $extgroup[expiry])<!--{/if}--><br />
<!--{/loop}-->
</td></tr>
<!--{/if}-->
<tr><th>{lang rank}:</th><td>$member[ranktitle] {eval showstars($member['rankstars']);}</td></tr>
<tr><th>{lang readperm}:</th><td>$member[readaccess]</td></tr>
<tr><th>{lang credits}:</th><td>$member[credits]</td></tr>
<!--{loop $extcredits $id $credit}-->
<tr><th>$credit[title]:</th><td>{$member[extcredits.$id]} $credit[unit]</td></tr>
<!--{/loop}-->
<tr><th>{lang posts}:</th><td>$member[posts] ({lang post_percent} $percent%)</td></tr>
<tr><th>{lang posts_per_day}:</th><td>$postperday {lang posts}</td></tr>
<tr><th>{lang digestposts}:</th><td>$member[digestposts] {lang posts}</td></tr>
<tr><td colspan="2"><hr class="line" size="0"></td></tr>
<tr><th>{lang gender}:</th><td><!--{if $member['gender'] == 1}-->{lang male}<!--{elseif $member['gender'] == 2}-->{lang female}<!--{else}-->{lang secret}<!--{/if}--></td></tr>
<!--{if $member['location']}--><tr><th>{lang location}:</th><td>$member[location] </td></tr><!--{/if}-->
<tr><th>{lang birthday}:</th><td>$member[bday]</td></tr>
<!--{if $member['site']}--><tr><th>{lang homepage}: </th><td><a href="$member[site]" target="_blank">$member[site]</a></td></tr><!--{/if}-->
<!--{if $member['showemail']}--><tr><th>Email: </th><td>$member[email]</td></tr><!--{/if}-->
<!--{if $member['qq']}--><tr><th>QQ: </th><td><a href="http://wpa.qq.com/msgrd?V=1&Uin=$member[qq]&Site=$bbname&Menu=yes" target="_blank"><img src="http://wpa.qq.com/pa?p=1:$member[qq]:4" border="0" alt="QQ" />$member[qq]</a></td></tr><!--{/if}-->
<!--{if $member['icq']}--><tr><th>ICQ: </th><td>$member[icq]</td></tr><!--{/if}-->
<!--{if $member['yahoo']}--><tr><th>Yahoo: </th><td>$member[yahoo]</td></tr><!--{/if}-->
<!--{if $member['msn']}--><tr><th>MSN: </th><td>$member[msn]</td></tr><!--{/if}-->
<!--{if $member['taobao']}--><tr><th>{lang taobao}: </th><td><script type="text/javascript">document.write('<a target="_blank" href="http://amos1.taobao.com/msg.ww?v=2&uid='+encodeURIComponent('$member[taobaoas]')+'&s=2"><img src="http://amos1.taobao.com/online.ww?v=2&uid='+encodeURIComponent('$member[taobaoas]')+'&s=1" alt="{lang taobao}" border="0" /></a>');</script></td></tr><!--{/if}-->
<!--{if $member['alipay']}--><tr><th>{lang alipay}: </th><td><a href="https://www.alipay.com/payto:$member[alipay]?partner=20880020258585430156" target="_blank">$member[alipay]</a></td></tr><!--{/if}-->
<tr><th>{lang trade_buyer_rate}:</th><td>$member[sellercredit] <a href="eccredit.php?uid=$member[uid]" target="_blank"><img src="images/rank/seller/$member['sellerrank'].gif" border="0" class="absmiddle"></a></td></tr>
<tr><th>{lang trade_seller_rate}:</th><td>$member[buyercredit] <a href="eccredit.php?uid=$member[uid]" target="_blank"><img src="images/rank/buyer/$member['buyerrank'].gif" border="0" class="absmiddle"></a></td></tr>
<!--{loop $_DCACHE['fields'] $field}-->
<tr><th>$field[title]:</th><td>
<!--{if $field['selective']}-->
$field['choices'][$member['field_'.$field['fieldid']]]
<!--{else}-->
$member['field_'.$field['fieldid']]
<!--{/if}-->
</td></tr>
<!--{/loop}-->
</table>
</div>
</td>
<!--{if $spacesettings['side'] != 0 && $spacesettings['side'] != 1}-->
<td id="main_layout2"><!--{eval userinfo($member)}--></td>
<!--{/if}--> | zyyhong | trunk/jiaju001/bbs/templates/default/viewpro.htm | HTML | asf20 | 8,252 |
<script type="text/javascript">
if(!(is_ie >= 5 || is_moz >= 2)) {
$('restoredata').style.display = 'none';
}
var editorid = '$editorid';
var textobj = $(editorid + '_textarea');
var wysiwyg = (is_ie || is_moz || (is_opera >= 9)) && parseInt('$editormode') && bbinsert == 1 ? 1 : 0;
var allowswitcheditor = parseInt('$allowswitcheditor');
var allowhtml = parseInt('$allowhtml');
var forumallowhtml = parseInt('$forum[allowhtml]');
var allowsmilies = parseInt('$forum[allowsmilies]');
var allowbbcode = parseInt('$forum[allowbbcode]');
var allowimgcode = parseInt('$forum[allowimgcode]');
var special = parseInt('$special');
var BORDERCOLOR = "{BORDERCOLOR}";
var ALTBG2 = "{ALTBG2}";
var charset = '$charset';
var smilies = new Array();
<!--{if !empty($GLOBALS['_DCACHE']['smilies']) && is_array($GLOBALS['_DCACHE']['smilies'])}-->
<!--{loop $_DCACHE['smilies_display'] $typeid $smilies}-->
<!--{loop $smilies $key $smiley}-->
<!--{eval $smiley[code]=addcslashes($smiley['code'], '\\\'');}-->
smilies[$key] = {'code' : '$smiley[code]', 'url' : '$_DCACHE[smileytypes][$typeid][directory]/$smiley[url]'};
<!--{/loop}-->
<!--{/loop}-->
<!--{/if}-->
lang['post_autosave_none'] = "{lang post_autosave_none}";
lang['post_autosave_confirm'] = "{lang post_autosave_confirm}";
lang['post_video_uploading'] = "{lang video_uploading}";
lang['post_video_vclass_required'] = "{lang video_vclass_required}";
</script>
<!--{if $allowpostattach}-->
<script type="text/javascript">
var thumbwidth = parseInt($thumbwidth);
var thumbheight = parseInt($thumbheight);
var extensions = '$attachextensions';
lang['post_attachment_ext_notallowed'] = '{lang post_attachment_ext_notallowed}';
lang['post_attachment_img_invalid'] = '{lang post_attachment_img_invalid}';
lang['post_attachment_deletelink'] = '{lang post_attachment_deletelink}';
lang['post_attachment_insert'] = '{lang post_attachment_insert}';
lang['post_attachment_insertlink'] = '{lang post_attachment_insertlink}';
</script>
<script type="text/javascript" src="include/javascript/post_attach.js"></script>
<!--{/if}-->
<script type="text/javascript" src="include/javascript/post.js"></script>
<!--{if $smileyinsert}--><script type="text/javascript">ajaxget('post.php?action=smilies', 'smilieslist');</script><!--{/if}-->
<!--{if $bbinsert}-->
<script type="text/javascript">
var fontoptions = new Array({lang post_discuzcode_fontoptions});
var custombbcodes = new Array();
<!--{if $forum['allowbbcode'] && $allowcusbbcode}-->
<!--{loop $_DCACHE['bbcodes_display'] $tag $bbcode}-->
custombbcodes["$tag"] = {'prompt' : '$bbcode[prompt]'};
<!--{/loop}-->
<!--{/if}-->
lang['enter_list_item'] = "{lang post_discuzcode_listitem}";
lang['enter_link_url'] = "{lang post_discuzcode_linkurl}";
lang['enter_image_url'] = "{lang post_discuzcode_imageurl}";
lang['enter_email_link'] = "{lang post_discuzcode_emaillink}";
lang['fontname'] = "{lang post_discuzcode_fontname}";
lang['fontsize'] = "{lang post_discuzcode_fontsize}";
lang['post_advanceeditor'] = "{lang editor_mode_all}";
lang['post_simpleeditor'] = "{lang editor_mode_simple}";
lang['submit'] = "{lang submit}";
lang['cancel'] = "{lang cancel}";
</script>
<script type="text/javascript" src="include/javascript/editor.js"></script>
<!--{/if}-->
<script type="text/javascript" src="include/javascript/bbcode.js"></script>
<!--{if $action == 'edit' || $action == 'reply' && $repquote}-->
<script type="text/javascript">
if(wysiwyg) {
editdoc.body.innerHTML = bbcode2html(textobj.value);
}
</script>
<!--{/if}-->
<script type="text/javascript" src="include/javascript/post_editor.js"></script>
<script type="text/javascript">
$(editorid + '_contract').onclick = function() {resizeEditor(-100)};
$(editorid + '_expand').onclick = function() {resizeEditor(100)};
$('checklength').onclick = function() {checklength($('postform'))};
$('previewbutton').onclick = function() {previewpost()};
$('clearcontent').onclick = function() {clearcontent()};
$('postform').onsubmit = function() {validate(this);if($('postsubmit').name != 'editsubmit') return false};
<!--{if $action == 'newthread'}-->
$('subject').focus();
<!--{else}-->
checkFocus();
setCaretAtEnd();
<!--{/if}-->
</script> | zyyhong | trunk/jiaju001/bbs/templates/default/post_js.htm | HTML | asf20 | 4,416 |
<?php
// Message Pack for Discuz! Version 1.0.0
// Created by Crossday
$language = array
(
'undefined_action' => '未定义操作,请返回。',
'group_nopermission' => '您所在的用户组($grouptitle)无法进行此操作。',
'group_expiry_disabled' => '您目前没有即将到期的用户组,请返回。',
'period_nopermission' => '对不起,管理员设置了每日 $banperiods 不能进行此操作或访问此页面,请其他时间再试。',
'submit_seccode_invalid' => '您输入的验证码不正确,无法提交,请返回修改。',
'submit_secqaa_invalid' => '验证问答回答错误,无法提交,请返回修改。',
'submit_invalid' => '您的请求来路不正确或验证字串不符,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。',
'not_loggedin' => '对不起,您还没有登录,无法进行此操作。',
'action_closed' => '论坛尚未开启此功能,或者此功能已经被管理员禁止,请返回。',
'board_closed' => '对不起,本论坛暂时关闭,详情请<a href=\"mailto:$adminemail\">联系管理员</a>。',
'max_pages' => '管理员设置了本内容可以被翻阅到的最大页数为 $pages 页,如需查看相关内容,请返回并指定查询条件后再试。',
'login_invalid' => '用户名无效,密码错误或安全问题回答错误,您可以有至多 5 次尝试。',
'login_strike' => '累计 5 次错误尝试,15 分钟内您将不能登录论坛。',
'login_succeed' => '欢迎您回来,{$discuz_userss}。现在将转入登录前页面。',
'login_succeed_inactive_member' => '欢迎您回来,{$discuz_userss}。您的帐号处于非激活状态,现在将转入控制面板。',
'logout_succeed' => '您已退出论坛,现在将以游客身份转入退出前页面。',
'user_banned' => '对不起,您的 IP 地址不在被允许的范围内,或您的账号被禁用,无法访问本论坛。',
'word_banned' => '对不起,您填写的内容(如签名、帖子、短消息等)包含不良内容而无法提交,请返回修改。',
'forum_nonexistence' => '指定的版块不存在,请返回。',
'forum_passwd_correct' => '密码验证成功,现在将转入主题列表。',
'forum_passwd_incorrect' => '您输入的密码不正确,不能访问这个版块。',
'forum_nopermission' => '本版块只有特定用户组可以访问。',
'forum_permforum_nopermission' => '您不满足访问这个版块所需的条件。</b><br /> 访问条件: $formulamessage<br /> 您的信息: $usermsg<b>',
'forum_disablepost' => '本版块禁止发帖。',
'thread_nonexistence' => '指定的主题不存在或已被删除或正在被审核,请返回。',
'thread_nopermission' => '对不起,本帖要求阅读权限高于 $thread[readperm] 才可浏览,请返回。',
'thread_poll_closed' => '本主题已关闭,无法继续投票,请返回。',
'thread_poll_voted' => '您已参与过这个投票,请返回。',
'thread_poll_invalid' => '您没有选择投票选项,请返回修改。',
'thread_poll_succeed' => '您的投票成功提交,现在将转入主题页。',
'thread_rate_moderator_invalid' => '对不起,作为版主您只能在自己的管辖范围内评分,请返回。',
'ajax_thread_rate_moderator_invalid' => '对不起,作为版主您只能在自己的管辖范围内评分。',
'thread_rate_range_invalid' => '您未输入分值或超过每次评分范围限制,请返回修改。',
'ajax_thread_rate_range_invalid' => '您未输入分值或超过每次评分范围限制。',
'thread_rate_timelimit' => '对不起,您不能对发表于 $karmaratelimit 小时前的帖子进行评分,请返回。',
'ajax_thread_rate_timelimit' => '对不起,您不能对发表于 $karmaratelimit 小时前的帖子进行评分。',
'thread_rate_member_invalid' => '对不起,您不能给自己发表的帖子评分,请返回。',
'ajax_thread_rate_member_invalid' => '对不起,您不能给自己发表的帖子评分。',
'thread_rate_ctrl' => '对不起,您最近 24 小时评分数超过限制,请返回修改。',
'thread_rate_duplicate' => '对不起,您不能对同一个帖子重复评分,请返回。',
'ajax_thread_rate_duplicate' => '对不起,您不能对同一个帖子重复评分。',
'thread_rate_succeed' => '感谢您的参与,现在将转入评分前页面。',
'ajax_thread_rate_succeed' => '感谢您的参与。',
'thread_rate_removesucceed' => '评分已成功撤销,现在将转入评分前页面。',
'thread_rate_anonymous' => '对不起,您不能对匿名帖评分,请返回。',
'ajax_thread_rate_anonymous' => '对不起,您不能对匿名帖评分。',
'thread_rate_banned' => '对不起,您不能对屏蔽帖评分,请返回。',
'ajax_thread_rate_banned' => '对不起,您不能对屏蔽帖评分。',
'thread_rate_log_nonexistence' => '对不起,指定帖子在近一年内没有评分记录,请返回。',
'thread_pay_succeed' => '您已成功购买本主题,现在将转入主题页面。',
'thread_report_disabled' => '对不起,管理员关闭了报告帖子功能,请返回。',
'ajax_thread_report_disabled' => '对不起,管理员关闭了报告帖子功能。',
'thread_report_flood_ctrl' => '对不起,您两次报告间隔不得少于 $floodctrl 秒,请返回。',
'ajax_thread_report_flood_ctrl' => '对不起,您两次报告间隔不得少于 $floodctrl 秒。',
'thread_maxpostsperhour_invalid' => '对不起,本站规定会员每小时最多只能发表 $maxpostsperhour 个帖子。',
'thread_report_invalid' => '您没有选择对谁报告本帖,请返回修改。',
'thread_report_succeed' => '您的意见已经报告给版主和管理员,现在将转入主题页面。',
'ajax_thread_report_succeed' => '您的意见已经报告给版主和管理员。',
'digest_nonexistence' => '对不起,指定范围内没有精华帖,请返回。',
'view_log_invalid' => '浏览量记录文件($logfile)无法写入,请设置其属性 777 或删除后重新建立。',
'attachment_referer_invalid' => '对不起,请不要从外部链接下载本论坛的附件。',
'attachment_nopermission' => '对不起,本附件要求阅读权限高于 $attach[readperm] 才可下载,请返回。',
'attachment_forum_nopermission' => '对不起,只有特定用户可以下载本论坛的附件,请返回。',
'attachment_nonexistence' => '附件文件不存在或无法读入,请与管理员联系。',
'attachment_payto' => '附件所在主题需要付费,请您付费后下载。',
'attachement_payto_attach' => '附件需要付费,请您付费后下载。',
'attachment_yetpay' => '对不起,您已经购买过此附件,请勿重复付费。',
'attachment_buy' => '您已成功购买本附件,现在将转入附件下载。',
'post_hide_nopermission' => '对不起,您没有权限使用 [hide] 代码,请返回修改。',
'post_newbie_span' => '对不起,您只在注册时间起 $newbiespan 小时后才有发帖权限,请返回。',
'post_allowspecialonly' => '对不起,本论坛只允许发布特殊类型主题,请返回。',
'post_forum_newthread_nopermission' => '对不起,本版块只有特定用户组可以发新话题,请返回。',
'post_forum_newreply_nopermission' => '对不起,本版块只有特定用户组可以回复,请返回。',
'post_thread_closed' => '对不起,本主题已关闭,不再接受新回复,请返回。',
'post_thread_closed_by_dateline' => '对不起,管理员设置了本版块发表于 $forum[autoclose] 天以前的主题自动关闭,不再接受新回复,请返回。',
'post_thread_closed_by_lastpost' => '对不起,管理员设置了本版块最后回复于 $forum[autoclose] 天以前的主题自动关闭,不再接受新回复,请返回。',
'post_subject_toolong' => '对不起,您的标题超过 80 个字符,请返回修改标题长度。',
'post_message_tooshort' => '对不起,您的帖子小于 $minpostsize 个字符的限制,请返回修改。',
'post_message_toolong' => '对不起,您的帖子超过 $maxpostsize 个字符的限制,请返回修改。',
'post_sm_isnull' => '您没有输入标题或内容,请返回填写。',
'post_type_isnull' => '您没有选择主题的类别,请返回修改。',
'post_flood_ctrl' => '对不起,您两次发表间隔少于 $floodctrl 秒,请不要灌水!',
'post_net_price_iszero' => '您的主题售价扣除积分交易税后为 0,请返回修改。',
'post_poll_option_toomany' => '对不起,您的投票选项超过 $maxpolloptions 个,请返回修改。',
'post_edit_reward_nopermission' => '对不起,悬赏已经结束,无法退还积分,请返回。',
'post_edit_reward_already_reply' => '对不起,您不能删除已经有回复的悬赏,请返回。',
'post_edit_nopermission' => '对不起,您没有权力编辑他人发表的帖子,请返回。',
'post_edit_timelimit' => '对不起,您的帖子从发表到现在已超过 $edittimelimit 分钟,不能再进行编辑,请返回。',
'post_edit_moderate' => '对不起,管理员设置了需要对发帖进行审核,您没有权力编辑已通过审核的帖子,请返回。',
'post_edit_delete_succeed' => '主题删除成功,现在将转入主题列表。',
'post_attachment_toobig' => '对不起,您的附件大小超过论坛限制,请返回修改。',
'post_attachment_type_toobig' => '对不起,您的附件超过 \".$extension\" 类型 $typemaxsize 的限制,请返回修改。',
'post_attachment_ext_notallowed' => '对不起,不支持上传此类扩展名的附件,请返回修改。',
'post_attachment_size_invalid' => '对不起,您上传的附件尺寸为 0,系统不允许上传此类附件,请返回修改。',
'post_attachment_quota_exceed' => '对不起,您最近 24 小时上传的附件已超过 $maxsizeperday 字节的限制,无法继续上传,请返回或稍后再试。',
'post_attachment_save_error' => '附件文件无法保存到服务器,可能是目录属性设置问题,请与管理员联系。',
'post_edit_succeed' => '您的帖子编辑成功,现在将转入主题页。<br /><br /><a href=\"forumdisplay.php?fid=$fid\">[ 需要转入主题列表请点击这里 ]</a>',
'post_reply_succeed' => '非常感谢,您的回复已经发布,现在将转入主题页。<br /><br /><a href=\"forumdisplay.php?fid=$fid\">[ 需要转入主题列表请点击这里 ]</a>',
'post_check' => '指定的帖子不存在或已被删除或正在被审核。<br /><br /><a href=\"viewthread.php?tid=$ptid\">[ 尝试转入主题请点击这里 ]</a>',
'post_reply_blog_succeed' => '非常感谢,您的评论已经发布,现在将转入文集。',
'post_reply_mod_succeed' => '非常感谢,管理员设置了需要对新回复进行审核,您的帖子通过审核后将被显示出来,现在将转入主题列表。',
'post_reply_mod_blog_succeed' => '非常感谢,管理员设置了需要对评论进行审核,您的评论通过审核后将被显示出来,现在将转入文集。',
'post_newthread_succeed' => '非常感谢,您的主题已经发布,现在将转入主题页。<br /><br /><a href=\"forumdisplay.php?fid=$fid\">[ 需要转入主题列表请点击这里 ]</a>',
'post_newthread_blog_succeed' => '非常感谢,您的文章已经发布,现在将转入文集。',
'post_newthread_blog_invalid' => '对不起,您没有权限或管理员设置了禁止在本版发表文章,请返回。',
'post_newthread_mod_succeed' => '非常感谢,管理员设置了需要对新主题进行审核,现在将转入主题列表,您的帖子通过审核后将被显示出来。',
'post_newthread_mod_blog_succeed' => '非常感谢,管理员设置了需要对本栏目新文章进行审核,您的文章通过审核后将被显示出来,现在将转入文集。',
'register_disable' => '对不起,目前论坛禁止新用户注册,请返回。',
'register_ctrl' => '对不起,您的 IP 地址在 $regctrl 小时内只能注册一个帐号,请返回。',
'register_flood_ctrl' => '对不起,同一 IP 地址在 24 小时内只能进行 $regfloodctrl 次注册尝试,请返回。',
'register_check_found' => '对不起,您输入的用户名 \"$username\" 已经被他人使用,请选择其他名字后再试。',
'register_invite_notfound' => '没有填写邀请码不能注册,请返回。',
'register_invite_error' => '邀请码不正确,请返回。',
'register_invite_iperror' => '注册用户IP和邀请码拥有者IP相同,不能注册请返回。',
'register_invite_expiration' => '邀请码已过期,不能使用请返回。',
'register_check_notfound' => '恭喜您,您输入的用户名 \"$username\" 没有人使用,可以继续注册。',
'register_manual_verify' => '非常感谢您的注册,管理员设置了人工验证新注册用户,请等待审核通过,现在将转入控制面板首页。',
'register_succeed' => '非常感谢您的注册,现在将以会员身份登录论坛。',
'profile_username_toolong' => '对不起,您的用户名超过 15 个字符,请返回输入一个较短的用户名。',
'profile_username_tooshort' => '对不起,您输入的用户名小于3个字符, 请返回输入一个较长的用户名。',
'profile_passwd_notmatch' => '两次输入的密码不一致,请返回检查后重试。',
'profile_passwd_wrong' => '原密码不正确,您不能修改密码或Email或安全提问,请返回。',
'profile_admin_security_invalid' => '作为管理者之一,您需要填写安全提问和答案以保障论坛的安全,请返回。',
'profile_username_duplicate' => '该用户名已经被注册了,请返回重新填写。',
'profile_email_duplicate' => '该 Email 地址已经被注册了,请返回重新填写。',
'profile_username_illegal' => '用户名包含敏感字符或被系统屏蔽,请返回重新填写。',
'profile_nickname_cstatus_illegal' => '昵称或自定义头衔包含敏感字符或被系统屏蔽,请返回重新填写。',
'profile_passwd_illegal' => '密码空或包含非法字符,请返回重新填写。',
'profile_email_illegal' => 'Email 地址无效或包含不可使用的邮箱域名,请返回重新填写。',
'profile_alipay_illegal' => '支付宝账号无效,请返回重新填写。',
'profile_alipay_msn' => 'MSN账号无效,请返回重新填写。',
'profile_required_info_invalid' => '您没有填写必填项目,请返回修改。',
'profile_sig_toolong' => '您的签名长度超过 $maxsigsize 字符的限制,请返回修改。',
'profile_avatar_invalid' => '您设置的头像类型无效,请返回修改。',
'profile_avatar_toobig' => '您设置的头像超过 $maxavatarsize 字节大小,请返回修改。',
'profile_avatar_size_invalid' => '读取远程头像尺寸失败,如确认头像地址无误,请返回输入头像的宽、高代替原有的“*”。',
'profile_avatardir_nonexistence' => '头像目录 ./images/avatars 不存在,请联系管理员。',
'profile_avatar_succeed' => '您头像设置已成功更新,现在将转入个人资料页。',
'profile_email_verify' => '确认 Email 已经发送,请用邮件中提供的方法激活您的帐号。如果您没有收到我们发送的系统邮件,请点击控制面板首页中的“重新验证 Email 有效性”,或尝试更换另外一个地址。注意:在完成激活之前,根据管理员设置,您将只能以待验证会员的身份访问论坛,您可能不能进行发帖等操作。激活成功后,上述限制将自动取消。',
'profile_succeed' => '个人资料已成功保存。',
'credits_disabled' => '对不起,管理员没有启用论坛积分。',
'credits_transaction_disabled' => '对不起,交易积分没有被启用,无法使用此功能,请返回或与管理员联系。',
'credits_transaction_amount_invalid' => '您要转账或兑换的积分数量输入有误,请返回修改。',
'credits_password_invalid' => '您没有输入密码或密码错误,不能进行积分操作,请返回。',
'credits_policy_lowerlimit' => '对不起,管理员设置了当您的{$extcredits[$id][title]}低于 {$extcredits[$id][lowerlimit]} {$extcredits[$id][unit]}的下限时不能进行此操作,请返回。',
'credits_policy_num_lowerlimit' => '对不起,您的操作将会导致您的 <b>{$extcredits[$id][title]}</b> 低于系统规定的下限值 {$extcredits[$id][lowerlimit]} {$extcredits[$id][unit]},请返回修正后重新提交。',
'credits_balance_insufficient' => '对不起,您的账户余额少于 $minbalance 的最低余额限制,请返回。',
'credits_buy_thread' => '对不起,您已经购买过此主题,请勿重复付费。',
'credits_net_amount_iszero' => '本交易扣除积分交易税后的净值为 0,请返回修改。',
'credits_transfer_send_nonexistence' => '您没有输入接收人或接收人不存在,请返回修改。',
'credits_transfer_self' => '对不起,您不能对自己转账,请返回修改。',
'credits_exchange_invalid' => '您选择原积分和目标积分相同,不能进行兑换,请返回修改。',
'credits_transaction_succeed' => '积分操作成功,现在将转入转账与兑换记录。',
'credits_addfunds_amount_invalid' => '您单次购买的积分数量超出最大值 $ec_maxcredits 或最小值 $ec_mincredits 的限制。',
'credits_addfunds_ctrl' => '您两次提交订单间隔小于 180 秒,请稍后再试。',
'credits_addfunds_toomuch' => '您超出本月允许购买 $ec_maxcreditspermonth 的限额。',
'credits_addfunds_order_invalid' => '当前订单号无效,请在上一页重新提交,给您带来不便敬请谅解。',
'credits_addfunds_succeed' => '正在提交编号为 $orderid 的订单。',
'usergroups_toomany' => '您设置的扩展用户组超过系统存储容量,请返回修改。',
'usergroups_span_invalid' => '对不起,您至少需要支付 $group[minspan] 天的积分价格,请返回。',
'usergroups_join_succeed' => '成功加入用户组,现在将转入公众用户组设置。',
'usergroups_exit_succeed' => '成功退出用户组,现在将转入公众用户组设置。',
'usergroups_update_succeed' => '公众用户组成功更新,现在将转入公众用户组设置。',
'usergroups_nonexistence' => '对不起,没有这个用户组,请返回。',
'username_nonexistence' => '指定用户不存在,请返回修改。',
'buddy_add_invalid' => '用户已存在于您的好友列表中。',
'buddy_add_toomany' => '您已经设定了超过 20 位好友。',
'buddy_update_succeed' => '好友列表成功更新。',
'redirect_nextnewset_nonexistence' => '没有比当前更新的主题,请返回。',
'redirect_nextoldset_nonexistence' => '没有比当前更早的主题,请返回。',
'favorite_exists' => '您过去已经收藏过这个主题或版块。',
'favorite_add_succeed' => '指定主题或版块已成功添加到收藏夹中。',
'favorite_update_succeed' => '收藏夹已成功更新,现在将转入更新后的收藏夹。',
'favorite_is_full' => '您的收藏夹已满,请在继续操作前删除一些不用的收藏。',
'subscription_exists' => '您过去已经订阅过这个主题。',
'subscription_add_succeed' => '您选择的主题已经成功订阅。',
'subscription_update_succeed' => '订阅列表已经成功更新,现在将转入更新后的订阅列表。',
'subscription_nopermission' => '对不起,您无权订阅该主题。',
'subscription_is_full' => '您的订阅列表已满,请在继续操作前删除一些不用的订阅。',
'search_ctrl' => '对不起,您在 $searchctrl 秒内只能进行一次搜索,请返回。',
'search_toomany' => '对不起,管理员设置了每分钟系统最多响应搜索请求 $maxspm 次,请返回并稍后再试。',
'search_invalid' => '您没有指定要搜索的关键字或用户名,请返回重新填写。',
'search_threadtype_invalid' => '您没有输入要搜索的分类信息项目,请返回重新填写。',
'search_forum_invalid' => '您没有指定搜索论坛的范围,请返回重新填写。',
'search_id_invalid' => '您指定的搜索不存在或已过期,请返回。',
'search_redirect' => '搜索成功完成,现在将转入结果页面。',
'member_nonexistence' => '指定的用户不存在或已被删除,请返回。',
'member_list_disable' => '对不起,管理员禁止了会员列表功能。',
'email_friend_invalid' => '相关项目没有填写完整,请返回修改。',
'ajax_email_friend_invalid' => '相关项目没有填写完整。',
'email_friend_succeed' => '您的推荐已经通过 Email 发给朋友,现在将转入原帖。',
'ajax_email_friend_succeed' => '您的推荐已经通过 Email 发给朋友。',
'email_invite_succeed' => '您的邀请码已经通过 Email 发给朋友。',
'announcement_nonexistence' => '目前没有公告供查看,请返回。',
'mark_read_succeed' => '所有版块已被标记已读。',
'register_verify_invalid' => '管理员设置了人工验证新注册用户,请返回等待审核通过。',
'email_verify_invalid' => '您在 24 小时内只能提交一次验证 Email 请求,请返回。',
'email_verify_succeed' => '确认 Email 已经发送,请用邮件中提供的方法激活您的帐号。',
'submit_verify_succeed' => '审核请求提交成功,现在将返回控制面板首页。',
'activate_succeed' => '您好,$member[username],您的帐号已被成功激活,现在将转入论坛首页。',
'activate_illegal' => '您所用的 ID 不存在或您不是等待验证会员。',
'poll_overdue' => '投票已经过期,请返回。',
'poll_choose_most' => '此投票最多只能选择 {$pollarray[maxchoices]} 项,请返回修改。',
'poll_maxchoices_expiration_invalid' => '对不起,最多可选项数与有效记票天数只接受数字,请返回修改。',
'poll_end' => '投票已经结束,不能再投票。',
'trade_closed' => '本交易已关闭',
'trade_invalid' => '无效的交易请求',
'trade_credits_no_enough' => '您的 {$extcredits[$creditstrans][title]} 不足,无法用 {$extcredits[$creditstrans][title]} 换取商品的优惠,请返回修改。',
'trade_by_myself' => '您无法购买自己的商品,请返回修改。',
'trade_input_no' => '请输入正确的商品数,请返回修改。',
'trade_lack' => '商品剩余数量不足,请返回修改。',
'trade_alipay_please' => '对不起,支付宝账户不能为空,请返回修改。',
'trade_please_name' => '对不起,商品名称不能为空,请返回修改。',
'trade_price_between' => '对不起,商品价格必须在 '.$mintradeprice.' 元至 '.$maxtradeprice.' 元之间,请返回修改。',
'trade_price_more_than' => '对不起,商品价格必须大于 $mintradeprice 元,请返回修改。',
'trade_please_locus' => '对不起,商品所在地不能为空,请返回修改。',
'tread_please_number' => '对不起,商品数量不能为空,请返回修改。',
'trade_orderstatus_updated' => '交易单状态已更新。',
'trade_displayorder_updated' => '柜台商品摆放顺序已更新。',
'trade_order_created' => '交易单已创建,现在将转入交易单页面。',
'trade_password_error' => '您输入的密码不正确,不能修改订单状态,请返回修改。',
'trade_thread_succeed' => '非常感谢,您的商品主题已经发布,现在将转入添加商品页。',
'trade_add_succeed' => '非常感谢,您的商品已经发布,现在将转入商品主题页。<br /><br /><a href=\"post.php?action=reply&fid=$fid&tid=$tid&addtrade=yes\">[ 继续添加商品请点击这里 ]</a><br /><br /><a href=\"forumdisplay.php?fid=$fid\">[ 需要转入主题列表请点击这里 ]</a>',
'trade_newreply_nopermission' => '对不起,只有已开放的商品主题可以回复,请返回。',
'reward_cant_operate' => '对不起,您不能设置最佳答案, 请返回。',
'reward_cant_self' => '对不起,您不能把自己的回复设置成最佳答案, 请返回。',
'reward_repeat_selection' => '不能重复选定最佳答案, 请返回。',
'reward_completion' => '最佳答案设置成功,请返回。',
'reward_credits_invalid' => '对不起,悬赏积分设置不合理,请返回修改。',
'reward_credits_please' => '对不起,悬赏积分不能为空,请返回修改。',
'reward_credits_fall' => '对不起,悬赏积分不能降低, 请返回修改。',
'reward_credits_overflow' => '对不起,悬赏积分不能高于 32767,请返回修改。',
'reward_credits_between' => '对不起,悬赏积分必须在 $minrewardprice 与 $maxrewardprice 之间, 请返回修改。',
'reward_credits_shortage' => '对不起,积分余额不足,请返回修改。',
'reward_end' => '对不起,请确认是否是悬赏贴或者悬赏已经结束。',
'activity_stop' => '对不起,活动已停止申请,请返回。',
'activity_repeat_apply' => '对不起,活动不能重复申请。',
'activity_completion' => '活动申请成功,请等待发起人审核。',
'activity_choice_applicant' => '请选择活动的申请者。',
'activity_auditing_completion' => '活动人员审核完毕。',
'activity_delete_completion' => '活动列表清理完毕。',
'activity_fromtime_please' => '对不起,活动开始时间不能为空,请返回修改。',
'activity_fromtime_error' => '对不起,活动开始时间格式不正确,请返回修改。',
'activity_sort_please' => '对不起,活动所属类别不能为空,请返回修改。',
'activity_address_please' => '对不起,活动地点不能为空,请返回修改。',
'activity_totime_error' => '对不起,活动征集截止日期格式不正确,请返回修改。',
'activity_smaller_current' => '对不起,活动开始时间不能小于当前时间',
'post_poll_inputmore' => '对不起,您至少应当填写 2 个投票选项,请返回修改。',
'getpasswd_account_notmatch' => '用户名,Email 地址或安全提问不匹配,请返回修改。',
'getpasswd_account_invalid' => '对不起,管理员和超级版主不能使用取回密码功能,请返回。',
'getpasswd_illegal' => '您所用的 ID 不存在或已经过期,无法取回密码。',
'getpasswd_send_succeed' => '取回密码的方法已经通过 Email 发送到您的信箱中,<br />请在 3 天之内到论坛修改您的密码。',
'getpasswd_succeed' => '您的密码已重新设置,请使用新密码登录。',
'blog_nonexistence' => '指定的用户不存在,或其文集中没有文章。',
'blog_topic_nonexistence' => '指定的文章不存在或已被删除,请返回。',
'blog_category_isnull' => '当前作者在指定栏目内没有文集,请返回。',
'blog_add_illegal' => '对不起,您不是本主题的作者,无法进行此操作。',
'blog_add_succeed' => '操作成功。',
'threadmod_nonexistence' => '主题管理记录不存在,或管理记录已经过期并删除,请返回。',
'pm_newbie_span' => '对不起,您只在注册时间起 $newbiespan 小时后才有发短消息权限,请返回。',
'ajax_pm_newbie_span' => '对不起,您只在注册时间起 $newbiespan 小时后才有发短消息权限。',
'pm_box_isfull' => '您的信箱已满,在阅读短消息前必须删除一些不用的信息。',
'pm_nonexistence' => '对不起,短消息不存在或已被删除。',
'pm_flood_ctrl' => '对不起,您两次发消息间隔少于 $floodctrl 秒,请不要灌水!',
'pm_send_nonexistence' => '收件人不存在或存在重复,请返回修改。',
'ajax_pm_send_nonexistence' => '收件人{$msgto}不存在。',
'pm_send_invalid' => '您的消息没有填写完整,请返回修改。',
'ajax_pm_send_invalid' => '您的消息没有填写完整。',
'pm_send_toomany' => '收件人数量超过 $maxpmsend 人,请返回修改。',
'pm_send_ignore' => '$member[username] 拒绝接受您或所有人发来的短消息,请返回修改。',
'ajax_pm_send_ignore' => '$member[username] 拒绝接受您或所有人发来的短消息。',
'pm_send_succeed' => '短消息发送成功,现在将转入消息列表。',
'ajax_pm_send_succeed' => '短消息发送成功。',
'pm_saved_succeed' => '短消息已保存,现在将转入草稿箱。',
'pm_delete_succeed' => '指定消息成功删除。',
'pm_mark_unread_succeed' => '标记为未读成功。',
'pm_ignore_succeed' => '忽略列表已成功更新,现在将转入消息列表。',
'pm_noprompt_succeed' => '短消息已忽略。',
'ajax_pm_noprompt_succeed' => '',
'plugin_nopermission' => '对不起,您没有权限使用此插件模块。',
'plugin_module_nonexistence' => '指定的插件模块文件($modfile)不存在或存在语法错误,请检查是否已将插件完整上传。',
'admin_nopermission' => '对不起,您没有权限使用管理功能。',
'admin_expiration_invalid' => '您设置的有效期限超出系统允许的范围,请返回修改。',
'admin_reason_invalid' => '对不起,您在进行操作前需要选择或输入原因,请返回修改。',
'admin_moderate_invalid' => '对不起,您没有选择主题或者无法操作特殊主题,请返回修改。',
'admin_getip_nopermission' => '对不起,您没有权限查看比您高级的管理员 IP,请返回。',
'admin_delpost_invalid' => '您没有选择要删除的帖子,请返回。',
'admin_banpost_invalid' => '您没有选择要屏蔽的帖子,请返回。',
'admin_move_illegal' => '您选择的目标版块与原版块相同,请返回修改。',
'admin_split_invalid' => '这个主题没有回复,无法分割,请返回。',
'admin_split_subject_invalid' => '您没有输入标题,请返回修改。',
'admin_split_new_invalid' => '您没有选择要分割入新主题的帖子,请返回修改。',
'admin_merge_nonexistence' => '您指定的主题 ID (tid) 不存在,请返回修改。',
'admin_merge_invalid' => '对不起,您没有权限合并当前版块以外的主题或将主题与自身合并,请返回。',
'admin_succeed' => '管理操作成功,现在将返回论坛。',
'admin_succeed_next' => '管理操作成功,现在将转入后续操作。',
'admin_move_invalid' => '您没有选择目标版块或者目标版块不存在,请返回修改。',
'admin_move_have_mod' => '目标版块需要内容审核,您不能将主题复制或者移动到那里。',
'admin_move_nopermission' => '对不起,你在目标版块没有发帖权限或者发表特殊主题的权限,请返回。',
'supe_post_reply_succeed' => '非常感谢,您的回复已经发布,现在将转入主题页。',
'supe_post_reply_succeed' => '非常感谢,您的回复已经发布,现在将转入主题页。',
'supe_resource_not_exist' => '该资源不存在,或者被删除。请返回。',
'supe_resource_is_not_of_you' => '该资源不是您所发布,您没有权力操作他人的资源。请返回。',
'supe_resource_have_imported_into_forum' => '该资源已经导入论坛, 请不要重复导入。请返回。',
'supe_resource_imported_forbid' => '对不起!论坛没有开启 SupeSite,您不能导入资源,请返回。',
'supe_imported_succeed' => '你所选择的资源已经成功导入论坛!',
'supe_pls_select_forum' => '您选择论坛的论坛不存在或者您没有权限导入!请返回修改。',
'supe_newthread_import_mod_succeed' => '你所选择的资源已经成功导入论坛!<br />管理员设置了需要对新主题进行审核,现在将转入主题列表,您的帖子通过审核后将被显示出来。',
'supe_imported_newthread_have_replies' => '对不起,管理员设置了需要对该论坛的帖子进行审核,您的资源已经有人回复,不能导入该论坛,请您返回尝试选择其它论坛。',
'supe_post_edit_succeed' => '您的帖子编辑成功,现在将转入主题页。',
'supe_post_reply_succeed' => '非常感谢,您的回复已经发布,现在将转入主题页。',
'supe_post_newthread_succeed' => '非常感谢,您的主题已经发布,现在将转入主题页。',
'supe_pushsetting_nohand' => '当前论坛设置不允许手工推送到 SupeSite,请返回检查。',
'supe_pushsetting_noopen' => '论坛没有开启 SupeSite,您不能推送主题,请返回检查。',
'supe_imported_trade_notallowed' => '对不起!您无法将该商品导入论坛,导致此结果的原因可能是论坛没有开启交易功能,或者管理员没有设置交易帐号,请返回。',
'supe_imported_trade_forum_notallowed' => '对不起!您没有权限将此商品导入该论坛,导致此结果的原因可能是您所选择的论坛不允许发布商品主题,或者您所在的用户没有权限进行交易,请返回。',
'supe_pwverify' => '您输入的密码不正确,不能访问这个圈子。',
'supe_pwpass' => '密码验证成功,现在将转入主题页。',
'supe_permission_limit' => '对不起,此帖仅对圈内人士开放!',
'special_noaction' => '特殊主题不允许进行此操作,请返回。',
'special_refundment_invalid' => '特殊主题不能执行强制退款!',
'auditstatuson_succeed' => '审核成功,点击查看该帖。',
'audit_edit_succeed' => '<a href=\"javascript:if(opener)opener.location.reload();window.close();\">编辑成功, 点击关闭本页。</a>',
'todays_birthdays_banned' => '对不起,管理员禁止了显示生日会员功能。',
'switch_status_now' => '正在切换您的状态。',
'space_style_nofound' => '个人空间风格不存在,请返回。',
'space_layout_nocenter' => '中间栏至少要有一个模块,请返回。',
'space_setting_succeed' => '个人空间设置保存成功。<br /><br /><a href=\"memcp.php?action=spacemodule\">[ 需要继续管理个人空间请点击这里 ]</a>',
'magics_close' => '道具中心关闭,请返回。',
'magics_market_close' => '道具市场关闭,请返回。',
'magics_market_operation_error' => '道具市场关闭,请返回。',
'magics_perm' => '您所在的用户组不允许使用道具系统,请返回。',
'magics_nonexistence' => '道具不存在或者不可用,请返回。',
'magics_filename_nonexistence' => '道具文件所需文件 {$magicfile} 不存在。',
'magics_info_nonexistence' => '相关资料填写不全,请返回。',
'magics_nopermission' => '你所在的用户组不允许进行该操作,请返回。',
'magics_credits_no_enough' => '您的 {$extcredits[$creditstrans][title]} 不足,请返回修改购买道具数量。',
'magics_num_no_enough' => '库存不足,请返回修改购买道具数量。',
'magics_amount_no_enough' => '没有足够的道具可以操作,请返回修改。',
'magics_num_invalid' => '操作数量不合法,请返回修改。',
'magics_succeed' => '道具操作成功。',
'magics_post_anonymous' => '匿名贴不允许使用此道具,请返回。',
'magics_price_iszero' => '您的道具售价扣除积分交易税后为 0,请返回修改。',
'magics_price_invalid' => '道具设置价格不正确,请返回修改。',
'magics_price_high' => '道具设置价格过高,请返回修改。',
'magics_username_nonexistence' => '您没有输入要赠送的用户名,请返回。',
'magics_target_nopermission' => '对不起,不允许对目标对象使用该道具,请返回。',
'magics_target_nonexistence' => '对不起,您所指定的目标不存在,请返回。',
'magics_weight_range_invalid' => '超过最大道具负载量,请返回修改。',
'magics_give_myself' => '对不起,不能赠送给自己,请返回修改。',
'magics_give_succeed' => '赠送成功',
'magics_mod_forbidden' => '对不起,此帖已被版主操作,禁止使用道具,请返回。',
'magics_operation_succeed' => '道具使用成功。',
'magics_operation_nopermission' => '对不起,此道具只能操作自己发的主题和帖子,请返回。',
'magics_MOK_message' => '恭喜您,获得 {$getmoney} {$extcredits[$creditstrans][title]} 请返回',
'magics_SEK_message' => '此人的IP为: {$post[useip]} 请返回。',
'magics_RTK_on_message' => '你查询的会员不在线。',
'magics_RTK_off_message' => '你查询的会员在线,所在位置 {$actioncode[$msession[action]]} 请返回。',
'faq_content_empty' => '指定的帮助项目不存在,请返回。',
'faq_search_help' => '搜索帮助',
'faq_keywords_empty' => '您没有指定要搜索的关键字,请返回重新填写。',
'frame_off' => '对不起,没有开启左右分栏功能,请返回。',
'extcredits_disallowexchangeout' => '$extcredits[$fromcredits][title] 不允许兑出',
'extcredits_disallowexchangein' => '$extcredits[$tocredits][title] 不允许兑入',
'circle_nopermission' => '对不起,你尚未加入本圈,无法进行此操作。请返回。',
'tag_closed' => '对不起,管理员锁定了此 TAG。',
'eccredit_order_notfound' => '指定的订单不存在或已被删除。',
'eccredit_rate_repeat' => '不能重复评价。',
'eccredit_succees' => '您的评价已经成功。',
'eccredit_nofound'=> '指定的评价不存在或已被删除。',
'eccredit_reexplanation_repeat' => '请勿重复解释。',
'eccredit_reexplanation_closed' => '对不起,允许解释的有效期已过!',
'invite_invalid' => '您填写的邀请码无效。',
'invite_close' => '邀请注册功能已关闭,请返回。',
'invite_nopermission' => '您所在的用户组不允许使用邀请注册。',
'invite_num_invalid' => '购买数量非法',
'invite_buy_succeed' => '购买成功。',
'invite_mark_succeed' => '标记操作成功。',
'invite_num_buy_range_invalid' => '超过您所在用户组邀请码拥有数量的最大值,请返回修改购买数量。',
'invite_num_range_invalid' => '您所拥有的邀请码数量已经到达最大值,请返回。',
'invite_credits_no_enough' => '您的 {$extcredits[$creditstrans][title]} 不足,请返回修改购买数量。',
'debate_end' => '辩论已经结束,请返回。',
'debate_position_nofound' => '对不起,发表辩论主题需要输入正方和反方观点,请返回修改。',
'debate_endtime_invalid' => '对不起,您设置辩论的结束时间小于当前时间,请返回修改。',
'debate_nofound' => '对不起,该辩论主题不存在。',
'debate_poll_nopermission' => '对不起,请您先登陆,然后再进行投票。',
'debate_poll_voted' => '您已经投过票。',
'debate_poll_end' => '投票已经结束,不能再投票。',
'debate_poll_succeed' => '投票成功。',
'debate_poll_myself' => '对不起,您不能给自己投票。',
'debate_umpire_invalid' => '对不起,你指定的裁判 (<b>{$umpire}</b>) 不存在或者被删除,请返回修改。',
'debate_umpire_edit_invalid' => '您发表的评论已经超出了一个小时,您不能再进行编辑。',
'debate_umpire_nopermission' => '您不是裁判,不能对此辩论进行评判,请返回。',
'debate_umpire_nofound_bestdebater' => '您没有填写最佳辩手,请返回。',
'debate_umpire_nofound_winner' => '您没有填写获胜方,请返回。',
'debate_umpire_nofound_point' => '您没填写您的观点,请返回。',
'debate_umpire_bestdebater_invalid' => '您指定的最佳辩手不存在或者不合法,请返回修改。',
'debate_umpire_comment_succeed' => '评判成功。',
'debate_umpire_comment_invalid' => '裁判已经进行了评判,您不能再进行编辑,请返回。',
'debate_stand_incorrect' => '您选择的立场与上一次不一致,请返回确认。',
'threadtype_required_invalid' => '资料填写不全,请返回检查{$checkoption[$var][title]}选项。',
'threadtype_format_invalid' => '资料格式不正确,请返回检查{$checkoption[$var][title]}选项。',
'threadtype_toolong_invalid' => '资料长度过长,请返回检查{$checkoption[$var][title]}选项。',
'threadtype_num_invalid' => '资料数值不正确,请返回检查{$checkoption[$var][title]}选项。',
'threadtype_unchangeable_invalid' => '资料不得修改,请返回检查{$checkoption[$var][title]}选项。',
'threadtype_expiration_invalid' => '此主题必须指定有效期,请返回修改。',
'video_del_succeed' => '视频成功被删除',
'video_invalid' => '指定的视频不存在或已被删除',
'reprint_invalid' => '转贴数据不存在,请返回。',
);
?> | zyyhong | trunk/jiaju001/bbs/templates/default/messages.lang.php | PHP | asf20 | 41,437 |
{template header}
<!--{if $inajax}-->
<div class="tagthread">
<a class="close" href="javascript:;hideMenu()" title=="{lang close}"><img src="{IMGDIR}/close.gif" alt="{lang close}" /></a>
<h4>{lang tag}: $name</h4>
<ul>
<!--{if $threadlist}-->
<!--{loop $threadlist $thread}-->
<li><a href="viewthread.php?tid=$thread[tid]" target="_blank">$thread[subject]</a></li>
<!--{/loop}-->
<!--{/if}-->
<li class="more"><a href="tag.php?name=$tagnameenc" target="_blank">{lang tag_more}</a></li>
</ul>
</div>
<!--{else}-->
<div id="nav">
<a href="$indexname">$bbname</a> » <a href="tag.php">{lang tag}</a> » $name
</div>
<!--{if !empty($multipage)}-->
<div class="pages_btns">
$multipage
</div>
<!--{/if}-->
<div class="mainbox threadlist">
<h1>{lang tag}: $name</h1>
<table summary="$name" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td class="icon"> </td>
<th>{lang subject}</th>
<td class="forum">{lang forum}</td>
<td class="author">{lang author}</td>
<td class="nums">{lang replies}/{lang views}</td>
<td class="lastpost">{lang lastpost}</td>
</tr>
</thead>
<!--{if $threadlist}-->
<!--{loop $threadlist $thread}-->
<tbody>
<tr>
<td class="icon">
<!--{if $thread['special'] == 1}-->
<img src="{IMGDIR}/pollsmall.gif" alt="{lang thread_poll}" />
<!--{elseif $thread['special'] == 2}-->
<img src="{IMGDIR}/tradesmall.gif" alt="{lang thread_trade}" />
<!--{elseif $thread['special'] == 3}-->
<!--{if $thread['price'] > 0}-->
<img src="{IMGDIR}/rewardsmall.gif" alt="{lang thread_reward}" />
<!--{elseif $thread['price'] < 0}-->
<img src="{IMGDIR}/rewardsmallend.gif" alt="{lang thread_rewardend}" />
<!--{/if}-->
<!--{elseif $thread['special'] == 4}-->
<img src="{IMGDIR}/activitysmall.gif" alt="{lang thread_activity}" />
<!--{elseif $thread['special'] == 5}-->
<img src="{IMGDIR}/debatesmall.gif" alt="{lang thread_debate}" />
<!--{elseif $thread['special'] == 6}-->
<img src="{IMGDIR}/videosmall.gif" alt="{lang thread_video}" />
<!--{else}-->
$thread['icon']
<!--{/if}-->
</td>
<th>
<label>
<!--{if $thread['special'] == 1}-->
<img src="{IMGDIR}/pollsmall.gif" alt="{lang thread_poll}" />
<!--{/if}-->
<!--{if $thread['special'] == 2}-->
<img src="{IMGDIR}/tradesmall.gif" alt="{lang thread_trade}" />
<!--{/if}-->
<!--{if $thread['special'] == 3}-->
<!--{if $thread['price'] > 0}-->
<img src="{IMGDIR}/rewardsmall.gif" alt="{lang thread_reward}" />
<!--{elseif $thread['special'] == '3' && $thread['price'] < 0}-->
<img src="{IMGDIR}/rewardsmallend.gif" alt="{lang thread_rewardend}" />
<!--{/if}-->
<!--{/if}-->
<!--{if $thread['special'] == 4}-->
<img src="{IMGDIR}/activitysmall.gif" alt="{lang thread_activity}" />
<!--{/if}-->
<!--{if $thread['special'] == 5}-->
<img src="{IMGDIR}/debatesmall.gif" alt="{lang thread_debate}" />
<!--{/if}-->
<!--{if $thread['attachment']}-->
<img src="images/attachicons/common.gif" alt="{lang attachment}" />
<!--{/if}-->
<!--{if $thread['displayorder']}-->
<img src="{IMGDIR}/pin_$thread[displayorder].gif" alt="{lang thread_stick}<!--{if $thread['displayorder'] == 3}-->$threadsticky[0]<!--{elseif $thread['displayorder'] == 2}-->$threadsticky[1]<!--{elseif $thread['displayorder'] == 1}-->$threadsticky[2]<!--{/if}-->" />
<!--{/if}-->
<!--{if $thread['digest']}-->
<img src="{IMGDIR}/digest_$thread[digest].gif" alt="{lang thread_digest} $thread[digest]" />
<!--{/if}-->
</label>
<a href="viewthread.php?tid=$thread[tid]" target="_blank">$thread[subject]</a>
<!--{if $thread[multipage]}-->
<span class="threadpages">$thread[multipage]</span>
<!--{/if}-->
</th>
<td class="forum"><a href="forumdisplay.php?fid=$thread[fid]">$thread[forumname]</a></td>
<td class="author">
<cite>
<!--{if $thread['authorid'] && $thread['author']}-->
<a href="space.php?uid=$thread[authorid]">$thread[author]</a>
<!--{else}-->
<!--{if $forum['ismoderator']}--><a href="space.php?uid=$thread[authorid]">{lang anonymous}</a><!--{else}-->{lang anonymous}<!--{/if}-->
<!--{/if}-->
</cite>
<em>$thread[dateline]</em>
</td>
<td class="nums"><strong>$thread[replies]</strong> / <em>$thread[views]</em></td>
<td class="lastpost">
<em><a href="redirect.php?tid=$thread[tid]&goto=lastpost#lastpost">$thread[lastpost]</a></em>
<cite>{lang forum_lastpost_by} <!--{if $thread['lastposter']}--><a href="space.php?username=$thread[lastposterenc]">$thread[lastposter]</a><!--{else}-->{lang anonymous}<!--{/if}--></cite>
</td>
</tr>
<!--{/loop}-->
<!--{else}-->
<tr><td colspan="5">{lang tag_nofound}</td></tr>
<!--{/if}-->
</table></div>
<!--{if !empty($multipage)}-->
<div class="subtable" style="margin-top: {TABLESPACE}px">
$multipage
</div>
<!--{/if}-->
<!--{/if}-->
{template footer} | zyyhong | trunk/jiaju001/bbs/templates/default/tag_threads.htm | HTML | asf20 | 5,412 |
<!--{if $postinfo['attachment'] && $attachments}-->
<div class="mainbox">
<h3>{lang attachments}</h3>
<table summary="{lang attachments}" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td class="selector">{lang delete_check}</td>
<td>aid</td>
<td>{lang attachment}</td>
<td class="time">{lang attachment_date}</td>
<td class="nums" nowrap="nowrap">{lang attachment_size}</td>
<td class="nums" nowrap="nowrap">{lang downloads}</td>
<td nowrap="nowrap">{lang readperm}</td>
<td>{lang price}</td>
<td>{lang description}</td>
</tr>
</thead>
<!--{loop $attachments $attach}-->
<tr>
<td class="selector"><input class="checkbox" type="checkbox" name="deleteaid[]" value="$attach[aid]"></td>
<td nowrap="nowrap">
<!--{if $attach['isimage']}-->
<a href="###" onclick="insertAttachimgTag('$attach[aid]', '$attach['width']')" title="{lang post_attachment_insert}">$attach[aid]</a>
<!--{else}-->
<a href="###" onclick="insertAttachTag('$attach[aid]')" title="{lang post_attachment_insert}">$attach[aid]</a>
<!--{/if}-->
</td>
<td>
<div id="attach$attach[aid]">
<a href="###" class="right" onclick="attachupdate('$attach[aid]')">[{lang update}]</a>
<!--{if $attach['isimage']}-->
<a href="###" class="right" onclick="insertAttachimgTag('$attach[aid]', '$attach['width']')" title="{lang post_attachment_insert}">[{lang post_attachment_insertlink}]</a>
<!--{else}-->
<a href="###" class="right" onclick="insertAttachTag('$attach[aid]')" title="{lang post_attachment_insert}">[{lang post_attachment_insertlink}]</a>
<!--{/if}-->
<!--{if $attach['isimage']}-->
<!--{if $editormode || $allowswitcheditor}-->
<span id="imgpreview_$attach[aid]" onmouseover="showMenu(this.id, 0, 0, 1, 0)">$attach[filetype] <a href="attachment.php?aid=$attach[aid]&noupdate=yes¬humb=yes" target="_blank">$attach[filename]</a></span>
<div class="popupmenu_popup" id="imgpreview_$attach[aid]_menu" style="position:absolute;top:-100000px;margin-left: 20px;text-align: center"><img id="preview_$attach[aid]" onload="if(this.width < $thumbwidth) this.style.width = 'auto'; else this.style.width = '{$thumbwidth}px';$('imgpreview_$attach[aid]_menu').style.width = this.clientWidth" {if $attach['thumb']}src="$attach[url]/$attach[attachment].thumb.jpg"{else}src="$attach[url]/$attach[attachment]"{/if} /></div>
<!--{else}-->
$attach[filetype] <a href="attachment.php?aid=$attach[aid]&noupdate=yes¬humb=yes" target="_blank">$attach[filename]</a>
<!--{/if}-->
<!--{else}-->
$attach[filetype] <a href="attachment.php?aid=$attach[aid]" target="_blank">$attach[filename]</a>
<!--{/if}-->
</div>
<span id="attachupdate$attach[aid]"></span>
</td>
<td class="time">$attach[dateline]</td>
<td class="nums">$attach[filesize]</td>
<td class="nums">$attach[downloads]</td>
<td><!--{if $allowsetattachperm}--><input type="text" size="3" name="attachpermnew[{$attach[aid]}]" value="$attach[readperm]"><!--{else}--><input type="text" size="3" value="$attach[readperm]" disabled><!--{/if}--></td>
<td><!--{if $maxprice}--><input type="text" size="3" name="attachpricenew[{$attach[aid]}]" value="$attach[price]"><!--{else}--><input type="text" size="3" value="$attach[price]" disabled><!--{/if}--></td>
<td><input type="text" size="25" name="attachdescnew[{$attach[aid]}]" value="$attach[description]"></td>
</tr>
<!--{/loop}-->
</table>
</div>
<!--{/if}--> | zyyhong | trunk/jiaju001/bbs/templates/default/post_editpost_attachlist.htm | HTML | asf20 | 3,646 |
{template header}
<input type="hidden" name="selecttypeid" size="45" value="$selecttypeid" />
<table cellspacing="0" cellpadding="0" width="100%">
<!--{if $forum['threadtypes']['expiration'][$selecttypeid]}-->
<tr><th>{lang threadtype_expiration}({lang required})</th>
<td>
<select name="typeexpiration">
<option value="259200">{lang three_days}</option>
<option value="432000">{lang five_days}</option>
<option value="604800">{lang seven_days}</option>
<option value="2592000">{lang one_month}</option>
<option value="7776000">{lang three_months}</option>
<option value="15552000">{lang half_year}</option>
<option value="31536000">{lang one_year}</option>
</select>
</td>
</tr>
<!--{/if}-->
<!--{loop $optionlist $optionid $option}-->
<tr>
<th>$option[title]
<!--{if $option['maxnum']}-->
({lang maxnum} $option[maxnum])
<!--{/if}-->
<!--{if $option['minnum']}-->
({lang minnum} $option[minnum])
<!--{/if}-->
<!--{if $option['maxlength']}-->
({lang maxlength} $option[maxlength])
<!--{/if}-->
<!--{if $option['required']}-->
({lang required})
<!--{/if}-->
<!--{if $option['unchangeable']}-->
({lang unchangeable})
<!--{/if}-->
<!--{if $option[description]}--><br />$option[description]<!--{/if}-->
</th>
<td>
<!--{if in_array($option['type'], array('number', 'text', 'email', 'calendar', 'image', 'url'))}-->
<!--{if $option['type'] == 'calendar'}-->
<script type="text/javascript" src="include/javascript/calendar.js"></script>
<input type="text" name="typeoption[{$option[identifier]}]" size="45" value="$option[value]" onclick="showcalendar(event, this, false)" $option[unchangeable] />
<!--{else}-->
<input type="text" name="typeoption[{$option[identifier]}]" size="45" value="$option[value]" $option[unchangeable] />
<!--{/if}-->
<!--{elseif in_array($option['type'], array('radio', 'checkbox', 'select'))}-->
<!--{if $option[type] == 'select'}-->
<select name="typeoption[{$option[identifier]}]" $option[unchangeable]>
<!--{loop $option['choices'] $id $value}-->
<option value="$id" $option['value'][$id]>$value</option>
<!--{/loop}-->
</select>
<!--{elseif $option['type'] == 'radio'}-->
<!--{loop $option['choices'] $id $value}-->
<input type="radio" class="radio" name="typeoption[{$option[identifier]}]" size="45" value="$id" $option['value'][$id] $option[unchangeable]> $value
<!--{/loop}-->
<!--{elseif $option['type'] == 'checkbox'}-->
<!--{loop $option['choices'] $id $value}-->
<input type="checkbox" class="checkbox" name="typeoption[{$option[identifier]}][]" size="45" value="$id" $option['value'][$id][$id] $option[unchangeable]> $value
<!--{/loop}-->
<!--{/if}-->
<!--{elseif in_array($option['type'], array('textarea'))}-->
<textarea name="typeoption[{$option[identifier]}]" rows="10" cols="20" style="width:99%; height:60px" $option[unchangeable]>$option[value]</textarea>
<!--{/if}-->
</td>
</tr>
<!--{/loop}-->
</table>
{template footer}
| zyyhong | trunk/jiaju001/bbs/templates/default/post_typeoption.htm | HTML | asf20 | 3,093 |
<form method="post" action="my.php?item=subscriptions">
<input type="hidden" name="formhash" value="{FORMHASH}" />
<table cellspacing="0" cellpadding="0" width="100%" summary="{lang my_subscription_threads}">
<thead>
<tr>
<td width="48"><input type="checkbox" name="chkall" class="header checkbox" onclick="checkall(this.form)" />{lang delete_check}</td>
<td>{lang subject}</td>
<td>{lang forum}</td>
<td>{lang replies}</td>
<td>{lang lastpost}</td>
</tr>
</thead>
<tbody>
<!--{if $subslist}-->
<!--{loop $subslist $subs}-->
<tr>
<td><input class="checkbox" type="checkbox" name="delete[]" value="$subs[tid]" /></td>
<td><a href="viewthread.php?tid=$subs[tid]" target="_blank">$subs[subject]</a></td>
<td><a href="forumdisplay.php?fid=$subs[fid]" target="_blank">$subs[name]</a></td>
<td>$subs[replies]</td>
<td><cite><a href="redirect.php?tid=$subs[tid]&goto=lastpost#lastpost">$subs[lastpost]</a> by <!--{if $subs['lastposter']}--><a href="space.php?username=$subs[lastposterenc]" target="_blank">$subs[lastposter]</a><!--{else}-->{lang anonymous}<!--{/if}--></cite></td>
</tr>
<!--{/loop}-->
<!--{else}-->
<tr><td colspan="5">{lang memcp_nosubs}</td></tr>
<!--{/if}-->
</table>
<p class="btns"><button type="submit" class="submit" name="subsubmit" value="true">{lang submit}</button></p>
</form> | zyyhong | trunk/jiaju001/bbs/templates/default/my_subscriptions.htm | HTML | asf20 | 1,349 |
<?php
// Email Pack for Discuz! Version 3.1.0
// Translated by Crossday
// ATTENTION: Please add slashes(\) before single & double quotes( ' & " )
$language = array
(
'get_passwd_subject' => '取回密码说明',
'get_passwd_message' => '
$member[username],
这封信是由 $bbname 发送的。
您收到这封邮件,是因为在我们的论坛上这个邮箱地址被登记为用户邮箱,
且该用户请求使用 Email 密码重置功能所致。
----------------------------------------------------------------------
重要!
----------------------------------------------------------------------
如果您没有提交密码重置的请求或不是我们论坛的注册用户,请立即忽略
并删除这封邮件。只在您确认需要重置密码的情况下,才继续阅读下面的
内容。
----------------------------------------------------------------------
密码重置说明
----------------------------------------------------------------------
您只需在提交请求后的三天之内,通过点击下面的链接重置您的密码:
{$boardurl}member.php?action=getpasswd&uid=$member[uid]&id=$idstring
(如果上面不是链接形式,请将地址手工粘贴到浏览器地址栏再访问)
上面的页面打开后,输入新的密码后提交,之后您即可使用新的密码登录
论坛了。您可以在用户控制面板中随时修改您的密码。
本请求提交者的 IP 为 $onlineip
此致
$bbname 管理团队.
$boardurl',
'email_verify_subject' => 'Email 地址验证',
'email_verify_message' => '
$discuz_user ,
这封信是由 $bbname 发送的。
您收到这封邮件,是因为在我们论坛的新用户注册,或用户修改 Email 使用
了您的地址。如果您并没有访问过我们的论坛,或没有进行上述操作,请忽
略这封邮件。您不需要退订或进行其他进一步的操作。
----------------------------------------------------------------------
帐号激活说明
----------------------------------------------------------------------
您是我们论坛的新用户,或在修改您的注册 Email 时使用了本地址,我们需
要对您的地址有效性进行验证以避免垃圾邮件或地址被滥用。
您只需点击下面的链接即可激活您的帐号:
{$boardurl}member.php?action=activate&uid=$discuz_uid&id=$idstring
(如果上面不是链接形式,请将地址手工粘贴到浏览器地址栏再访问)
感谢您的访问,祝您使用愉快!
此致
$bbname 管理团队.
$boardurl',
'email_notify_subject' => '《$thread[subject]》新回复通知',
'email_notify_message' => '
您好,
这封信是由 $bbname 发送的。
您收到这封邮件,是因为您订阅的以下主题在最近 24 小时内有了新的回复。
如果您并没有访问过我们的论坛,或没有进行上述操作,请忽略这封邮件。
您不需要退订或进行其他进一步的操作。
----------------------------------------------------------------------
主题信息
----------------------------------------------------------------------
URL: {$boardurl}viewthread.php?tid=$thread[tid]
标题: $thread[subject]
作者: $thread[author]
查看: $thread[views]
回复: $thread[replies]
该主题最近一次由 $thread[lastposter] 于 $thread[lastpost] 回复。
您订阅的主题可能有更多的回复,为了不影响您信箱的正常使用,我们每 24
小时至多只会发送一次新回复通知,在此期间如果有新回复,将在下次一并通
知。
此致
$bbname 管理团队.
$boardurl',
'add_member_subject' => '您被添加成为会员',
'add_member_message' => '
$newusername ,
这封信是由 $bbname 发送的。
我是 $discuz_user ,$bbname 的管理者之一。您收到这封邮件,是因为您
刚刚被添加成为我们论坛的会员,当前 Email 即是我们为您注册的地址。
----------------------------------------------------------------------
重要!
----------------------------------------------------------------------
如果您对我们的论坛不感兴趣或无意成为会员,请忽略这封邮件。
----------------------------------------------------------------------
帐号信息
----------------------------------------------------------------------
论坛名称:$bbname
论坛地址:$boardurl
用户名:$newusername
密码:$newpassword
从现在起您可以使用您的帐号登录我们的论坛,祝您使用愉快!
此致
$bbname 管理团队.
$boardurl',
'birthday_subject' => '祝您生日快乐',
'birthday_message' => '
$member[username],
这封信是由 $bbname 发送的。
您收到这封邮件,是因为在我们的论坛上这个邮箱地址被登记为用户邮箱,
并且按照您填写的信息,今天是您的生日,很高兴能在此时为您献上一份
生日祝福,我谨代表论坛管理团队,衷心祝福您生日快乐。
如果您并非我们的会员,或今天并非您的生日,可能是有人误用了您的邮
件地址,或错误的填写了生日信息,本邮件不会多次重复发送,请忽略这
封邮件。
此致
$bbname 管理团队.
$boardurl',
'email_to_friend_subject' => '推荐给您: $thread[subject]',
'email_to_friend_message' => '
$sendtoname,
这封信是由 $bbname 的 $discuz_userss 发送的。
您收到这封邮件,是因为在 $discuz_userss 通过我们论坛的“推荐给朋友”
功能推荐了如下的内容给您,如果您对此不感兴趣,请忽略这封邮件。您不
需要退订或进行其他进一步的操作。
----------------------------------------------------------------------
信件原文开始
----------------------------------------------------------------------
$message
----------------------------------------------------------------------
信件原文结束
----------------------------------------------------------------------
请注意这封信仅仅是由用户使用 “推荐给朋友”发送的,不是论坛官方邮件,
论坛管理团队不会对这类邮件负责。
欢迎您访问 $bbname
$boardurl',
'email_to_invite_subject' => '您的朋友 $discuz_userss 发送 $bbname 论坛注册邀请码给您',
'email_to_invite_message' => '
$sendtoname,
这封信是由 $bbname 的 $discuz_userss 发送的。
您收到这封邮件,是因为在 $discuz_userss 通过我们论坛的“发送邀请码给朋友”
功能推荐了如下的内容给您,如果您对此不感兴趣,请忽略这封邮件。您不
需要退订或进行其他进一步的操作。
----------------------------------------------------------------------
信件原文开始
----------------------------------------------------------------------
$message
----------------------------------------------------------------------
信件原文结束
----------------------------------------------------------------------
请注意这封信仅仅是由用户使用 “发送邀请码给朋友”发送的,不是论坛官方邮件,
论坛管理团队不会对这类邮件负责。
欢迎您访问 $bbname
$boardurl',
'moderate_member_subject' => '用户审核结果通知',
'moderate_member_message' => '
$member[username] ,
这封信是由 $bbname 发送的。
您收到这封邮件,是因为在我们的论坛上这个邮箱地址被新用户注册时所
使用,且管理员设置了需对新用户进行人工审核,本邮件将通知您提交的
申请的审核结果。
----------------------------------------------------------------------
注册信息与审核结果
----------------------------------------------------------------------
用户名: $member[username]
注册时间: $member[regdate]
提交时间: $member[submitdate]
提交次数: $member[submittimes]
注册原因: $member[message]
审核结果: $member[operation]
审核时间: $member[moddate]
审核管理员: $discuz_userss
管理员留言: $member[remark]
----------------------------------------------------------------------
审核结果说明
----------------------------------------------------------------------
通过: 您的注册已通过审核,您已成为我们论坛的正式用户。
否决: 您的注册信息不完整,或未满足我们对新用户的某些要求,您可以
根据管理员留言,完善您的注册信息,然后再提交。
删除:您的注册由于与我们的要求偏差较大,或我们的论坛新注册人数已
超过预期,申请被彻底否决。您的帐号已从数据库中删除,将无法
再使用其登录或提交再次审核,请您谅解。
此致
$bbname 管理团队.
$boardurl'
);
?> | zyyhong | trunk/jiaju001/bbs/templates/default/emails.lang.php | PHP | asf20 | 8,957 |
/*
Offical Style for Discuz!(R)
URL: http://www.discuz.net
(C) 2001-2007 Comsenz Inc.
<style type="text/css">
*/
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Common Style ~~~~ */
* { word-wrap: break-word; }
body, td, input, textarea, select, button { color: {TABLETEXT}; font: {FONTSIZE}/1.6em {FONT}; }
body, ul, dl, dd, p, h1, h2, h3, h4, h5, h6, form, fieldset { margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { font-size: 1em; }
#menu li, .popupmenu_popup li, #announcement li, .portalbox li, .tabs li, .postmessage fieldset li, .side li, .formbox li, .notice li { list-style: none; }
a { color: {LINK}; text-decoration: none; }
a:hover { text-decoration: underline; }
a img { border: none; }
em, cite, strong, th { font-style: normal; font-weight: normal; }
table { empty-cells: show; border-collapse: collapse; }
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Layout & Block Style ~~~~ */
.wrap { width: 950px; text-align: left; margin: 0 auto; }
.notice { font-size: {MSGFONTSIZE}; border: 1px solid {NOTICEBORDER}; background: {NOTICEBG} url({IMGDIR}/notice.gif) no-repeat 1em 0.7em; padding: 0.5em 1em 0.3em 3em; margin-bottom: {BOXSPACE}; color: {NOTICETEXT}; }
.message { margin: 3em 10em 5em !important; }
.message h1 { line-height: 26px; border: 1px solid; {PORTALBOXBGCODE}; background-repeat: repeat-x; background-position: 0 0; border-color: {TABLEBG} {TABLEBG} {CATBORDER} {TABLEBG}; padding-left: 1em; margin-bottom: 1em; }
.message p { margin: 1.5em 1em; }
.message a { color: {HIGHLIGHTLINK}; }
#header { width: 100%; overflow: hidden; }
#header h2 { float: left; padding: 5px 0; }
#footer { border-top: 1px solid {BORDERCOLOR}; background: {ALTBG2}; color: {TEXT}; padding: 12px 0; }
#footlinks { float: right; margin-top: -3px; text-align: right; }
#footer img { float: left; margin: 0 10px 0 0; }
#copyright, #debuginfo { font: {SMFONTSIZE}/1.5em {SMFONT}; }
#copyright strong, #copyright em { font-weight: bold; }
#copyright strong a { color: #0954A6; }
#copyright em { color: #FF9D25; }
#debuginfo { color: {LIGHTTEXT}; }
.scrolltop { cursor: pointer; }
#menu { height: 31px; border: 1px solid {CATBORDER}; {HEADERMENUBGCODE}; background-repeat: repeat-x; }
#menu ul { float: right; padding: 4px 10px 0; border-right: 1px solid {TABLEBG}; }
#menu li { float: left; }
#menu li a { text-decoration: none; float: left; color: {HEADERMENUTEXT}; padding: 4px 8px 3px; background: url({IMGDIR}/menu_itemline.gif) no-repeat 0 6px; }
#menu li.hover, #menu li.current { background-color: {BGCOLOR}; border: 1px solid; border-color: {CATBORDER} {CATBORDER} {BGCOLOR}; }
#menu li.current { font-weight: bold; }
#menu li.hover a { padding: 3px 7px; background-image: none; }
#menu li.current a { padding: 4px 7px 3px; background-image: none; }
#menu cite a { font-weight: bold; background-image: none; }
.frameswitch { float: left; height: 30px; line-height: 30px; padding-left: 10px; border-left: 1px solid {TABLEBG}; }
#menu a.frameoff, #menu a.frameon { float: left; border: none; padding-left: 16px; margin-left: 0; background: no-repeat 0 50%; }
#menu a.frameoff { background-image: url({IMGDIR}/frame_off.gif); }
#menu a.frameon { background-image: url({IMGDIR}/frame_on.gif); }
#foruminfo { width: 100%; overflow: hidden; margin: 10px 0; color: {TEXT}; }
#userinfo, #foruminfo #nav { float: left; padding-left: 5px; }
#forumstats, #headsearch { float: right; text-align: right; padding-right: 5px; }
#foruminfo p { margin: 0; }
#foruminfo a{ color: {HIGHLIGHTLINK}; }
#foruminfo em { color: {TABLETEXT}; }
#foruminfo cite { font-weight: bold; }
#foruminfo strong a { font-weight: bold; color: {TABLETEXT}; }
#nav { margin: 10px 5px; }
#foruminfo #nav { margin: 0; }
#userinfo #nav { float: none; padding: 0; }
#nav a { font-weight: bold; color: {HIGHLIGHTLINK}; }
#announcement { border-top: 1px dashed {CATBORDER}; line-height: 36px; height: 36px; overflow: hidden; }
#announcement div { border: 1px solid {BGCOLOR}; padding: 0 10px; line-height: 35px !important; height: 36px; overflow-y: hidden;}
#announcement li { float: left; margin-right: 20px; padding-left: 10px; background: url({IMGDIR}/arrow_right.gif) no-repeat 0 50%; white-space: nowrap; }
#announcement li em { font-size: 0.83em; margin-left: 5px; color: {TEXT}; }
.portalbox { width: 100%; background: {CATBORDER}; margin-bottom: {BOXSPACE}; border-collapse: separate; }
.portalbox td { padding: 10px; vertical-align: top; {PORTALBOXBGCODE}; background-repeat: repeat-x; background-position: 0 0; background-repeat: repeat-x; background-position: 0 0; border: 1px solid {TABLEBG}; }
.portalbox h3 { margin: 0 0 5px; font-size: 1em; white-space: nowrap; }
.portalbox strong { font-weight: bold; margin-top: 4px;}
.portalbox em { color: {LIGHTTEXT}; }
.portalbox em a { color: {LIGHTTEXT}; }
.portalbox cite a { color: {HIGHLIGHTLINK}; }
#supeitems li { float: left; height: 1.6em; overflow: hidden; }
#hottags a { white-space: nowrap; margin-right: 0.5em; }
#hottags h3 { clear:both; }
.headactions { float: right; line-height: 1em; padding: 10px 10px 0 0; }
.headactions img { vertical-align: middle; cursor: pointer; padding: 0 5px; }
.mainbox .headactions { color: {HEADERTEXT}; }
.mainbox .headactions a, .mainbox .headactions span, .mainbox .headactions strong { background: url({IMGDIR}/headactions_line.gif) no-repeat 100% 50%; padding-right: 10px; margin-right: 8px; color: {HEADERTEXT}; }
.mainbox .headactions strong { font-weight: bold; background-image: url({IMGDIR}/arrow_left.gif); }
.pages_btns { width: 100%; padding: 0 0 8px; overflow: hidden; }
.postbtn, .replybtn { float: right; }
.postbtn { margin-left: 10px; cursor: pointer; }
.pages_btns .pages em { line-height: 26px; }
.pages, .threadflow { float: left; border: 1px solid {CATBORDER}; background: {COMMONBOXBG}; height: 24px; line-height: 26px; color: {LIGHTTEXT}; overflow: hidden; }
.pages a, .pages strong, .pages em, .pages kbd, #multipage .pages em { float: left; padding: 0 8px; line-height:26px; }
.pages a:hover { background-color: {BGCOLOR}; }
.pages strong { font-weight: bold; color: {NOTICETEXT}; background: {BGBORDER}; }
.pages a.prev, .pages a.next { line-height: 24px; font-family: Verdana, Arial, Helvetica, sans-serif; }
.pages a.next { padding: 0 15px; }
.pages kbd { border-left: 1px solid {CATBORDER}; margin: 0; }
* html .pages kbd { padding: 1px 8px; }
.pages kbd input { border: 1px solid {CATBORDER}; margin-top: 3px !important; * > margin-top: 1px !important; margin: 1px 4px 0 3px; padding: 0 2px; height: 17px; }
.pages kbd>input { margin-bottom: 2px; }
.threadflow { margin-right: 5px; padding: 0 5px; }
.tabs { padding-bottom: 26px; margin-bottom: 15px; background: {ALTBG2}; border-top: 1px solid {TABLEBG}; border-bottom: 1px solid {CATBORDER}; }
.tabs li { float: left; line-height: 25px; border-right: 1px solid {BGBORDER}; }
.tabs li.current { background: {BGCOLOR}; height: 27px; font-weight: bold; }
.tabs li a { float: left; padding: 0 10px; }
.headertabs { background: {BGCOLOR} none; margin-bottom: 0; }
.headertabs li.current { background-color: {CATCOLOR}; }
.sendpm a { color: {NOTICETEXT}; background: url({IMGDIR}/buddy_sendpm.gif) no-repeat 15px 50%; padding: 0 20px 0 35px !important; }
#headfilter { border: solid {BORDERCOLOR}; border-width: 1px 1px 0; }
#headfilter .tabs { border-bottom-color: {BGCOLOR}; margin-bottom: 0; }
#footfilter { padding: 10px; he\ight: 44px; height: 24px; line-height: 24px; background: {COMMONBOXBG}; border-color: {COMMONBOXBORDER}; font-family: Simsun, "Times New Roman"; }
#footfilter form { float: right; }
#footfilter * { vertical-align: middle; }
.legend { border: 1px solid {BGBORDER}; background: {ALTBG1}; padding: 10px; margin: 10px auto; width: 500px; text-align: center; line-height: 35px; }
.legend label { padding: 0 20px; }
.legend img { vertical-align: middle; margin-right: 10px; }
.avatarlist { overflow: hidden; padding: 5px 0; }
* html .avatarlist { height: 1%; }
.avatarlist dl { float: left; width: 70px; border: 1px solid {COMMONBOXBORDER}; padding: 5px; margin-right: 5px; text-align: center; }
.avatarlist dt { width: 70px; height: 70px; }
.avatarlist dl img { width: 64px; height: 64px; }
.avatarlist dd { height: 22px; line-height: 22px; overflow: hidden; }
.taglist { width: 100%; padding: 10px 0; overflow: hidden; }
.taglist li { float: left; display: inline; width: 10em; height: 24px; overflow: hidden; margin: 0 10px; }
.taglist li em { font-size: 10px; color: {LIGHTTEXT}; }
.attriblist * { color: {TABLETEXT}; }
.attriblist dt { float: left; margin-right: 10px; }
.attriblist .name { font-weight: bold; }
.attriblist dd a { color: {HIGHLIGHTLINK};}
#forumlinks {}
#forumlinks td { padding: 5px 5px 5px 55px; background: url({IMGDIR}/forumlink.gif) no-repeat 18px 50%; color: {LIGHTTEXT}; }
#forumlinks .forumlink_logo { float: right; }
#online {}
#online h4 { font-weight: normal; color: {TEXT}; }
#online h4 strong { font-weight: bold; }
#online dl { padding: 5px 5px 5px 55px; }
#onlinelist { background: url({IMGDIR}/online.gif) no-repeat 10px 10px; border-top: 1px solid {COMMONBOXBORDER}; }
#online dt { padding: 5px; }
#online dt img { margin-bottom: -3px; }
#online dd { border-top: 1px solid {COMMONBOXBORDER}; }
#bdayslist { padding: 10px 0 10px 55px; border-top: 1px solid {COMMONBOXBORDER}; background: url({IMGDIR}/bdays_cake.gif) no-repeat 10px 5px; }
.userlist { overflow: hidden; padding: 5px 5px 0; }
* html .userlist { height: 1%; }
.userlist li { float: left; width:128px; height: 20px; overflow: hidden; }
.userlist li img { vertical-align: middle; }
#onlinelist .userlist li { height: auto; margin:4px auto ;}
#recommendlist { }
#recommendlist li { float: left; white-space: nowrap; width: 24.9%; overflow: hidden; text-indent: 12px; background: url({IMGDIR}/arrow_right.gif) no-repeat 2px 7px; }
#recommendlist.rules li { width: 49%; }
.recommendrules { padding: 0px;}
#seccode { cursor: pointer; }
.autosave { behavior: url(#default#userdata); }
#menu a.notabs { background: none; }
.headactions a.notabs { background: none; margin-right: 0px; padding-right: 0px; }
.absmiddle { vertical-align: middle; }
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Box Style ~~~~ */
/*Main Box*/
.mainbox { background: {TABLEBG}; border: {BORDERWIDTH} solid {BORDERCOLOR}; padding: {TABLESPACE}; margin-bottom: {BOXSPACE}; }
.mainbox h1, .mainbox h3, .mainbox h6 { line-height: 31px; padding-left: 1em; {HEADERBGCODE}; background-repeat: repeat-x; background-position: 0 0; color: {HEADERTEXT}; }
.mainbox h1 a, .mainbox h3 a { color: {HEADERTEXT}; }
.mainbox table { width: 100%; }
.forumlist table, .threadlist table { border-collapse: separate; }
.mainbox thead th, .mainbox thead td { background: {CATCOLOR}; padding: 2px 5px; line-height: 22px; color: {TEXT}; }
.mainbox thead.category th, .mainbox thead.category td { {CATBGCODE}; }
.mainbox thead.separation th, .mainbox thead.separation td { border-top: 1px solid {BGBORDER} }
.mainbox tbody th, .mainbox tbody td { border-top: 1px solid {BGBORDER}; padding: 5px; }
.mainbox tbody cite, .mainbox tbody em { line-height: 1.3em; }
.forumlist tbody strong, .threadlist tbody strong , .formbox tbody strong { color: {NOTICETEXT}; }
/*Tabel Footer: Button Operation*/
.footoperation { background: {CATCOLOR}; padding: 5px; border-top: 1px solid {CATBORDER}; }
.threadlist .footoperation { padding-left: 61px; }
.footoperation * { vertical-align: middle; }
.footoperation label { margin-right: 1em; cursor: pointer; }
.footoperation button { line-height: 1em; display: inline; width: 0; overflow: visible; padding: 3px 5px 2px; border: 1px solid {BGBORDER}; background: {TABLEBG}; color: {HIGHLIGHTLINK}; cursor: pointer; margin-left: 2px; }
.footoperation>button { width: auto; }
/*Forum & Thread List*/
.forumlist tbody th, .forumlist tbody td, .threadlist tbody th, .threadlist tbody td { color: {TEXT}; padding: 1px 5px; border-bottom: 1px solid {TABLEBG}; background-color: {ALTBG1}; }
.forumlist tbody th { height: 40px; }
.forumlist th, .threadlist th { text-align: left; }
.forumlist th { padding-left: 55px !important; }
.forumlist h2 em { color: {HIGHLIGHTLINK}; }
.forumlist tbody th { background-image: url({IMGDIR}/forum.gif); background-repeat: no-repeat; background-position: 13px 50%; }
.forumlist tbody th.new { background-image: url({IMGDIR}/forum_new.gif); }
.moderators a { color: {HIGHLIGHTLINK}; }
.moderators a strong { font-weight: bold; color: {HIGHLIGHTLINK}; }
.threadlist th label { float: right; }
.threadpages { background: url({IMGDIR}/multipage.gif) no-repeat 0 100%; font-size: 11px; margin-left: 5px; white-space: nowrap; }
.threadpages a { padding-left: 8px; }
.threadpages a:hover { text-decoration: underline; }
.threadlist th a.new { color: {NOTICETEXT}; text-transform: uppercase; font-size: 9px; white-space: nowrap; }
.threadlist th input { float: left; margin-right: 5px; }
.threadlist th em, .threadlist th em a { color: {LIGHTTEXT}; }
.threadlist th img.icon { float: left; margin-left: -22px; }
.threadlist th img.attach, .threadlist th img.icon { margin-bottom: -3px; }
.threadlist .target { float: left; display: block; width: 20px; height: 20px; margin-left: -28px; text-indent: -9999px; overflow: hidden; }
* html .threadlist .target { margin-left: -14px; margin-right: 5px; }
.forumlist tbody tr:hover th, .forumlist tbody tr:hover td, .threadlist tbody tr:hover th, .threadlist tbody tr:hover td { background-color: {ALTBG2}; }
.forumlist td.lastpost { width: 260px; }
.threadlist td.folder { text-align: center; width: 30px; }
.threadlist td.icon { text-align: center; padding: 3px 0; width: 16px; }
.threadlist td.author { width: 120px; }
.threadlist td.lastpost { text-align: right; width: 120px; padding-right: 15px; }
.threadlist td.lastpost cite a { color: {LIGHTTEXT}; }
.forumlist cite, .threadlist cite { display: block; }
.threadlist td.author em, .threadlist td.lastpost em { font-size: {SMFONTSIZE}; }
label.highlight { width: 40px; margin-right: 30px; }
label.highlight, label.highlight input { float: left; }
label.highlight em { float: right; width: 16px; height:16px; }
.quickmanage label.highlight { width: 40px; margin: 3px 18px 3px 0; }
#updatecircles th { background-image: none; }
#updatecircles .circlelogo { float: left; margin-left: -40px; margin-top: 10px; max-height: 32px; max-width: 32px; width: expression(this.width > 32 && this.height < this.width ? 32: true); height: expression(this.height > 32 ? 32: true); }
/*Viewthread*/
.viewthread { padding-bottom: 1px; }
.viewthread table, #pmprompt table, #forumlinks, #pmlist, #specialpost, #newpost, #editpost { table-layout: fixed; }
.viewthread ins, .mainbox ins { display: block; text-align: center; text-decoration: none; margin-bottom: 1px; background: {COMMONBOXBG}; border-bottom: 1px solid {CATBORDER}; line-height: 26px; }
ins.logininfo { background: {CATCOLOR}; padding: 2px 5px; line-height: 22px; color: {TEXT}; text-align: left; border: none; }
.viewthread ins, .viewthread ins a { color: {NOTICETEXT}; }
.viewthread td.postcontent, .viewthread td.postauthor { vertical-align: top; padding: 0 1px; border: none; overflow: hidden; background: {TABLEBG}; }
.postinfo { color: {TEXT}; border-bottom: 1px solid {BGBORDER}; padding: 0 5px; line-height: 26px; height: 26px; overflow: hidden; }
.postinfo strong, .postinfo em { float: right; line-height: 26px !important; cursor: pointer; padding: 0 3px; color: {HIGHLIGHTLINK}; }
.postinfo strong { margin-left: 5px; color: {NOTICETEXT}; font-weight: bold; }
* html .postinfo strong { margin-top: -2px; }
.postinfo strong sup { font-weight: normal; margin-left: 1px; color: {LIGHTTEXT}; }
.postinfo a { color: {HIGHLIGHTLINK}; }
.postinfo label { color:{NOTICETEXT}; cursor: pointer; }
.postmessage { padding: 10px; overflow-x: hidden; }
.postmessage *, .pmmessage *, .register * { line-height: normal; }
.defaultpost { height: auto !important; height:200px; min-height:200px !important; }
.postmessage h2 {font-size: 1.17em; margin-bottom: 0.5em; }
.t_msgfont, .t_msgfont td { font-size: {MSGFONTSIZE}; line-height: 1.6em; }
.t_smallfont, .t_smallfont td { font-size: {MSGSMALLSIZE}; line-height: 1.6em; }
.t_bigfont, .t_bigfont td { font-size: {MSGBIGSIZE}; line-height: 1.6em; }
.t_msgfont *, .t_smallfont *, .t_bigfont * { line-height: normal; }
.t_msgfont a, .t_smallfont a, .t_bigfont a { color: {HIGHLIGHTLINK}; }
.postratings { float: right; }
.signatures { overflow: hidden; height: expression(signature(this)); max-height: {MAXSIGROWS}px; background: url({IMGDIR}/sigline.gif) no-repeat 0 0; margin: 10px; padding-top: 20px; color: {TEXT}; line-height: 1.6em; }
.signatures * { line-height: normal; }
.signatures strong { font-weight: bold; }
.postactions { border-top: 1px solid {COMMONBOXBORDER}; background: {COMMONBOXBG}; line-height: 30px; height: 30px; padding: 0 10px; }
.postactions strong { cursor: pointer; }
.postactions input { float: right; margin: 5px 0 0 5px; }
.postactions p { float: right; }
.postmessage .box { border-width: 0; margin: 5px 0; }
.postmessage .typeoption { width: 500px; }
.typeoption tbody th { width: 100px; }
.typeoption tbody td, .typeoption tbody th { border-top: 0px; border-bottom: 1px dashed {COMMONBOXBORDER}; }
.postmessage .box tbody th, .postmessage .box tbody td { border-top-color: {COMMONBOXBORDER}; }
.postmessage fieldset { font-size: 12px; width: 500px; padding: 10px; border: 1px solid {BGBORDER}; margin-top: 2em; }
.postmessage fieldset li { color: {LIGHTTEXT}; line-height: 1.6em; }
.postmessage fieldset li cite, .postmessage fieldset li em { margin: auto 10px; }
.t_msgfont li, .t_bigfont li, .t_smallfont li, .faq li { margin-left: 2em; }
.postattach { width: 500px; margin: 10px 0; }
.postattachlist { width: 500px; font-size: 12px; margin-top: 2em; }
.t_attach { border: 1px solid {COMMONBOXBORDER}; background: {TABLEBG}; font-size: 12px; padding: 5px; }
.t_attach em { color: {LIGHTTEXT}; }
.t_attachlist { border-bottom: 1px dashed {COMMONBOXBORDER}; padding: 5px 0; }
.t_attachlist dt { font-weight: bold; }
.t_attachlist dt img { margin-bottom: -4px; }
.t_attachlist dd { padding-left: 20px; color: {LIGHTTEXT}; }
.t_attachinsert { margin: 1em 0; font-size: 12px; }
.t_attachinsert p img { margin-bottom: -4px; }
.t_table { border: 1px solid {CATBORDER}; empty-cells: show; border-collapse: collapse; }
.t_table td { padding: 4px; border: 1px solid {CATBORDER}; overflow: hidden; }
/* Discuz! Code */
/*CODE & Quote*/
.blockcode, .quote { font-size: 12px; margin: 10px 20px; border: solid {CATBORDER}; border-width: 4px 1px 1px; {PORTALBOXBGCODE}; background-repeat: repeat-x; background-position: 0 0; overflow: hidden; }
.blockcode h5, .quote h5 { border: 1px solid; border-color: {TABLEBG} {TABLEBG} {CATBORDER} {TABLEBG}; line-height: 26px; padding-left: 5px; color: {TEXT}; }
.blockcode code, .quote blockquote { margin: 1em 1em 1em 3em; line-height: 1.6em; }
.blockcode code { font: 14px/1.4em "Courier New", Courier, monospace; display: block; padding: 5px; }
.blockcode .headactions { color: {TEXT}; font-size: {MSGSMALLSIZE}; cursor: pointer; padding-top: 5px; }
p.posttags { margin: 2em 0em 0.5em 0em; }
p.posttags a, .footoperation span.posttags a { color: #F00; font-weight: bold; }
p.posttags .postkeywords a, { color: {NOTICETEXT}; }
.postmessage strong { font-weight: bold; }
.postmessage em { color:{TEXT}; }
.postmessage span.t_tag { cursor: pointer; border-bottom: 1px solid #F00; white-space: nowrap; }
.mainbox td.postauthor { width: 180px; background: {ALTBG2}; padding: 5px; overflow: hidden; }
.postauthor cite { font-weight: bold; display: block; border-bottom: 1px solid {BGBORDER}; height: 21px; overflow: hidden; margin-bottom: 5px; }
.postauthor cite label a { float: right; padding: 3px; }
div.avatar { margin: 5px; text-align: center; width: 160px; overflow: hidden }
.postauthor dt { float: left; margin-right: 0.5em; color: {TEXT}; }
.postauthor dd, .postauthor dt { height: 1.6em; line-height: 1.6em; }
.postauthor dd { overflow: hidden; }
.postauthor p { margin: 0 10px; }
.postauthor p.customstatus { color: {TEXT} }
.postauthor p em, .postauthor dt em { color: {NOTICETEXT}; }
.postauthor ul { margin: 5px 10px; line-height: 1.6em; overflow: hidden; }
.postauthor li { text-indent: 22px; width: 49.5%; height: 1.6em; overflow: hidden; float: left; background-position: 0 50%; background-repeat: no-repeat; }
.postauthor li.pm { background-image: url({IMGDIR}/buddy_sendpm.gif); }
.postauthor li.buddy { background-image: url({IMGDIR}/user_add.gif); }
.postauthor li.space { background-image: url({IMGDIR}/forumlink.gif); }
.postauthor li.online { background-image: url({IMGDIR}/user_online.gif); color: {NOTICETEXT}; }
.postauthor li.offline { color: {TEXT}; background-image: url({IMGDIR}/user_offline.gif); }
.postauthor li.magic { background-image: url({IMGDIR}/magic.gif);}
.postauthor dl.profile, .postauthor div.bio { margin: 5px 10px; padding-top: 5px; }
/*Common Box*/
.box { background: {TABLEBG}; border: {BORDERWIDTH} solid {CATBORDER}; padding: {TABLESPACE}; margin-bottom: {BOXSPACE}; }
.box h4 { {PORTALBOXBGCODE}; background-repeat: repeat-x; background-position: 0 0; line-height: 30px; padding: 0 10px; }
.box table { width: 100%; }
.box td { border-top: 1px solid {COMMONBOXBORDER}; }
.box .box li { list-style: none;}
.postattachlist h4, .tradethumblist h4, .pollpanel h4, .activitythread h4, .typeoption h4 { border-top: 1px solid {BGBORDER}; }
#pmprompt { border-color: {NOTICEBORDER}; }
#pmprompt h4 { background: {NOTICEBG}; border-top: none; }
#pmprompt th, #pmprompt td { border-top-color: {NOTICEBORDER}; }
/*List*/
td.user { width: 120px; }
td.nums { width: 80px; text-align: center; }
td.time { width: 120px; }
td.selector { width: 20px; text-align: center; }
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Spacial Threads ~~~~ */
.specialthread h1 { background: {TABLEBG}; font-size: 1.5em; color: {TABLETEXT}; padding: 10px 5px; border-bottom: 1px solid {COMMONBOXBORDER}; }
.specialthread h1 a { color: {HIGHLIGHTLINK}; }
.specialthread .postcontent label { float: right; display: inline; margin: 12px 12px 0; border: 1px solid {CATBORDER}; padding: 3px 5px; background: {CATCOLOR} no-repeat 3px 50%; }
.specialthread .postcontent label strong { color: {NOTICETEXT}; }
.specialthread .postcontent label a { color: {HIGHLIGHTLINK}; }
.specialthread .postauthor { width: 180px; }
.specialpostcontainer { padding: 0 1px; }
.specialpost { border-bottom: 4px solid {ALTBG1}; text-align: right; }
.specialpost .postinfo h2 { float: left; font-weight: normal; padding-left: 8px; font-size: {SMFONTSIZE}; }
.specialpost .postinfo h2 em {}
.specialpost .postinfo { border-color: {ALTBG2}; height: 1.8em; }
.specialpost strong { border: none; }
.specialpost .postinfo h2 a { font-size: 12px; }
.specialpost .postmessage { text-align: left; min-height: 30px; border-bottom: 1px solid {CATBORDER}; }
* html .specialpost .postmessage { height: 30px; overflow: visible; }
p.imicons { margin: 8px auto; width: 160px;}
/* [ Poll ] */
.pollpanel { margin: 1em 0; border-width: 1px 0 0; }
.pollpanel h4 span { float: left;line-height:30px;}
.pollpanel h4 a { float: right;line-height:30px; font-weight:normal; }
.pollpanel tbody td { vertical-align: middle; }
.pollpanel tbody td a { color: {HIGHLIGHTLINK} }
.optionbar { float: left; margin-right: 0.5em; border: 1px solid {BGBORDER}; {HEADERBGCODE}; background-repeat: repeat-x; background-position: 0 100%; height: 12px; }
.optionbar div { float: left; border: 1px solid {TABLEBG}; height: 10px; overflow: hidden; }
/* [ Reward ] */
.rewardthread .postcontent label { background-image: url({IMGDIR}/rewardsmallend.gif); padding-left: 25px; }
.rewardthread .postcontent label.unsolved { background-image: url({IMGDIR}/rewardsmall.gif); float:right; }
#bestpost { padding-top: 10px; margin-top: 10px; border-top: 1px solid {CATBORDER}; }
/* [ Activity ] */
.activitythread .box th { width: 7em; }
#activityjoin label { float: none; border: none; background: transparent; padding: 0; margin: 0; }
/* [ Trade ] */
.tradethread .postmessage { min-height: 160px; }
* html .tradethread .postmessage { height: 360px !important; }
.tradethread .postauthor dt, .tradethread .postauthor dd { height: 20px; overflow: hidden; }
*>.tradeinfo { overflow: hidden; }
* html .tradeinfo { height: 1%; }
.tradeinfo h1 { background: {ALTBG2}; font-size: 1.5em; color: {TABLETEXT}; padding: 10px 5px; border-bottom: 1px solid {COMMONBOXBORDER}; margin-bottom: 1em; }
.tradethumb, .tradeattribute { float: left; }
.tradethumb { width: 260px; text-align: center;}
.tradeattribute { padding-left: 1em; }
.tradeattribute img { vertical-align: middle; }
.tradeattribute dl { overflow: hidden; padding-bottom:2em !important; }
.tradeattribute dt { float: left; width: 5em; padding: 0.5em; line-height: 2em; clear: left; }
.tradeattribute dd { border-bottom: 1px dotted {COMMONBOXBORDER}; padding: 0.5em 1.5em; line-height: 2em; }
.tradeattribute em, .tradeattribute del { color: {LIGHTTEXT}; }
.tradeattribute strong { font-size: 1.6em; font-weight: bold; color: #F00; }
.sellerinfo { float: right; display: inline; margin-right: 1em; width: 180px; }
.sellerinfo h4 { border-bottom: 1px dotted {COMMONBOXBORDER}; }
.sellerinfo dl { margin: 1em; }
.tradeinfo .postinfo { clear: both; }
.tradeinfo .postmessage { min-height: 100px; }
* html .tradethread .postmessage { height: 100px; }
*>.tradethumblist { overflow: hidden; }
* html .tradethumblist { height: 1%; }
.tradethumblist dl { float: left; text-align: center; padding: 10px; width: 170px; height: 220px; w\idth: 150px; he\ight: 200px; }
.tradethumblist dd.thumblist { height: 100px; overflow: hidden; }
.tradethumblist dd img { vertical-align: middle; cursor: pointer; }
.tradethumblist dl p { height: 1.6em; overflow: hidden; }
.tradethumblist p.tradename { height: 45px; line-height: 18px; margin-top: 5px; }
.tradethumblist del { color: {LIGHTTEXT}; }
.tradethumblist strong { font-weight: bold; color: #F00; }
#ajaxtradelist .price { text-align: right; }
#ajaxtradelist strong { font-weight: bold; color: #F00; }
#ajaxtradelist .popupmenu_popup { white-space: nowrap;overflow: visible; }
#ajaxtradelist .popupmenu_popup a { color: {HIGHLIGHTLINK}; }
/* [ Debate ] */
.debatethread .postmessage { min-height: inherit; height: auto; }
.debatethread .box { margin: 0;}
.debatethread .debatepoints { border-width: 1px 0 0; padding-bottom: 0; border-top: none; margin-bottom: 10px; }
.debatepoints tbody td { border: 0px; width: 50%; border-bottom: none; vertical-align: top; }
.debatepoints .message td.stand1 { border:1px solid {NOTICEBORDER}; background: {NOTICEBG}; border-bottom: none; }
.debatepoints .message td.stand2 { border:1px solid {BGBORDER}; background: {ALTBG1}; border-bottom: none; }
.debatepoints .button td.stand1 { border:1px solid {NOTICEBORDER}; background: {NOTICEBG}; border-top: none; }
.debatepoints .button td.stand2 { border:1px solid {BGBORDER}; background: {ALTBG1}; border-top: none; }
.debatepoints h2 { padding-left: 40px; line-height: 2em; background-position: 5px 1px; background-repeat: no-repeat; }
.stand1 h2 { background-image: url({IMGDIR}/debate_stand_1.gif); }
.stand2 h2 { background-image: url({IMGDIR}/debate_stand_2.gif); }
.poststand0, .poststand1, .poststand2 { font-size: 1.17em; text-align: center; display: block; float: left; border: 1px solid {COMMONBOXBORDER}; background: {COMMONBOXBG}; color: {LIGHTTEXT}; width: 40px; height: 22px; line-height: 22px; margin-right: 12px; }
.poststand1 { border: 1px solid {NOTICEBORDER}; background: {NOTICEBG}; color: {NOTICETEXT}; }
.poststand2 { border: 1px solid {BGBORDER}; background: {ALTBG1}; color: {HIGHLIGHTLINK}; }
.debatepoints p { padding: 0 10px; overflow: hidden; }
.debatepoints a { margin: 0 auto; display: block; width: 80px; text-align: center; border: 1px solid; padding: 0.3em 1em; }
.debatepoints #affirmbutton { border-color: {NOTICEBORDER}; background: {NOTICEBG}; color: {NOTICETEXT}; }
.debatepoints #negabutton { border-color: {BGBORDER}; background: {ALTBG1}; color: {HIGHLIGHTLINK}; }
.debatethread .optionbar div { float: none; }
.payinfo dt { float: left; width: 10em; padding: 0.5em; }
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Control Panel ~~~~ */
.container { width: 100%; overflow: hidden; }
.content { float: right; width: 80%; }
.content .mainbox { padding-bottom: 5px; }
.content .footoperation, .content .mainbox thead th, .content .mainbox thead td,
.content .mainbox tbody th, .content .mainbox tbody td { border-top: none; border-bottom: 1px solid {BGBORDER}; }
.side { float: left; width: 18%;}
.side div { border: 1px solid {CATBORDER};{PORTALBOXBGCODE}; background-repeat: repeat-x; background-position: 0 0; margin-bottom: {BOXSPACE}; }
.side h2 { padding-left: 10px; line-height: 2.4em; font-size: 1.17em; border: 1px solid; border-color: {TABLEBG} {TABLEBG} {COMMONBOXBORDER} {TABLEBG};}
.side ul { padding: 1px; }
.side li{ text-indent: 26px; line-height: 2.4em; }
.side h3 { font-weight: normal; background:url({IMGDIR}/arrow_right.gif) no-repeat 14px 46%; }
.side_on h3 { font-weight: bold; border: solid {BGBORDER}; border-width: 1px 0; background: {ALTBG2} url({IMGDIR}/arrow_down.gif) no-repeat 14px 46%; }
.side li ul { border-bottom: 1px solid {COMMONBOXBORDER}; }
.side li li { padding-left: 1em;}
.side li.current { font-weight: bold; }
.side li.current a { color: {TEXT}; }
.side li.first h3 { border-top: none; }
.side li.last ul { border-bottom: none; }
#memberinfo { }
#memberinfo .memberinfo_avatar { text-align: center; width: 170px; font-weight: bold; }
#memberinfo li label { color: {TEXT}; margin-right: 0.5em; }
#memberinfo .memberinfo_forum label { float: left; width: 7em; text-align: right; }
.mysearch { float: left; display: block; margin-top: -10px; margin-left: 10px;}
/* Message Tabs*/
.msgtabs { border-bottom: 1px solid {CATBORDER}; padding-bottom: 23px; padding-right: 5px; margin-top: 0.8em;}
.msgtabs strong { float: right; padding: 0 12px; border: 1px solid {CATBORDER}; border-bottom: 1px solid {CATCOLOR}; margin-right: 5px; text-decoration: none; height: 22px; line-height: 22px; font-weight: bold; background: {CATCOLOR}; }
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DropMenu ~~~~ */
.dropmenu { padding-right: 15px !important; background-image: url({IMGDIR}/arrow_down.gif) !important; background-position: 100% 50% !important; background-repeat: no-repeat !important; cursor: pointer; }
.popupmenu_popup { text-align: left; line-height: 1.4em; padding: 10px; overflow: hidden; border: 1px solid {CATBORDER}; {PORTALBOXBGCODE}; background-repeat: repeat-x; background-position: 0 1px; }
.headermenu_popup { width: 170px; }
.headermenu_popup li { float: left; width: 7em; line-height: 24px; height: 24px; overflow: hidden; border-bottom: 1px solid {COMMONBOXBORDER}; }
.newspecialmenu { width: 100px; }
.newspecialmenu li { background: url({IMGDIR}/folder_s.gif) no-repeat 3px 50%; float: left; }
.newspecialmenu li.poll { background-image: url({IMGDIR}/pollsmall.gif); }
.newspecialmenu li.trade { background-image: url({IMGDIR}/tradesmall.gif); }
.newspecialmenu li.reward { background-image: url({IMGDIR}/rewardsmall.gif); }
.newspecialmenu li.activity { background-image: url({IMGDIR}/activitysmall.gif); }
.newspecialmenu li.debate { background-image: url({IMGDIR}/debatesmall.gif); }
.newspecialmenu li.video { background-image: url({IMGDIR}/videosmall.gif); }
.newspecialmenu a { float: left; width: 75px; border-bottom: 1px solid {COMMONBOXBORDER}; padding: 5px 0 5px 25px; }
.newspecialmenu a:hover { text-decoration: none; color: {HIGHLIGHTLINK}; border-bottom-color: {CATBORDER}; }
#forumlist_menu { padding: 10px 30px 10px 20px; }
#forumlist_menu dl { padding: 5px 0; }
#forumlist_menu dt a { font-weight: bold; color: {TEXT}; }
#forumlist_menu dd { padding-left: 1em; }
#forumlist_menu li.sub { padding-left: 1em; }
#forumlist_menu li.current a { font-weight: bold; }
#forumlist_menu li a { font-weight: normal; color: {HIGHLIGHTLINK}; }
.userinfopanel { border: 1px solid {CATBORDER}; width: 140px; {PORTALBOXBGCODE}; background-repeat: repeat-x; background-position: 0 0; padding: 10px; }
.imicons { text-align: center; border: 1px solid {COMMONBOXBORDER}; background: {TABLEBG}; padding: 4px 1px; }
.imicons img { vertical-align: middle; }
.userinfopanel p { text-align: left; margin: 0; }
.userinfopanel p a { color: {HIGHLIGHTLINK}; }
.userinfopanel dl { border-bottom: 1px solid {COMMONBOXBORDER}; margin: 5px 0; padding: 5px 0; }
.postauthor cite a { float: left; padding: 5px; border: solid {ALTBG2}; border-width: 1px 1px 0; height: 10px; overflow: hidden; }
.postauthor cite a.hover { border-color: {CATBORDER}; background-color: {TABLEBG}; }
.popupmenu_popup .postauthor { width: 180px; }
.popupmenu_popup .postauthor a { color: {HIGHLIGHTLINK}; }
/*Popup Calendar*/
#calendar { border: 1px solid {BORDERCOLOR}; background: {ALTBG1}; margin-bottom: 0.8em;}
#calendar td { padding: 2px; font-weight: bold;}
#calendar_week td { height: 2em; line-height: 2em; border-bottom: 1px solid {CATBORDER};}
#hourminute td {padding: 4px 2px; border-top: 1px solid {CATBORDER};}
.calendar_expire, .calendar_expire a:link, .calendar_expire a:visited { color: {TEXT}; font-weight: normal; }
.calendar_default, .calendar_default a:link, .calendar_default a:visited { color: {HIGHLIGHTLINK};}
.calendar_checked, .calendar_checked a:link, .calendar_checked a:visited { color: {NOTICETEXT}; font-weight: bold;}
td.calendar_checked, span.calendar_checked{ background: {CATBORDER};}
.calendar_today, .calendar_today a:link, .calendar_today a:visited { color: {TABLETEXT}; font-weight: bold; }
#calendar_header td{ width: 30px; height: 20px; border-bottom: 1px solid {CATBORDER}; font-weight: normal; }
#calendar_year { display: none; line-height: 130%; background: {ALTBG1}; position: absolute; z-index: 10; }
#calendar_year .col { float: left; background: {ALTBG1}; margin-left: 1px; border: 1px solid {CATBORDER}; padding: 4px; }
#calendar_month { display: none; background: {ALTBG1}; line-height: 130%; border: 1px solid #DDD; padding: 4px; position: absolute; z-index: 11; }
#styleswitcher_menu { overflow: visible; }
#styleswitcher_menu, #styleswitcher_menu ul li, #styleswitcher_menu ul li.current a, #styleswitcher_menu ul li a { white-space: nowrap; }
#styleswitcher_menu ul li.current { font-weight: bold; }
#styleswitcher_menu ul li.current a { color: {TEXT}; }
#styleswitcher_menu {}
#styleswitcher_menu li.current { font-weight: bold; }
.tagthread { width: 360px; }
.tagthread .close { float: right; padding-top: 5px; }
.tagthread h4 { line-height: 26px; border-bottom: 1px solid {COMMONBOXBORDER}; }
.tagthread ul { padding: 5px; }
.tagthread li { line-height: 1.8em; }
.tagthread li.more { text-align: right; background: url({IMGDIR}/arrow_right.gif) no-repeat 100% 50%; padding-right: 10px; }
.headactions .popupmenu_popup a, .headactions .popupmenu_popup strong { color: {TEXT}; background: none; white-space: nowrap; }
.headactions .popupmenu_popup { overflow: visible; }
*+html #my_menu, *+html #memcp_menu, *+html #stats_menu, *+html #plugin_menu { margin-left: 1px; }
* html #my_menu, * html #memcp_menu, * html #stats_menu, * html #plugin_menu { margin-left: 1px; }
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Form Style ~~~~ */
fieldset { border: none; }
input, textarea { border-width: 1px; background: {TABLEBG}; border-color: {INPUTBORDER}; padding: 2px; }
input[type="radio"], input[type="checkbox"] { border: none; background: none; }
.radio, .checkbox{ border: none; background: none; }
.invitecodelist input { border: none; font-family: "Courier New", Courier, monospace; font-size: 13px; cursor: pointer; }
button { border: 1px solid; border-color: {COMMONBOXBORDER} {LIGHTTEXT} {LIGHTTEXT} {COMMONBOXBORDER}; background: {CATCOLOR}; height: 2em; line-height: 2em; cursor: pointer; }
#postsubmit, button.submit { margin-right: 1em; border: 1px solid; border-color: #FFFDEE #FDB939 #FDB939 #FFFDEE; background: #FFF8C5; color: {NOTICETEXT}; padding: 0 10px; }
button.insmsg { margin: 1em 0; border: 1px solid {NOTICEBORDER}; background: {NOTICEBG}; color: {NOTICETEXT}; }
.formbox th { width: 180px; text-align: left; }
.formbox th, .formbox td { padding: 5px; }
.formbox th, .formbox td { border-bottom: 1px solid {BGBORDER}; }
.formbox table a { color: {HIGHLIGHTLINK}; }
.formbox label { cursor: pointer; }
.lighttxt, .formbox *.tips { color: {LIGHTTEXT}; }
.formbox th ul { padding: 5px 0; margin: 5px 0; }
#threadtypes table td, #threadtypes table th { border-top: 1px solid {BGBORDER}; border-bottom: 0;}
/*Login Form*/
#loginform * { vertical-align: middle; }
#loginform button { line-height: 21px; height: 21px; padding: 0 4px; margin-left: 3px; }
/*PostForm & Editor*/
.editor_cell { vertical-align: top; }
#editor { border: solid; border-color: {CATBORDER}; border-width: 1px 1px 0; background: {COMMONBOXBG}; }
#editor td { border: none; padding: 2px; }
.editortoolbar table { width: auto; }
.editortoolbar a, .editortoolbar .a { display: block; padding: 1px; border: 1px solid {COMMONBOXBG}; cursor: pointer; }
.editortoolbar a.hover, .editortoolbar a:hover, .editortoolbar .a1 { background-color: {ALTBG2}; border: 1px solid {BORDERCOLOR}; text-decoration: none; }
.editor_switcher_bar { position: relative; }
.editor_switcher_bar a { float: right; padding: 0 3px; margin-right: 5px; }
.editor_switcher_bar button { border: 1px solid; border-color: {CATBORDER} {CATBORDER} {TABLEBG} {CATBORDER}; font-weight: bold; height: 30px; he\ight: 28px; line-height: 28px; background: {TABLEBG}; margin: 0 2px; position: relative; top: 6px; cursor: pointer; }
*+html .editor_switcher_bar button { top: 4px; }
* html .editor_switcher_bar button { top: 4px; }
.editor_switcher_bar .editor_switcher { border-bottom-color: {CATBORDER}; font-weight: normal; }
.editor_text { border: 1px solid; border-color: {CATBORDER} {CATBORDER} {CATBORDER} {CATBORDER}; }
.editor_text textarea { border: none; width: 99%; font: 12px/1.6em "Courier New", Courier, monospace; }
.editor_button { background: {COMMONBOXBG}; border: solid {CATBORDER}; border-width: 0 1px 0; margin-bottom: {BOXSPACE}; }
.editor_button button { background: transparent; border-width: 0 0 0 1px; color: {HIGHLIGHTLINK}; }
.editor_attach { border: 1px solid {CATBORDER}; }
#wysiwyg { font: {MSGFONTSIZE}/1.6em {FONT} !important; }
#wysiwyg * { line-height: normal; }
#wysiwyg a { text-decoration:underline; color: {HIGHLIGHTLINK} !important; color: {HIGHLIGHTLINK}; }
#wysiwyg li { margin-left: 2em; }
#wysiwyg strong, #wysiwyg b { font-weight: bold; }
#wysiwyg em, #wysiwyg i { font-style: italic; }
.fontname_menu { width: 97px; }
.fontsize_menu { width: 27px; line-height: normal; }
#posteditor_popup_table_menu { width: 220px; }
.fontname_menu li, .fontsize_menu li { cursor: pointer; }
.editor_colornormal, .editor_colorhover { border: none !important; padding: 2px !important; }
.editor_colornormal div { width: 10px; height: 10px; overflow: hidden; cursor: pointer; border: 1px solid {TABLEBG}; }
.editor_colorhover div { width: 10px; height: 10px; overflow: hidden; cursor: pointer; border: 1px solid {TABLETEXT}; }
/*QuickPost*/
#quickpost { overflow: hidden; padding-bottom: 0; }
* html #quickpost { height: 1%; overflow: visible; }
#quickpost h5 { margin: 0.5em 1em; }
.postoptions, .postform, .smilies { float: left; }
.postoptions, .smilies { width: 20%; }
.postoptions p { margin: 2px 0.7em; }
.postform { width: 59%; padding-bottom: 10px; }
.postform p label { vertical-align: top; font-weight: bold; }
.postform h5 input { width: 60%; }
.postform p, .postform div { margin: 0 1em; }
.postform h4 * { vertical-align: middle; }
.postform h4 input { width: 60%; }
.postform textarea { width: 90%; height: 160px; }
.postform .btns { margin-top: 0.5em; line-height: 30px; color: {LIGHTTEXT}; }
.postform .btns button { vertical-align: middle; }
.postform .btns a { color: {HIGHLIGHTLINK}; }
.postform button { border: none; background: transparent; color: {HIGHLIGHTLINK}; padding: 0; cursor: pointer; }
.postform #postsubmit { float: left; display: inline; margin-left: 2.3em; }
.btns em { color: {LIGHTTEXT}; }
#smilieslist { border: 1px solid {COMMONBOXBORDER}; overflow: hidden; text-align: center; }
#quickpost #smilieslist { margin: 6px 1em 0 ; }
#quickpost h4 { border-bottom: 1px solid {COMMONBOXBORDER};}
#smilieslist td { border: none; padding: 8px 0; cursor: pointer; }
#smilieslist td:hover { background: {COMMONBOXBORDER}; }
#smilieslist .pages { float: none; border-width: 1px 0 0; }
#smilieslist h4 { color: {HIGHLIGHTLINK}; padding: 5px; line-height: 20px; background: {COMMONBOXBG}; border-bottom: 1px solid {COMMONBOXBORDER}; text-align: left; }
#smilieslist .popupmenu_popup { overflow: visible; padding: 5px 10px; white-space: nowrap; }
#smilieslist .popupmenu_popup a { color: {HIGHLIGHTLINK}; }
/*Ajax Form*/
.ajaxform {}
.ajaxform th, .ajaxform td { border-bottom: 1px solid {COMMONBOXBORDER}; padding: 5px; }
.ajaxform thead th { font-weight: bold; }
.ajaxform a { color: {HIGHLIGHTLINK}; }
.btns th, .btns td { border: none !important; }
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Advertisments ~~~~ */
#ad_headerbanner { float: right; margin-top: 15px; }
.ad_text { border: 1px solid {CATBORDER}; margin-bottom: {BOXSPACE}; padding: 6px; {PORTALBOXBGCODE}; background-repeat: repeat-x; }
.ad_text table { width: 100%; border-collapse: collapse; }
.ad_text td { background-repeat: repeat-x; background-position: 0 0; padding: 2px 10px; }.ad_textlink1 { float: left; white-space: nowrap; }
.ad_textlink2 { margin: 10px; }
.ad_textlink1,.ad_textlink2 { padding-left: 25px; background: url({IMGDIR}/ad_icon.gif) no-repeat 0 50%; }
.ad_pip { clear: right; float: right; display: inline; margin: 10px 10px 10px; }
.ad_topicrelated { clear: both; float: right; display: inline; margin: 0 10px 10px; padding: 10px 10px 10px 30px; border: 1px solid #78A73D; background: #CAEEC0; }
.ad_column { text-align: center; margin-bottom: {BOXSPACE}; }
.ad_footerbanner { text-align: center; clear: both; margin: 5px }
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Archiver ~~~~ */
.archiver .wrap { margin: 20px auto 10px; width: 760px; padding: 10px; border: 1px solid {CATBORDER}; }
.archiver_banner { text-align: center; padding: 5px; margin-top: 40px;}
.archiver h1, .archiver h2 { font-size: 1.17em; padding: 0 5px; }
.archiver_forumlist, .archiver_threadlist { padding: 1em; font-size: 1.17em; line-height: 1.6em; }
.archiver_forumlist ul { padding-left: 2em; }
.archiver_threadlist li { list-style: none; padding-left: 10px; background: url({IMGDIR}/arrow_right.gif) no-repeat 0 46%; }
.archiver_threadlist li em { color: {LIGHTTEXT}; font-size: 0.83em; }
.archiver_post { border-top: 1px solid {CATBORDER}; }
.archiver_post cite { padding-left: 10px; font-weight: bold; }
.archiver_post p { line-height: 3em; height: 3em; margin-bottom: 0.5em; background: {ALTBG2}; }
.archiver_postbody { overflow:hidden; font-size: 1.17em; padding: 0 10px 10px; border-bottom: 1px solid {COMMONBOXBORDER}; }
.archiver_pages, .archiver_fullversion { padding: 10px; }
.archiver_pages strong, .archiver_fullversion strong, .archiver_fullversion strong a { font-weight: bold; color: {NOTICETEXT}; }
#ajaxwaitid { position: absolute; display: none; z-index: 100; width: 100px; height: 1.6em; top: 0px; right: 0px; line-height: 1.6em; overflow: hidden; background: #dd0000; color: #ffffff;}
.postform .special, #postform .special { font-weight: bold; color: {HIGHLIGHTLINK};}
#newpost em { color: {LIGHTTEXT} }
.top{ border-left: 0px; border-top:0xp; border-right:0px; border-bottom: 1px solid #FF9200; height:23px; background-color:#FFD297; text-align:right; line-height:23px}
.top a{ padding:0px 5px} | zyyhong | trunk/jiaju001/bbs/templates/default/css.htm | HTML | asf20 | 45,113 |
<div style="clear: both; margin-top: 5px">
<table width="{TABLEWIDTH}" align="center" style="border: #FF9200 solid 1px;">
<tr class="header" style="background-color:#FFD297">
<td width="25%" align="center"><b>≡ 最新图片 ≡</b></td>
<td width="25%" align="center"><b>≡ 最新主题 ≡</b></td>
<td width="25%" align="center"><b>≡ 最新回复 ≡</b></td>
<td width="25%" align="center"><b>≡ 本周焦点 ≡</b></td>
<td><div class="right"><a href="#" onclick="toggle_collapse('top10');"><img id="top10_img" src="{IMGDIR}/collapsed_no.gif" border="0" alt="" /></a></td>
</tr>
<tbody id="top10">
<tr>
<td align="middle" valign="bottom">
<script language="JavaScript" src="pic.php">
</script>
</td>
<td valign="top">
<div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td width="24" background="images/rank.gif"></td>
<td background="images/rankbg.gif" style="line-height:20px" valign="top">
<!--#最新主题循环开始-->
<script language="JavaScript" src="./api/javascript.php?key=bbstop_threads_1"></script>
<!--#循环结束-->
</td>
</tr>
</tbody>
</table>
</div>
</td>
<td valign="top">
<div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td width="24" background="images/rank.gif"></td>
<td background="images/rankbg.gif" style="line-height:20px" valign="top">
<!--#最新回复循环开始-->
<script language="JavaScript" src="./api/javascript.php?key=bbstop_threads_2"></script>
<!--#循环结束-->
</td>
</tr>
</tbody>
</table>
</div>
</td>
<td valign="top">
<div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td width="24" background="images/rank.gif"></td>
<td background="images/rankbg.gif" style="line-height:20px" valign="top">
<!--#最热贴循环开始-->
<script language="JavaScript" src="./api/javascript.php?key=bbstop_threads_3"></script>
<!--#循环结束-->
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
<br />
</div> | zyyhong | trunk/jiaju001/bbs/templates/default/toplist.htm | HTML | asf20 | 2,281 |
<div>
<h2>{lang my_admin}</h2>
<ul>
<li class="<!--{if $BASESCRIPT == 'pm.php'}-->side_on first<!--{/if}-->"><h3><a href="pm.php">{lang pm}</a></h3></li>
<!--{if $BASESCRIPT == 'my.php'}-->
<li class="side_on">
<h3>{lang my}</h3>
<ul>
<li<!--{if in_array($item, array('threads', 'posts'))}--> class="current"<!--{/if}-->><a href="my.php?item=threads$extrafid">{lang show_mytopics}</a></li>
<li<!--{if $item == 'favorites'}--> class="current"<!--{/if}-->><a href="my.php?item=favorites&type=thread$extrafid">{lang my_favorite}</a></li>
<li<!--{if $item == 'subscriptions'}--> class="current"<!--{/if}-->><a href="my.php?item=subscriptions&type=forum$extrafid">{lang my_subscriptions}</a></li>
<li<!--{if $item == 'grouppermission'}--> class="current"<!--{/if}-->><a href="my.php?item=grouppermission">{lang my_permissions}</a></li>
<li<!--{if $item == 'polls'}--> class="current"<!--{/if}-->><a href="my.php?item=polls&type=poll$extrafid">{lang my_polls}</a></li>
<li<!--{if in_array($item, array('tradestats', 'selltrades', 'buytrades', 'tradethreads'))}--> class="current"<!--{/if}-->><a href="my.php?item=tradestats$extrafid">{lang my_trades}</a></li>
<li<!--{if $item == 'reward'}--> class="current"<!--{/if}-->><a href="my.php?item=reward&type=stats$extrafid">{lang my_rewards}</a></li>
<li<!--{if $item == 'activities'}--> class="current"<!--{/if}-->><a href="my.php?item=activities&type=orig$extrafid">{lang my_activities}</a></li>
<li<!--{if $item == 'debate'}--> class="current"<!--{/if}-->><a href="my.php?item=debate&type=orig$extrafid">{lang my_debate}</a></li>
<!--{if $videoopen}-->
<li<!--{if $item == 'video'}--> class="current"<!--{/if}-->><a href="my.php?item=video&type=orig$extrafid">{lang my_video}</a></li>
<!--{/if}-->
<li<!--{if $item == 'buddylist'}--> class="current"<!--{/if}-->><a href="my.php?item=buddylist&$extrafid">{lang my_buddylist}</a></li>
<!--{if $creditspolicy['promotion_visit'] || $creditspolicy['promotion_register']}-->
<li<!--{if $item == 'promotion'}--> class="current"<!--{/if}-->><a href="my.php?item=promotion$extrafid">{lang post_my_advisit}</a></li>
<!--{/if}-->
<!--{if $supe['status'] && $xspacestatus}-->
<li><a href="$supe[siteurl]/?uid/$discuz_uid" target="_blank">{lang space}</a></li>
<!--{elseif $spacestatus}-->
<li><a href="space.php?uid=$discuz_uid" target="_blank">{lang space}</a></li>
<!--{/if}-->
</ul>
</li>
<!--{else}-->
<li><h3><a href="my.php">{lang my}</a></h3></li>
<!--{/if}-->
<!--{if $BASESCRIPT == 'memcp.php'}-->
<li class="side_on">
<h3>{lang memcp}</h3>
<ul>
<li<!--{if !$action}--> class="current"<!--{/if}-->><a href="memcp.php">{lang memcp_home}</a></li>
<li<!--{if $action == 'profile'}--> class="current"<!--{/if}-->><a href="memcp.php?action=profile">{lang memcp_profile}</a></li>
<!--{if $exchangestatus || $transferstatus || $ec_ratio}-->
<li<!--{if $action == 'credits' && in_array($operation, array('exchange', 'transfer', 'addfunds'))}--> class="current"<!--{/if}-->><a href="memcp.php?action=credits">{lang memcp_credits}</a></li>
<!--{/if}-->
<li<!--{if $action == 'creditslog' && in_array($operation, array('creditslog', 'paymentlog', 'incomelog', 'rewardpaylog', 'rewardincomelog'))}--> class="current"<!--{/if}-->><a href="memcp.php?action=creditslog">{lang memcp_credits_log}</a></li>
<!--{if $allowmultigroups}-->
<li<!--{if $action == 'usergroups'}--> class="current"<!--{/if}-->><a href="memcp.php?action=usergroups">{lang memcp_usergroups}</a></li>
<!--{/if}-->
<!--{if $spacestatus || $supe['status'] && $xspacestatus}-->
<li><a href="memcp.php?action=spacemodule" target="_blank">{lang space_settings}</a></li>
<!--{/if}-->
<!--{if $supe['status'] && !$xspacestatus}-->
<li><a href="$supe[siteurl]/?uid/$discuz_uid" target="_blank">{lang space_upgrade_space}</a></li>
<!--{/if}-->
</ul>
</li>
<!--{else}-->
<li><h3><a href="memcp.php">{lang memcp}</a></h3></li>
<!--{/if}-->
<!--{if $regstatus > 1}-->
<!--{if $BASESCRIPT == 'invite.php'}-->
<li class="side_on last">
<h3>{lang invite}</h3>
<ul>
<li<!--{if $action == 'buyinvite'}--> class="current"<!--{/if}-->><a href="invite.php?action=buyinvite">{lang invite_get}</a></li>
<li<!--{if in_array($action, array('availablelog', 'invalidlog', 'usedlog', 'sendlog'))}--> class="current"<!--{/if}-->><a href="invite.php?action=availablelog">{lang invite_logs}</a></li>
</ul>
</li>
<!--{else}-->
<li><h3><a href="invite.php">{lang invite}</a></h3></li>
<!--{/if}-->
<!--{/if}-->
</ul>
</ul>
</div>
<div class="credits_info">
<h2>{lang memcp_credits_info}</h2>
<ul>
<li>{lang credits}: $credits</li>
<!--{loop $extcredits $id $credit}-->
<li>
<!--{if $id == $creditstrans}-->
$credit[title]: <span style="font-weight: bold;">$GLOBALS['extcredits'.$id]</span> $credit[unit]
<!--{else}-->
$credit[title]: $GLOBALS['extcredits'.$id] $credit[unit]
<!--{/if}-->
</li>
<!--{/loop}-->
</ul>
</div>
| zyyhong | trunk/jiaju001/bbs/templates/default/personal_navbar.htm | HTML | asf20 | 5,173 |
<form method="post" action="my.php?item=buddylist">
<input type="hidden" name="formhash" value="{FORMHASH}" />
<table summary="{lang my_buddylist}" cellspacing="0" cellpadding="0" width="100%">
<thead>
<tr>
<td class="selector">{lang delete_check}</td>
<td class="user">{lang username}</td>
<td>{lang my_buddylist_note}</td>
<td class="time">{lang my_buddylist_time}</td>
</tr>
</thead>
<tbody>
<!--{loop $buddylist $buddy}-->
<tr>
<td class="selector"><input class="checkbox" type="checkbox" name="delete[]" value="$buddy[buddyid]" /></td>
<td><a href="space.php?uid=$buddy[buddyid]" target="_blank">$buddy[username]</a></td>
<td><input type="text" name="descriptionnew[{$buddy[buddyid]}]" value="$buddy[description]" style="width: 90%" /></td>
<td>$buddy[dateline]</td>
</tr>
<!--{/loop}-->
</tbody><tr>
<td class="selector"></td>
<td style="width: 200px">{lang add_new} <input type="text" name="newbuddy" size="15" /></td>
<td style="width: 55%"><input type="text" name="newdescription" style="width: 90%" /></td>
<td> </td>
</tr>
<tr class="btns">
<td class="selector"></td>
<td colspan="3"><button class="submit" type="submit" name="buddysubmit" id="buddysubmit" value="true">{lang submit}</button></td>
</tr>
</table>
</form>
| zyyhong | trunk/jiaju001/bbs/templates/default/my_buddylist.htm | HTML | asf20 | 1,327 |
<table cellspacing="0" cellpadding="0" width="100%">
<tr><td>
{lang my_promotion_url}<br />
</td></tr>
<tr><td>
{lang post_promotion_url1}<input type="text" onclick="this.select();setcopy(this.value, '{lang post_copied}');" value="$boardurl?fromuid=$discuz_uid" size="50" />
</td></tr>
<tr><td>
{lang post_promotion_url2}<input type="text" onclick="this.select();setcopy(this.value, '{lang post_copied}');" value="$boardurl?fromuser=$discuz_user" size="50" />
</td></tr>
<tr><td>
<em>
<ul>
<li>{lang credit_promotion}</li>
<!--{if $promotion_visit}--><li>{lang credit_promotion_visit} <font color="red">$promotion_visit</font></li><!--{/if}-->
<!--{if $promotion_register}--><li>{lang credit_promotion_register} <font color="red">$promotion_register</font></li><!--{/if}-->
</ul>
</em>
</td></tr>
</table> | zyyhong | trunk/jiaju001/bbs/templates/default/my_promotion.htm | HTML | asf20 | 857 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$charset" />
$extrahead
<title>{lang supe_dialog_box} - Powered By X-Space</title>
<link href="{$supe[siteurl]}/admin/images/style.css" rel="stylesheet" type="text/css" />
<style>
#noticetb td.succ {
background: #FCFFEF url({$supe[siteurl]}/admin/images/icon_succ.gif) no-repeat 1em 3.2em;
padding: 1em;
padding-bottom: 0;
width: 500px;
}
#noticetb td.warning {
background: #FCFFEF url({$supe[siteurl]}/admin/images/icon_notice.gif) no-repeat 1em 3.2em;
padding: 1em;
padding-bottom: 0;
width: 500px;
}
#noticetb h1 {
background: none;
margin-top: 0;
margin-bottom: 1em;
padding-left: 0;
line-height: 1.2em;
border-bottom: 1px solid #EEE;
}
#noticetb p {
margin: 0.5em 0;
padding-left: 2.5em;
padding-bottom: 2em;
}
#noticetb p.links {
text-align: right;
border-top: 1px solid #EEE;
padding: 0.5em;
padding-bottom: 0;
}
#noticetb p.links a {
background: url({$supe[siteurl]}/admin/images/icon_arrow.gif) no-repeat 0 0.1em;
padding-left: 1em;
margin-left: 1em;
}
.succ {
background: #FCFFEF url({$supe[siteurl]}/admin/images/icon_succ.gif) no-repeat 1em 3.2em;
padding: 1em;
padding-bottom: 0;
width: 500px;
}
.warning {
background: #FCFFEF url({$supe[siteurl]}/admin/images/icon_notice.gif) no-repeat 1em 3.2em;
padding: 1em;
padding-bottom: 0;
width: 500px;
}
</style>
</head>
<body>
<table id="noticetb" summary="" cellpadding="0" cellspacing="0" width="450" border="0" style="margin: 20% auto;">
<tr>
<td width="7" height="7"><img src="{$supe[siteurl]}/admin/images/y_box_01.gif" alt="" /></td>
<td style="background: url({$supe[siteurl]}/admin/images/y_box_02.gif) repeat-x;"><img src="{$supe[siteurl]}/admin/images/y_box_02.gif" alt="" /></td>
<td width="6"><img src="{$supe[siteurl]}/admin/images/y_box_03.gif" alt="" /></td>
</tr>
<tr>
<td style="background: url({$supe[siteurl]}/admin/images/y_box_04.gif) repeat-y;"><img src="{$supe[siteurl]}/admin/images/y_box_04.gif" alt="" /></td>
<!--{if $supe_error}-->
<td class="warning">
<!--{else}-->
<td class="succ">
<!--{/if}-->
<h1>{lang supe_message}</h1>
<p style="font-weight: bold;">
$show_message
<!--{if !$supe_error}-->
<br /><br /><a href="$url_forward">{lang message_forward}</a>
<!--{/if}-->
</p>
<p class="links"><!--{if !$supe_error}--><a href="$url_forward">{lang supe_confirm}</a><!--{else}--><a href="javascript:history.back();" class="back">{lang message_go_back}</a><!--{/if}--></p>
</td>
<td style="background: url({$supe[siteurl]}/admin/images/y_box_05.gif) repeat-y;"><img src="{$supe[siteurl]}/admin/images/y_box_05.gif" alt="" /></td>
</tr>
<tr>
<td height="28" style="vertical-align: top;"><img src="{$supe[siteurl]}/admin/images/y_box_06.gif" alt="" /></td>
<td style="background: url({$supe[siteurl]}/admin/images/y_box_07.gif) repeat-x top;"><img src="{$supe[siteurl]}/admin/images/y_box_07.gif" alt="" /></td>
<td style="vertical-align: top;"><img src="{$supe[siteurl]}/admin/images/y_box_08.gif" alt="" /></td>
</tr>
</table>
</body>
</html> | zyyhong | trunk/jiaju001/bbs/templates/default/supesite_showmessage.htm | HTML | asf20 | 3,351 |
{template header}
<div class="subtable nav">
<a href="$indexname">$bbname</a> » {lang supe_import_forum}
</div><br />
<script type="text/javascript">
function validate(theform) {
if (!theform.importsubmit.disabled && !theform.fid.value) {
alert('{lang supe_pls_choose_forum_you_want}');
return false;
}
theform.importsubmit.disabled = true;
return true;
}
var threadtypes = new Array();
$js_threadtypes
var threadtypesrequired = new Array();
$js_threadtypesrequired
function selectthreadtype(fid) {
if(!fid) {
return;
}
var threadtype = threadtypes[fid];
typeidtbody = $('tbody1');
if(typeidtbody.firstChild) {
typeidtbody.firstChild.removeNode(true);
}
if(threadtype != '') {
tr1 = document.createElement('tr');
td1 = document.createElement('td');
td1.setAttribute('className', 'altbg1');
td1.innerHTML = '<span class="bold">{lang admin_type}:</span>';
td2 = document.createElement('td');
td2.setAttribute('className', 'altbg2');
var html = '<select name="typeid">';
if(threadtypesrequired[fid] == '') {
html += '<option value="0"></option>';
}
for(k in threadtype) {
html += '<option value="'+k+'">' + threadtype[k] + '</option>';
}
html += '</select>';
td2.innerHTML = html;
tr1.appendChild(td1);
tr1.appendChild(td2);
typeidtbody.appendChild(tr1);
}
}
</script>
<form method="post" name="input" action="post.php?action=import&extra=$extra&importsubmit=yes&itemid=$itemid" $enctype onSubmit="return validate(this)">
<input type="hidden" name="formhash" value="{FORMHASH}">
<div class="spaceborder" style="clear: both">
<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
<tr><td colspan="2" class="header">{lang supe_choose_forum}
</td></tr>
<tr>
<td class="altbg1 bold" width="40%">{lang username}:</td>
<td class="altbg2" width="60%">$discuz_userss <span class="smalltxt">[<a href="$link_logout">{lang member_logout}</a>]</span></td>
</tr>
<!--{if $seccodecheck}-->
<tr>
<th><label for="seccodeverify">{lang seccode}</label></th>
<td>
<div id="seccodeimage"></div>
<input type="text" onfocus="updateseccode();this.onfocus = null" id="seccodeverify" name="seccodeverify" size="8" maxlength="4" />
<em class="tips"><strong>{lang seccode_click}</strong> <!--{if $seccodedata['animator'] == 2}-->{lang seccode_animator_flashrefresh}<!--{elseif $seccodedata['animator'] == 1}-->{lang seccode_animator_refresh}<!--{else}-->{lang seccode_refresh}<!--{/if}--></em></td>
<script type="text/javascript">
var seccodedata = [{$seccodedata['width']}, {$seccodedata['height']}, {$seccodedata['type']}];
</script>
</tr>
<!--{/if}-->
<!--{if $secqaacheck}-->
<tr>
<td class="altbg1">{lang secqaa}:</td>
<td class="altbg2"><div id="secquestion"></div><input type="text" name="secanswer" size="25" maxlength="50">
<script type="text/javascript">
<!--{if ($attackevasive & 1) && $seccodecheck}-->
setTimeout("updatesecqaa()", 2001);
<!--{else}-->
updatesecqaa();
<!--{/if}-->
</script></td>
</tr>
<!--{/if}-->
<tr>
<td class="altbg1"><span class="bold">{lang supe_target_forum}:</span></td>
<td class="altbg2">
<select name="fid" id="fid" onchange="selectthreadtype(this.options[this.options.selectedIndex].value)">
$forumselect
</select>
</td>
</tr>
<tbody id="tbody1">
</tbody>
<tr><td colspan="2" align="left" class="altbg1">{lang supesite_import_comment}</td></tr>
</table></div>
<br /><center><input class="button" type="submit" name="importsubmit" value="{lang submit}" tabindex="5"></center>
</form>
<script type="text/javascript">
options1 = $('fid').options;
var len = options1.length;
for(var i=0; i < len; i++) {
if(options1[i].value != '') {
options1[i].selected = true;
selectthreadtype(options1[i].value);
break;
}
}
</script>
{template footer} | zyyhong | trunk/jiaju001/bbs/templates/default/supesite_import.htm | HTML | asf20 | 3,945 |
<table cellspacing="0" cellpadding="0" width="100%">
<thead>
<tr>
<td>{lang in_thread}</td>
<td>{lang forum}</td>
<td class="time"><!--{if $type == 'orig'}-->{lang lastpost}<!--{else}-->{lang debate_dateline}<!--{/if}--></td>
<td>{lang status}</td>
</tr>
</thead>
<tbody>
<!--{if $debatelist}-->
<!--{loop $debatelist $key $debate}-->
<tr>
<td><a href="viewthread.php?tid=$debate[tid]" target="_blank">$debate[subject]</a></td>
<td><a href="forumdisplay.php?fid=$debate[fid]" target="_blank">$debate[forumname]</a></td>
<td>
<!--{if $type == 'debate'}-->
<em>
<a href="redirect.php?tid=$debate[tid]&goto=lastpost#lastpost" target="_blank">$debate[lastpost]</a><br />by
<!--{if $debate['lastposter']}-->
<a href="space.php?username=$debate[lastposterenc]" target="_blank">$debate[lastposter]</a>
<!--{else}-->
{lang anonymous}
<!--{/if}-->
</em>
<!--{else}-->
<em>$debate[dateline]</em>
<!--{/if}--> </td>
<td><!--{if $debate[displayorder] == '-1'}-->{lang forum_recyclebin}<!--{elseif $debate[displayorder] == '-2'}-->{lang my_threads_aduit}<!--{elseif $debate[closed] == '1'}-->{lang my_threads_close}<!--{else}-->{lang my_threads_common}<!--{/if}--></td>
</tr>
<!--{/loop}-->
<!--{else}-->
<tr><td colspan="4">{lang forum_nothreads}</td></tr>
<!--{/if}-->
</tbody>
</table> | zyyhong | trunk/jiaju001/bbs/templates/default/my_debate.htm | HTML | asf20 | 1,381 |
<?php
// Message Pack for Discuz! WAP Version 1.0.0
// Created by Crossday
$lang = array
(
'username' => '用户名',
'password' => '密码',
'submit' => '提交',
'page' => '页',
'replies' => '回',
'views' => '点',
'reply' => '回复',
'delete' => '删除',
'anonymous' => '匿名',
'forum' => '版块',
'from' => '来自:',
'type' => '分类:',
'subject' => '标题:',
'message' => '内容:',
'home_page' => '首页',
'last_page' => '上页',
'next_page' => '下页',
'end_page' => '尾页',
'turn_page' => '翻页',
'next_thread' => '下一主题',
'last_thread' => '上一主题',
'end' => '结束',
'unread' => '未读',
'sub_forums' => '子版块',
'email' => '电子邮件',
'more' => '更多',
'search' => '搜索',
'digest' => '精华',
'reload' => '刷新',
'author' => '作者:',
'dateline' => '时间:',
'return' => '返回',
'keywords' => '关键词',
'not_loggedin' => '请登录后使用本功能',
'wap_disabled' => 'WAP 功能未启用',
'board_closed' => '论坛目前临时关闭',
'undefined_action' => '未定义操作',
'home_online' => '在线人数:',
'home_members' => '会员',
'home_newpm' => '条新短消息',
'home_forums' => '论坛板块',
'home_tools' => '工具箱',
'home_newthreads' => '查看新帖',
'login' => '登录',
'login_username' => '用户名/UID',
'login_succeed' => '{$discuz_user}成功登录',
'login_strike' => '累计5次密码错误,15分钟内不能登录',
'login_invalid' => '用户名或密码有误,您共有5次尝试机会',
'logout' => '退出',
'logout_succeed' => '成功退出登录',
'security_question' => '安全提问',
'security_answer' => '回答',
'security_question_0' => '无安全提问',
'security_question_1' => '母亲的名字',
'security_question_2' => '爷爷的名字',
'security_question_3' => '父亲出生的城市',
'security_question_4' => '您其中一位老师的名字',
'security_question_5' => '您个人计算机的型号',
'security_question_6' => '您最喜欢的餐馆名称',
'security_question_7' => '驾驶执照的最后四位数字',
'register' => '注册',
'register_username' => '用户名',
'register_disable' => '此论坛禁止通过WAP注册',
'register_ctrl' => '对不起,您的 IP 地址在 $regctrl 小时内只能注册一个帐号,请返回。',
'register_flood_ctrl' => '对不起,同一 IP 地址在 24 小时内只能进行 $regfloodctrl 次注册尝试,请返回。',
'register_manual_verify' => '非常感谢您的注册,管理员设置了人工验证新注册用户,请等待审核通过,现在将转入控制面板首页。',
'register_succeed' => '非常感谢您的注册,现在将以会员身份登录论坛。',
'fav_add_succeed' => '已成功添加到收藏夹中,请返回。',
'fav_existence' => '您过去已经收藏过这个主题或者版块,请返回。',
'goto_last_nonexistence' => '没有比这个主题更早的主题了',
'goto_next_nonexistence' => '没有比这个主题更晚的主题了',
'forum_thread_sticky' => '[顶]',
'forum_thread_digest' => '[精]',
'forum_nopermission' => '无权访问本版块',
'forum_nonexistence' => '指定版块不存在',
'forum_list' => '帖子列表',
'forum_sublist' => '子版块列表',
'my' => '我的',
'my_uid' => 'UID:',
'my_username' => '用户名:',
'my_gender' => '性别:',
'my_bday' => '生日:',
'my_location' => '来自:',
'my_bio' => '自我介绍:',
'my_phone' => '我的手机',
'my_favorites' => '我的收藏',
'my_addfav' => '设为我的收藏',
'my_nonexistence' => '该用户不存在',
'my_male' => '男',
'my_female' => '女',
'my_secrecy' => '保密',
'my_threads' => '我的主题',
'my_replies' => '我的回复',
'my_fav_thread' => '我收藏的主题',
'my_fav_forum' => '我收藏的版块',
'thread_nopermission' => '无权查看本主题',
'thread_nonexistence' => '指定主题不存在',
'thread_replylist' => '回复列表',
'thread_reply' => '回复主题:',
'thread_quickreply' => '快速回复',
'post_reply' => '回复本帖',
'post_new' => '发新话题',
'post_sm_isnull' => '未填写标题或内容',
'post_subject_toolong' => '标题超过80字节',
'post_message_toolong' => '内容超过{$minpostsize}字节限制',
'post_message_tooshort' => '内容少于{$maxpostsize}字节限制',
'post_type_isnull' => '未选择主题分类',
'post_flood_ctrl' => '两次发表少于{$floodctrl}秒',
'post_mod_succeed' => '成功提交人工审核',
'post_mod_forward' => '回到当前论坛',
'post_thread_closed' => '本主题已关闭',
'post_thread_closed_by_dateline' => '本主题发布于$forum[autoclose]天前<br />已被自动关闭',
'post_thread_closed_by_lastpost' => '本主题最后回复于$forum[autoclose]天前<br />已被自动关闭',
'post_newbie_span' => '注册{$newbiespan}小时后才可发帖',
'post_hide_nopermission' => '无权使用[hide]代码',
'post_newthread_nopermission' => '无权在本论坛发新话题',
'post_newthread_succeed' => '主题发表成功<br /><a href=\"index.php?action=forum&fid=$fid\">返回论坛</a>',
'post_newthread_forward' => '查看主题',
'post_newreply_nopermission' => '无权在本论坛发表回复',
'post_newreply_succeed' => '主题回复成功<br /><a href=\"index.php?action=forum&fid=$fid\">返回论坛</a>',
'post_newreply_forward' => '查看回复',
'profile_username_toolang' => '对不起,您的用户名超过 15 个字符,请返回输入一个较短的用户名。',
'profile_username_tooshort' => '对不起,您输入的用户名小于3个字符, 请返回输入一个较长的用户名。',
'profile_passwd_notmatch' => '两次输入的密码不一致,请返回检查后重试。',
'profile_username_duplicate' => '该用户名已经被注册了,请返回重新填写。',
'profile_email_duplicate' => '该 Email 地址已经被注册了,请返回重新填写。',
'profile_username_illegal' => '用户名包含敏感字符或被系统屏蔽,请返回重新填写。',
'profile_passwd_illegal' => '密码空或包含非法字符,请返回重新填写。',
'profile_email_illegal' => 'Email 地址无效或包含不可使用的邮箱域名,请返回重新填写。',
'profile_email_verify' => '确认 Email 已经发送,请用邮件中提供的方法激活您的帐号。如果您没有收到我们发送的系统邮件,请点击控制面板首页中的“重新验证 Email 有效性”,或尝试更换另外一个地址。注意:在完成激活之前,根据管理员设置,您将只能以等验证会员的身份访问论坛,您可能不能进行发帖等操作。激活成功后,上述限制将自动取消。',
'pm' => '短消息',
'pm_home' => '短消息首页',
'pm_list' => '短消息列表',
'pm_unread' => '未读消息',
'pm_all' => '全部消息',
'pm_send' => '发送短消息',
'pm_to' => '收信人',
'pm_delete_all' => '删除已读短信',
'pm_flood_ctrl' => '两次发表少于{$floodctrl}秒',
'pm_delete_confirm' => '确认删除所有已读短信',
'pm_sm_isnull' => '未填写标题或内容',
'pm_nonexistence' => '短消息不存在',
'pm_send_nonexistence' => '收信人不存在',
'pm_send_ignore' => '收件人拒收短消息',
'pm_send_succeed' => '短消息成功发送',
'pm_delete_succeed' => '短消息成功删除',
'return_thread' => '返回主题',
'return_forum' => '返回板块',
'stats' => '论坛统计',
'stats_threads' => '主题数',
'stats_posts' => '帖子数',
'stats_members' => '会员数',
'search' => '论坛搜索',
'search_result' => '搜索结果',
'search_invalid' => '您没有指定要搜索的关键字或用户名,请返回重新填写。',
'search_ctrl' => '对不起,您在 $searchctrl 秒内只能进行一次搜索,请返回。',
'search_id_invalid' => '您指定的搜索不存在或已过期,请返回。',
'search_group_nopermission' => '您所在的用户组没有搜索权限,请返回',
'goto' => 'WAP跳转',
'wap_submit_invalid' => '验证信息不正确',
'post_hide_reply_hidden' => '** 本内容隐藏 **',
'topindex' => '城市家居网首页',
'infoo' => '<br />wap.jiaju001.com 京ICP证090435号<br />客服电话 400-650-3056',
);
?> | zyyhong | trunk/jiaju001/bbs/templates/default/wap.lang.php | PHP | asf20 | 8,460 |
{template header}
<div id="nav"><a href="$indexname">$bbname</a> $navigation » {lang pay}</div>
<form method="post" action="misc.php?action=pay">
<input type="hidden" name="formhash" value="{FORMHASH}" />
<input type="hidden" name="referer" value="$referer" />
<div class="mainbox formbox">
<h1>{lang pay}</h1>
<table summary="{lang pay}" cellspacing="0" cellpadding="0">
<tr>
<th>{lang username}:</th>
<td>$discuz_userss <span class="smalltxt">[<a href="$link_logout">{lang member_logout}</a>]</span></td>
</tr>
<tr>
<th>{lang author}:</th>
<td><a href="space.php?uid=$thread[authorid]">$thread[author]</a></td>
</tr>
<tr>
<th>{lang subject}:</th>
<td><a href="viewthread.php?tid=$tid">$thread[subject]</a></td>
</tr>
<tr>
<th valign="top">{lang price}({$extcredits[$creditstrans][title]}):</th>
<td>$thread[price] {$extcredits[$creditstrans][unit]}</td>
</tr>
<tr>
<th valign="top">{lang pay_author_income}({$extcredits[$creditstrans][title]}):</th>
<td>$thread[netprice] {$extcredits[$creditstrans][unit]}</td>
</tr>
<tr>
<th valign="top">{lang pay_balance}({$extcredits[$creditstrans][title]}):</th>
<td>$balance {$extcredits[$creditstrans][unit]}</td>
</tr>
<tr class="btns">
<th> </th>
<td>
<input type="hidden" name="tid" value="$tid" />
<button class="submit" type="submit" name="paysubmit" value="true">{lang submit}</button>
</td>
</tr>
</table>
</div>
</form>
{template footer} | zyyhong | trunk/jiaju001/bbs/templates/default/pay.htm | HTML | asf20 | 1,563 |
{template header}
<div class="ajaxform" style="width: 500px;">
<form method="post" id="postpmform" name="postpmform" action="pm.php?action=send&inajax=1">
<input type="hidden" name="formhash" value="{FORMHASH}" />
<input type="hidden" name="pmsubmit" value="{FORMHASH}" />
<table cellspacing="0" cellpadding="0" width="100%">
<thead>
<tr>
<th>{lang pm_send}</th>
<td align="right"><a href="javascript:hideMenu();"><img src="{IMGDIR}/close.gif" alt="{lang close}" title="{lang close}" /></a></td>
</tr>
</thead>
<!--{if $seccodecheck}-->
<tr>
<th><label for="seccodeverify">{lang seccode}</label></th>
<td>
<div id="seccodeimage"></div>
<input type="text" onfocus="updateseccode();this.onfocus = null" id="seccodeverify" name="seccodeverify" size="8" maxlength="4" />
<em class="tips"><strong>{lang seccode_click}</strong> <!--{if $seccodedata['animator'] == 2}-->{lang seccode_animator_flashrefresh}<!--{elseif $seccodedata['animator'] == 1}-->{lang seccode_animator_refresh}<!--{else}-->{lang seccode_refresh}<!--{/if}--></em></td>
<script type="text/javascript">
var seccodedata = [{$seccodedata['width']}, {$seccodedata['height']}, {$seccodedata['type']}];
</script>
</tr>
<!--{/if}-->
<!--{if $secqaacheck}-->
<tr>
<th>{lang secqaa}</th>
<td><div id="secquestion"></div><input type="text" name="secanswer" size="25" maxlength="50" /></td>
</tr>
<script type="text/javascript">ajaxget('ajax.php?action=updatesecqaa', 'secquestion');</script>
<!--{/if}-->
<tr><th>{lang to}</th>
<td><input type="text" name="msgto" size="65" value="$touser" /></td></tr>
<tr>
<th>{lang subject}</th>
<td><input type="text" name="subject" size="65" value="$subject" /></td>
</tr>
<tr>
<th>{lang message}<br /><br />
</th>
<td><textarea id="pm_textarea" rows="6" cols="10" name="message" style="width: 100%; height:100px; word-break: break-all" onKeyDown="ctlent(event);"></textarea><br /></td>
</tr>
</tbody>
<tr>
<th></th>
<td><button name="pmsubmit" type="button" class="submit" value="true" onclick="ajaxpost('postpmform', '$ajaxmenuid');return false">{lang submit}</button></td>
</table>
</form>
</div>
{template footer} | zyyhong | trunk/jiaju001/bbs/templates/default/pm_send_ajax.htm | HTML | asf20 | 2,225 |
{template header}
<!--{if !empty($multipage)}--><div class="pages_btns">$multipage</div><!--{/if}-->
<div class="box specialpostcontainer">
<ul class="tabs">
<li id="viewall" $standchecked[all]><a href="viewthread.php?do=viewdebatepost&tid=$tid" onclick="ajaxget(this.href, 'ajaxdebateposts', 'ajaxspecialposts');doane(event);">{lang debate_all_point}</a></li>
<li id="viewstand1" $standchecked[1]><a href="viewthread.php?do=viewdebatepost&tid=$tid&stand=1" onclick="ajaxget(this.href, 'ajaxdebateposts', 'ajaxspecialposts');doane(event);">{lang debate_square_point}</a></li>
<li id="viewstand2" $standchecked[2]><a href="viewthread.php?do=viewdebatepost&tid=$tid&stand=2" onclick="ajaxget(this.href, 'ajaxdebateposts', 'ajaxspecialposts');doane(event);">{lang debate_opponent_point}</a></li>
<li id="viewstand0" $standchecked[0]><a href="viewthread.php?do=viewdebatepost&tid=$tid&stand=0" onclick="ajaxget(this.href, 'ajaxdebateposts', 'ajaxspecialposts');doane(event);">{lang debate_neutra_point}</a></li>
<!--{if $debate['umpirepoint']}-->
<li id="viewumpire" $standchecked[umpire]><a href="javascript:;" onclick="checkumpire(event)">{lang debate_umpirepoint}</a></li>
<!--{/if}-->
</ul>
<div id="ajaxspecialposts">
<form method="post" name="modactions">
<input type="hidden" name="formhash" value="{FORMHASH}" />
<!--{if !empty($postlist)}-->
<!--{loop $postlist $post}-->
<div class="specialpost">
<div class="postinfo"><h2><span class="poststand{$post[stand]}"><!--{if $post[stand] == 1}-->{lang debate_square}<!--{elseif $post[stand] == 2}-->{lang debate_opponent}<!--{else}-->{lang debate_neutral}<!--{/if}--></span>
<a class="dropmenu" href="space.php?uid=$post[authorid]" target="_blank" style="font-weight: normal;" onclick="ajaxmenu(event, this.id, 0, '', 1, 3, 0)" id="author_$post[pid]">$post[author]</a> $post[dateline] </h2>
<!--{if !isset($stand)}--><strong href="###$post[pid]" class="bold" title="{lang post_copylink}" onclick="setcopy('{$boardurl}viewthread.php?tid=$tid&page=$page$fromuid#pid$post[pid]', '{lang post_copied}')"><!--{if !empty($postno[$post[number]+1])}-->{echo $postno[$post[number]+1]}<!--{else}-->{$post[number]}{$postno[0]}<!--{/if}--></strong><!--{/if}-->
<!--{if $post['stand']}-->
( {lang debate_poll_num}: <span class="bold">$post[voters]</span> {lang debate_poll} )
<a href="misc.php?action=debatevote&tid=$tid&pid=$post[pid]" id="voterdebate_$post[pid]" onclick="ajaxmenu(event, this.id)">{lang debate_poll_my}</a>
<!--{/if}-->
<!--{if ($forum['ismoderator'] && $alloweditpost && !(in_array($post['adminid'], array(1, 2, 3)) && $adminid > $post['adminid'])) || ($forum['alloweditpost'] && $discuz_uid && $post['authorid'] == $discuz_uid)}--> <a href="post.php?action=edit&fid=$fid&tid=$tid&pid=$post[pid]&page=$page&extra=$extra">{lang edit}</a><!--{/if}-->
<!--{if $allowpostreply}--> <a href="post.php?action=reply&fid=$fid&tid=$tid&repquote=$post[pid]&extra=$extra&page=$page">{lang reply_quote}</a><!--{/if}-->
<!--{if $forum['ismoderator'] && $allowdelpost}--><input class="checkbox" type="checkbox" name="topiclist[]" value="$post[pid]" /><!--{/if}-->
</div>
<div class="postmessage">
<!--{if !empty($post[subject])}--><h2>$post[subject]</h2><!--{/if}-->
<!--{if $adminid != 1 && $bannedmessages && (($post['authorid'] && !$post['username']) || ($post['groupid'] == 4 || $post['groupid'] == 5))}-->
<div class="notice" style="width: 500px">{lang message_banned}</div>
<!--{elseif $adminid != 1 && $post['status'] == 1}-->
<div class="notice" style="width: 500px">{lang message_single_banned}</div>
<!--{else}-->
<div class="t_msgfont">$post[message]</div>
<!--{if $post['attachment']}-->
<div class="notice postattach">{lang attachment}: <em>{lang attach_nopermission}</em></div>
<!--{elseif $hideattach && $post['attachments']}-->
<div class="notice postattach">{lang attachment}: <em>{lang attachment_reply_show}</em></div>
<!--{elseif $post['attachlist']}-->
<div class="box postattachlist">
<h4>{lang attachment}</h4>
$post[attachlist]
</div>
<!--{/if}-->
<!--{/if}-->
</div>
</div>
<!--{/loop}-->
<!--{else}-->
<div class="specialpost">
<p class="postmessage">{lang none}</p>
</div>
<!--{/if}-->
</form>
</div>
</div>
<!--{if !empty($multipage)}--><div class="pages_btns">$multipage</div><!--{/if}-->
{template footer} | zyyhong | trunk/jiaju001/bbs/templates/default/viewthread_debate_posts.htm | HTML | asf20 | 4,658 |
<!--{if !$iscircle || !empty($frombbs)}-->{template header}<!--{else}-->{template supesite_header}<!--{/if}-->
<script type="text/javascript" src="include/javascript/viewthread.js"></script>
<script type="text/javascript">zoomstatus = parseInt($zoomstatus);</script>
<div id="foruminfo">
<div id="nav">
<!--{if $forumjump && $jsmenu[1]}--><a href="$indexname" id="forumlist" onmouseover="showMenu(this.id)" class="dropmenu">$bbname</a><!--{else}--><a href="$indexname">$bbname</a><!--{/if}--> $navigation
</div>
<div id="headsearch">
<!--{if !empty($google) && ($google & 4)}-->
<script type="text/javascript" src="forumdata/cache/google_var.js"></script>
<script type="text/javascript" src="include/javascript/google.js"></script>
<!--{/if}-->
<!--{if !empty($qihoo['status']) && $searchboxstatus}-->
<form method="post" action="search.php?srchtype=qihoo" onSubmit="this.target='_blank';">
<input type="hidden" name="searchsubmit" value="yes" />
<input type="text" name="srchtxt" value="$qihoo_searchboxtxt" size="27" class="input" style="{BGCODE}" onmouseover="this.focus();this.value='';this.onmouseover=null;" onfocus="this.select()" />
<button type="submit">{lang search}</button>
</form>
<!--{/if}-->
</div>
</div>
<div id="ad_text"></div>
<!--{if !empty($newpmexists) || $announcepm}-->
<div class="maintable" id="pmprompt">
{template pmprompt}
</div>
<!--{/if}-->
<div class="pages_btns">
<div class="threadflow"><a href="redirect.php?fid=$fid&tid=$tid&goto=nextoldset"> ‹‹ {lang last_thread}</a> | <a href="redirect.php?fid=$fid&tid=$tid&goto=nextnewset">{lang next_thread} ››</a></div>
<!--{if $allowpost || !$discuz_uid}-->
<span class="postbtn" id="newspecialheader" onmouseover="showMenu(this.id)"><a href="post.php?action=newthread&fid=$fid&extra=$extra"><img src="{IMGDIR}/newtopic.gif" border="0" alt="{lang post_newthread}" title="{lang post_newthread}" /></a></span>
<!--{/if}-->
<!--{if $allowpostreply || !$discuz_uid}--><span class="replybtn"><a href="post.php?action=reply&fid=$fid&tid=$tid&extra=$extra"><img src="{IMGDIR}/reply.gif" border="0" alt="" /></a></span><!--{/if}-->
</div>
<!--{if $allowposttrade || $allowpostpoll || $allowpostreward || $allowpostactivity || $allowpostdebate || $allowpostvideo || $forum['threadtypes'] || !$discuz_uid}-->
<ul class="popupmenu_popup newspecialmenu" id="newspecialheader_menu" style="display: none">
<!--{if !$forum['allowspecialonly']}--><li><a href="post.php?action=newthread&fid=$fid&extra=$extra">{lang post_newthread}</a></li><!--{/if}-->
<!--{if $allowpostpoll || !$discuz_uid}--><li class="poll"><a href="post.php?action=newthread&fid=$fid&extra=$extra&special=1">{lang post_newthreadpoll}</a></li><!--{/if}-->
<!--{if $allowposttrade || !$discuz_uid}--><li class="trade"><a href="post.php?action=newthread&fid=$fid&extra=$extra&special=2">{lang post_newthreadtrade}</a></li><!--{/if}-->
<!--{if $allowpostreward || !$discuz_uid}--><li class="reward"><a href="post.php?action=newthread&fid=$fid&extra=$extra&special=3">{lang post_newthreadreward}</a></li><!--{/if}-->
<!--{if $allowpostactivity || !$discuz_uid}--><li class="activity"><a href="post.php?action=newthread&fid=$fid&extra=$extra&special=4">{lang post_newthreadactivity}</a></li><!--{/if}-->
<!--{if $allowpostdebate || !$discuz_uid}--><li class="debate"><a href="post.php?action=newthread&fid=$fid&extra=$extra&special=5">{lang post_newthreaddebate}</a></li><!--{/if}-->
<!--{if $allowpostvideo || !$discuz_uid}--><li class="video"><a href="post.php?action=newthread&fid=$fid&extra=$extra&special=6">{lang post_newthreadvideo}</a></li><!--{/if}-->
<!--{if $forum['threadtypes'] && !$forum['allowspecialonly']}-->
<!--{loop $forum['threadtypes']['types'] $typeid $threadtypes}-->
<!--{if $forum['threadtypes']['special'][$typeid] && $forum['threadtypes']['show'][$typeid]}-->
<li class="popupmenu_option"><a href="post.php?action=newthread&fid=$fid&extra=$extra&typeid=$typeid">$threadtypes</a></li>
<!--{/if}-->
<!--{/loop}-->
<!--{loop $forum['typemodels'] $id $model}-->
<li class="popupmenu_option"><a href="post.php?action=newthread&fid=$fid&extra=$extra&modelid=$id">$model[name]</a></li>
<!--{/loop}-->
<!--{/if}-->
</ul>
<!--{/if}-->
<!--{if $highlightstatus}--><a href="viewthread.php?tid=$tid&page=$page" style="font-weight: normal">{lang disable_highlight}</a><!--{/if}-->
<div class="mainbox viewthread specialthread">
<div class="headactions">
<!--{if $discuz_uid}-->
<a href="misc.php?action=emailfriend&tid=$tid" id="emailfriend" onclick="ajaxmenu(event, this.id, 9000000, '', 0)">{lang thread_email_friend}</a>
<a href="my.php?item=subscriptions&subadd=$tid" id="ajax_subscription" onclick="ajaxmenu(event, this.id)">{lang thread_subscribe}</a>
<a href="my.php?item=favorites&tid=$tid" id="ajax_favorite" onclick="ajaxmenu(event, this.id)">{lang thread_favorite}</a>
<!--{/if}-->
<!--{if $supe['status'] && $xspacestatus && $thread['authorid'] == $discuz_uid}-->
<!--{if !$thread['itemid']}-->
<a href="$supe[siteurl]/spacecp.php?action=spaceblogs&op=add&tid=$tid" target="_blank">{lang supe_join_xspace}</a>
<!--{else}-->
<a href="$supe[siteurl]/index.php?action/viewspace/itemid/$thread[itemid]/fromdiscuz/$supe_fromdiscuz" target="_blank">{lang supe_view_in_xspace}</a>
<!--{/if}-->
<a href="$supe[siteurl]/spacecp.php?action=spacenews&op=add&tid=$tid" target="_blank">{lang supe_resource_add}</a>
<!--{elseif $spacestatus && $thread['authorid'] && ($thread['authorid'] == $discuz_uid || $forum['ismoderator'])}-->
<!--{if $thread['blog']}-->
<a href="misc.php?action=blog&tid=$tid" id="ajax_blog" onclick="ajaxmenu(event, this.id, 2000, 'changestatus', 0)">{lang blog_remove}</a>
<!--{elseif $allowuseblog && $forum['allowshare'] && $thread['authorid'] == $discuz_uid}-->
<a href="misc.php?action=blog&tid=$tid" id="ajax_blog" onclick="ajaxmenu(event, this.id, 2000, 'changestatus', 0)">{lang blog_add}</a>
<!--{/if}-->
<script type="text/javascript">
function changestatus(obj) {
obj.innerHTML = obj.innerHTML == '{lang blog_remove}' ? '{lang blog_add}' : '{lang blog_remove}';
}
</script>
<!--{/if}-->
</div>
<h6>{lang special_video}</h6>
<!--{if $lastmod['modaction'] || $thread['blog'] || $thread['readperm'] || $thread[itemid] || $lastmod['magicname']}-->
<ins>
<!--{if $thread[itemid]}-->
<a href="$supe[siteurl]/index.php?action/viewspace/itemid/$thread[itemid]" target="_blank"><span class="bold" style="margin-right:20px;">{lang supe_thread_already_been_join_to_xspace}</span></a>
<!--{/if}-->
<!--{if $lastmod['modaction']}--> <a href="misc.php?action=viewthreadmod&tid=$tid" title="{lang thread_mod}" target="_blank">{lang thread_mod_by}</a> <!--{/if}-->
<!--{if $spacestatus && $thread['blog']}--> <a href="space.php?$thread[authorid]/myblogs" target="_blank">{lang thread_blog}</a> <!--{/if}-->
<!--{if $thread['readperm']}--> {lang readperm_thread} <span class="bold">$thread[readperm]</span> <!--{/if}-->
<!--{if $lastmod['magicname']}--> <a href="misc.php?action=viewthreadmod&tid=$tid" title="{lang thread_mod}" target="_blank">{lang magics_logs}</a> <!--{/if}-->
</ins>
<!--{/if}-->
<table summary="" cellspacing="0" cellpadding="0">
<tr>
<td class="postcontent">
<h1>$thread[subject]</h1>
<div class="postmessage">
<!--{if !empty($post[ratings])}--><span class="postratings"><a href="misc.php?action=viewratings&tid=$tid&pid=$pid" title="{lang rate} $post[rate]">$post[ratings]</a></span><!--{/if}-->
{eval $playurl = "http://union.bokecc.com/flash/discuz2/player.swf?siteid=$vsiteid&vid=$vid&tid=$tid&pid=$pid&autoStart=$vautoplay&referer=".urlencode($boardurl."viewthread.php?tid=$tid");}
{eval $shareplayurl = "http://union.bokecc.com/flash/discuz2/player.swf?siteid=$vsiteid&vid=$vid";}
<div style="text-align: center; margin-bottom: 1em;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="object_flash_player" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" height="373" width="438">
<param name="movie" value='$playurl'>
<param name="quality" value="high">
<param name="allowScriptAccess" value="always">
<param name="allowFullScreen" value="true">
<embed src='$playurl' allowScriptAccess="always" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowfullscreen="true" height="373" width="438">
</object>
</div>
$post[message]
<!--{if $post['attachment']}-->
<div class="notice postattach">{lang attachment}: <em>{lang attach_nopermission}</em></div>
<!--{elseif $hideattach && $post['attachments']}-->
<div class="notice postattach">{lang attachment}: <em>{lang attachment_reply_show}</em></div>
<!--{elseif $postlist[$pid]['attachlist']}-->
<div class="box postattachlist">
<h4>{lang attachment}</h4>
{$postlist[$pid][attachlist]} </div>
<!--{/if}-->
<!--{if $thread['tags'] || $relatedkeywords}-->
<p class="posttags">{lang thread_keywords}
<!--{if $thread['tags']}-->$thread[tags]<!--{/if}-->
<!--{if $relatedkeywords}--><span class="postkeywords">$relatedkeywords</span><!--{/if}-->
</p>
<!--{/if}-->
</div>
</td>
<td class="postauthor">
$post[avatar]
<dl>
<dt>{lang special_author}</dt><dd><a href="space.php?username=$post[author]" target="_blank">$post[author]</a></dd>
<dt>$post[authortitle]</dt><dd> </dd>
<dt>{eval showstars($post['stars']);}</dt><dd> </dd>
<dt>{lang special_starttime}</dt><dd>$thread[starttime]</dd>
</dl>
<!--{if $post['msn'] || $post['qq'] || $post['icq'] || $post['yahoo'] || $post['taobao']}-->
<p class="imicons">
<!--{if $post['msn']}--><a href="javascript:;" onclick="msnoperate('add', '$post[msn]')" title="{lang msn_add}"><img src="{IMGDIR}/msnadd.gif" alt="{lang msn_add}" /></a>
<a href="javascript:;" onclick="msnoperate('chat', '$post[msn]')" title="{lang msn_chat}"><img src="{IMGDIR}/msnchat.gif" alt="{lang msn_chat}" /></a><!--{/if}-->
<!--{if $post['qq']}--><a href="http://wpa.qq.com/msgrd?V=1&Uin=$post[qq]&Site=$bbname&Menu=yes" target="_blank"><img src="{IMGDIR}/qq.gif" alt="QQ" /></a><!--{/if}-->
<!--{if $post['icq']}--><a href="http://wwp.icq.com/scripts/search.dll?to=$post[icq]" target="_blank"><img src="{IMGDIR}/icq.gif" alt="ICQ" /></a><!--{/if}-->
<!--{if $post['yahoo']}--><a href="http://edit.yahoo.com/config/send_webmesg?.target=$post[yahoo]&.src=pg" target="_blank"><img src="{IMGDIR}/yahoo.gif" alt="Yahoo!" /></a><!--{/if}-->
<!--{if $post['taobao']}--><script type="text/javascript">document.write('<a target="_blank" href="http://amos1.taobao.com/msg.ww?v=2&uid='+encodeURIComponent('$post[taobaoas]')+'&s=2"><img src="{IMGDIR}/taobao.gif" alt="{lang taobao}" /></a>');</script><!--{/if}-->
</p>
<!--{/if}-->
<!--{if $customauthorinfo[3]}--><dl class="profile">{eval @eval('echo "'.$customauthorinfo[3].'";');}</dl><!--{/if}-->
<dl style="padding-top:15px;padding-left:3px">
{lang video_playurl}<a href="###" onclick="playurl.select('');setcopy(playurl.value, '{lang playurl_copied}');">[{lang copy}]</a><br /><input type="text" id="playurl" value="{$boardurl}viewthread.php?tid=$tid" size="28" onclick="this.select();setcopy(this.value, '{lang playurl_copied}');"><br />
{lang video_shareurl}<a href="###" onclick="shareurl.select('');setcopy(shareurl.value, '{lang shareurl_copied}');">[{lang copy}]</a><br /><input type="text" id="shareurl" value="[video=$vautoplay]$vid[/video]" size="28" onclick="this.select();setcopy(this.value, '{lang shareurl_copied}');"><br />
{lang video_flashurl}<a href="###" onclick="flashurl.select('');setcopy(flashurl.value, '{lang flashurl_copied}');">[{lang copy}]</a><br /><input type="text" id="flashurl" value="$shareplayurl" size="28" onclick="this.select();setcopy(this.value, '{lang flashurl_copied}');"></dl>
</td>
</tr>
<tr>
<td class="postcontent">
<p class="postactions">
<!--{if $forum['ismoderator'] || $thread[authorid] == $discuz_uid}--><a href="post.php?action=edit&fid=$fid&tid=$tid&pid=$post[pid]&page=$page&extra=$extra">{lang edit}</a> <!--{/if}-->
<!--{if $raterange && $post['authorid']}--> <a href="misc.php?action=rate&tid=$tid&pid=$post[pid]&page=$page" id="ajax_rate_$post[pid]" onclick="ajaxmenu(event, this.id, 9000000, '', 0)">{lang rate}</a> <!--{/if}-->
<!--{if $discuz_uid && $magicstatus}--><a href="magic.php?action=user&pid=$post[pid]" target="_blank">{lang magics_use}</a><!--{/if}-->
</p> </td>
<td class="postauthor"> </td>
</tr>
</table>
</div>
<div id="ad_interthread"></div>
<div id="ajaxspecialpost"></div>
<script type="text/javascript">ajaxget('viewthread.php?fid=$fid&tid=$tid&do=viewspecialpost&page=$page', 'ajaxspecialpost');</script>
{template viewthread_fastreply} | zyyhong | trunk/jiaju001/bbs/templates/default/viewthread_video.htm | HTML | asf20 | 13,628 |
{template header}
<!--{if $inajax}-->
{lang admin_getip_this} <b>$member[useip]</b> $member[iplocation]
<!--{if $allowviewip}-->
<br /><a href="admincp.php?action=ipban&ip=$member[useip]&frames=yes" target="_blank">[ {lang admin_ban_this_ip} ]</a>
<!--{/if}-->
<a href="###close" onclick="hideMenu()">[ {lang pm_close} ]</a>
<!--{else}-->
<div id="nav">
<a href="$indexname">$bbname</a> $navigation » {lang admin_getip}
</div>
<div class="mainbox formbox">
<h1>{lang admin_getip}</h1>
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td>{lang admin_getip_this} <b>$member[useip]</b> $member[iplocation]
</td>
<tr><td>
<!--{if $allowviewip}-->
<a href="admincp.php?action=ipban&ip=$member[useip]&frames=yes" target="_blank">[ {lang admin_ban_this_ip} ]</a>
<!--{/if}-->
<a href="###" onclick="history.go(-1)">[ {lang go_back} ]</a>
</td></tr></table></div></form>
<!--{/if}-->
{template footer} | zyyhong | trunk/jiaju001/bbs/templates/default/topicadmin_getip.htm | HTML | asf20 | 983 |
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=$charset" />
<title>$bbname</title>
<style type="text/css">
body { background-color: #FFFFFF; color: #000000; font-family: Verdana, Tahoma; font-size: 12px; margin: 20px; padding: 0px; }
#largetext { font-size: 18px; font-weight: bold; margin-bottom: 10px; padding-top: 3px; width: auto; }
#userinfo { font-size: 12px; color: #888888; text-align: right; width: auto; }
#copyright { margin-top: 30px; font-size: 11px; text-align: center; }
.wrapper { }
.subject { font-size: 14px; font-weight: bold; padding: 3px; margin-bottom: 10px; border: 1px solid #A8A8A8; }
.pm { color: #000000; padding: 10px; margin-top:10px; border: 1px solid #888888; }
.content { color: #888888; }
.msgborder { margin: 2em; margin-top: 3px; padding: 10px; border: 1px solid #888888; word-break: break-all; }
</style>
</head>
<body>
<div id="wrapper">
<div id="largetext">{lang pm_archive}</div>
<div id="userinfo"><a href="{$boardurl}space.php?uid=$discuz_uid" target="_blank">$discuz_userss @ $timenow[time]</a></div>
<br />
<!--{loop $pmlist $pm}-->
<div class="pm">
<div class="subject">$pm[subject]</div>
<strong>{lang time}:</strong> $pm[dateline]<br />
<strong>{lang pm_archive_folder}:</strong> <!--{if $pm['folder'] == 'outbox'}-->{lang pm_outbox}<!--{else}-->{lang pm_inbox}<!--{/if}--><br />
<strong>{lang from}:</strong> <!--{if !$announcepm}--><!--{if $pm[msgfromid]}--><a href="space.php?uid=$pm[msgfromid]">$pm[msgfrom]</a><!--{else}-->$pm[msgfrom]<!--{/if}--><!--{else}-->{lang pm_announce}<!--{/if}--><br />
<strong>{lang to}:</strong> <a href="{$boardurl}space.php?uid=$pm[msgtoid]" target="_blank">$pm[msgto]</a><br />
<br />
<div class="content">$pm[message]</div>
</div>
<!--{/loop}-->
</div>
<div id='copyright'>
Powered by <strong><a href="http://www.discuz.net" target="_blank">Discuz!</a> $version</strong></a>
© 2001-2006 <a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a>
</div>
</body>
</html> | zyyhong | trunk/jiaju001/bbs/templates/default/pm_archive_html.htm | HTML | asf20 | 2,079 |
<table cellspacing="0" cellpadding="0" width="100%">
<thead>
<tr>
<td>{lang in_thread}</td>
<td>{lang forum}</td>
<td><!--{if $type == 'poll'}-->{lang lastpost}<!--{else}-->{lang poll_dateline}<!--{/if}--></td>
<td>{lang status}</td>
</tr>
</thead>
<tbody>
<!--{if $polllist}-->
<!--{loop $polllist $key $poll}-->
<tr>
<td><a href="viewthread.php?tid=$poll[tid]" target="_blank">$poll[subject]</a></td>
<td><a href="forumdisplay.php?fid=$poll[fid]" target="_blank">$poll[forumname]</a></td>
<td>
<!--{if $type == 'poll'}-->
<cite>
<a href="redirect.php?tid=$poll[tid]&goto=lastpost#lastpost" target="_blank">$poll[lastpost]</a><br />by
<!--{if $poll['lastposter']}-->
<a href="space.php?username=$poll[lastposterenc]" target="_blank">$poll[lastposter]</a>
<!--{else}-->
{lang anonymous}
<!--{/if}-->
<cite>
<!--{else}-->
<cite>$poll[dateline]</cite>
<!--{/if}-->
</td>
<td><!--{if $poll[displayorder] == '-1'}-->{lang forum_recyclebin}<!--{elseif $poll[displayorder] == '-2'}-->{lang my_threads_aduit}<!--{elseif $poll[closed] == '1'}-->{lang my_threads_close}<!--{else}-->{lang my_threads_common}<!--{/if}--></td>
</tr>
<!--{/loop}-->
<!--{else}-->
<tr><td colspan="4">{lang forum_nothreads}</td></tr>
<!--{/if}-->
</tbody>
</table> | zyyhong | trunk/jiaju001/bbs/templates/default/my_polls.htm | HTML | asf20 | 1,340 |
<!--{if !$iscircle || !$sgid}-->{template header}<!--{else}-->{template supesite_header}<!--{/if}-->
<div id="nav"><a href="$indexname">$bbname</a> $navigation » <!--{if $special == 2}--><a href="viewthread.php?do=tradeinfo&tid=$tid&pid=$pid">$trade[subject]</a> » {lang post_editpost_tradegoods}<!--{elseif $isfirstpost}-->{lang post_editpost_trade}<!--{else}-->{lang post_editpost}<!--{/if}--></div>
<!--{if isset($trade) && $allowposttrade || isset($activity) && $allowpostactivity || isset($trade) && $allowposttrade}-->
<script type="text/javascript" src="include/javascript/calendar.js"></script>
<!--{/if}-->
<script type="text/javascript">
var postminchars = parseInt('$minpostsize');
var postmaxchars = parseInt('$maxpostsize');
var disablepostctrl = parseInt('$disablepostctrl');
var typerequired = 0;
var attachments = new Array();
var bbinsert = parseInt('$bbinsert');
var tradepost = {if $special == 2}1{else}0{/if};
var isfirstpost = parseInt('$isfirstpost');
var attachimgurl = new Array();
var allowposttrade = parseInt('$allowposttrade');
lang['board_allowed'] = '{lang board_allowed}';
lang['lento'] = '{lang lento}';
lang['bytes'] = '{lang bytes}';
lang['post_curlength'] = '{lang post_curlength}';
lang['post_subject_and_message_isnull'] = '{lang post_subject_and_message_isnull}';
lang['post_subject_toolong'] = '{lang post_subject_toolong}';
lang['post_message_length_invalid'] = '{lang post_message_length_invalid}';
lang['post_trade_alipay_null'] = '{lang post_trade_alipay_null}';
lang['post_trade_goodsname_null'] = '{lang post_trade_goodsname_null}';
lang['post_trade_price_null'] = '{lang post_trade_price_null}';
</script>
{template post_preview}
<form method="post" id="postform" action="post.php?action=edit&fid=$fid&tid=$tid&pid=$pid&extra=$extra&editsubmit=yes&mod=$mod" $enctype>
<input type="hidden" name="formhash" id="formhash" value="{FORMHASH}" />
<input type="hidden" name="page" value="$page" />
<div class="mainbox formbox">
<h1><!--{if $special == 2}-->{lang post_editpost_tradegoods}<!--{elseif $isfirstpost}-->{lang post_editpost_trade}<!--{else}-->{lang post_editpost}<!--{/if}--></h1>
<table summary="Edit Trade" cellspacing="0" cellpadding="0" id="specialpost">
<thead>
<tr>
<th>{lang username}</th>
<td>
<!--{if $discuz_uid}-->
$discuz_userss [<a href="$link_logout">{lang member_logout}</a>]
<!--{else}-->
{lang guest} [<a href="$link_login">{lang member_login}</a>]
<!--{/if}-->
</td>
</tr>
</thead>
<tr>
<th><label for="subject">{lang subject}</label></th>
<td>
$typeselect
<input type="text" name="subject" id="subject" size="45" value="$postinfo[subject]" tabindex="3" />
<input type="hidden" name="origsubject" value="$postinfo[subject]" />
</td>
</tr>
<!--{if $special == 2}-->
<thead>
<tr>
<th>{lang post_goodsinfo}</th>
<td> </td>
</tr>
</thead>
{template post_trade}
<!--{else}-->
<tr>
{template post_editor}
</tr>
<!--{/if}-->
<!--{if $isfirstpost}-->
<!--{if $special == 2}-->
<thead>
<tr>
<th>{lang post_otherinfo}</th>
<td> </td>
</tr>
</thead>
<!--{else}-->
<!--{if $tagstatus}-->
<tr>
<th><label for="tags">{lang post_tag}</label></th>
<td>
<input size="45" type="input" id="tags" name="tags" value="$threadtags" tabindex="95" />
<button onclick="relatekw();return false">{lang searchtags}</button><span id="tagselect"></span>
<em class="tips">{lang tag_comment}</em>
</td>
</tr>
<!--{/if}-->
<tr>
<th><label for="aboutthread">{lang post_trade_aboutcounter}</label></th>
<td><textarea name="aboutcounter" id="aboutcounter" rows="10" cols="20" style="width:99%; height:60px" tabindex="96">$postinfo[aboutcounter]</textarea></td>
</tr>
<!--{/if}-->
<!--{if $allowsetreadperm}-->
<tr>
<th><label for="readperm">{lang readperm_thread}</label></th>
<td><input type="text" id="readperm" name="readperm" size="6" value="$thread[readperm]" /> ({lang post_zero_is_nopermission})</td>
</tr>
<!--{/if}-->
<!--{/if}-->
<tr class="btns">
<th> </th>
<td>
<button type="submit" name="editsubmit" id="postsubmit" value="true" tabindex="101"><!--{if $special == 2}-->{lang post_editpost_tradegoods}<!--{elseif $isfirstpost}-->{lang post_editpost_trade}<!--{else}-->{lang post_editpost}<!--{/if}--></button>
<input type="hidden" name="wysiwyg" id="{$editorid}_mode" value="$editormode" />
<em>{lang post_submit_hotkey}</em>
<a href="###" id="restoredata" onclick="loadData()" title="{lang post_autosave_last_restore}">{lang post_autosave_restore}</a>
</td>
</tr>
</table>
</div>
{template post_editpost_attachlist}
</form>
{template post_js}
<script type="text/javascript">
var textobj = $(editorid + '_textarea');
<!--{if $bbinsert}-->
<!--{if $editormode}-->if(!(is_opera && is_opera < 9)) {textobj.value = bbcode2html(textobj.value);}<!--{/if}-->
newEditor(wysiwyg);
<!--{/if}-->
checkFocus();
setCaretAtEnd();
if(!(is_ie >= 5 || is_moz >= 2)) {
$('restoredata').style.display = 'none';
}
<!--{if $special == 2 && $tradetypeid}-->ajaxget('post.php?action=threadtypes&tradetype=yes&pid=$pid&typeid=$tradetypeid&themeid=1', 'threadtypes');<!--{/if}-->
</script>
<!--{if !$iscircle || !$sgid}-->{template footer}<!--{else}-->{template supesite_footer}<!--{/if}--> | zyyhong | trunk/jiaju001/bbs/templates/default/post_editpost_trade.htm | HTML | asf20 | 5,694 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$charset" />
<title>$navtitle $bbname $seotitle - Powered by Discuz!</title>
$seohead
<meta name="keywords" content="{$metakeywords}$seokeywords" />
<meta name="description" content="$metadescription $bbname $seodescription - Discuz! Board" />
<meta name="generator" content="Discuz! $version" />
<meta name="author" content="Discuz! Team and Comsenz UI Team" />
<meta name="copyright" content="2001-2007 Comsenz Inc." />
<meta name="MSSmartTagsPreventParsing" content="True" />
<meta http-equiv="MSThemeCompatible" content="Yes" />
<link rel="archives" title="$bbname" href="{$boardurl}archiver/" />
$rsshead
$extrahead
<!--{if $allowcsscache}-->
<link rel="stylesheet" type="text/css" href="forumdata/cache/style_{STYLEID}.css" />
<link rel="stylesheet" type="text/css" href="forumdata/cache/style_{STYLEID}_append.css" />
<!--{else}-->
<style type="text/css">{template css}</style>
<style type="text/css">{template css_append}</style>
<!--{/if}-->
<script type="text/javascript">var IMGDIR = '{IMGDIR}';var attackevasive = '$attackevasive';var gid = 0;<!--{if in_array(CURSCRIPT, array('viewthread', 'forumdisplay'))}-->gid = parseInt('$thisgid');<!--{elseif CURSCRIPT == 'index'}-->gid = parseInt('$gid');<!--{/if}-->var fid = parseInt('$fid');var tid = parseInt('$tid');</script>
<script type="text/javascript" src="include/javascript/common.js"></script>
<script type="text/javascript" src="include/javascript/menu.js"></script>
<script type="text/javascript" src="include/javascript/ajax.js"></script>
</head>
<body onkeydown="if(event.keyCode==27) return false;">
<div id="append_parent"></div><div id="ajaxwaitid"></div>
<div id="header">
<h2><a href="$indexname" title="$bbname">{BOARDLOGO}</a></h2>
<div id="ad_headerbanner"></div>
<div id="menu">
<!--{if $_DCACHE['settings']['frameon'] > 0}-->
<span class="frameswitch">
<script type="text/javascript">
if(top == self) {
<!--{if ($_DCACHE['settings']['frameon'] == 2 && !defined('CACHE_FILE') && in_array(CURSCRIPT, array('index', 'forumdisplay', 'viewthread')) && (($_DCOOKIE['frameon'] == 'yes' && $_GET['frameon'] != 'no') || (empty($_DCOOKIE['frameon']) && empty($_GET['frameon']))))}-->
top.location = 'frame.php?frameon=yes&referer='+escape(self.location);
<!--{/if}-->
document.write('<a href="frame.php?frameon=yes" target="_top" class="frameon">{lang frameon_column}<\/a>');
} else {
document.write('<a href="frame.php?frameon=no" target="_top" class="frameoff">{lang frameon_flat}<\/a>');
}
</script>
</span>
<!--{/if}-->
<ul>
<!--{if $discuz_uid}-->
<li><cite><a href="space.php?action=viewpro&uid=$discuz_uid">$discuz_userss:</a></cite></li>
<li><a href="$link_logout">{lang logout}</a></li>
<!--{if $maxpmnum}--><li<!--{if $BASESCRIPT == 'pm.php'}--> class="current"<!--{/if}-->><a href="pm.php" target="_blank">{lang pm}</a></li><!--{/if}-->
<!--{else}-->
<li<!--{if $BASESCRIPT == $regname}--> class="current"<!--{/if}-->><a href="$link_register">$reglinkname</a></li>
<li<!--{if $BASESCRIPT == 'logging.php'}--> class="current"<!--{/if}-->><a href="$link_login">{lang login}</a></li>
<!--{/if}-->
<!--{if $memliststatus}--><li<!--{if $BASESCRIPT == 'member.php'}--> class="current"<!--{/if}-->><a href="member.php?action=list">{lang memberlist}</a></li><!--{/if}-->
<!--{if $allowsearch || $qihoo['status']}--><li<!--{if $BASESCRIPT == 'search.php'}--> class="current"<!--{/if}-->><a href="search.php{if !empty($fid)}?srchfid=$fid{/if}">{lang search}</a></li><!--{/if}-->
<!--{if $tagstatus}--><li<!--{if $BASESCRIPT == 'tag.php'}--> class="current"<!--{/if}-->><a href="tag.php">{lang tag}</a></li><!--{/if}-->
<!--{if !empty($plugins['links'])}-->
<!--{loop $plugins['links'] $module}-->
<!--{if !$module['adminid'] || ($module['adminid'] && $adminid > 0 && $module['adminid'] >= $adminid)}--><li>$module[url]</li><!--{/if}-->
<!--{/loop}-->
<!--{/if}-->
<!--{if $discuz_uid}-->
<!--{if $jsmenu[4]}--><li id="my" class="dropmenu<!--{if $BASESCRIPT == 'my.php'}--> current<!--{/if}-->" onmouseover="showMenu(this.id)"><a href="my.php">{lang my}</a></li><!--{else}--><li><a href="my.php?item=threads"<!--{if $BASESCRIPT == 'my.php'}-->class="current"<!--{/if}-->>{lang show_mytopics}</a></li><li><a href="my.php?item=grouppermission">{lang my_permissions}</a></li><!--{/if}-->
<!--{if $jsmenu[2]}--><li id="memcp" class="dropmenu<!--{if $BASESCRIPT == 'memcp.php'}--> current<!--{/if}-->" onmouseover="showMenu(this.id)"><a href="memcp.php">{lang memcp}</a></li><!--{else}--><li><a href="memcp.php"<!--{if $BASESCRIPT == 'memcp.php'}-->class="current"<!--{/if}-->>{lang memcp}</a></li><!--{/if}-->
<!--{if $regstatus > 1}--><li<!--{if $BASESCRIPT == 'invite.php'}--> class="current"<!--{/if}-->><a href="invite.php">{lang invite}</a></li><!--{/if}-->
<!--{if $magicstatus}--><li<!--{if $BASESCRIPT == 'magic.php'}--> class="current"<!--{/if}-->><a href="magic.php">{lang magics_title}</a></li><!--{/if}-->
<!--{/if}-->
<!--{if !empty($plugins['jsmenu'])}--><li id="plugin" class="dropmenu" onmouseover="showMenu(this.id)"><a href="#">$pluginjsmenu</a></li><!--{/if}-->
<!--{if $allowviewstats}--><!--{if !empty($jsmenu[3])}--><li id="stats" class="dropmenu<!--{if $BASESCRIPT == 'stats.php'}--> current<!--{/if}-->" onmouseover="showMenu(this.id)"><a href="stats.php">{lang statistics}</a></li><!--{else}--><li><a href="stats.php">{lang statistics}</a></li><!--{/if}--><!--{/if}-->
<!--{if $discuz_uid && in_array($adminid, array(1, 2, 3))}--><li><a href="admincp.php" target="_blank">{lang admincp}</a></li><!--{/if}-->
<li<!--{if $BASESCRIPT == 'faq.php'}--> class="current"<!--{/if}-->><a href="faq.php">{lang faq}</a></li>
</ul>
</div>
</div>
<div class="wrap"> | zyyhong | trunk/jiaju001/bbs/templates/PinkDresser/header.htm | HTML | asf20 | 6,119 |
<!--{if !empty($jsmenu) && (empty($bbclosed) || $adminid == 1)}-->{template jsmenu}<!--{/if}-->
<div id="ad_footerbanner1"></div><div id="ad_footerbanner2"></div><div id="ad_footerbanner3"></div>
</div>
<div id="footer">
<div class="wrap">
<div id="footlinks">
<p>{lang time_now}<!--{if $icp}--> <a href="http://www.miibeian.gov.cn/" target="_blank">$icp</a><!--{/if}--></p>
<p>
<a href="member.php?action=clearcookies&formhash={FORMHASH}">{lang clear_cookies}</a>
- <a href="mailto:$adminemail">{lang contactus}</a> - <a href="$siteurl" target="_blank">$sitename</a>
<!--{if $archiverstatus}--> - <a href="archiver/" target="_blank">Archiver</a><!--{/if}-->
<!--{if $wapstatus}--> - <a href="wap/" target="_blank">WAP</a><!--{/if}-->
- <span class="scrolltop" onclick="window.scrollTo(0,0);">TOP</span>
<!--{if !empty($stylejumpstatus)}-->
- <span id="styleswitcher" class="dropmenu" onmouseover="showMenu(this.id)">{lang style}</span>
<script type="text/javascript">
function setstyle(styleid) {
<!--{if CURSCRIPT == 'forumdisplay'}-->
location.href = 'forumdisplay.php?fid=$fid&page=$page&styleid=' + styleid;
<!--{elseif CURSCRIPT == 'viewthread'}-->
location.href = 'viewthread.php?tid=$tid&page=$page&styleid=' + styleid;
<!--{else}-->
location.href = '$indexname?styleid=' + styleid;
<!--{/if}-->
}
</script>
<ul id="styleswitcher_menu" class="popupmenu_popup" style="display: none;">
<!--{loop $stylejump $id $name}-->
<li{if $id == $styleid} class="current"{/if}><a href="###" onclick="setstyle($id)">$name</a></li>
<!--{/loop}-->
</ul>
<!--{/if}-->
</p>
</div>
<a href="http://www.discuz.net" target="_blank" title="Powered by Discuz!"><img src="{IMGDIR}/discuz_icon.gif" border="0" alt="Discuz!" /></a>
<p id="copyright">
Powered by <strong><a href="http://www.discuz.net" target="_blank">Discuz!</a></strong> <em>$version</em><!--{if !empty($boardlicensed)}--> <a href="http://www.discuz.com/index.php?action=certificate&host=$_SERVER[HTTP_HOST]" target="_blank">Licensed</a><!--{/if}-->
© 2001-2007 <a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a>
</p>
{eval updatesession();}
<!--{if debuginfo()}-->
<p id="debuginfo">Processed in $debuginfo[time] second(s), $debuginfo[queries] queries<!--{if $gzipcompress}-->, Gzip enabled<!--{/if}-->.</p>
<!--{/if}-->
</div>
</div>
<!--{if $_DCACHE['settings']['frameon'] && in_array(CURSCRIPT, array('index', 'forumdisplay', 'viewthread')) && $_DCOOKIE['frameon'] == 'yes'}-->
<script type="text/javascript" src="include/javascript/iframe.js"></script>
<!--{/if}-->
{eval output();}
</body>
</html> | zyyhong | trunk/jiaju001/bbs/templates/PinkDresser/footer.htm | HTML | asf20 | 2,787 |
/*
PinkDresser Style for Discuz!(R)
URL: http://www.discuz.net
(C) 2001-2007 Comsenz Inc.
<style type="text/css">
*/
* { word-break: break-all; word-wrap: break-word; }
body { {BGCODE}; text-align: center; background-repeat: repeat-x; }
.wrap { text-align: left; margin: 0 auto; overflow: hidden; margin-bottom: 0; background: #FFF url({IMGDIR}/wrap_shadow.gif) repeat-y 0 0; width: 992px; w\idth: 922px; padding: 0 35px; }
.message { margin: 3em 10em 5em !important; padding: 0 0 2em !important; }
.message p { margin: 1em; }
#header { overflow: hidden; width: 992px; w\idth: 952px; padding: 0 20px; margin: 0 auto; height: 122px; background: url({IMGDIR}/header.gif) no-repeat 894px -122px; }
#header h2 { float: left; padding: 5px 0; height: 80px; background: url({IMGDIR}/header.gif) no-repeat 0 0; }
#menu li a { text-decoration: none; float: left; color: {HEADERMENUTEXT}; padding: 4px 8px 3px; }
#announcement div { border: 1px solid {TABLEBG}; padding: 0 10px; line-height: 35px !important; height: 36px; overflow-y: hidden;}
.pages a, .pages strong, .pages em, .pages kbd { float: left; padding: 0 8px; line-height:26px; }
.legend label { padding: 0 15px; }
.mainbox table { width: 99.9%; }
#wysiwyg { font: {MSGFONTSIZE}/1.6em {FONT} !important; background: #FFF; background-image: none !important; }
.postform .btns { margin-top: 0.5em; line-height: 30px; color: {LIGHTTEXT}; font-family: Simsun, "Times New Roman"; }
#smilieslist h4 { color: {HIGHLIGHTLINK}; padding: 5px; background: {COMMONBOXBG}; border-bottom: 1px solid {COMMONBOXBORDER}; text-align: left; }
#ad_headerbanner { float: right; margin: 15px 10px 0 0; }
.postform .special, #postform .special { font-weight: bold; color: {HIGHLIGHTLINK};}
#menu { border: none; height: 32px; clear: both; background: transparent url({IMGDIR}/header.gif) no-repeat 0 -90px; }
.frameswitch, #menu ul { border: none; }
#menu li.hover, #menu li.current { background-color: {CATCOLOR}; border: 1px solid; border-color: {BORDERCOLOR} {BORDERCOLOR} {BGCOLOR}; }
#menu li a { background: none; }
.mainbox tbody th, .mainbox tbody td { border-top: 1px solid {BGBORDER}; padding: 5px; }
.forumlist tbody th, .threadlist tbody th, .forumlist tbody td.nums, .threadlist tbody td.nums, .threadlist tbody td.author, .threadlist tbody td.folder { border-right: 1px solid {BGBORDER}; }
.forumlist tbody td, .threadlist tbody td { border-left: 3px solid {TABLEBG}; padding: 5px; }
.threadlist tbody td.folder { border-left: none; }
.threadlist tbody td.icon { padding-left: 5px; }
#wysiwyg { background-image: none !important; }
#footer { width: 992px; margin: 0 auto; border: none; padding: 0; height: 137px; background: #FFF url({IMGDIR}/footer_shadow.gif) repeat-x 0 0; }
#footer .wrap { padding: 15px 0 0 50px; width: 992px; w\idth: 942px; height: 137px; he\ight: 122px; background: transparent url({IMGDIR}/footer_shadow.gif) no-repeat 0 -137px; }
#footlinks { height: 137px; margin: -15px 0 0 0; padding: 15px 50px 0 0; background: transparent url({IMGDIR}/footer_shadow.gif) no-repeat 100% -274px; }
| zyyhong | trunk/jiaju001/bbs/templates/PinkDresser/css_append.htm | HTML | asf20 | 3,153 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: leftmenu.php 9804 2007-08-15 05:56:19Z cnteacher $
*/
define('NOROBOT', TRUE);
require_once './include/common.inc.php';
require_once DISCUZ_ROOT.'./include/forum.func.php';
$forumlist = $collapse = $gid = array();
$newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
$sql = !empty($accessmasks) ?
"SELECT f.fid, f.fup, f.type, f.name, ff.viewperm, a.allowview FROM {$tablepre}forums f
LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid
LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid
WHERE f.status>'0' ORDER BY f.type, f.displayorder"
: "SELECT f.fid, f.fup, f.type, f.name, ff.viewperm FROM {$tablepre}forums f
LEFT JOIN {$tablepre}forumfields ff USING(fid)
WHERE f.status>'0' ORDER BY f.type, f.displayorder";
$query = $db->query($sql);
$forumdata = $forumlist = $haschild = array();
while($forumdata = $db->fetch_array($query)) {
if(!$forumdata['viewperm'] || ($forumdata['viewperm'] && forumperm($forumdata['viewperm'])) || !empty($forumdata['allowview']) || (isset($forumdata['users']) && strstr($forumdata['users'], "\t$discuz_uid\t"))) {
$forumdata['name'] = addslashes($forumdata['name']);
$forumdata['type'] != 'group' && $haschild[$forumdata['fup']] = true;
$forumlist[] = $forumdata;
}
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}sessions");
$onlinenum = $db->result($query , 0);
include template('leftmenu');
?> | zyyhong | trunk/jiaju001/bbs/leftmenu.php | PHP | asf20 | 1,548 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: relatekw.php 10051 2007-08-23 02:40:59Z monkey $
*/
error_reporting(0);
set_magic_quotes_runtime(0);
define('DISCUZ_ROOT', './');
define('IN_DISCUZ', TRUE);
define('NOROBOT', TRUE);
$inajax = 1;
$subjectenc = rawurlencode(strip_tags($_GET['subjectenc']));
$messageenc = rawurlencode(strip_tags(preg_replace("/\[.+?\]/U", '', $_GET['messageenc'])));
require_once './config.inc.php';
$data = @implode('', file("http://keyword.discuz.com/related_kw.html?title=$subjectenc&content=$messageenc&ics=$charset&ocs=$charset"));
if($data) {
require_once DISCUZ_ROOT.'./include/global.func.php';
if(PHP_VERSION > '5' && $charset != 'utf-8') {
require_once DISCUZ_ROOT.'./include/chinese.class.php';
$chs = new Chinese('utf-8', $charset);
}
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser, $data, $values, $index);
xml_parser_free($parser);
$kws = array();
foreach($values as $valuearray) {
if($valuearray['tag'] == 'kw' || $valuearray['tag'] == 'ekw') {
$kws[] = !empty($chs) ? $chs->convert(trim($valuearray['value'])) : trim($valuearray['value']);
}
}
$return = '';
if($kws) {
foreach($kws as $kw) {
$kw = htmlspecialchars($kw);
$return .= $kw.' ';
}
$return = htmlspecialchars($return);
}
include template('relatekw');
}
?> | zyyhong | trunk/jiaju001/bbs/relatekw.php | PHP | asf20 | 1,562 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: trade.php 16736 2008-11-17 05:25:55Z cnteacher $
*/
define('NOROBOT', TRUE);
define('CURSCRIPT', 'trade');
require_once './include/common.inc.php';
require_once DISCUZ_ROOT.'./api/alipayapi.php';
if(!$discuz_uid) {
showmessage('not_loggedin', NULL, 'NOPERM');
}
$page = max(1, intval($page));
if(!empty($orderid)) {
include_once language('misc');
$tradelog = daddslashes($db->fetch_first("SELECT * FROM {$tablepre}tradelog WHERE orderid='$orderid'"), 1);
if(empty($tradelog) || $discuz_uid != $tradelog['sellerid'] && $discuz_uid != $tradelog['buyerid']) {
showmessage('undefined_action', NULL, 'HALTED');
}
$trade_message = '';
$currentcredit = $creditstrans ? $_DSESSION['extcredits'.$creditstrans] : 0;
$discountprice = $tradelog['baseprice'] * $tradelog['number'];
if(!empty($pay) && !$tradelog['offline'] && $tradelog['status'] == 0 && $tradelog['buyerid'] == $discuz_uid) {
$trade = $db->fetch_first("SELECT * FROM {$tablepre}trades WHERE tid='$tradelog[tid]' AND pid='$tradelog[pid]'");
if($discuz_uid && $currentcredit < $discountcredit && $tradelog['discount']) {
showmessage('trade_credits_no_enough');
}
$pay = array();
$pay['commision'] = 0;
$transport = $tradelog['transport'];
$transportfee = 0;
trade_setprice(array('fee' => $fee, 'trade' => $trade, 'transport' => $transport), $price, $pay, $transportfee);
$payurl = trade_payurl($pay, $trade, $tradelog);
showmessage('credits_addfunds_succeed', $payurl);
}
if(submitcheck('offlinesubmit') && in_array($offlinestatus, trade_offline($tradelog, 0))) {
if(md5($password) != $_DSESSION['discuz_pw']) {
showmessage('trade_password_error', 'trade.php?orderid='.$orderid);
}
if($offlinestatus == STATUS_SELLER_SEND) {
$trade = $db->fetch_first("SELECT amount FROM {$tablepre}trades WHERE tid='$tradelog[tid]' AND pid='$tradelog[pid]'");
$user = $tradelog['buyer'];
$itemsubject = $tradelog['subject'];
sendpm($tradelog['sellerid'], 'trade_seller_send_subject', 'trade_seller_send_message', '0', 'System Message');
} elseif($offlinestatus == STATUS_WAIT_BUYER) {
$user = $tradelog['seller'];
$itemsubject = $tradelog['subject'];
sendpm($tradelog['buyerid'], 'trade_buyer_confirm_subject', 'trade_buyer_confirm_message', '0', 'System Message');
} elseif($offlinestatus == STATUS_TRADE_SUCCESS) {
$db->query("UPDATE {$tablepre}trades SET lastbuyer='$tradelog[buyer]', lastupdate='$timestamp', totalitems=totalitems+'$tradelog[number]', tradesum=tradesum+'$tradelog[price]' WHERE tid='$tradelog[tid]' AND pid='$tradelog[pid]'", 'UNBUFFERED');
$itemsubject = $tradelog['subject'];
sendpm($tradelog['sellerid'], 'trade_success_subject', 'trade_success_message', '0', 'System Message');
sendpm($tradelog['buyerid'], 'trade_success_subject', 'trade_success_message', '0', 'System Message');
} elseif($offlinestatus == STATUS_REFUND_CLOSE) {
$db->query("UPDATE {$tablepre}trades SET amount=amount+'$tradelog[number]' WHERE tid='$tradelog[tid]' AND pid='$tradelog[pid]'", 'UNBUFFERED');
$itemsubject = $tradelog['subject'];
sendpm($tradelog['sellerid'], 'trade_fefund_success_subject', 'trade_fefund_success_message', '0', 'System Message');
sendpm($tradelog['buyerid'], 'trade_fefund_success_subject', 'trade_fefund_success_message', '0', 'System Message');
}
$message = trim($message);
if($message) {
$message = daddslashes($tradelog['message']."\t\t\t".$discuz_uid."\t".$discuz_user."\t".$timestamp."\t".nl2br(strip_tags(substr($message, 0, 200))), 1);
} else {
$message = daddslashes($tradelog['message'], 1);
}
$db->query("UPDATE {$tablepre}tradelog SET status='$offlinestatus', lastupdate='$timestamp', message='$message' WHERE orderid='$orderid'");
showmessage('trade_orderstatus_updated', 'trade.php?orderid='.$orderid);
}
if(submitcheck('tradesubmit')) {
if($tradelog['status'] == 0) {
$update = array();
if($tradelog['sellerid'] == $discuz_uid) {
$tradelog['baseprice'] = floatval($newprice);
$tradelog['transportfee'] = intval($newfee);
$update = array(
"baseprice='$tradelog[baseprice]'",
"transportfee='$tradelog[transportfee]'"
);
}
if($tradelog['buyerid'] == $discuz_uid) {
$newnumber = intval($newnumber);
if($newnumber <= 0) {
showmessage('trade_input_no');
}
$trade = $db->fetch_first("SELECT amount FROM {$tablepre}trades WHERE tid='$tradelog[tid]' AND pid='$tradelog[pid]'");
if($newnumber > $trade['amount'] + $tradelog['number']) {
showmessage('trade_lack');
}
$amount = $trade['amount'] + $tradelog['number'] - $newnumber;
$db->query("UPDATE {$tablepre}trades SET amount='$amount' WHERE tid='$tradelog[tid]' AND pid='$tradelog[pid]'", 'UNBUFFERED');
$tradelog['number'] = $newnumber;
$update = array(
"number='$tradelog[number]'",
"discount=0",
"buyername='".dhtmlspecialchars($newbuyername)."'",
"buyercontact='".dhtmlspecialchars($newbuyercontact)."'",
"buyerzip='".dhtmlspecialchars($newbuyerzip)."'",
"buyerphone='".dhtmlspecialchars($newbuyerphone)."'",
"buyermobile='".dhtmlspecialchars($newbuyermobile)."'"
);
}
if($update) {
if($tradelog['discount']) {
$tradelog['baseprice'] = $tradelog['baseprice'] - $tax;
$price = $tradelog['baseprice'] * $tradelog['number'];
} else {
$price = $tradelog['baseprice'] * $tradelog['number'];
}
$update[] = "price='".($price + ($tradelog['transport'] == 2 ? $tradelog['transportfee'] : 0))."'";
$db->query("UPDATE {$tablepre}tradelog SET ".implode(',', $update)." WHERE orderid='$orderid'");
$tradelog = $db->fetch_first("SELECT * FROM {$tablepre}tradelog WHERE orderid='$orderid'");
}
}
}
$tradelog['lastupdate'] = gmdate("$dateformat $timeformat", $tradelog['lastupdate'] + $timeoffset * 3600);
$tradelog['statusview'] = trade_getstatus($tradelog['status']);
$messagelist = array();
if($tradelog['offline']) {
$offlinenext = trade_offline($tradelog);
$message = explode("\t\t\t", $tradelog['message']);
foreach($message as $row) {
$row = explode("\t", $row);
$row[2] = gmdate("$dateformat $timeformat", $row[2] + $timeoffset * 3600);
$row[0] && $messagelist[] = $row;
}
} else {
$loginurl = 'https://www.alipay.com/trade/query_trade_detail.htm?trade_no='.$tradelog['tradeno'];
}
include template('trade_view');
} else {
if(empty($pid)) {
$pid = $db->result_first("SELECT pid FROM {$tablepre}posts WHERE tid='$tid' AND first='1' LIMIT 1");
}
if($db->result_first("SELECT closed FROM {$tablepre}threads WHERE tid='$tid'")) {
showmessage('trade_closed', 'viewthread.php?tid='.$tid.'&page='.$page);
}
$trade = $db->fetch_first("SELECT * FROM {$tablepre}trades WHERE tid='$tid' AND pid='$pid'");
if(empty($trade)) {
showmessage('undefined_action', NULL, 'HALTED');
}
$fromcode = false;
if($trade['closed']) {
showmessage('trade_closed', 'viewthread.php?tid='.$tid.'&page='.$page);
}
if($trade['price'] <= 0) {
showmessage('trade_invalid', 'viewthread.php?tid='.$tid.'&page='.$page);
}
if($action != 'trade' && !submitcheck('tradesubmit')) {
$lastbuyerinfo = dhtmlspecialchars($db->fetch_first("SELECT buyername,buyercontact,buyerzip,buyerphone,buyermobile FROM {$tablepre}tradelog WHERE buyerid='$discuz_uid' AND status!=0 AND buyername!='' ORDER BY lastupdate DESC LIMIT 1"));
$extra = rawurlencode($extra);
include template('trade');
} else {
if($trade['sellerid'] == $discuz_uid) {
showmessage('trade_by_myself');
} elseif($number <= 0) {
showmessage('trade_input_no');
} elseif(!$fromcode && $number > $trade['amount']) {
showmessage('trade_lack');
}
$pay['number'] = $number;
$pay['price'] = $trade['price'];
$price = $pay['price'] * $pay['number'];
$buyercredits = 0;
$pay['commision'] = 0;
$orderid = $pay['orderid'] = gmdate('YmdHis', $timestamp + $_DCACHE['settings']['timeoffset'] * 3600).random(18);
$transportfee = 0;
trade_setprice(array('fee' => $fee, 'trade' => $trade, 'transport' => $transport), $price, $pay, $transportfee);
$buyerid = $discuz_uid ? $discuz_uid : 0;
$discuz_user = $discuz_user ? $discuz_user : $guestuser;
$trade = daddslashes($trade, 1);
$buyermsg = dhtmlspecialchars($buyermsg);
$buyerzip = dhtmlspecialchars($buyerzip);
$buyerphone = dhtmlspecialchars($buyerphone);
$buyermobile = dhtmlspecialchars($buyermobile);
$buyername = dhtmlspecialchars($buyername);
$buyercontact = dhtmlspecialchars($buyercontact);
$offline = !empty($offline) ? 1 : 0;
$db->query("INSERT INTO {$tablepre}tradelog
(tid, pid, orderid, subject, price, quality, itemtype, number, tax, locus, sellerid, seller, selleraccount, buyerid, buyer, buyercontact, buyercredits, buyermsg, lastupdate, offline, buyerzip, buyerphone, buyermobile, buyername, transport, transportfee, baseprice, discount) VALUES
('$trade[tid]', '$trade[pid]', '$orderid', '$trade[subject]', '$price', '$trade[quality]', '$trade[itemtype]', '$number', '$tax',
'$trade[locus]', '$trade[sellerid]', '$trade[seller]', '$trade[account]', '$discuz_uid', '$discuz_user', '$buyercontact', 0, '$buyermsg', '$timestamp', '$offline', '$buyerzip', '$buyerphone', '$buyermobile', '$buyername', '$transport', '$transportfee', '$trade[price]', 0)");
$db->query("UPDATE {$tablepre}trades SET amount=amount-'$number' WHERE tid='$trade[tid]' AND pid='$trade[pid]'", 'UNBUFFERED');
showmessage('trade_order_created', 'trade.php?orderid='.$orderid);
}
}
?> | zyyhong | trunk/jiaju001/bbs/trade.php | PHP | asf20 | 9,828 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: attachment.php 10506 2007-09-03 09:56:32Z liuqiang $
*/
define('NOROBOT', TRUE);
require_once './include/common.inc.php';
$discuz_action = 14;
// read local file's function: 1=fread 2=readfile 3=fpassthru 4=fpassthru+multiple
$readmod = 2;
$refererhost = parse_url($_SERVER['HTTP_REFERER']);
$supe_host = $supe['status'] ? parse_url($supe['siteurl']) : '';
if($attachrefcheck && $_SERVER['HTTP_REFERER'] && !($refererhost['host'] == $_SERVER['HTTP_HOST'] || ($supe['status'] && $refererhost['host'] == $supe_host['host']))) {
//dheader("Location: {$boardurl}images/common/invalidreferer.gif");
showmessage('attachment_referer_invalid', NULL, 'HALTED');
}
periodscheck('attachbanperiods');
$attachexists = $ispaid = FALSE;
if(!empty($aid)) {
$query = $db->query("SELECT * FROM {$tablepre}attachments WHERE aid='$aid'");
if($attach = $db->fetch_array($query)) {
$query = $db->query("SELECT tid, fid, price, special FROM {$tablepre}threads WHERE tid='$attach[tid]' AND displayorder>='0'");
$thread = $db->fetch_array($query);
if($thread['fid']) {
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE pid='$attach[pid]' AND invisible='0'");
if($db->result($query, 0)) {
$attachexists = TRUE;
}
}
}
}
if(!$attachexists) {
showmessage('attachment_nonexistence');
}
if($allowgetattach && ($attach['readperm'] && $attach['readperm'] > $readaccess) && $adminid <= 0 && !($discuz_uid && $discuz_uid == $attach['uid'])) {
showmessage('attachment_forum_nopermission', NULL, 'NOPERM');
}
if(!$thread['special'] && $thread['price'] > 0 && (!$discuz_uid || ($discuz_uid && $discuz_uid != $attach['uid'] && $adminid <=0))) {
$query = $db->query("SELECT uid FROM {$tablepre}paymentlog WHERE uid='$discuz_uid' AND tid='$attach[tid]'");
if($db->result($query, 0)) {
$ispaid = TRUE;
} else {
showmessage('attachment_payto', 'viewthread.php?tid='.$attach['tid']);
}
}
if($attach['price'] && (!$discuz_uid || ($discuz_uid != $attach['uid'] && !in_array($adminid, array(1, 2))))) {
if($adminid != 3 || !$db->result($db->query("SELECT uid FROM {$tablepre}moderators m INNER JOIN {$tablepre}threads t ON t.tid='$attach[tid]' AND t.fid=m.fid WHERE m.uid='$discuz_uid'"), 0)) {
$payrequired = 0;
if(!$discuz_uid) {
$payrequired = 1;
} else {
$payrequired = !$db->result($db->query("SELECT uid FROM {$tablepre}attachpaymentlog WHERE uid='$discuz_uid' AND aid='$attach[aid]'"), 0);
}
if($payrequired) {
showmessage('attachement_payto_attach', 'misc.php?action=attachpay&aid='.$attach['aid']);
}
}
}
if($attach['isimage'] && empty($nothumb) && $attach['thumb']) {
if($attach['remote'] && !$ftp['hideurl']) {
dheader('location:'.$ftp['attachurl'].'/'.$attach['attachment'].'.thumb.jpg');
}
dheader('Content-Disposition: inline; filename='.$attach['filename'].'.thumb.jpg');
dheader('Content-Type: image/pjpeg');
if(!$attach['remote']) {
$thumbfilename = $attachdir.'/'.$attach['attachment'].'.thumb.jpg';
if(is_readable($thumbfilename)) {
$filesize = filesize($thumbfilename);
$fp = fopen($thumbfilename, 'rb');
@flock($fp, 2);
$attachment = @fread($fp, $filesize);
@fclose($fp);
echo $attachment;
exit;
}
} else {
if(getremotefile($attach['attachment'].'.thumb.jpg')) {
exit;
}
}
}
$filename = $attachdir.'/'.$attach['attachment'];
if(!$attach['remote'] && !(is_readable($filename) && $attachexists)) {
showmessage('attachment_nonexistence');
}
$query = $db->query("SELECT f.viewperm, f.getattachperm, f.getattachcredits, a.allowgetattach FROM {$tablepre}forumfields f
LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid
WHERE f.fid='$thread[fid]'");
$forum = $db->fetch_array($query);
if(!$ispaid) {
if(!$forum['allowgetattach']) {
if(!$forum['getattachperm'] && !$allowgetattach) {
showmessage('group_nopermission', NULL, 'NOPERM');
} elseif(($forum['getattachperm'] && !forumperm($forum['getattachperm'])) || ($forum['viewperm'] && !forumperm($forum['viewperm']))) {
showmessage('attachment_forum_nopermission', NULL, 'NOPERM');
}
}
}
if(!($isimage = preg_match("/^image\/.+/", $attach['filetype']))) {
$getattachcredits = $forum['getattachcredits'] ? unserialize($forum['getattachcredits']) : $creditspolicy['getattach'];
checklowerlimit($getattachcredits, -1);
}
if(empty($noupdate)) {
if($delayviewcount == 2 || $delayviewcount == 3) {
$logfile = './forumdata/cache/cache_attachviews.log';
if(substr($timestamp, -1) == '0') {
require_once DISCUZ_ROOT.'./include/misc.func.php';
updateviews('attachments', 'aid', 'downloads', $logfile);
}
if(@$fp = fopen(DISCUZ_ROOT.$logfile, 'a')) {
fwrite($fp, "$aid\n");
fclose($fp);
} elseif($adminid == 1) {
showmessage('view_log_invalid');
}
} else {
$db->query("UPDATE {$tablepre}attachments SET downloads=downloads+'1' WHERE aid='$aid'", 'UNBUFFERED');
}
}
if(!$isimage) {
updatecredits($discuz_uid, $getattachcredits, -1);
}
ob_end_clean();
//dheader('Cache-control: max-age=31536000');
//dheader('Expires: '.gmdate('D, d M Y H:i:s', $timestamp + 31536000).' GMT');
if($attach['remote'] && !$ftp['hideurl']) {
dheader('location:'.$ftp['attachurl'].'/'.$attach['attachment']);
}
$filesize = filesize($filename);
$attach['filename'] = '"'.(strtolower($charset) == 'utf-8' && strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? urlencode($attach['filename']) : $attach['filename']).'"';
dheader('Date: '.gmdate('D, d M Y H:i:s', $attach['dateline']).' GMT');
dheader('Last-Modified: '.gmdate('D, d M Y H:i:s', $attach['dateline']).' GMT');
dheader('Content-Encoding: none');
if($isimage && !empty($noupdate)) {
dheader('Content-Disposition: inline; filename='.$attach['filename']);
} else {
dheader('Content-Disposition: attachment; filename='.$attach['filename']);
}
dheader('Content-Type: '.$attach['filetype']);
dheader('Content-Length: '.$filesize);
$range = 0;
if($readmod == 4) {
dheader('Accept-Ranges: bytes');
if(!empty($_SERVER['HTTP_RANGE'])) {
list($range) = explode('-',(str_replace('bytes=', '', $_SERVER['HTTP_RANGE'])));
$rangesize = ($filesize - $range) > 0 ? ($filesize - $range) : 0;
dheader('Content-Length: '.$rangesize);
dheader('HTTP/1.1 206 Partial Content');
dheader('Content-Range: bytes='.$range.'-'.($filesize-1).'/'.($filesize));
}
}
if(!$attach['remote']) {
error_reporting(0);
getlocalfile($filename, $readmod, $range);
} else {
if(!getremotefile($attach['attachment'])) {
showmessage('attachment_nonexistence');
}
}
function getremotefile($file) {
global $authkey, $ftp, $attachdir;
@set_time_limit(0);
if(!@readfile($ftp['attachurl'].'/'.$file)) {
require_once DISCUZ_ROOT.'./include/ftp.func.php';
if(!($ftp['connid'] = dftp_connect($ftp['host'], $ftp['username'], authcode($ftp['password'], 'DECODE', md5($authkey)), $ftp['attachdir'], $ftp['port'], $ftp['ssl']))) {
return FALSE;
}
$tmpfile = @tempnam($attachdir, '');
if(dftp_get($ftp['connid'], $tmpfile, $file, FTP_BINARY)) {
@readfile($tmpfile);
@unlink($tmpfile);
} else {
@unlink($tmpfile);
return FALSE;
}
}
return TRUE;
}
function getlocalfile($filename, $readmod = 1, $range = 0) {
if($readmod == 1 || $readmod == 3 || $readmod == 4) {
if($fp = @fopen($filename, 'rb')) {
@fseek($fp, $range);
if(function_exists('fpassthru') && ($readmod == 3 || $readmod == 4)) {
@fpassthru($fp);
} else {
echo @fread($fp, filesize($filename));
}
}
@fclose($fp);
} else {
@readfile($filename);
}
@flush(); @ob_flush();
}
?> | zyyhong | trunk/jiaju001/bbs/attachment.php | PHP | asf20 | 7,856 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: invite.php 10420 2007-08-29 08:18:57Z tiger $
*/
require_once './include/common.inc.php';
if($regstatus < 1) {
showmessage('invite_close');
} elseif(!$discuz_uid || !$allowinvite) {
showmessage('group_nopermission', NULL, 'NOPERM');
}
$action = !empty($action) ? $action : 'availablelog';
if($action == 'buyinvite') {
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}invites WHERE uid='$discuz_uid' AND dateline>'$timestamp'-86400 AND dateline<'$timestamp'");
$myinvitenum = intval($db->result($query, 0));
if($maxinvitenum && $myinvitenum == $maxinvitenum) {
showmessage('invite_num_range_invalid', 'invite.php');
}
if(!submitcheck('buysubmit')) {
include template('invite_get');
} else {
$amount = intval($amount);
$buyinvitecredit = $amount ? $amount * $inviteprice : 0;
if(!$amount || $amount < 0) {
showmessage('invite_num_invalid', 'invite.php');
} elseif(${'extcredits'.$creditstrans} < $buyinvitecredit && $buyinvitecredit) {
showmessage('invite_credits_no_enough', 'invite.php');
} elseif(($maxinvitenum && $myinvitenum + $amount > $maxinvitenum) || $amount > 50) {
showmessage('invite_num_buy_range_invalid', 'invite.php');
} elseif($buyinvitecredit && !$creditstrans) {
showmessage('credits_transaction_disabled');
} else {
for($i=1; $i<=$amount; $i++) {
$invitecode = substr(md5($discuz_uid.$timestamp.random(6)), 0, 10).random(6);
$expiration = $timestamp + $maxinviteday * 86400;
$db->query("INSERT INTO {$tablepre}invites (uid, dateline, expiration, inviteip, invitecode) VALUES ('$discuz_uid', '$timestamp', '$expiration', '$onlineip', '$invitecode')", 'UNBUFFERED');
}
if($buyinvitecredit && $creditstrans) {
$db->query("UPDATE {$tablepre}members SET extcredits$creditstrans=extcredits$creditstrans-'$buyinvitecredit' WHERE uid='$discuz_uid'");
}
showmessage('invite_buy_succeed', 'invite.php');
}
}
} elseif(in_array($action, array('availablelog', 'invalidlog', 'usedlog'))) {
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
$cur_class = array($action => 'class="current"');
$sql = $status = '';
switch($action) {
case 'availablelog':
$status = '1';
$sql = "SELECT dateline, expiration, invitecode, status
FROM {$tablepre}invites
WHERE uid='$discuz_uid' AND status IN ('1', '3') ORDER BY dateline DESC LIMIT $start_limit,$tpp";
break;
case 'usedlog':
$status = '2';
$sql = "SELECT i.dateline, i.expiration, i.invitecode, m.username, m.uid
FROM {$tablepre}invites i, {$tablepre}members m
WHERE i.uid='$discuz_uid' AND i.status='2' AND i.reguid=m.uid ORDER BY dateline DESC LIMIT $start_limit,$tpp";
break;
case 'invalidlog':
$status = '4';
$sql = "SELECT dateline, expiration, invitecode
FROM {$tablepre}invites
WHERE uid='$discuz_uid' AND status='4' ORDER BY dateline DESC LIMIT $start_limit,$tpp";
break;
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}invites WHERE uid='$discuz_uid' AND status='$status'");
$invitenum = intval($db->result($query, 0));
$multipage = multi($invitenum, $tpp, $page, "invite.php?action=$action");
$invitelist = array();
$query = $db->query("$sql");
while($invite = $db->fetch_array($query)) {
$invite['dateline'] = gmdate("$dateformat $timeformat", $invite['dateline'] + ($timeoffset * 3600));
$invite['expiration'] = gmdate("$dateformat $timeformat", $invite['expiration'] + ($timeoffset * 3600));
$invitelist[] = $invite;
}
include template('invite_log');
} elseif($action == 'sendinvite') {
if(!$allowmailinvite) {
showmessage('group_nopermission', 'invite.php');
}
if(!submitcheck('sendsubmit')) {
$fromuid = $creditspolicy['promotion_register'] ? '&fromuid='.$discuz_uid : '';
$threadurl = "{$boardurl}$regname?invitecode=$invitecode$fromuid";
$query = $db->query("SELECT email FROM {$tablepre}members WHERE uid='$discuz_uid'");
$email = $db->result($query, 0);
include template('invite_send');
} else {
if(empty($fromname) || empty($fromemail) || empty($sendtoname) || empty($sendtoemail)) {
showmessage('email_friend_invalid');
}
$query = $db->query("SELECT invitecode FROM {$tablepre}invites WHERE uid='$discuz_uid' AND status='1' AND invitecode='$invitecode'");
if(!$invitenum = $db->result($query, 0)) {
showmessage('invite_invalid');
} else {
$db->query("UPDATE {$tablepre}invites SET status='3' WHERE uid='$discuz_uid' AND invitecode='$invitecode'");
sendmail("$sendtoname <$sendtoemail>", 'email_to_invite_subject', 'email_to_invite_message', "$fromname <$fromemail>");
showmessage('email_invite_succeed', 'invite.php');
}
}
} elseif($action == 'markinvite') {
$changestatus = $do == 'undo' ? 1 : 3;
if(!empty($invitecode)) {
$db->query("UPDATE {$tablepre}invites SET status='$changestatus' WHERE uid='$discuz_uid' AND invitecode='$invitecode'");
}
$query = $db->query("SELECT invitecode, dateline, expiration FROM {$tablepre}invites WHERE uid='$discuz_uid' AND invitecode='$invitecode'");
$invite = $db->fetch_array($query);
$invite['dateline'] = gmdate("$dateformat $timeformat", $invite['dateline'] + ($timeoffset * 3600));
$invite['expiration'] = gmdate("$dateformat $timeformat", $invite['expiration'] + ($timeoffset * 3600));
include template('invite_log');
} else {
showmessage('undefined_action');
}
?> | zyyhong | trunk/jiaju001/bbs/invite.php | PHP | asf20 | 5,601 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: memcp.php 10424 2007-08-29 08:44:01Z monkey $
*/
define('NOROBOT', TRUE);
require_once './include/common.inc.php';
$discuz_action = 7;
$avatarextarray = array('gif', 'jpg', 'png');
if(!$discuz_uid) {
showmessage('not_loggedin', NULL, 'HALTED');
}
$action = !empty($action) ? $action : '';
$operation = !empty($operation) ? $operation : '';
$maxbiosize = $maxbiosize ? $maxbiosize : 200;
$maxbiotradesize = $maxbiotradesize ? $maxbiotradesize : 400;
if(!$action) {
if($allowavatar || $allownickname) {
$query = $db->query("SELECT mf.nickname, mf.avatar, mf.avatarwidth, mf.avatarheight, m.gender, m.groupid
FROM {$tablepre}memberfields mf, {$tablepre}members m WHERE m.uid='$discuz_uid' AND mf.uid=m.uid");
$member = $db->fetch_array($query);
} else {
$member = array('nickname' => '', 'avatar' => '');
}
$avatar = $member['avatar'] ? "<div class=\"avatar\" style=\"width: ".$member['avatarwidth']."\"><img src=\"$member[avatar]\" width=\"$member[avatarwidth]\" height=\"$member[avatarheight]\" border=\"0\" alt=\"\" /></div>" : '<img class="avatar" src="images/avatars/noavatar.gif" alt="" />';
$validating = array();
if($regverify == 2 && $groupid == 8) {
$query = $db->query("SELECT * FROM {$tablepre}validating WHERE uid='$discuz_uid'");
if($validating = $db->fetch_array($query)) {
$validating['moddate'] = $validating['moddate'] ? gmdate("$dateformat $timeformat", $validating['moddate'] + $timeoffset * 3600) : 0;
$validating['adminenc'] = rawurlencode($validating['admin']);
}
}
$query = $db->query("SELECT uid, posts, digestposts, oltime, regdate, regip, lastvisit, lastip, lastpost FROM {$tablepre}members WHERE uid='$discuz_uid'");
$member = $db->fetch_array($query);
$member['postperday'] = $timestamp - $member['regdate'] > 86400 ? round(86400 * $member['posts'] / ($timestamp - $member['regdate']), 2) : $member['posts'];
$member['regdate'] = gmdate("$dateformat", $member['regdate'] + $timeoffset * 3600);
$member['lastvisit'] = gmdate("$dateformat $timeformat", $member['lastvisit'] + ($timeoffset * 3600));
$member['lastpost'] = $member['lastpost'] ? gmdate("$dateformat $timeformat", $member['lastpost'] + ($timeoffset * 3600)) : 'x';
require_once DISCUZ_ROOT.'./include/misc.func.php';
$member['regiplocation'] = convertip($member['regip']);
$member['lastiplocation'] = convertip($member['lastip']);
$msgexists = 0;
$msglist = array();
$query = $db->query("SELECT * FROM {$tablepre}pms WHERE msgtoid='$discuz_uid' AND folder='inbox' AND delstatus!='2' ORDER BY dateline DESC LIMIT 0, 5");
while($message = $db->fetch_array($query)) {
$msgexists = 1;
$message['dateline'] = gmdate("$dateformat $timeformat", $message['dateline'] + $timeoffset * 3600);
$message['subject'] = $message['new'] ? "<b>$message[subject]</b>" : $message['subject'];
$msglist[] = $message;
}
$loglist = array();
$query = $db->query("SELECT * FROM {$tablepre}creditslog WHERE uid='$discuz_uid' ORDER BY dateline DESC LIMIT 5");
while($log = $db->fetch_array($query)) {
$log['fromtoenc'] = rawurlencode($log['fromto']);
$log['dateline'] = gmdate("$dateformat $timeformat", $log['dateline'] + $timeoffset * 3600);
$loglist[] = $log;
}
include template('memcp_home');
} elseif($action == 'profile') {
$typeid = empty($typeid) || !in_array($typeid, array(1, 2, 3, 4, 5)) ? 2 : $typeid;
require_once DISCUZ_ROOT.'./forumdata/cache/cache_profilefields.php';
$query = $db->query("SELECT * FROM {$tablepre}members m
LEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid
WHERE m.uid='$discuz_uid'");
$member = $db->fetch_array($query);
$seccodecheck = substr(sprintf('%05b', $seccodestatus), -5, 1) && (!$seccodedata['minposts'] || $posts < $seccodedata['minposts']);
$passport_status = $passport_status == 'shopex' && $passport_shopex ? '' : $passport_status;
if(!submitcheck('editsubmit', 0, $seccodecheck)) {
require_once DISCUZ_ROOT.'./include/editor.func.php';
$enctype = $allowavatar == 3 && $typeid == 4 ? 'enctype="multipart/form-data"' : '';
if($typeid == 1) {
if($seccodecheck) {
$seccode = random(6, 1) + $seccode{0} * 1000000;
}
} elseif($typeid == 2) {
$gendercheck = array($member['gender'] => 'checked="checked"');
} elseif($typeid == 4) {
if(substr(trim($member['avatar']), 0, 14) == 'customavatars/' && !file_exists(DISCUZ_ROOT.'./'.$member['avatar'])) {
$db->query("UPDATE {$tablepre}memberfields SET avatar='', avatarwidth='0', avatarheight='0' WHERE uid='$discuz_uid'");
$member['avatar'] = '';
}
$bio = explode("\t\t\t", $member['bio']);
$member['bio'] = html2bbcode($bio[0]);
$member['biotrade'] = html2bbcode($bio[1]);
$member['signature'] = html2bbcode($member['sightml']);
$member['avatarwidth'] = !empty($member['avatarwidth']) ? $member['avatarwidth'] : '*';
$member['avatarheight'] = !empty($member['avatarheight']) ? $member['avatarheight'] : '*';
} elseif($typeid == 5) {
$invisiblechecked = $member['invisible'] ? 'checked="checked"' : '';
$emailchecked = $member['showemail'] ? 'checked="checked"' : '';
$newschecked = $member['newsletter'] ? 'checked="checked"' : '';
$tppchecked = array($member['tpp'] => 'selected="selected"');
$pppchecked = array($member['ppp'] => 'selected="selected"');
$toselect = array(strval((float)$member['timeoffset']) => 'selected="selected"');
$pscheck = array(intval($member['pmsound']) => 'checked="checked"');
$emcheck = array($member['editormode'] => 'selected="selected"');
$tfcheck = array($member['timeformat'] => 'checked="checked"');
$dfcheck = array($member['dateformat'] => 'selected="selected"');
$styleselect = '';
$query = $db->query("SELECT styleid, name FROM {$tablepre}styles WHERE available='1'");
while($style = $db->fetch_array($query)) {
$styleselect .= "<option value=\"$style[styleid]\" ".
($style['styleid'] == $member['styleid'] ? 'selected="selected"' : NULL).
">$style[name]</option>\n";
}
$customshow = str_pad(base_convert($member['customshow'], 10, 3), 3, 0, STR_PAD_LEFT);
$sschecked = array($customshow{0} => 'selected="selected"');
$sachecked = array($customshow{1} => 'selected="selected"');
$sichecked = array($customshow{2} => 'selected="selected"');
$dateformatlist = array();
if(!empty($userdateformat) && ($count = count($userdateformat))) {
for($num =1; $num <= $count; $num ++) {
$dateformatlist[$num] = str_replace(array('n', 'j', 'y', 'Y'), array('mm', 'dd', 'yy', 'yyyy'), $userdateformat[$num-1]);
}
}
}
include template('memcp_profile');
} else {
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
$membersql = $memberfieldsql = $authstradd1 = $authstradd2 = $newpasswdadd = '';
if($typeid == 1) {
if(!$passport_status) {
$secquesnew = $questionidnew == -1 ? $discuz_secques : quescrypt($questionidnew, $answernew);
if($newpassword || $secquesnew != $discuz_secques) {
if(md5($oldpassword) != $discuz_pw) {
showmessage('profile_passwd_wrong', NULL, 'HALTED');
}
if($newpassword) {
if($newpassword != addslashes($newpassword)) {
showmessage('profile_passwd_illegal');
} elseif($newpassword != $newpassword2) {
showmessage('profile_passwd_notmatch');
}
$newpasswdadd = ", password='".md5($newpassword)."'";
}
}
if(($adminid == 1 || $adminid == 2 || $adminid == 3) && !$secquesnew && $admincp['forcesecques']) {
showmessage('profile_admin_security_invalid');
}
}
if($emailnew != $member['email']) {
if(md5($oldpassword) != $discuz_pw && !$passport_status) {
showmessage('profile_passwd_wrong', NULL, 'HALTED');
} else {
$emailnew = $passport_status ? $member['email'] : $emailnew;
$accessexp = '/('.str_replace("\r\n", '|', preg_quote($accessemail, '/')).')$/i';
$censorexp = '/('.str_replace("\r\n", '|', preg_quote($censoremail, '/')).')$/i';
$invalidemail = $accessemail ? !preg_match($accessexp, $emailnew) : $censoremail && preg_match($censorexp, $emailnew);
if(!isemail($emailnew) || $invalidemail) {
showmessage('profile_email_illegal');
}
}
}
$emailnew = dhtmlspecialchars($emailnew);
if($regverify == 1 && $adminid == 0 && (($grouptype == 'member' && $adminid == 0) || $groupid == 8)) {
$query = $db->query("SELECT email FROM {$tablepre}members WHERE uid='$discuz_uid'");
if($emailnew != $db->result($query, 0)) {
if(!$doublee) {
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE email='$emailnew' LIMIT 1");
if($db->result($query, 0)) {
showmessage('profile_email_duplicate');
}
}
$idstring = random(6);
$groupid = 8;
require_once DISCUZ_ROOT.'./forumdata/cache/usergroup_8.php';
$authstradd1 = ", groupid='8'";
$authstradd2 = "authstr='$timestamp\t2\t$idstring'";
sendmail("$discuz_userss <$emailnew>", 'email_verify_subject', 'email_verify_message');
}
}
$membersql = "secques='$secquesnew', email='$emailnew' $newpasswdadd $authstradd1";
$memberfieldsql = $authstradd2;
} elseif($typeid == 2) {
$censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($censoruser = trim($censoruser)), '/')).')$/i';
if($censoruser && (@preg_match($censorexp, $nicknamenew) || @preg_match($censorexp, $cstatusnew))) {
showmessage('profile_nickname_cstatus_illegal');
}
if($msnnew && !isemail($msnnew)) {
showmessage('profile_alipay_msn');
}
if($alipaynew && !isemail($alipaynew)) {
showmessage('profile_alipay_illegal');
}
$sitenew = dhtmlspecialchars(trim(preg_match("/^https?:\/\/.+/i", $sitenew) ? $sitenew : ($sitenew ? 'http://'.$sitenew : '')));
$icqnew = preg_match ("/^([0-9]+)$/", $icqnew) && strlen($icqnew) >= 5 && strlen($icqnew) <= 12 ? $icqnew : '';
$qqnew = preg_match ("/^([0-9]+)$/", $qqnew) && strlen($qqnew) >= 5 && strlen($qqnew) <= 12 ? $qqnew : '';
$bdaynew = datecheck($bdaynew) ? $bdaynew : '0000-00-00';
$yahoonew = dhtmlspecialchars($yahoonew);
$msnnew = dhtmlspecialchars($msnnew);
$taobaonew = dhtmlspecialchars($taobaonew);
$alipaynew = dhtmlspecialchars($alipaynew);
$nicknamenew = $allownickname ? cutstr(censor(dhtmlspecialchars($nicknamenew)), 30) : '';
$cstatusadd = $allowcstatus ? ', customstatus=\''.cutstr(censor(dhtmlspecialchars($cstatusnew)), 30).'\'' : '';
$gendernew = empty($gendernew) ? 0 : intval($gendernew);
$locationnew = cutstr(censor(dhtmlspecialchars($locationnew)), 30);
$membersql = "gender='$gendernew', bday='$bdaynew'";
$memberfieldsql = "nickname='$nicknamenew', site='$sitenew', location='$locationnew', icq='$icqnew', qq='$qqnew', yahoo='$yahoonew', msn='$msnnew', taobao='$taobaonew', alipay='$alipaynew' $cstatusadd";
} elseif($typeid == 3 && ($_DCACHE['fields_required'] || $_DCACHE['fields_optional'])) {
$fieldadd = array();
foreach(array_merge($_DCACHE['fields_required'], $_DCACHE['fields_optional']) as $field) {
$field_key = 'field_'.$field['fieldid'];
$field_val = trim(${'field_'.$field['fieldid'].'new'});
if($field['required'] && $field_val == '' && !($field['unchangeable'] && $member[$field_key])) {
showmessage('profile_required_info_invalid');
} elseif($field['selective'] && $field_val != '' && !isset($field['choices'][$field_val])) {
showmessage('undefined_action', NULL, 'HALTED');
} elseif(!$field['unchangeable'] || !$member[$field_key]) {
$fieldadd[] = "$field_key='".dhtmlspecialchars($field_val)."'";
}
}
$memberfieldsql = implode(', ', $fieldadd);
} elseif($typeid == 4) {
if($maxsigsize) {
if(strlen($signaturenew) > $maxsigsize) {
showmessage('profile_sig_toolong');
}
} else {
$signaturenew = '';
}
$avataradd = $avatar = '';
$avatarimagesize = array();
if($allowavatar == 3 && disuploadedfile($_FILES['customavatar']['tmp_name']) && $_FILES['customavatar']['tmp_name'] != 'none' && $_FILES['customavatar']['tmp_name'] && trim($_FILES['customavatar']['name'])) {
$_FILES['customavatar']['name'] = daddslashes($_FILES['customavatar']['name']);
$avatarext = strtolower(fileext($_FILES['customavatar']['name']));
if(is_array($avatarextarray) && !in_array($avatarext, $avatarextarray)) {
showmessage('profile_avatar_invalid');
}
$avatar = 'customavatars/'.$discuz_uid.'.'.$avatarext;
$avatartarget = DISCUZ_ROOT.'./'.$avatar;
if(!@copy($_FILES['customavatar']['tmp_name'], $avatartarget)) {
@move_uploaded_file($_FILES['customavatar']['tmp_name'], $avatartarget);
}
$avatarimagesize = @getimagesize($avatartarget);
if(!$avatarimagesize || ($maxavatarsize && @filesize($avatartarget) > $maxavatarsize)) {
@unlink($avatartarget);
showmessage($avatarimagesize ? 'profile_avatar_toobig' : 'profile_avatar_invalid');
}
$avatarwidthnew = $avatarimagesize[0];
$avatarheightnew = $avatarimagesize[1];
} elseif(($allowavatar == 2 || $allowavatar == 3) && $urlavatar) {
if(!preg_match("/^(http:\/\/.+?)|(images\/avatars\/.+?)|(customavatars\/.+?)$/i", $urlavatar)) {
showmessage('profile_avatar_invalid');
} elseif(!intval($avatarwidthnew) || !intval($avatarheightnew)) {
$avatarimagesize = @getimagesize($urlavatar);
}
$avatar = $urlavatar;
} elseif(($allowavatar == 1 || $allowavatar == 2 || $allowavatar == 3) && $urlavatar) {
if(!preg_match("/^(images\/avatars\/.+?)$/i", $urlavatar)) {
showmessage('profile_avatar_invalid');
}
$avatarimagesize = @getimagesize($urlavatar);
$avatar = $urlavatar;
}
if($avatar) {
if(!in_array(strtolower(fileext($avatar)), array('gif', 'jpg', 'png'))) {
showmessage('profile_avatar_invalid');
}
$avatar = dhtmlspecialchars(trim($avatar));
if(!intval($avatarwidthnew) || !intval($avatarheightnew)) {
@list($avatarwidthnew, $avatarheightnew) = $avatarimagesize ? $avatarimagesize : array($avatarwidthnew, $avatarheightnew);
}
$maxsize = max($avatarwidthnew, $avatarheightnew);
if($maxsize > $maxavatarpixel) {
$avatarwidthnew = $avatarwidthnew * $maxavatarpixel / $maxsize;
$avatarheightnew = $avatarheightnew * $maxavatarpixel / $maxsize;
}
$avataradd = ", avatar='$avatar', avatarwidth='$avatarwidthnew', avatarheight='$avatarheightnew'";
} else {
$avataradd = ", avatar='', avatarwidth='', avatarheight=''";
}
$signaturenew = censor($signaturenew);
$sigstatusnew = $signaturenew ? 1 : 0;
$bionew = censor(dhtmlspecialchars($bionew));
$sightmlnew = addslashes(discuzcode(stripslashes($signaturenew), 1, 0, 0, 0, $allowsigbbcode, $allowsigimgcode, 0, 0, 1));
$biohtmlnew = addslashes(discuzcode(stripslashes($bionew), 1, 0, 0, 0, $allowbiobbcode, $allowbioimgcode, 0, 0, 1));
$biohtmlnew .= "\t\t\t".addslashes(discuzcode(stripslashes($biotradenew), 1, 0, 0, 0, 1, 1, 0, 0, 1));
$membersql = "sigstatus='$sigstatusnew'";
$memberfieldsql = "bio='$biohtmlnew', sightml='$sightmlnew' $avataradd";
} else {
$tppnew = in_array($tppnew, array(10, 20, 30)) ? $tppnew : 0;
$pppnew = in_array($pppnew, array(5, 10, 15)) ? $pppnew : 0;
$editormodenew = in_array($editormodenew, array(0, 1, 2)) ? $editormodenew : 2;
$ssnew = in_array($ssnew, array(0, 1)) ? $ssnew : 2;
$sanew = in_array($sanew, array(0, 1)) ? $sanew : 2;
$sinew = in_array($sinew, array(0, 1)) ? $sinew : 2;
$customshownew = base_convert($ssnew.$sanew.$sinew, 3, 10);
$dateformatnew = ($dateformatnew = intval($dateformatnew)) && !empty($userdateformat[$dateformatnew -1]) ? $dateformatnew : 0;
$invisiblenew = $allowinvisible && $invisiblenew ? 1 : 0;
$showemailnew = empty($showemailnew) ? 0 : 1;
$styleid = empty($styleidnew) ? $styleid : $styleidnew;
$membersql = "styleid='$styleidnew', showemail='$showemailnew', timeoffset='$timeoffsetnew', tpp='$tppnew', ppp='$pppnew', editormode='$editormodenew', customshow='$customshownew', newsletter='$newsletternew', invisible='$invisiblenew', timeformat='$timeformatnew', dateformat='$dateformatnew', pmsound='$pmsoundnew'";
}
if($membersql) {
$db->query("UPDATE {$tablepre}members SET $membersql WHERE uid='$discuz_uid'");
}
$query = $db->query("SELECT uid FROM {$tablepre}memberfields WHERE uid='$discuz_uid'");
if(!$db->num_rows($query)) {
$db->query("REPLACE INTO {$tablepre}memberfields (uid) VALUES ('$discuz_uid')");
}
if($memberfieldsql) {
$db->query("UPDATE {$tablepre}memberfields SET $memberfieldsql WHERE uid='$discuz_uid'");
}
if($type == 1 && !empty($authstradd1) && !empty($authstradd2)) {
showmessage('profile_email_verify');
} else {
showmessage('profile_succeed', 'memcp.php?action=profile&typeid='.$typeid);
}
}
} elseif($action == 'credits') {
$taxpercent = sprintf('%1.2f', $creditstax * 100).'%';
if(!$operation) {
if($exchangestatus) {
$operation = 'exchange';
} elseif($transferstatus) {
$operation = 'transfer';
} elseif($ec_ratio) {
$operation = 'addfunds';
}
}
if($operation == 'transfer' && $transferstatus) {
if(!submitcheck('creditssubmit')) {
include template('memcp_credits');
} else {
$amount = intval($amount);
if(md5($password) != $discuz_pw) {
showmessage('credits_password_invalid');
} elseif($amount <= 0) {
showmessage('credits_transaction_amount_invalid');
} elseif(${'extcredits'.$creditstrans} - $amount < ($minbalance = $transfermincredits)) {
showmessage('credits_balance_insufficient');
} elseif(!($netamount = floor($amount * (1 - $creditstax)))) {
showmessage('credits_net_amount_iszero');
}
$query = $db->query("SELECT uid, username FROM {$tablepre}members WHERE username='$to'");
if(!$member = $db->fetch_array($query)) {
showmessage('credits_transfer_send_nonexistence');
} elseif($member['uid'] == $discuz_uid) {
showmessage('credits_transfer_self');
}
$db->query("UPDATE {$tablepre}members SET extcredits$creditstrans=extcredits$creditstrans-'$amount' WHERE uid='$discuz_uid'");
$db->query("UPDATE {$tablepre}members SET extcredits$creditstrans=extcredits$creditstrans+'$netamount' WHERE uid='$member[uid]'");
$db->query("INSERT INTO {$tablepre}creditslog (uid, fromto, sendcredits, receivecredits, send, receive, dateline, operation)
VALUES ('$discuz_uid', '".addslashes($member['username'])."', '$creditstrans', '$creditstrans', '$amount', '0', '$timestamp', 'TFR'),
('$member[uid]', '$discuz_user', '$creditstrans', '$creditstrans', '0', '$netamount', '$timestamp', 'RCV')");
if(!empty($transfermessage)) {
$transfermessage = stripslashes($transfermessage);
$transfertime = gmdate($GLOBALS['_DCACHE']['settings']['dateformat'].' '.$GLOBALS['_DCACHE']['settings']['timeformat'], $timestamp + $timeoffset * 3600);
sendpm($member['uid'], 'transfer_subject', 'transfer_message');
}
showmessage('credits_transaction_succeed', 'memcp.php?action=creditslog&operation=creditslog');
}
} elseif($operation == 'exchange' && $exchangestatus) {
if(!submitcheck('creditssubmit')) {
$extcredits_exchange = array();
if(!empty($extcredits)) {
foreach($extcredits as $key => $value) {
if($value['allowexchangein'] || $value['allowexchangeout']) {
$extcredits_exchange['extcredits'.$key] = array('title' => $value['title'], 'unit' => $value['unit']);
}
}
}
include template('memcp_credits');
} elseif($extcredits[$fromcredits]['ratio'] && $extcredits[$tocredits]['ratio']) {
$amount = intval($amount);
if(md5($password) != $discuz_pw) {
showmessage('credits_password_invalid');
} elseif($fromcredits == $tocredits) {
showmessage('credits_exchange_invalid');
} elseif($amount <= 0) {
showmessage('credits_transaction_amount_invalid');
} elseif(${'extcredits'.$fromcredits} - $amount < ($minbalance = $exchangemincredits)) {
showmessage('credits_balance_insufficient');
} elseif(!($netamount = floor($amount * $extcredits[$fromcredits]['ratio'] * (1 - $creditstax) / $extcredits[$tocredits]['ratio']))) {
showmessage('credits_net_amount_iszero');
}
if(!$extcredits[$fromcredits]['allowexchangeout']) {
showmessage('extcredits_disallowexchangeout');
}
if(!$extcredits[$tocredits]['allowexchangein']) {
showmessage('extcredits_disallowexchangein');
}
$db->query("UPDATE {$tablepre}members SET extcredits$fromcredits=extcredits$fromcredits-'$amount', extcredits$tocredits=extcredits$tocredits+'$netamount' WHERE uid='$discuz_uid'");
$db->query("INSERT INTO {$tablepre}creditslog (uid, fromto, sendcredits, receivecredits, send, receive, dateline, operation)
VALUES ('$discuz_uid', '$discuz_user', '$fromcredits', '$tocredits', '$amount', '$netamount', '$timestamp', 'EXC')");
showmessage('credits_transaction_succeed', 'memcp.php?action=creditslog&operation=creditslog');
}
} elseif($operation == 'addfunds' && $ec_ratio) {
if(!submitcheck('creditssubmit')) {
include template('memcp_credits');
} else {
include language('misc');
$amount = intval($amount);
if(!$amount || ($ec_mincredits && $amount < $ec_mincredits) || ($ec_maxcredits && $amount > $ec_maxcredits)) {
showmessage('credits_addfunds_amount_invalid');
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}orders WHERE uid='$discuz_uid' AND submitdate>='$timestamp'-180 LIMIT 1");
if($db->result($query, 0)) {
showmessage('credits_addfunds_ctrl');
}
if($ec_maxcreditspermonth) {
$query = $db->query("SELECT SUM(amount) FROM {$tablepre}orders WHERE uid='$discuz_uid' AND submitdate>='$timestamp'-2592000 AND status IN (2, 3)");
if(($db->result($query, 0)) + $amount > $ec_maxcreditspermonth) {
showmessage('credits_addfunds_toomuch');
}
}
$price = ceil($amount / $ec_ratio * 100) / 100;
$orderid = gmdate('YmdHis', $timestamp + $_DCACHE['settings']['timeoffset'] * 3600).random(18);
$query = $db->query("SELECT orderid FROM {$tablepre}orders WHERE orderid='$orderid'");
if($db->num_rows($query)) {
showmessage('credits_addfunds_order_invalid');
}
$db->query("INSERT INTO {$tablepre}orders (orderid, status, uid, amount, price, submitdate)
VALUES ('$orderid', '1', '$discuz_uid', '$amount', '$price', '$timestamp')");
require_once DISCUZ_ROOT.'./api/alipayapi.php';
showmessage('credits_addfunds_succeed', credit_payurl($price, $orderid));
}
} else {
showmessage('undefined_action', NULL, 'HALTED');
}
} elseif($action == 'creditslog') {
if($operation == 'paymentlog') {
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}paymentlog WHERE uid='$discuz_uid'");
$multipage = multi($db->result($query, 0), $tpp, $page, "memcp.php?action=creditslog&operation=paymentlog");
$loglist = array();
$query = $db->query("SELECT p.*, f.fid, f.name, t.subject, t.author, t.dateline AS tdateline FROM {$tablepre}paymentlog p
LEFT JOIN {$tablepre}threads t ON t.tid=p.tid
LEFT JOIN {$tablepre}forums f ON f.fid=t.fid
WHERE p.uid='$discuz_uid' ORDER BY p.dateline DESC
LIMIT $start_limit, $tpp");
while($log = $db->fetch_array($query)) {
$log['authorenc'] = rawurlencode($log['authorenc']);
$log['dateline'] = gmdate("$dateformat $timeformat", $log['dateline'] + $timeoffset * 3600);
$log['tdateline'] = gmdate("$dateformat $timeformat", $log['tdateline'] + $timeoffset * 3600);
$loglist[] = $log;
}
include template('memcp_credits');
} elseif($operation == 'incomelog') {
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}paymentlog WHERE authorid='$discuz_uid'");
$multipage = multi($db->result($query, 0), $tpp, $page, "memcp.php?action=creditslog&operation=incomelog");
$loglist = array();
$query = $db->query("SELECT p.*, m.username, f.fid, f.name, t.subject, t.dateline AS tdateline FROM {$tablepre}paymentlog p
LEFT JOIN {$tablepre}threads t ON t.tid=p.tid
LEFT JOIN {$tablepre}forums f ON f.fid=t.fid
LEFT JOIN {$tablepre}members m ON m.uid=p.uid
WHERE p.authorid='$discuz_uid' ORDER BY p.dateline DESC
LIMIT $start_limit, $tpp");
while($log = $db->fetch_array($query)) {
$log['dateline'] = gmdate("$dateformat $timeformat", $log['dateline'] + $timeoffset * 3600);
$log['tdateline'] = gmdate("$dateformat $timeformat", $log['tdateline'] + $timeoffset * 3600);
$loglist[] = $log;
}
include template('memcp_credits');
} elseif($operation == 'rewardpaylog') {
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}rewardlog WHERE authorid='$discuz_uid'");
$multipage = multi($db->result($query, 0), $tpp, $page, "memcp.php?action=creditslog&operation=incomelog");
$loglist = array();
$query = $db->query("SELECT
r.*, m.uid, m.username
, f.fid, f.name, t.subject, t.price
FROM
{$tablepre}rewardlog r
LEFT JOIN {$tablepre}threads t ON t.tid=r.tid
LEFT JOIN {$tablepre}forums f ON f.fid=t.fid
LEFT JOIN {$tablepre}members m ON m.uid=r.answererid
WHERE r.authorid='$discuz_uid' ORDER BY r.dateline DESC
LIMIT $start_limit, $tpp");
while($log = $db->fetch_array($query)) {
$log['dateline'] = gmdate("$dateformat $timeformat", $log['dateline'] + $timeoffset * 3600);
$log['price'] = abs($log['price']);
$loglist[] = $log;
}
include template('memcp_credits');
} elseif($operation == 'rewardincomelog') {
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}rewardlog WHERE answererid='$discuz_uid'");
$multipage = multi($db->result($query, 0), $tpp, $page, "memcp.php?action=creditslog&operation=incomelog");
$loglist = array();
$query = $db->query("SELECT r.*, m.uid, m.username, f.fid, f.name, t.subject, t.price FROM {$tablepre}rewardlog r
LEFT JOIN {$tablepre}threads t ON t.tid=r.tid
LEFT JOIN {$tablepre}forums f ON f.fid=t.fid
LEFT JOIN {$tablepre}members m ON m.uid=r.authorid
WHERE r.answererid='$discuz_uid' and r.authorid>0 ORDER BY r.dateline DESC
LIMIT $start_limit, $tpp");
while($log = $db->fetch_array($query)) {
$log['dateline'] = gmdate("$dateformat $timeformat", $log['dateline'] + $timeoffset * 3600);
$log['price'] = abs($log['price']);
$loglist[] = $log;
}
include template('memcp_credits');
} else {
$operation = 'creditslog';
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}creditslog WHERE uid='$discuz_uid'");
$multipage = multi($db->result($query, 0), $tpp, $page, "memcp.php?action=creditslog&operation=creditslog");
$loglist = array();
$query = $db->query("SELECT * FROM {$tablepre}creditslog WHERE uid='$discuz_uid' ORDER BY dateline DESC LIMIT $start_limit, $tpp");
while($log = $db->fetch_array($query)) {
$log['fromtoenc'] = rawurlencode($log['fromto']);
$log['dateline'] = gmdate("$dateformat $timeformat", $log['dateline'] + $timeoffset * 3600);
$loglist[] = $log;
}
include template('memcp_credits');
}
} elseif($action == 'usergroups') {
if(!$allowmultigroups) {
showmessage('group_nopermission', NULL, 'NOPERM');
}
$switchmaingroup = $grouppublic || $grouptype == 'member' ? 1 : 0;
if(empty($type)) {
$query = $db->query("SELECT groupterms FROM {$tablepre}memberfields WHERE uid='$discuz_uid'");
$groupterms = unserialize($db->result($query, 0));
$grouplist = array();
$extgroupidarray = explode("\t", $extgroupids);
$query = $db->query("SELECT groupid, grouptitle, type, system, allowmultigroups FROM {$tablepre}usergroups WHERE (type='special' AND system<>'private' AND radminid='0') OR (type='member' AND '$credits'>=creditshigher AND '$credits'<creditslower) OR groupid IN ('$groupid'".($extgroupids ? ', '.str_replace("\t", ',', $extgroupids) : '').") ORDER BY type, system");
while($group = $db->fetch_array($query)) {
if(in_array($group['groupid'], $extgroupidarray) && ($group['groupid'] == $groupid || ($group['type'] != 'member' && $group['system'] == 'private'))) {
$group['grouptitle'] = '<b><i>'.$group['grouptitle'].'</i></b>';
} elseif(!$group['allowmultigroups']) {
$group['grouptitle'] = '<u>'.$group['grouptitle'].'</u>';
}
$group['mainselected'] = $group['groupid'] == $groupid ? 'checked="checked"' : '';
$group['maindisabled'] = $switchmaingroup && (($group['system'] != 'private' && ($group['system'] == "0\t0" || $group['groupid'] == $groupid || in_array($group['groupid'], $extgroupidarray))) || $group['type'] == 'member') ? '' : 'disabled';
$group['dailyprice'] = $group['minspan'] = 0;
if($group['system'] != 'private') {
list($group['dailyprice'], $group['minspan']) = explode("\t", $group['system']);
}
if($group['groupid'] == $groupid && !empty($groupterms['main'])) {
$group['expiry'] = gmdate($dateformat, $groupterms['main']['time'] + $timeoffset * 3600);
} elseif(isset($groupterms['ext'][$group['groupid']])) {
$group['expiry'] = gmdate($dateformat, $groupterms['ext'][$group['groupid']] + $timeoffset * 3600);
} else {
$group['expiry'] = 'N/A';
}
$grouplist[$group['groupid']] = $group;
}
include template('memcp_usergroups');
} else {
if($type == 'main' && submitcheck('groupsubmit') && $switchmaingroup) {
$query = $db->query("SELECT groupid, type, system, grouptitle FROM {$tablepre}usergroups WHERE groupid='$groupidnew' AND (".($extgroupids ? 'groupid IN ('.str_replace("\t", ',', $extgroupids).') OR ' : '')."(type='special' AND system='0\t0' AND radminid='0') OR (type='member' AND '$credits'>=creditshigher AND '$credits'<creditslower))");
if(!$group = $db->fetch_array($query)) {
showmessage('undefined_action', NULL, 'HALTED');
}
$extgroupidsnew = $groupid;
foreach(explode("\t", $extgroupids) as $extgroupid) {
if($extgroupid && $extgroupid != $groupidnew) {
$extgroupidsnew .= "\t".$extgroupid;
}
}
$adminidnew = in_array($adminid, array(1, 2, 3)) ? $adminid : ($group['type'] == 'special' ? -1 : 0);
$db->query("UPDATE {$tablepre}members SET groupid='$groupidnew', adminid='$adminidnew', extgroupids='$extgroupidsnew' WHERE uid='$discuz_uid'");
showmessage('usergroups_update_succeed', 'memcp.php?action=usergroups');
} elseif($type == 'extended') {
$query = $db->query("SELECT groupid, type, system, grouptitle FROM {$tablepre}usergroups WHERE groupid='$edit' AND (".($extgroupids ? 'groupid IN ('.str_replace("\t", ',', $extgroupids).') OR ' : '')."(type='special' AND system<>'private' AND radminid='0'))");
if(!$group = $db->fetch_array($query)) {
showmessage('undefined_action', NULL, 'HALTED');
}
$join = !in_array($group['groupid'], explode("\t", $extgroupids));
$group['dailyprice'] = $group['minspan'] = 0;
if($group['system'] != 'private') {
list($group['dailyprice'], $group['minspan']) = explode("\t", $group['system']);
}
if(!isset($extcredits[$creditstrans])) {
showmessage('credits_transaction_disabled');
}
if(!submitcheck('groupsubmit')) {
$group['minamount'] = $group['dailyprice'] * $group['minspan'];
include template('memcp_usergroups');
} else {
$query = $db->query("SELECT groupterms FROM {$tablepre}memberfields WHERE uid='$discuz_uid'");
$groupterms = unserialize($db->result($query, 0));
if($join) {
$extgroupidsarray = array();
foreach(array_unique(array_merge(explode("\t", $extgroupids), array($edit))) as $extgroupid) {
if($extgroupid) {
$extgroupidsarray[] = $extgroupid;
}
}
$extgroupidsnew = implode("\t", $extgroupidsarray);
if($group['dailyprice']) {
if(($days = intval($days)) < $group['minspan']) {
showmessage('usergroups_span_invalid');
}
if(${'extcredits'.$creditstrans} - ($amount = $days * $group['dailyprice']) < ($minbalance = 0)) {
showmessage('credits_balance_insufficient');
}
$groupexpirynew = $timestamp + $days * 86400;
$groupterms['ext'][$edit] = $groupexpirynew;
$groupexpirynew = groupexpiry($groupterms);
$db->query("UPDATE {$tablepre}members SET groupexpiry='$groupexpirynew', extgroupids='$extgroupidsnew', extcredits$creditstrans=extcredits$creditstrans-'$amount' WHERE uid='$discuz_uid'");
$db->query("UPDATE {$tablepre}memberfields SET groupterms='".addslashes(serialize($groupterms))."' WHERE uid='$discuz_uid'");
$db->query("INSERT INTO {$tablepre}creditslog (uid, fromto, sendcredits, receivecredits, send, receive, dateline, operation)
VALUES ('$discuz_uid', '$discuz_user', '$creditstrans', '0', '$amount', '0', '$timestamp', 'UGP')");
} else {
$db->query("UPDATE {$tablepre}members SET extgroupids='$extgroupidsnew' WHERE uid='$discuz_uid'");
}
showmessage('usergroups_join_succeed', 'memcp.php?action=usergroups');
} else {
if($edit != $groupid) {
if(isset($groupterms['ext'][$edit])) {
unset($groupterms['ext'][$edit]);
}
$groupexpirynew = groupexpiry($groupterms);
$db->query("UPDATE {$tablepre}memberfields SET groupterms='".addslashes(serialize($groupterms))."' WHERE uid='$discuz_uid'");
} else {
$groupexpirynew = 'groupexpiry';
}
$extgroupidsarray = array();
foreach(explode("\t", $extgroupids) as $extgroupid) {
if($extgroupid && $extgroupid != $edit) {
$extgroupidsarray[] = $extgroupid;
}
}
$extgroupidsnew = implode("\t", array_unique($extgroupidsarray));
$db->query("UPDATE {$tablepre}members SET groupexpiry='$groupexpirynew', extgroupids='$extgroupidsnew' WHERE uid='$discuz_uid'");
showmessage('usergroups_exit_succeed', 'memcp.php?action=usergroups');
}
}
} else {
showmessage('usergroups_nonexistence');
}
}
} elseif($action == 'spacemodule') {
if($supe['status'] && $xspacestatus) {
dheader("location:$supe[siteurl]/spacecp.php?docp=1");
}
if(!$spacestatus) {
showmessage('undefined_action', NULL, 'HALTED');
}
require_once DISCUZ_ROOT.'./include/space.func.php';
include_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
include_once language('spaces');
foreach($modulesettings as $module => $setting) {
if(empty($spacedata['limit'.$module]) && $module != 'userinfo' && $module != 'calendar') {
unset($modulesettings[$module]);
}
}
$spacestyledir = DISCUZ_ROOT.'./mspace/';
$sdir = opendir($spacestyledir);
$spacestyles = array();
$i = 3;
while($entry = readdir($sdir)) {
if($entry != '.' && $entry != '..' && file_exists("$spacestyledir/$entry/style.ini")) {
$spacestyles[$entry] = file("$spacestyledir/$entry/style.ini");
if($i == 3) {
$spacestyles[$entry]['row'] = 1;
$i = 0;
}
$i++;
}
}
if(submitcheck('spacesubmit')) {
$spacelayout = !empty($spacelayout) && is_array($spacelayout) ? $spacelayout : array();
if(empty($spacelayout[1])) {
showmessage('space_layout_nocenter');
} else {
if(empty($spacelayout[0])) {
$spaceside = 2;
}
if(empty($spacelayout[2])) {
$spaceside = 1;
}
}
$db->query("UPDATE {$tablepre}memberfields SET spacename = '".dhtmlspecialchars(trim($spacename))."' WHERE uid='$discuz_uid'");
$spacelayout = implode("\t", $spacelayout);
$spaceside = intval($spaceside);
if(!array_key_exists($spacestyle, $spacestyles)) {
showmessage('space_style_nofound', NULL, 'HALTED');
}
$spacestyle = addslashes($spacestyle);
$db->query("UPDATE {$tablepre}memberspaces SET description= '".dhtmlspecialchars($spacedescription)."', layout='$spacelayout', side='$spaceside', style='$spacestyle' WHERE uid='$discuz_uid'");
$db->query("DELETE FROM {$tablepre}spacecaches WHERE uid='$uid'");
showmessage('space_setting_succeed', "space.php?$discuz_uid");
}
$query = $db->query("SELECT spacename FROM {$tablepre}memberfields WHERE uid='$discuz_uid'");
$spacename = $db->result($query, 0);
$spacesettings = getspacesettings($discuz_uid);
$spacesettings['name'] = $spacename;
$spacepath = 'mspace/';
$menulist = $modulelist = array();
$spacesettings['layout'] = explode("\t", $spacesettings['layout']);
foreach($spacesettings['layout'] as $k => $layoutitem) {
$layout[$k] = explode('][', ']'.$layoutitem.'[');
$layout[$k] = array_slice($layout[$k], 1, count($layout[$k])-2);
}
$menuarray = array_flip($listmodule);
ksort($menuarray);
$layoutjs = '\''.implode('\',\'', $spacesettings['layout']).'\'';
include template('space_module');
include template('memcp_spacemodule');
}
?> | zyyhong | trunk/jiaju001/bbs/memcp.php | PHP | asf20 | 37,737 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: faq.php 9804 2007-08-15 05:56:19Z cnteacher $
*/
require_once './include/common.inc.php';
$discuz_action = 51;
if(empty($action)) {
$faqparent = $faqsub = array();
$query = $db->query("SELECT id, fpid, title FROM {$tablepre}faqs ORDER BY displayorder");
while($faq = $db->fetch_array($query)) {
if(empty($faq['fpid'])) {
$faqparent[$faq['id']] = $faq;
} else {
$faqsub[$faq['fpid']][] = $faq;
}
}
} elseif($action == 'message') {
$query = $db->query("SELECT * FROM {$tablepre}faqs WHERE id='$id'");
if($faq = $db->fetch_array($query)) {
$navigation = "» $faq[title]";
$otherlist = array();
$query = $db->query("SELECT id, fpid, title FROM {$tablepre}faqs WHERE fpid='$faq[fpid]' AND id!='$faq[id]' ORDER BY displayorder");
while($other = $db->fetch_array($query)) {
$otherlist[] = $other;
}
} else {
showmessage("faq_content_empty", 'faq.php');
}
} elseif($action == 'search') {
if(submitcheck('searchsubmit')) {
$navigation = "» ".$lang['faq_search_help'];
$keyword = isset($keyword) ? trim($keyword) : '';
if($keyword) {
$sqlsrch = '';
$searchtype = in_array($searchtype, array('all', 'title', 'message')) ? $searchtype : 'all';
switch($searchtype) {
case 'all':
$sqlsrch = "WHERE title LIKE '%$keyword%' OR message LIKE '%$keyword%'";
break;
case 'title':
$sqlsrch = "WHERE title LIKE '%$keyword%'";
break;
case 'message':
$sqlsrch = "WHERE message LIKE '%$keyword%'";
break;
}
$keyword = stripslashes($keyword);
$faqlist = array();
$query = $db->query("SELECT fpid, title, message FROM {$tablepre}faqs $sqlsrch ORDER BY displayorder");
while($faq = $db->fetch_array($query)) {
if(!empty($faq['fpid'])) {
$faq['title'] = preg_replace("/(?<=[\s\"\]>()]|[\x7f-\xff]|^)(".preg_quote($keyword, '/').")(([.,:;-?!()\s\"<\[]|[\x7f-\xff]|$))/siU", "<u><b><font color=\"#FF0000\">\\1</font></b></u>\\2", stripslashes($faq['title']));
$faq['message'] = preg_replace("/(?<=[\s\"\]>()]|[\x7f-\xff]|^)(".preg_quote($keyword, '/').")(([.,:;-?!()\s\"<\[]|[\x7f-\xff]|$))/siU", "<u><b><font color=\"#FF0000\">\\1</font></b></u>\\2", stripslashes($faq['message']));
$faqlist[] = $faq;
}
}
} else {
showmessage('faq_keywords_empty', 'faq.php');
}
}
} else {
showmessage('undefined_action', NULL, 'HALTED');
}
include template('faq');
?> | zyyhong | trunk/jiaju001/bbs/faq.php | PHP | asf20 | 2,583 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: seccode.php 9804 2007-08-15 05:56:19Z cnteacher $
*/
define('CURSCRIPT', 'seccode');
define('NOROBOT', TRUE);
require_once './include/common.inc.php';
$refererhost = parse_url($_SERVER['HTTP_REFERER']);
$refererhost['host'] .= !empty($refererhost['port']) ? (':'.$refererhost['port']) : '';
if($refererhost['host'] != $_SERVER['HTTP_HOST']) {
exit('Access Denied');
}
$seccodedata['width'] = $seccodedata['width'] >= 100 && $seccodedata['width'] <= 200 ? $seccodedata['width'] : 150;
$seccodedata['height'] = $seccodedata['height'] >= 50 && $seccodedata['height'] <= 80 ? $seccodedata['height'] : 60;
if($update) {
$seccode = random(6, 1) + $seccode{0} * 1000000;
updatesession();
}
seccodeconvert($seccode);
if(!$nocacheheaders) {
@dheader("Expires: -1");
@dheader("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@dheader("Pragma: no-cache");
}
if($seccodedata['type'] < 2 && function_exists('imagecreate') && function_exists('imagecolorset') && function_exists('imagecopyresized') &&
function_exists('imagecolorallocate') && function_exists('imagechar') && function_exists('imagecolorsforindex') &&
function_exists('imageline') && function_exists('imagecreatefromstring') && (function_exists('imagegif') || function_exists('imagepng') || function_exists('imagejpeg'))) {
$bgcontent = seccode_background();
if($seccodedata['animator'] == 1 && function_exists('imagegif')) {
include_once './include/gifmerge.class.php';
$trueframe = mt_rand(1, 9);
for($i = 0; $i <= 9; $i++) {
$im = imagecreatefromstring($bgcontent);
$x[$i] = $y[$i] = 0;
$seccodedata['adulterate'] && seccode_adulterate();
if($i == $trueframe) {
$seccodedata['ttf'] && function_exists('imagettftext') || $seccodedata['type'] == 1 ? seccode_ttffont() : seccode_giffont();
$d[$i] = mt_rand(250, 400);
} else {
seccode_adulteratefont();
$d[$i] = mt_rand(5, 15);
}
ob_start();
imagegif($im);
imagedestroy($im);
$frame[$i] = ob_get_contents();
ob_end_clean();
}
$anim = new GifMerge($frame, 255, 255, 255, 0, $d, $x, $y, 'C_MEMORY');
dheader('Content-type: image/gif');
echo $anim->getAnimation();
} else {
$im = imagecreatefromstring($bgcontent);
$seccodedata['adulterate'] && seccode_adulterate();
$seccodedata['ttf'] && function_exists('imagettftext') || $seccodedata['type'] == 1 ? seccode_ttffont() : seccode_giffont();
if(function_exists('imagepng')) {
dheader('Content-type: image/png');
imagepng($im);
} else {
dheader('Content-type: image/jpeg');
imagejpeg($im, '', 100);
}
imagedestroy($im);
}
} elseif($seccodedata['type'] == 2 && extension_loaded('ming')) {
$spacing = 5;
$codewidth = ($seccodedata['width'] - $spacing * 5) / 4;
$strforswdaction = '';
for($i = 0; $i <= 3; $i++) {
$strforswdaction .= seccode_swfcode($codewidth, $spacing, $seccode[$i], $i+1);
}
ming_setScale(20.00000000);
ming_useswfversion(6);
$movie = new SWFMovie();
$movie->setDimension($seccodedata['width'], $seccodedata['height']);
$movie->setBackground(255, 255, 255);
$movie->setRate(31);
$fontcolor = '0x'.(sprintf('%02s', dechex (mt_rand(0, 255)))).(sprintf('%02s', dechex (mt_rand(0, 128)))).(sprintf('%02s', dechex (mt_rand(0, 255))));
$strAction = "
_root.createEmptyMovieClip ( 'triangle', 1 );
with ( _root.triangle ) {
lineStyle( 3, $fontcolor, 100 );
$strforswdaction
}
";
$movie->add(new SWFAction( str_replace("\r", "", $strAction) ));
header('Content-type: application/x-shockwave-flash');
$movie->output();
} else {
$numbers = array
(
'B' => array('00','fc','66','66','66','7c','66','66','fc','00'),
'C' => array('00','38','64','c0','c0','c0','c4','64','3c','00'),
'E' => array('00','fe','62','62','68','78','6a','62','fe','00'),
'F' => array('00','f8','60','60','68','78','6a','62','fe','00'),
'G' => array('00','78','cc','cc','de','c0','c4','c4','7c','00'),
'H' => array('00','e7','66','66','66','7e','66','66','e7','00'),
'J' => array('00','f8','cc','cc','cc','0c','0c','0c','7f','00'),
'K' => array('00','f3','66','66','7c','78','6c','66','f7','00'),
'M' => array('00','f7','63','6b','6b','77','77','77','e3','00'),
'P' => array('00','f8','60','60','7c','66','66','66','fc','00'),
'Q' => array('00','78','cc','cc','cc','cc','cc','cc','78','00'),
'R' => array('00','f3','66','6c','7c','66','66','66','fc','00'),
'T' => array('00','78','30','30','30','30','b4','b4','fc','00'),
'V' => array('00','1c','1c','36','36','36','63','63','f7','00'),
'W' => array('00','36','36','36','77','7f','6b','63','f7','00'),
'X' => array('00','f7','66','3c','18','18','3c','66','ef','00'),
'Y' => array('00','7e','18','18','18','3c','24','66','ef','00'),
'2' => array('fc','c0','60','30','18','0c','cc','cc','78','00'),
'3' => array('78','8c','0c','0c','38','0c','0c','8c','78','00'),
'4' => array('00','3e','0c','fe','4c','6c','2c','3c','1c','1c'),
'6' => array('78','cc','cc','cc','ec','d8','c0','60','3c','00'),
'7' => array('30','30','38','18','18','18','1c','8c','fc','00'),
'8' => array('78','cc','cc','cc','78','cc','cc','cc','78','00'),
'9' => array('f0','18','0c','6c','dc','cc','cc','cc','78','00')
);
foreach($numbers as $i => $number) {
for($j = 0; $j < 6; $j++) {
$a1 = substr('012', mt_rand(0, 2), 1).substr('012345', mt_rand(0, 5), 1);
$a2 = substr('012345', mt_rand(0, 5), 1).substr('0123', mt_rand(0, 3), 1);
mt_rand(0, 1) == 1 ? array_push($numbers[$i], $a1) : array_unshift($numbers[$i], $a1);
mt_rand(0, 1) == 0 ? array_push($numbers[$i], $a1) : array_unshift($numbers[$i], $a2);
}
}
$bitmap = array();
for($i = 0; $i < 20; $i++) {
for($j = 0; $j < 4; $j++) {
$n = substr($seccode, $j, 1);
$bytes = $numbers[$n][$i];
$a = mt_rand(0, 14);
array_push($bitmap, $bytes);
}
}
for($i = 0; $i < 8; $i++) {
$a = substr('012345', mt_rand(0, 2), 1) . substr('012345', mt_rand(0, 5), 1);
array_unshift($bitmap, $a);
array_push($bitmap, $a);
}
$image = pack('H*', '424d9e000000000000003e000000280000002000000018000000010001000000'.
'0000600000000000000000000000000000000000000000000000FFFFFF00'.implode('', $bitmap));
dheader('Content-Type: image/bmp');
echo $image;
}
function seccode_background() {
global $seccodedata, $c;
$im = imagecreatetruecolor($seccodedata['width'], $seccodedata['height']);
$backgroundcolor = imagecolorallocate($im, 255, 255, 255);
$backgrounds = array();
if($seccodedata['background'] && function_exists('imagecreatefromjpeg') && function_exists('imagecolorat') && function_exists('imagecopymerge') &&
function_exists('imagesetpixel') && function_exists('imageSX') && function_exists('imageSY')) {
if($handle = @opendir('images/seccode/background/')) {
while($bgfile = @readdir($handle)) {
if(preg_match('/\.jpg$/i', $bgfile)) {
$backgrounds[] = 'images/seccode/background/'.$bgfile;
}
}
@closedir($handle);
}
if($backgrounds) {
$imwm = imagecreatefromjpeg($backgrounds[array_rand($backgrounds)]);
$colorindex = imagecolorat($imwm, 0, 0);
$c = imagecolorsforindex($imwm, $colorindex);
$colorindex = imagecolorat($imwm, 1, 0);
imagesetpixel($imwm, 0, 0, $colorindex);
$c[0] = $c['red'];$c[1] = $c['green'];$c[2] = $c['blue'];
imagecopymerge($im, $imwm, 0, 0, mt_rand(0, 200 - $seccodedata['width']), mt_rand(0, 80 - $seccodedata['height']), imageSX($imwm), imageSY($imwm), 100);
imagedestroy($imwm);
}
}
if(!$seccodedata['background'] || !$backgrounds) {
for($i = 0;$i < 3;$i++) {
$start[$i] = mt_rand(200, 255);$end[$i] = mt_rand(100, 150);$step[$i] = ($end[$i] - $start[$i]) / $seccodedata['width'];$c[$i] = $start[$i];
}
for($i = 0;$i < $seccodedata['width'];$i++) {
$color = imagecolorallocate($im, $c[0], $c[1], $c[2]);
imageline($im, $i, 0, $i-$angle, $seccodedata['height'], $color);
$c[0] += $step[0];$c[1] += $step[1];$c[2] += $step[2];
}
$c[0] -= 20;$c[1] -= 20;$c[2] -= 20;
}
ob_start();
if(function_exists('imagepng')) {
imagepng($im);
} else {
imagejpeg($im, '', 100);
}
imagedestroy($im);
$bgcontent = ob_get_contents();
ob_end_clean();
return $bgcontent;
}
function seccode_giffont() {
global $seccode, $seccodedata, $im, $c;
$seccodedir = array();
if(function_exists('imagecreatefromgif')) {
$seccoderoot = 'images/seccode/gif/';
$dirs = opendir($seccoderoot);
while($dir = readdir($dirs)) {
if($dir != '.' && $dir != '..' && file_exists($seccoderoot.$dir.'/9.gif')) {
$seccodedir[] = $dir;
}
}
}
$widthtotal = 0;
for($i = 0; $i <= 3; $i++) {
$imcodefile = $seccodedir ? $seccoderoot.$seccodedir[array_rand($seccodedir)].'/'.strtolower($seccode[$i]).'.gif' : '';
if(!empty($imcodefile) && file_exists($imcodefile)) {
$font[$i]['file'] = $imcodefile;
$font[$i]['data'] = getimagesize($imcodefile);
$font[$i]['width'] = $font[$i]['data'][0] + mt_rand(0, 6) - 4;
$font[$i]['height'] = $font[$i]['data'][1] + mt_rand(0, 6) - 4;
$font[$i]['width'] += mt_rand(0, $seccodedata['width'] / 5 - $font[$i]['width']);
$widthtotal += $font[$i]['width'];
} else {
$font[$i]['file'] = '';
$font[$i]['width'] = 8 + mt_rand(0, $seccodedata['width'] / 5 - 5);
$widthtotal += $font[$i]['width'];
}
}
$x = mt_rand(1, $seccodedata['width'] - $widthtotal);
for($i = 0; $i <= 3; $i++) {
$seccodedata['color'] && $c = array(mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
if($font[$i]['file']) {
$imcode = imagecreatefromgif($font[$i]['file']);
if($seccodedata['size']) {
$font[$i]['width'] = mt_rand($font[$i]['width'] - $seccodedata['width'] / 20, $font[$i]['width'] + $seccodedata['width'] / 20);
$font[$i]['height'] = mt_rand($font[$i]['height'] - $seccodedata['width'] / 20, $font[$i]['height'] + $seccodedata['width'] / 20);
}
$y = mt_rand(0, $seccodedata['height'] - $font[$i]['height']);
if($seccodedata['shadow']) {
$imcodeshadow = $imcode;
imagecolorset($imcodeshadow, 0 , 255 - $c[0], 255 - $c[1], 255 - $c[2]);
imagecopyresized($im, $imcodeshadow, $x + 1, $y + 1, 0, 0, $font[$i]['width'], $font[$i]['height'], $font[$i]['data'][0], $font[$i]['data'][1]);
}
imagecolorset($imcode, 0 , $c[0], $c[1], $c[2]);
imagecopyresized($im, $imcode, $x, $y, 0, 0, $font[$i]['width'], $font[$i]['height'], $font[$i]['data'][0], $font[$i]['data'][1]);
} else {
$y = mt_rand(0, $seccodedata['height'] - 20);
if($seccodedata['shadow']) {
$text_shadowcolor = imagecolorallocate($im, 255 - $c[0], 255 - $c[1], 255 - $c[2]);
imagechar($im, 5, $x + 1, $y + 1, $seccode[$i], $text_shadowcolor);
}
$text_color = imagecolorallocate($im, $c[0], $c[1], $c[2]);
imagechar($im, 5, $x, $y, $seccode[$i], $text_color);
}
$x += $font[$i]['width'];
}
}
function seccode_ttffont() {
global $seccode, $seccodedata, $im, $c, $charset;
$seccoderoot = $seccodedata['type'] ? 'images/fonts/ch/' : 'images/fonts/en/';
$dirs = opendir($seccoderoot);
$seccodettf = array();
while($entry = readdir($dirs)) {
if($entry != '.' && $entry != '..' && strtolower(fileext($entry)) == 'ttf') {
$seccodettf[] = $entry;
}
}
$seccodelength = 4;
if($seccodedata['type'] && !empty($seccodettf)) {
if(strtoupper($charset) != 'UTF-8') {
include DISCUZ_ROOT.'include/chinese.class.php';
$cvt = new Chinese($charset, 'utf8');
$seccode = $cvt->Convert($seccode);
}
$seccode = array(substr($seccode, 0, 3), substr($seccode, 3, 3));
$seccodelength = 2;
}
$widthtotal = 0;
for($i = 0; $i < $seccodelength; $i++) {
$font[$i]['font'] = $seccoderoot.$seccodettf[array_rand($seccodettf)];
$font[$i]['angle'] = $seccodedata['angle'] ? mt_rand(-30, 30) : 0;
$font[$i]['size'] = $seccodedata['type'] ? $seccodedata['width'] / 7 : $seccodedata['width'] / 6;
$seccodedata['size'] && $font[$i]['size'] = mt_rand($font[$i]['size'] - $seccodedata['width'] / 40, $font[$i]['size'] + $seccodedata['width'] / 20);
$box = imagettfbbox($font[$i]['size'], 0, $font[$i]['font'], $seccode[$i]);
$font[$i]['zheight'] = max($box[1], $box[3]) - min($box[5], $box[7]);
$box = imagettfbbox($font[$i]['size'], $font[$i]['angle'], $font[$i]['font'], $seccode[$i]);
$font[$i]['height'] = max($box[1], $box[3]) - min($box[5], $box[7]);
$font[$i]['hd'] = $font[$i]['height'] - $font[$i]['zheight'];
$font[$i]['width'] = (max($box[2], $box[4]) - min($box[0], $box[6])) + mt_rand(0, $seccodedata['width'] / 8);
$font[$i]['width'] = $font[$i]['width'] > $seccodedata['width'] / $seccodelength ? $seccodedata['width'] / $seccodelength : $font[$i]['width'];
$widthtotal += $font[$i]['width'];
}
$x = mt_rand($font[0]['angle'] > 0 ? cos(deg2rad(90 - $font[0]['angle'])) * $font[0]['zheight'] : 1, $seccodedata['width'] - $widthtotal);
!$seccodedata['color'] && $text_color = imagecolorallocate($im, $c[0], $c[1], $c[2]);
for($i = 0; $i < $seccodelength; $i++) {
if($seccodedata['color']) {
$c = array(mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
$seccodedata['shadow'] && $text_shadowcolor = imagecolorallocate($im, 255 - $c[0], 255 - $c[1], 255 - $c[2]);
$text_color = imagecolorallocate($im, $c[0], $c[1], $c[2]);
} elseif($seccodedata['shadow']) {
$text_shadowcolor = imagecolorallocate($im, 255 - $c[0], 255 - $c[1], 255 - $c[2]);
}
$y = $font[0]['angle'] > 0 ? mt_rand($font[$i]['height'], $seccodedata['height']) : mt_rand($font[$i]['height'] - $font[$i]['hd'], $seccodedata['height'] - $font[$i]['hd']);
$seccodedata['shadow'] && imagettftext($im, $font[$i]['size'], $font[$i]['angle'], $x + 1, $y + 1, $text_shadowcolor, $font[$i]['font'], $seccode[$i]);
imagettftext($im, $font[$i]['size'], $font[$i]['angle'], $x, $y, $text_color, $font[$i]['font'], $seccode[$i]);
$x += $font[$i]['width'];
}
}
function seccode_adulterate() {
global $seccodedata, $im, $c;
$linenums = $seccodedata['height'] / 10;
for($i=0; $i <= $linenums; $i++) {
$color = $seccodedata['color'] ? imagecolorallocate($im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255)) : imagecolorallocate($im, $c[0], $c[1], $c[2]);
$x = mt_rand(0, $seccodedata['width']);
$y = mt_rand(0, $seccodedata['height']);
if(mt_rand(0, 1)) {
imagearc($im, $x, $y, mt_rand(0, $seccodedata['width']), mt_rand(0, $seccodedata['height']), mt_rand(0, 360), mt_rand(0, 360), $color);
} else {
imageline($im, $x, $y, $linex + mt_rand(0, $linemaxlong), $liney + mt_rand(0, mt_rand($seccodedata['height'], $seccodedata['width'])), $color);
}
}
}
function seccode_adulteratefont() {
global $seccodedata, $im, $c;
$seccodeunits = 'BCEFGHJKMPQRTVWXY2346789';
$x = $seccodedata['width'] / 4;
$y = $seccodedata['height'] / 10;
$text_color = imagecolorallocate($im, $c[0], $c[1], $c[2]);
for($i = 0; $i <= 3; $i++) {
$adulteratecode = $seccodeunits[mt_rand(0, 23)];
imagechar($im, 5, $x * $i + mt_rand(0, $x - 10), mt_rand($y, $seccodedata['height'] - 10 - $y), $adulteratecode, $text_color);
}
}
function seccode_swfcode($width, $d, $code, $order) {
global $seccodedata;
$str = '';
$height = $seccodedata['height'] - $d * 2;
$x_0 = ($order * ($width + $d) - $width);
$x_1 = $x_0 + $width / 2;
$x_2 = $x_0 + $width;
$y_0 = $d;
$y_2 = $y_0 + $height;
$y_1 = $y_2 / 2;
$y_0_5 = $y_2 / 4;
$y_1_5 = $y_1 + $y_0_5;
switch($code) {
case 'B':$str .= 'moveTo('.$x_1.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_1.', '.$y_2.');lineTo('.$x_2.', '.$y_1_5.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0_5.');lineTo('.$x_1.', '.$y_0.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');';break;
case 'C':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');';break;
case 'E':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');';break;
case 'F':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');';break;
case 'G':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_2.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');';break;
case 'H':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_2.', '.$y_1.');';break;
case 'J':$str .= 'moveTo('.$x_1.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_0.', '.$y_1_5.');';break;
case 'K':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_0.', '.$y_1.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_2.');';break;
case 'M':$str .= 'moveTo('.$x_0.', '.$y_2.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');';break;
case 'P':$str .= 'moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0_5.');lineTo('.$x_1.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');';break;
case 'Q':$str .= 'moveTo('.$x_2.', '.$y_2.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_1.', '.$y_1.');';break;
case 'R':$str .= 'moveTo('.$x_0.', '.$y_1.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0_5.');lineTo('.$x_1.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_2.');';break;
case 'T':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');moveTo('.$x_1.', '.$y_0.');lineTo('.$x_1.', '.$y_2.');';break;
case 'V':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_1.', '.$y_2.');lineTo('.$x_2.', '.$y_0.');';break;
case 'W':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_2.', '.$y_0.');';break;
case 'X':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');';break;
case 'Y':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_1.', '.$y_1.');lineTo('.$x_2.', '.$y_0.');moveTo('.$x_1.', '.$y_1.');lineTo('.$x_1.', '.$y_2.');';break;
case '2':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_1.');lineTo('.$x_0.', '.$y_1.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');';break;
case '3':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_0.', '.$y_2.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_2.', '.$y_1.');';break;
case '4':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');moveTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_1.');lineTo('.$x_2.', '.$y_1.');';break;
case '6':$str .= 'moveTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_2.', '.$y_1.');lineTo('.$x_0.', '.$y_1.');';break;
case '7':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');';break;
case '8':$str .= 'moveTo('.$x_0.', '.$y_0.');lineTo('.$x_0.', '.$y_2.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_0.', '.$y_0.');moveTo('.$x_0.', '.$y_1.');lineTo('.$x_2.', '.$y_1.');';break;
case '9':$str .= 'moveTo('.$x_2.', '.$y_1.');lineTo('.$x_0.', '.$y_1.');lineTo('.$x_0.', '.$y_0.');lineTo('.$x_2.', '.$y_0.');lineTo('.$x_2.', '.$y_2.');lineTo('.$x_0.', '.$y_2.');';break;
}
return $str;
}
?> | zyyhong | trunk/jiaju001/bbs/seccode.php | PHP | asf20 | 20,102 |
.sbtimage {
border:0px;
margin:0px;
height:26px;
width:72px;
}
.sbtinput {
height:26px;
PADDING-RIGHT: 3px;
PADDING-LEFT: 3px;
PADDING-BOTTOM: 3px;
WIDTH: 120px;
COLOR: #999999;
PADDING-TOP: 4px;
}
.Message {
WIDTH: 240px; CURSOR: move; COLOR: #333333; LINE-HEIGHT: 18px; POSITION: absolute; HEIGHT: 190px
}
.Message H2 {
FONT-WEIGHT: normal; FONT-SIZE: 12px; MARGIN: 4px 0px
}
.Style0 {
PADDING-RIGHT: 10px; PADDING-LEFT: 22px; BACKGROUND: url(./style0.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 192px
}
.Style1 {
PADDING-RIGHT: 10px; PADDING-LEFT: 22px; BACKGROUND: url(./style1.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 192px
}
.Style2 {
PADDING-RIGHT: 10px; PADDING-LEFT: 22px; BACKGROUND: url(./style2.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 192px
}
.Style3 {
PADDING-RIGHT: 10px; PADDING-LEFT: 22px; BACKGROUND: url(./style3.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 192px
}
.Style4 {
PADDING-RIGHT: 10px; PADDING-LEFT: 22px; BACKGROUND: url(./style4.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 192px
}
.Style5 {
PADDING-RIGHT: 10px; PADDING-LEFT: 22px; BACKGROUND: url(./style5.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 192px
}
.Style100 {
PADDING-RIGHT: 13px; PADDING-LEFT: 22px; BACKGROUND: url(./style100.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 192px
}
.Style0 .Head {
COLOR: #ff3992
}
.Style0 .Sign {
MARGIN: 0px; COLOR: #ff3992;margin-right:7px; TEXT-ALIGN: right
}
.Style0 .Sign A {
COLOR: #ff3992; TEXT-DECORATION: underline
}
.Style0 .Sign A:hover {
TEXT-DECORATION: none
}
.Style1 .Head {
COLOR: #cc0000
}
.Style1 .Sign {
MARGIN: 0px;margin-right:7px; COLOR: #cc0000; TEXT-ALIGN: right
}
.Style1 .Sign A {
COLOR: #cc0000; TEXT-DECORATION: underline
}
.Style1 .Sign A:hover {
TEXT-DECORATION: none
}
.Style2 .Head {
COLOR: #0096eb
}
.Style2 .Sign {
MARGIN: 0px;margin-right:7px; COLOR: #0096eb; TEXT-ALIGN: right
}
.Style2 .Sign A {
COLOR: #0096eb; TEXT-DECORATION: underline
}
.Style2 .Sign A:hover {
TEXT-DECORATION: none
}
.Style3 .Head {
COLOR: #00b115
}
.Style3 .Sign {
MARGIN: 0px;margin-right:7px; COLOR: #00b115; TEXT-ALIGN: right
}
.Style3 .Sign A {
COLOR: #00b115; TEXT-DECORATION: underline
}
.Style3 .Sign A:hover {
TEXT-DECORATION: none
}
.Style4 .Head {
COLOR: #a800d8
}
.Style4 .Sign {
MARGIN: 0px;margin-right:7px; COLOR: #a800d8; TEXT-ALIGN: right
}
.Style4 .Sign A {
COLOR: #a800d8; TEXT-DECORATION: underline
}
.Style4 .Sign A:hover {
TEXT-DECORATION: none
}
.Style5 .Head {
COLOR: #ff6600
}
.Style5 .Sign {
MARGIN: 0px;margin-right:7px; COLOR: #ff6600; TEXT-ALIGN: right
}
.Style5 .Sign A {
COLOR: #ff6600; TEXT-DECORATION: underline
}
.Style5 .Sign A:hover {
TEXT-DECORATION: none
}
.Style100 .Head {
COLOR: #ff0000
}
.Style100 .Sign {
MARGIN: 0px 4px 0px 0px; COLOR: #ff0000; TEXT-ALIGN: right
}
.Style100 .Sign A {
COLOR: #ff0000; TEXT-DECORATION: underline
}
.Style100 .Sign A:hover {
TEXT-DECORATION: none
}
.Num {
PADDING-LEFT: 13px; CURSOR: move
}
.Num IMG {
MARGIN-TOP: -15px;margin-right:7px; FLOAT: right; CURSOR: pointer
}
.Detail {
MARGIN: 3px -1px 0px 0px; OVERFLOW: hidden; LINE-HEIGHT: 17px; HEIGHT: 114px; WORD-WRAP: break-word
}
.Date {
FONT-SIZE: 10px; MARGIN: -1px 7px 0px; TEXT-ALIGN: right
}
.Paste {
TEXT-ALIGN: center
}
.Paste IMG {
FILTER: alpha(opacity=70); moz-opacity: 0.7; opacity: 0.7
}
.Heart {
FLOAT: left; MARGIN: 0px 4px -10px 0px
}
.MMessage {
WIDTH: 145px; COLOR: #333333; LINE-HEIGHT: 18px; HEIGHT: 99px
}
.MMessage H2 {
FONT-WEIGHT: normal; FONT-SIZE: 12px; MARGIN: 4px 0px
}
.MStyle0 {
PADDING-RIGHT: 5px; PADDING-LEFT: 10px; BACKGROUND: url(./M/style0s.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 88px
}
.MStyle1 {
PADDING-RIGHT: 5px; PADDING-LEFT: 10px; BACKGROUND: url(./M/style1s.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 88px
}
.MStyle2 {
PADDING-RIGHT: 5px; PADDING-LEFT: 10px; BACKGROUND: url(./M/style2s.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 88px
}
.MStyle3 {
PADDING-RIGHT: 5px; PADDING-LEFT: 10px; BACKGROUND: url(./M/style3s.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 88px
}
.MStyle4 {
PADDING-RIGHT: 5px; PADDING-LEFT: 10px; BACKGROUND: url(./M/style4s.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 88px
}
.MStyle5 {
PADDING-RIGHT: 5px; PADDING-LEFT: 10px; BACKGROUND: url(./M/style5s.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 88px
}
.MStyle100 {
PADDING-RIGHT: 5px; PADDING-LEFT: 10px; BACKGROUND: url(./M/style100s.gif) no-repeat 0px 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 11px; HEIGHT: 88px
}
.MStyle0 .Head {
COLOR: #ff3992
}
.MStyle0 .Sign {
MARGIN: -4px 0px 0px; COLOR: #ff3992; TEXT-ALIGN: right
}
.MStyle1 .Head {
COLOR: #cc0000
}
.MStyle1 .Sign {
MARGIN: -4px 0px 0px; COLOR: #cc0000; TEXT-ALIGN: right
}
.MStyle2 .Head {
COLOR: #0096eb
}
.MStyle2 .Sign {
MARGIN: -4px 0px 0px; COLOR: #0096eb; TEXT-ALIGN: right
}
.MStyle3 .Head {
COLOR: #00b115
}
.MStyle3 .Sign {
MARGIN: -4px 0px 0px; COLOR: #00b115; TEXT-ALIGN: right
}
.MStyle4 .Head {
COLOR: #a800d8
}
.MStyle4 .Sign {
MARGIN: -4px 0px 0px; COLOR: #a800d8; TEXT-ALIGN: right
}
.MStyle5 .Head {
COLOR: #ff6600
}
.MStyle5 .Sign {
MARGIN: -4px 0px 0px; COLOR: #ff6600; TEXT-ALIGN: right
}
.MStyle100 .Head {
COLOR: #ff0000
}
.MStyle100 .Sign {
MARGIN: -4px 0px 0px; COLOR: #ff0000; TEXT-ALIGN: right
}
.MNum {
PADDING-LEFT: 9px; CURSOR: move; TEXT-ALIGN: left
}
.MNum IMG {
MARGIN-TOP: -17px; FLOAT: right; CURSOR: pointer
}
.MDetail {
MARGIN: 2px -1px 6px 0px; OVERFLOW: hidden; LINE-HEIGHT: 17px; HEIGHT: 41px; TEXT-ALIGN: left
}
#Illu {
PADDING-RIGHT: 0px; PADDING-LEFT: 31px; Z-INDEX: 20000; BACKGROUND: url(./bg_diy.jpg) no-repeat; LEFT: 17px; PADDING-BOTTOM: 0px; WIDTH: 655px; LINE-HEIGHT: 24px; PADDING-TOP: 12px; POSITION: absolute; TOP: 14px; HEIGHT: 58px
}
#Illu P {
MARGIN: 4px 0px
}
#Tips {
BORDER-RIGHT: #3d9a13 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #3d9a13 1px solid; DISPLAY: none; PADDING-LEFT: 8px; Z-INDEX: 200001; LEFT: 50px; PADDING-BOTTOM: 8px; BORDER-LEFT: #3d9a13 1px solid; WIDTH: 680px; PADDING-TOP: 8px; BORDER-BOTTOM: #3d9a13 1px solid; POSITION: relative; TOP: 79px; BACKGROUND-COLOR: #ffffff
}
.screen {
PADDING-RIGHT: 24px; PADDING-LEFT: 19px; BACKGROUND: url(./screen_tips.gif) no-repeat 9px 50%; PADDING-BOTTOM: 0px; WIDTH: 93px; COLOR: #888888; PADDING-TOP: 22px; HEIGHT: 78px
}
.screen H6 {
FONT-WEIGHT: normal; FONT-SIZE: 12px; MARGIN: 0px 0px 5px; COLOR: #ffffff
}
.screen P {
MARGIN: 0px
}
.console {
DISPLAY: none; Z-INDEX: 100; FILTER: alpha(Opacity=35); LEFT: 0px; WIDTH: 100%; POSITION: absolute; TOP: -121px; HEIGHT: 600px; BACKGROUND-COLOR: #000000; opacity: 0.35
}
#Tips TD H5 {
FONT-SIZE: 12px; MARGIN: 5px 0px; COLOR: #ff3992
}
#Tips TD OL {
PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
}
#Tips TD OL LI {
PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 3px; WORD-BREAK: keep-all; PADDING-TOP: 0px; WHITE-SPACE: nowrap; LIST-STYLE-TYPE: none
}
BODY {
FONT-SIZE: 12px; BACKGROUND: url(./bg0.jpg); MARGIN: 0px; COLOR: #333333; WORD-BREAK: break-all; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
}
#Logo {
BACKGROUND: url(./bg_top_valentine.jpg) repeat-x; HEIGHT: 82px
}
#Feast IMG {
FLOAT: right; MARGIN: 7px 20px 0px 0px
}
#Search {
PADDING-RIGHT: 0px; BORDER-TOP: #3d9a13 2px solid; PADDING-LEFT: 5px; BACKGROUND: url(./bg_search.gif) repeat-x; PADDING-BOTTOM: 0px; PADDING-TOP: 5px; BORDER-BOTTOM: #3d9a13 2px solid; HEIGHT: 30px
}
#Search IMG {
FLOAT: left; MARGIN-RIGHT: 6px
}
#Search FORM {
FLOAT: left; MARGIN: 0px 0px 0px 34px
}
#ContOuter {
BACKGROUND: url(./bg.jpg)
}
#ContInner {
BACKGROUND: url(./banner_decoration.gif) repeat-x 50% top
}
#Cont {
Z-INDEX: 1; BACKGROUND: url(./bg_bottom_s.jpg) repeat-x left bottom
}
#Right {
PADDING-RIGHT: 0px; PADDING-LEFT: 20px; Z-INDEX: 1; BACKGROUND: url(./right_board.jpg) no-repeat left top; LEFT: 706px; PADDING-BOTTOM: 0px; WIDTH: 275px; PADDING-TOP: 434px; POSITION: absolute; HEIGHT: 64px
}
#Foot {
MARGIN-TOP: -3px
}
A.a_black {
COLOR: #000000; TEXT-DECORATION: underline
}
A.a_black:hover {
TEXT-DECORATION: none
}
A.a_white {
COLOR: #ffffff; TEXT-DECORATION: underline
}
A.a_white:hover {
TEXT-DECORATION: none
}
A.a_green {
COLOR: #70b817; TEXT-DECORATION: underline
}
A.a_green:hover {
TEXT-DECORATION: none
}
A.a_pink {
COLOR: #ff3992; TEXT-DECORATION: underline
}
A.a_pink:hover {
TEXT-DECORATION: none
}
A.a_gray9 {
COLOR: #999999; TEXT-DECORATION: underline
}
A.a_gray9:hover {
TEXT-DECORATION: none
}
.t_orab {
FONT-WEIGHT: bold; COLOR: #ff6600
}
.t_green {
COLOR: #70b817
}
.AC {
TEXT-ALIGN: center
}
.input {
BORDER-RIGHT: #666666 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #666666 1px solid; PADDING-LEFT: 3px; BACKGROUND: url(./input_bg.gif) no-repeat; PADDING-BOTTOM: 3px; MARGIN: -5px 5px 0px -5px; BORDER-LEFT: #666666 1px solid; WIDTH: 90px; COLOR: #999999; PADDING-TOP: 3px; BORDER-BOTTOM: #666666 1px solid; HEIGHT: 14px
}
.copyrightfont {
COLOR: #333333
}
#overlay IMG {
BORDER-TOP-STYLE: none;
BORDER-RIGHT-STYLE: none;
BORDER-LEFT-STYLE: none;
BORDER-BOTTOM-STYLE: none;
}
#overlay {
BACKGROUND-IMAGE: url(extend/lovewall/overlay.png);
}
HTML #overlay {
FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="extend/lovewall/overlay.png", sizingMethod="scale");
BACKGROUND-IMAGE: url(blank.gif);
BACKGROUND-COLOR: transparent;
} | zyyhong | trunk/jiaju001/bbs/extend/lovewall/lovewall.css | CSS | asf20 | 10,053 |
<?php
if(!defined('IN_DISCUZ')) exit('Access Denied');
$multipage = multi($lovek, 1, $page, "lovewall.php", $threadmaxpages);
$page = empty($page) || !intval($page) ? 1 : $page;
$page = $lovek + 1 - $page;
if($page < 1) {
$page = 1;
}
$dir = DISCUZ_ROOT."./extend/lovewall/cache/cache_lovewall_$page.php";
if(file_exists($dir)) {
@require_once $dir;
}
if(is_array($love_cache) && $lovecache == 1) {
$lovewall = $love_cache;
} else {
$lovewall = lovecache();
}
$navigation.= " » $lovetitle";
?> | zyyhong | trunk/jiaju001/bbs/extend/lovewall/lovewall_default.php | PHP | asf20 | 527 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: frame.php 9804 2007-08-15 05:56:19Z cnteacher $
*/
define('NOROBOT', TRUE);
include './include/common.inc.php';
$_GET['referer'] = urldecode($_GET['referer']);
$_SERVER['HTTP_REFERER'] = $_GET['referer'] ? $_GET['referer'] : $_SERVER['HTTP_REFERER'];
$_SERVER['HTTP_REFERER'] = !empty($_SERVER['HTTP_REFERER']) && substr($_SERVER['HTTP_REFERER'], 0, strlen($boardurl)) == $boardurl ? $_SERVER['HTTP_REFERER'] : (!empty($_GET['referer']) && substr($_GET['referer'], 0, strlen($boardurl)) == $boardurl ? $_GET['referer'] : $indexname);
if(empty($_SERVER['HTTP_REFERER'])) {
dheader("Location:$indexname");
}
if(!$_DCACHE['settings']['frameon']) {
showmessage('frame_off');
}
$_SERVER['HTTP_REFERER'] = preg_replace("/[&?]frameon=(yes|no)/i", '', $_SERVER['HTTP_REFERER']);
$newurl = $_SERVER['HTTP_REFERER'].(strpos($_SERVER['HTTP_REFERER'], '?') !== FALSE ? '&' : '?').'frameon=no';
if($_GET['frameon'] == 'no') {
dsetcookie('frameon', 'no', 31536000);
dheader("Location:$newurl");
} else {
dsetcookie('frameon', 'yes', 31536000);
$_DCOOKIE['frameon'] = 'yes';
include template('frame');
}
?> | zyyhong | trunk/jiaju001/bbs/frame.php | PHP | asf20 | 1,262 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> 家居论坛 </title>
<meta name="keywords" content="" />
<meta name="description" content=" 家居论坛 " />
<meta name="MSSmartTagsPreventParsing" content="True" />
<meta http-equiv="MSThemeCompatible" content="Yes" />
<link rel="archives" title="家居论坛" href="http://bbs.homebjjj.com/archiver/" />
<link rel="alternate" type="application/rss+xml" title="家居论坛" href="http://bbs.homebjjj.com/rss.php?auth=0" />
<link rel="stylesheet" type="text/css" href="forumdata/cache/style_1.css" />
<link rel="stylesheet" type="text/css" href="forumdata/cache/style_1_append.css" />
<style>
.logo{width:185px;height:65px; float:left}
.logo a{display:block;background:url(http://www.homebjjj.com/images/v2/odiy-bg.png) 0px -260px no-repeat;width:180px;height:65px;text-indent:-9999px;}
#tbar{float:left; width:330px; padding-top:30px; padding-left:20px;}
#tbar li{display:inline}
.addfav{text-align:right; float:right; width:400px; display:inline; padding-top:30px}
.addfav li{display:inline;padding-left:35px;}
#cart{background:url(http://www.homebjjj.com/images/v2/odiy-bg.png) -206px -286px no-repeat}
#my{background:url(http://www.homebjjj.com/images/v2/odiy-bg.png) -206px -265px no-repeat}
#card{background:url(http://www.homebjjj.com/images/v2/odiy-bg.png) -206px -308px no-repeat}
.nav{background:url(http://www.homebjjj.com/images/v2/odiy-bg.png) -260px -128px repeat-x; height:68px;}
.nav .tl{background:url(http://www.homebjjj.com/images/v2/odiy-bg.png) -200px -64px no-repeat; width:50px; height:63px; float:left}
.nav .tr{background:url(http://www.homebjjj.com/images/v2/odiy-bg.png) 0px 0px no-repeat; width:251px; height:63px; float:right;display:inline;}
.nav .tr li{display:inline;height:30px;width:72px;float:right;margin-right:10px;}
.nav .tr li a{ display:block;height:30px;width:72px;text-indent:-9999px;}
.nav .tm{float:left;width:600px; height:63px; padding-left:10px}
.nav .tm .menu{ line-height:30px; font-size:14px; clear:both}
.menu li{ width:85px; display:inline; float:left; text-align:center; background:url(http://www.homebjjj.com/images/v2/navr.png) no-repeat right}
.menu .last{background:none}
.menu .cur{background:url(http://www.homebjjj.com/images/v2/odiy-bg.png) 0px -64px no-repeat;height:29px; font-weight:bold;}
.menu a{width:85px; display:block;}
.menu .cur a{color:#FD6801}
.search-bar{ padding-top:2px; line-height:20px;}
.search-bar a:link,.search-bar a:visited{padding-left:9px; color:#AB5000}
.so-from{width:200px; line-height:20px; height:18px; border:1px solid #ccc; margin-right:10px; color:#a8a8a8}
</style>
<script type="text/javascript">var IMGDIR = 'images/default';var attackevasive = '0';var gid = 0;gid = parseInt('0');var fid = parseInt('0');var tid = parseInt('0');</script>
<script src="include/javascript/common.js" type="text/javascript"></script>
<script src="include/javascript/menu.js" type="text/javascript"></script>
<script src="include/javascript/ajax.js" type="text/javascript"></script>
</head>
<body onkeydown="if(event.keyCode==27) return false;">
<div id="append_parent"></div><div id="ajaxwaitid"></div>
<div class="wrap"><div class="logo"><a href="http://bbs.homebjjj.com" title="家居论坛">家居论坛</a></div><div id="tbar">
<ul>
<li><a href="http://www.homebjjj.com/member/reg.html?forward=http%3A%2F%2Fbbs.homebjjj.com%2F" class="notabs">注册</a></li>
<li><a href="http://www.homebjjj.com/member/login.html?forward=http%3A%2F%2Fbbs.homebjjj.com%2F">登录</a></li>
<li><a href="stats.php">统计</a></li> </ul>
</div><div class="addfav"><ul><li id="cart"><a href="http://www.homebjjj.com/member/cart.html">购物车</a></li><li id="my"><a href="http://www.homebjjj.com/member/">我的账户</a></li><li id="card"><a href="http://www.homebjjj.com/page/getcard.html">索取会员卡</a></li><li><span style="CURSOR: hand" onClick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.homebjjj.com');" class="set_home">设为首页</span> <a href="javascript:viod(0)" title="北京家居网" onClick="window.external.addFavorite('http://www.homebjjj.com','北京家居网')">收藏</a></li></ul></div></div><div class="wrap"><div class="nav"><div class="tl"></div><div class="tr"><ul><li><a href="http://www.homebjjj.com/page/bao.html" title="购物保障">购物保障</a></li><li><a href="http://www.homebjjj.com/page/buy.html" title="购物流程">购物流程</a></li></ul></div><div class="tm"><div class="menu"><ul><li><a href="http://www.homebjjj.com">商城首页</a></li><li><a href="http://news.homebjjj.com">家居资讯</a></li><li><a href="http://www.homebjjj.com/huodong/" target="_parent">活动专区</a></li><li><a href="http://www.homebjjj.com/cuxiao/" target="_parent">促销专区</a></li><li><a href="http://www.homebjjj.com/card/" target="_parent">家居龙卡</a><img style="position:absolute;top:51px;margin-left:20px;"src="http://www.homebjjj.com/images/v2/icon_new.gif" width="20" height="23" border="0" alt="全新上线"/></li><li><a href="http://www.homebjjj.com/jifen/" target="_parent">积分换礼</a></li><li class="cur"><a href="http://bbs.homebjjj.com">家居论坛</a></li></ul><div class="hack"></div></div><div class="search-bar"><form id="globalsearch" action="http://www.homebjjj.com/search" method="get" onsubmit="cleanTip()"><input id="search-key" name="key" value="搜索您感兴趣的商品、品牌..." title="搜索您感兴趣的商品、品牌..." class="so-from" onclick="cleanTip();" onblur="cleanTip();" /> <input src="http://www.homebjjj.com/images/v2/inco_so.png" type="image" align="absmiddle" /><a href="http://www.homebjjj.com/list/diban.html">地板</a> <a href="http://www.homebjjj.com/list/cizhuan.html">瓷砖</a> <a href="http://www.homebjjj.com/list/bizhi.html">壁纸</a> <a href="http://www.homebjjj.com/list/weiyu.html">卫浴</a> <a href="http://www.homebjjj.com/list/men.html">门窗</a> <a href="http://www.homebjjj.com/list/chugui.html">橱柜</a> <a href="http://www.homebjjj.com/list/youqi.html">油漆涂料</a> <a href="http://www.homebjjj.com/list/jiaju.html">家具</a></form></div></div></div></div><div class="wrap">
<div id="foruminfo">
<div id="userinfo">
<div id="nav">
<a href="index.php">家居论坛</a> </div>
<p>
</p>
</div>
<div id="forumstats">
<p>
今日: <em>5</em>, 昨日: <em>16</em>, 最高日: <em>191</em> <a href="digest.php">精华区</a>
<a href="rss.php?auth=0" title="RSS 订阅全部版块" target="_blank"><img src="images/common/xml.gif" alt="RSS 订阅全部版块" /></a> </p>
<p>主题: <em>7826</em>, 帖子: <em>10754</em>, 会员: <em>2634</em>, 欢迎新会员 <cite><a href="space.php?username=%E7%BB%BC%E6%B5%8E%E5%AE%B6%E5%9B%A2">综济家团</a></cite></p>
</div>
</div>
<div id="ad_text"></div>
<table summary="HeadBox" class="portalbox" cellpadding="0" cellspacing="1">
<tr>
</tr>
</table>
<!--------四格-------->
<div style="clear: both; margin-top: 5px">
<table width="TABLEWIDTH" align="center" style="border: #FF9200 solid 1px;">
<tr class="header" style="background-color:#FFD297">
<td width="25%" align="center"><b>≡ 最新图片 ≡</b></td>
<td width="25%" align="center"><b>≡ 最新主题 ≡</b></td>
<td width="25%" align="center"><b>≡ 最新回复 ≡</b></td>
<td width="25%" align="center"><b>≡ 本周焦点 ≡</b></td>
<td><div class="right"><a href="#" onclick="toggle_collapse('top10');"><img id="top10_img" src="images/default/collapsed_no.gif" border="0" alt="" /></a></td>
</tr>
<tbody id="top10">
<tr>
<td align="middle" valign="bottom">
<script src="pic.php" type="text/javascript"></script>
</td>
<td valign="top">
<div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td width="24" background="images/rank.gif"></td>
<td background="images/rankbg.gif" style="line-height:20px" valign="top">
<!--#最新主题循环开始-->
<script src="./api/javascript.php?key=bbstop_threads_1" type="text/javascript"></script>
<!--#循环结束-->
</td>
</tr>
</tbody>
</table>
</div>
</td>
<td valign="top">
<div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td width="24" background="images/rank.gif"></td>
<td background="images/rankbg.gif" style="line-height:20px" valign="top">
<!--#最新回复循环开始-->
<script src="./api/javascript.php?key=bbstop_threads_2" type="text/javascript"></script>
<!--#循环结束-->
</td>
</tr>
</tbody>
</table>
</div>
</td>
<td valign="top">
<div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td width="24" background="images/rank.gif"></td>
<td background="images/rankbg.gif" style="line-height:20px" valign="top">
<!--#最热贴循环开始-->
<script src="./api/javascript.php?key=bbstop_threads_3" type="text/javascript"></script>
<!--#循环结束-->
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
<br />
</div><!--------四格--------> <div class="mainbox forumlist">
<span class="headactions">
分区版主: <a class="notabs" href="space.php?username=%E5%AE%B6%E5%B1%85%E8%B1%86%E8%B1%86">家居豆豆</a> <img id="category_7_img" src="images/default/collapsed_no.gif" title="收起/展开" alt="收起/展开" onclick="toggle_collapse('category_7');" />
</span>
<h3><a href="index.php?gid=7">装修总论坛</a></h3>
<table id="category_7" summary="category7" cellspacing="0" cellpadding="0" style="">
<thead class="category">
<tr>
<th>版块</th>
<td class="nums">主题</td>
<td class="nums">帖数</td>
<td class="lastpost">最后发表</td>
</tr>
</thead><tbody id="forum38">
<tr>
<th class="new">
<h2><a href="forumdisplay.php?fid=38"><font color=red>装修大家谈</font></a><em> (今日: 4)</em></h2>
<p>本版只限于有装修需求的业主装修咨询,选材顾问解疑等等。</p> <p class="moderators">版主: <a class="notabs" href="space.php?username=%E4%BB%97%E5%89%91%E4%BB%99%E6%B8%B8">仗剑仙游</a></p> </th>
<td class="nums">592</td>
<td class="nums">972</td>
<td class="lastpost">
<a href="redirect.php?tid=13980&goto=lastpost#lastpost">家装管理、营销—处在家装市场初期的城市应 ...</a>
<cite>by <a href="space.php?username=19zhenxia">19zhenxia</a> - 2009-5-27 10:22</cite>
</td>
</tr>
</tbody>
<tbody id="forum13">
<tr>
<th class="new">
<h2><a href="forumdisplay.php?fid=13">团购活动</a></h2>
<p class="moderators">版主: <a class="notabs" href="space.php?username=%E4%BB%97%E5%89%91%E4%BB%99%E6%B8%B8">仗剑仙游</a></p> </th>
<td class="nums">232</td>
<td class="nums">598</td>
<td class="lastpost">
<a href="redirect.php?tid=13976&goto=lastpost#lastpost">寻找红木生产厂家</a>
<cite>by <a href="space.php?username=%E7%BB%BC%E6%B5%8E%E5%AE%B6%E5%9B%A2">综济家团</a> - 2009-5-26 17:12</cite>
</td>
</tr>
</tbody>
<tbody id="forum14">
<tr>
<th class="new">
<h2><a href="forumdisplay.php?fid=14">图说装修</a><em> (今日: 1)</em></h2>
<p>户型图,设计图,实景图.</p> <p class="moderators">版主: <a class="notabs" href="space.php?username=%E9%98%B3%E5%85%89100">阳光100</a></p> </th>
<td class="nums">1299</td>
<td class="nums">1692</td>
<td class="lastpost">
<a href="redirect.php?tid=13981&goto=lastpost#lastpost">朱雀门项目施工图</a>
<cite>by <a href="space.php?username=%E4%B8%89%E6%81%92%E5%9C%B0%E6%9A%96">三恒地暖</a> - 2009-5-27 10:55</cite>
</td>
</tr>
</tbody>
<tbody id="forum39">
<tr>
<th>
<h2><a href="forumdisplay.php?fid=39">家具欣赏</a></h2>
<p>好家具,除了是实用品更是艺术品</p> <p class="moderators">版主: <a class="notabs" href="space.php?username=yang">yang</a></p> </th>
<td class="nums">311</td>
<td class="nums">528</td>
<td class="lastpost">
<a href="redirect.php?tid=13960&goto=lastpost#lastpost">时尚、个性的小桌子点缀空间的好帮手 ...</a>
<cite>by <a href="space.php?username=xizhn">xizhn</a> - 2009-5-25 20:58</cite>
</td>
</tr>
</tbody>
<tbody id="forum35">
<tr>
<th class="new">
<h2><a href="forumdisplay.php?fid=35">装修日记</a></h2>
<p>写出您的装修心得和过程,展示您的装修风格与大家分享。<a href='viewthread.php?tid=9702'><b><font color='red'>写装修日记,得笔记本大奖!</font></b></a></p> <p class="moderators">版主: <a class="notabs" href="space.php?username=%E7%AB%8B%E5%A4%8F%E7%AB%8B%E5%A4%8F">立夏立夏</a></p> </th>
<td class="nums">165</td>
<td class="nums">516</td>
<td class="lastpost">
<a href="redirect.php?tid=13973&goto=lastpost#lastpost">北京金锐特别墅装修5126 9984专业别墅翻新/ ...</a>
<cite>by <a href="space.php?username=sjsl11">sjsl11</a> - 2009-5-26 13:52</cite>
</td>
</tr>
</tbody>
<tbody id="forum36">
<tr>
<th>
<h2><a href="forumdisplay.php?fid=36">家居风水</a></h2>
<p>家居风水自古有之。是古人对自然和居住环境的理解,在现代社会,家居风水仍然有一定的意义。</p> <p class="moderators">版主: <a class="notabs" href="space.php?username=%E6%B0%B4%E8%89%B2%E7%BA%A4%E5%B0%98">水色纤尘</a></p> </th>
<td class="nums">411</td>
<td class="nums">490</td>
<td class="lastpost">
<a href="redirect.php?tid=13951&goto=lastpost#lastpost">家居风水之门窗小常识!!</a>
<cite>by <a href="space.php?username=%E4%B8%80%E5%8F%B6%E5%AD%A4%E5%9F%8E">一叶孤城</a> - 2009-5-25 15:25</cite>
</td>
</tr>
</tbody>
<tbody id="forum3">
<tr>
<th class="new">
<h2><a href="forumdisplay.php?fid=3"><font color=blue>打折促销</font></a></h2>
<p>最新厂商优惠打折信息、二手市场,发广告的到这里. </p> <p class="moderators">版主: <a class="notabs" href="space.php?username=%E9%A5%B0%E5%AE%B6%E5%BB%BA%E6%9D%90">饰家建材</a></p> </th>
<td class="nums">2319</td>
<td class="nums">2570</td>
<td class="lastpost">
<a href="redirect.php?tid=13974&goto=lastpost#lastpost">天津整体橱柜</a>
<cite>by <a href="space.php?username=nxghj">nxghj</a> - 2009-5-26 16:04</cite>
</td>
</tr>
</tbody>
<tbody id="forum33">
<tr>
<th>
<h2><a href="forumdisplay.php?fid=33">消费投诉</a></h2>
<p>良好建议,违规投诉</p> <p class="moderators">版主: <a class="notabs" href="space.php?username=%E5%AE%B6%E5%B1%85%E5%AF%8C%E4%BA%BA">家居富人</a></p> </th>
<td class="nums">3</td>
<td class="nums">5</td>
<td class="lastpost">
<a href="redirect.php?tid=12117&goto=lastpost#lastpost">马红漫:救楼市不可牺牲公众财富利益 ...</a>
<cite>by <a href="space.php?username=mingyuahui">mingyuahui</a> - 2009-5-7 13:30</cite>
</td>
</tr>
</tbody>
</table>
</div>
<div id="ad_intercat_7"></div>
<div class="mainbox forumlist">
<span class="headactions">
分区版主: <a class="notabs" href="space.php?username=%E6%B0%B4%E8%89%B2%E7%BA%A4%E5%B0%98">水色纤尘</a> <img id="category_40_img" src="images/default/collapsed_no.gif" title="收起/展开" alt="收起/展开" onclick="toggle_collapse('category_40');" />
</span>
<h3><a href="index.php?gid=40">小区论坛</a></h3>
<table id="category_40" summary="category40" cellspacing="0" cellpadding="0" style="">
<thead class="category">
<tr>
<th>版块</th>
<td class="nums">主题</td>
<td class="nums">帖数</td>
<td class="lastpost">最后发表</td>
</tr>
</thead><tbody id="forum41">
<tr>
<th class="new">
<h2><a href="forumdisplay.php?fid=41">回龙观天露园小区</a></h2>
<p>天露园小区业主论坛,专为回龙观天露园小区业主提供的小区交流论坛</p> <p class="moderators">版主: <a class="notabs" href="space.php?username=%E5%BE%B7%E6%84%8F%E5%AE%9D%E5%AE%9D">德意宝宝</a></p> </th>
<td class="nums">68</td>
<td class="nums">325</td>
<td class="lastpost">
<a href="redirect.php?tid=13971&goto=lastpost#lastpost">专业旧房装修公司|二手房改造|二手房翻新51 ...</a>
<cite>by <a href="space.php?username=sjsl11">sjsl11</a> - 2009-5-26 13:44</cite>
</td>
</tr>
</tbody>
</table>
</div>
<div id="ad_intercat_40"></div>
<div class="mainbox forumlist">
<span class="headactions">
分区版主: <a class="notabs" href="space.php?username=%E9%98%B3%E5%85%89100">阳光100</a> <img id="category_8_img" src="images/default/collapsed_no.gif" title="收起/展开" alt="收起/展开" onclick="toggle_collapse('category_8');" />
</span>
<h3><a href="index.php?gid=8">休闲吧</a></h3>
<table id="category_8" summary="category8" cellspacing="0" cellpadding="0" style="">
<thead class="category">
<tr>
<th>版块</th>
<td class="nums">主题</td>
<td class="nums">帖数</td>
<td class="lastpost">最后发表</td>
</tr>
</thead><tbody id="forum6">
<tr>
<th>
<h2><a href="forumdisplay.php?fid=6">灌水天地、生活百科</a></h2>
<p>衣、食、住、行</p> <p class="moderators">版主: <a class="notabs" href="space.php?username=%E5%8C%97%E8%8B%91%E5%B0%8F%E5%8D%95">北苑小单</a></p> </th>
<td class="nums">2392</td>
<td class="nums">2974</td>
<td class="lastpost">
<a href="redirect.php?tid=13940&goto=lastpost#lastpost">烧烤低空直排油烟净化器</a>
<cite>by <a href="space.php?username=fuxiaowei00">fuxiaowei00</a> - 2009-5-25 10:20</cite>
</td>
</tr>
</tbody>
</table>
</div>
<div id="ad_intercat_8"></div>
<div class="mainbox forumlist">
<span class="headactions">
分区版主: <a class="notabs" href="space.php?username=%E5%BF%BD%E6%82%A0%E5%BF%BD%E6%82%A0">忽悠忽悠</a> <img id="category_29_img" src="images/default/collapsed_no.gif" title="收起/展开" alt="收起/展开" onclick="toggle_collapse('category_29');" />
</span>
<h3><a href="index.php?gid=29">站务管理</a></h3>
<table id="category_29" summary="category29" cellspacing="0" cellpadding="0" style="">
<thead class="category">
<tr>
<th>版块</th>
<td class="nums">主题</td>
<td class="nums">帖数</td>
<td class="lastpost">最后发表</td>
</tr>
</thead><tbody id="forum30">
<tr>
<th>
<h2><a href="forumdisplay.php?fid=30">站务管理</a></h2>
<p><font color='blue'>一元抢购、一元竞拍、积分兑换、领取商品通知</font></p> <p class="moderators">版主: <a class="notabs" href="space.php?username=chefulong">chefulong</a></p> </th>
<td class="nums">12</td>
<td class="nums">43</td>
<td class="lastpost">
<a href="redirect.php?tid=13763&goto=lastpost#lastpost">房贷新政 如何选择贷款银行</a>
<cite>by <a href="space.php?username=liduo890">liduo890</a> - 2009-5-6 13:59</cite>
</td>
</tr>
</tbody>
</table>
</div>
<div id="ad_intercat_29"></div>
<div class="box">
<span class="headactions"><img id="forumlinks_img" src="images/default/collapsed_no.gif" alt="" onclick="toggle_collapse('forumlinks');" /></span>
<h4>联盟论坛</h4>
<table summary="联盟论坛" id="forumlinks" cellpadding="0" cellspacing="0" style=""> <tr>
<td>
<a href="http://www.jiaboo.com/bbs" target="_blank">[家宝装修论坛]</a> <a href="http://bbs.jtlhome.com" target="_blank">[居泰隆家居论坛]</a> <a href="http://bbs.eyetao.com/" target="_blank">[企业论坛]</a> </td>
</tr>
</table>
</div>
<div class="box" id="online">
<span class="headactions"><a href="index.php?showoldetails=yes#online" class="nobdr"><img src="images/default/collapsed_yes.gif" alt="" /></a></span>
<h4>
<strong>在线会员</strong>
- 共 <em>125</em> 人在线
- 最高记录是 <em>532</em> 于 <em>2009-3-11</em>.
</h4>
<dl id="onlinelist">
<dt><img src="images/common/online_admin.gif" alt="" /> 管理员 <img src="images/common/online_supermod.gif" alt="" /> 超级版主 <img src="images/common/online_moderator.gif" alt="" /> 版主 <img src="images/common/online_member.gif" alt="" /> 会员 </dt>
</dl>
</div>
<ul class="popupmenu_popup" id="creditlist_menu" style="display: none">
<li>积分: 0</li></ul>
</div>
<div id="ad_footerbanner1"></div><div id="ad_footerbanner2"></div><div id="ad_footerbanner3"></div>
<div id="footer">
<div class="wrap">
<div id="footlinks">
<p>当前时区 GMT+8, 现在时间是 2009-5-27 11:09 <a href="http://www.miibeian.gov.cn/" target="_blank">京ICP备07032089号</a></p>
<p>
<a href="member.php?action=clearcookies&formhash=4893f5f6">清除 Cookies</a>
- <a href="mailto:admin@your.com">联系我们</a> - <a href="http://www.homebjjj.com" target="_blank">北京家居网</a>
- <a href="archiver/" target="_blank">Archiver</a> - <a href="wap/" target="_blank">WAP</a> - <span class="scrolltop" onclick="window.scrollTo(0,0);">TOP</span>
</p>
</div>
<img src="images/default/discuz_icon.gif" border="0" alt="Discuz!" />
<p id="copyright">
Powered by <strong><a href="http://www.homebjjj.com" target="_blank">北京家居网</a></strong> <em>6.0.0</em> © 2001-2007 <a href="http://www.homebjjj.com" target="_blank">Homebjjj Inc.</a>
</p> </div>
</div>
<div style="display: none" id="ad_none">
<div id="ad_headerbanner_none"></div>
<div class="ad_footerbanner" id="ad_footerbanner1_none"></div>
<div class="ad_footerbanner" id="ad_footerbanner2_none"></div>
<div class="ad_footerbanner" id="ad_footerbanner3_none"></div>
</div>
<script type="text/javascript">
var insenz_status = 0;
var insenz_availableadvs = {'headerbanner' : '1', 'thread3_0' : '2', 'thread2_0' : '3', 'thread1_0' : '4', 'interthread' : '5', 'footerbanner1' : '6', 'footerbanner2' : '7', 'footerbanner3' : '8'};
var insenz_adkeys = [];
var ad_divs = $('ad_none').getElementsByTagName('div');
var insenz_cookie = document.cookie.indexOf('insenz_cookie') == -1 ? null : getcookie('insenz_cookie');
var ad_obj = null;
if(!insenz_status || insenz_cookie) {
for(var i = 0; i < ad_divs.length; i++) {
if(ad_divs[i].id.substr(0, 3) == 'ad_' && (ad_obj = $(ad_divs[i].id.substr(0, ad_divs[i].id.length - 5))) && ad_divs[i].innerHTML) {
if(insenz_cookie) {
re = new RegExp(insenz_availableadvs[ad_divs[i].id.substr(3, ad_divs[i].id.length - 8)] + "\:(0" + "|" + gid + "|" + fid + ")", "ig");
if(re.exec(insenz_cookie) != null) continue;
}
ad_obj.innerHTML = ad_divs[i].innerHTML;
ad_obj.className = ad_divs[i].className;
}
}
}
</script>
<script type="text/javascript">
if(insenz_status) {
if(typeof insenz_usedadkeys != 'undefined' && typeof insenz_advs != 'undefined' && insenz_usedadkeys.length && insenz_advs.length) {
insenz_cookie = '';
for(var j in insenz_advs) {
for(var k in insenz_advs[j]) {
insenz_cookie += j + ':' + k + 'D';
}
}
setcookie('insenz_cookie', insenz_cookie, 86400);
} else {
insenz_cookie = 1;
setcookie('insenz_cookie', '', -86400);
var insenz_usedadkeys = new Array();
}
if(insenz_cookie) {
for(var i = 0; i < ad_divs.length; i++) {
if(ad_divs[i].id.substr(0, 3) == 'ad_' && (ad_obj = $(ad_divs[i].id.substr(0, ad_divs[i].id.length - 5))) && ad_divs[i].innerHTML && !in_array(insenz_availableadvs[ad_divs[i].id.substr(3, ad_divs[i].id.length - 8)], insenz_usedadkeys)) {
ad_obj.innerHTML = ad_divs[i].innerHTML;
ad_obj.className = ad_divs[i].className;
}
}
}
}
$('ad_none').parentNode.removeChild($('ad_none'));
</script>
<script>document.write(unescape("%3Cscript src='http://www.google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script><script type="text/javascript">var pageTracker = _gat._getTracker("UA-2629885-1");pageTracker._setDomainName("homebjjj.com");pageTracker._initData();pageTracker._trackPageview();</script>
</body>
</html> | zyyhong | trunk/jiaju001/bbs/77.html | HTML | asf20 | 26,462 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: register.php 10457 2007-08-31 06:57:06Z tiger $
*/
define('CURSCRIPT', 'register');
define('NOROBOT', TRUE);
require_once './include/common.inc.php';
require_once DISCUZ_ROOT.'./forumdata/cache/cache_profilefields.php';
$discuz_action = 5;
if($discuz_uid) {
showmessage('login_succeed', $indexname);
} elseif (!$regstatus) {
showmessage('register_disable');
}
$inviteconfig = array();
$query = $db->query("SELECT * FROM {$tablepre}settings WHERE variable IN ('bbrules', 'bbrulestxt', 'welcomemsg', 'welcomemsgtitle', 'welcomemsgtxt', 'inviteconfig')");
while($setting = $db->fetch_array($query)) {
$$setting['variable'] = $setting['value'];
}
$invitecode = $regstatus > 1 && $invitecode ? dhtmlspecialchars($invitecode) : '';
if($regstatus > 1) {
$inviterewardcredit = $inviteaddcredit = $invitedaddcredit = '';
@extract(unserialize($inviteconfig));
}
$query = $db->query("SELECT groupid, allownickname, allowcstatus, allowavatar, allowcusbbcode, allowsigbbcode, allowsigimgcode, maxsigsize FROM {$tablepre}usergroups WHERE ".($regverify ? "groupid='8'" : "creditshigher<=".intval($initcredits)." AND ".intval($initcredits)."<creditslower LIMIT 1"));
$groupinfo = $db->fetch_array($query);
$groupinfo['allowavatar'] = $groupinfo['allowavatar'] == 3 ? 2 : $groupinfo['allowavatar'];
$seccodecheck = $seccodestatus & 1;
$fromuid = !empty($_DCOOKIE['promotion']) && $creditspolicy['promotion_register'] ? intval($_DCOOKIE['promotion']) : 0;
if(!submitcheck('regsubmit', 0, $seccodecheck, $secqaa['status'][1])) {
$referer = isset($referer) ? dhtmlspecialchars($referer) : dreferer();
if($bbrules && !submitcheck('rulesubmit')) {
$bbrulestxt = nl2br("\n$bbrulestxt\n\n");
} else {
$enctype = $groupinfo['allowavatar'] == 3 ? 'enctype="multipart/form-data"' : NULL;
$accessexp = '/('.str_replace("\r\n", '|', preg_quote($accessemail, '/')).')$/i';
$censorexp = '/('.str_replace("\r\n", '|', preg_quote($censoremail, '/')).')$/i';
$accessemail = str_replace("\r\n", '/', $accessemail);
$censoremail = str_replace("\r\n", '/', $censoremail);
$advcheck = $regadvance ? 'checked="checked"' : '';
$advdisplay = $regadvance ? '' : 'none';
$fromuser = !empty($fromuser) ? dhtmlspecialchars($fromuser) : '';
$styleselect = $dayselect = '';
$query = $db->query("SELECT styleid, name FROM {$tablepre}styles WHERE available='1'");
while($styleinfo = $db->fetch_array($query)) {
$styleselect .= '<option value="'.$styleinfo['styleid'].'">'.$styleinfo['name'].'</option>'."\n";
}
if($fromuid) {
$query = $db->query("SELECT username FROM {$tablepre}members WHERE uid='$fromuid'");
if($db->num_rows($query)) {
$fromuser = dhtmlspecialchars($db->result($query, 0));
} else {
dsetcookie('promotion', '');
}
}
for($num = 1; $num <= 31; $num++) {
$dayselect .= '<option value="'.$num.'">'.$num.'</option>';
}
$dateformatlist = array();
if(!empty($userdateformat) && ($count = count($userdateformat))) {
for($num =1; $num <= $count; $num ++) {
$dateformatlist[$num] = str_replace(array('n', 'j', 'y', 'Y'), array('mm', 'dd', 'yy', 'yyyy'), $userdateformat[$num-1]);
}
}
}
if($seccodecheck) {
$seccode = random(6, 1);
}
if($secqaa['status'][1]) {
$seccode = random(1, 1) * 1000000 + substr($seccode, -6);
}
include template('register');
} else {
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
$email = trim($email);
$username = addslashes(trim(stripslashes($username)));
$alipay = trim($alipay);
if(strlen($username) < 3) {
showmessage('profile_username_tooshort');
}
if(strlen($username) > 15) {
showmessage('profile_username_toolong');
}
if($password != $password2) {
showmessage('profile_passwd_notmatch');
}
$guestexp = '\xA1\xA1|\xAC\xA3|^Guest|^\xD3\xCE\xBF\xCD|\xB9\x43\xAB\xC8';
$censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($censoruser = trim($censoruser)), '/')).')$/i';
if(preg_match("/^\s*$|^c:\\con\\con$|[%,\*\"\s\t\<\>\&]|$guestexp/is", $username) || ($censoruser && @preg_match($censorexp, $username))) {
showmessage('profile_username_illegal');
}
if($censoruser && (@preg_match($censorexp, $nickname) || @preg_match($censorexp, $cstatus))) {
showmessage('profile_nickname_cstatus_illegal');
}
if(!$password || $password != addslashes($password)) {
showmessage('profile_passwd_illegal');
}
$accessexp = '/('.str_replace("\r\n", '|', preg_quote($accessemail, '/')).')$/i';
$censorexp = '/('.str_replace("\r\n", '|', preg_quote($censoremail, '/')).')$/i';
$invalidemail = $accessemail ? !preg_match($accessexp, $email) : $censoremail && preg_match($censorexp, $email);
if(!isemail($email) || $invalidemail) {
showmessage('profile_email_illegal');
}
if($alipay && !isemail($alipay)) {
showmessage('profile_alipay_illegal');
}
if($msn && !isemail($msn)) {
showmessage('profile_alipay_msn');
}
$fieldadd1 = $fieldadd2 = '';
foreach(array_merge($_DCACHE['fields_required'], $_DCACHE['fields_optional']) as $field) {
$field_key = 'field_'.$field['fieldid'];
$field_val = ${'field_'.$field['fieldid'].'new'};
if($field['required'] && trim($field_val) == '') {
showmessage('profile_required_info_invalid');
} elseif($field['selective'] && $field_val != '' && !isset($field['choices'][$field_val])) {
showmessage('undefined_action', NULL, 'HALTED');
} else {
$fieldadd1 .= ", $field_key";
$fieldadd2 .= ', \''.dhtmlspecialchars($field_val).'\'';
}
}
if($regverify == 2 && !trim($regmessage)) {
showmessage('profile_required_info_invalid');
}
if($groupinfo['maxsigsize']) {
if(strlen($signature) > $groupinfo['maxsigsize']) {
$maxsigsize = $groupinfo['maxsigsize'];
showmessage('profile_sig_toolong');
}
} else {
$signature = '';
}
if($ipregctrl) {
foreach(explode("\n", $ipregctrl) as $ctrlip) {
if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $onlineip)) {
$ctrlip = $ctrlip.'%';
$regctrl = 72;
break;
} else {
$ctrlip = $onlineip;
}
}
} else {
$ctrlip = $onlineip;
}
if($regstatus > 1) {
if($regstatus == 2 && !$invitecode) {
showmessage('register_invite_notfound');
} elseif($invitecode) {
$groupinfo['groupid'] = $invitegroupid ? intval($invitegroupid) : $groupinfo['groupid'];
$query = $db->query("SELECT uid, invitecode, inviteip, expiration FROM {$tablepre}invites WHERE invitecode='$invitecode' AND status IN ('1', '3')");
if(!$invite = $db->fetch_array($query)) {
showmessage('register_invite_error');
} else {
if($invite['inviteip'] == $onlineip) {
showmessage('register_invite_iperror');
} elseif($invite['expiration'] < $timestamp) {
showmessage('register_invite_expiration');
}
}
}
}
if($regctrl) {
$query = $db->query("SELECT ip FROM {$tablepre}regips WHERE ip LIKE '$ctrlip' AND count='-1' AND dateline>$timestamp-'$regctrl'*3600 LIMIT 1");
if($db->num_rows($query)) {
showmessage('register_ctrl', NULL, 'HALTED');
}
}
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE username='$username'");
if($db->num_rows($query)) {
showmessage('profile_username_duplicate');
}
if(!$doublee) {
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE email='$email' LIMIT 1");
if($db->num_rows($query)) {
showmessage('profile_email_duplicate');
}
}
if($regfloodctrl) {
$query = $db->query("SELECT count FROM {$tablepre}regips WHERE ip='$onlineip' AND count>'0' AND dateline>'$timestamp'-86400");
if($regattempts = $db->result($query, 0)) {
if($regattempts >= $regfloodctrl) {
showmessage('register_flood_ctrl', NULL, 'HALTED');
} else {
$db->query("UPDATE {$tablepre}regips SET count=count+1 WHERE ip='$onlineip' AND count>'0'");
}
} else {
$db->query("INSERT INTO {$tablepre}regips (ip, count, dateline)
VALUES ('$onlineip', '1', '$timestamp')");
}
}
$password = md5($password);
$secques = quescrypt($questionid, $answer);
$tppnew = in_array($tppnew, array(10, 20, 30)) ? $tppnew : 0;
$pppnew = in_array($pppnew, array(5, 10, 15)) ? $pppnew : 0;
$dateformatnew = ($dateformatnew = intval($dateformatnew)) && !empty($userdateformat[$dateformatnew -1]) ? $dateformatnew : 0;
$icq = preg_match("/^([0-9]+)$/", $icq) && strlen($icq) >= 5 && strlen($icq) <= 12 ? $icq : '';
$qq = preg_match("/^([0-9]+)$/", $qq) && strlen($qq) >= 5 && strlen($qq) <= 12 ? $qq : '';
$bday = datecheck($bday) ? $bday : '0000-00-00';
//$avatar = dhtmlspecialchars($avatar);
$yahoo = dhtmlspecialchars($yahoo);
$taobao = dhtmlspecialchars($taobao);
$email = dhtmlspecialchars($email);
$msn = dhtmlspecialchars($msn);
$alipay = dhtmlspecialchars($alipay);
$bday = dhtmlspecialchars($bday);
$signature = censor($signature);
$sigstatus = $signature ? 1 : 0;
$sightml = addslashes(discuzcode(stripslashes($signature), 1, 0, 0, 0, ($groupinfo['allowsigbbcode'] ? ($groupinfo['allowcusbbcode'] ? 2 : 1) : 0), $groupinfo['allowsigimgcode'], 0));
$bio = censor(dhtmlspecialchars($bio));
$site = dhtmlspecialchars(trim(preg_match("/^https?:\/\/.+/i", $site) ? $site : ($site ? 'http://'.$site : '')));
$locationnew = cutstr(censor(dhtmlspecialchars($locationnew)), 30);
$nickname = $groupinfo['allownickname'] ? cutstr(censor(dhtmlspecialchars($nickname)), 30) : '';
$cstatus = $groupinfo['allowcstatus'] ? cutstr(censor(dhtmlspecialchars($cstatus)), 30) : '';
$invisiblenew = $invisiblenew && $groupinfo['allowinvisible'] ? 1 : 0;
$idstring = random(6);
$authstr = $regverify == 1 ? "$timestamp\t2\t$idstring" : '';
//avatar
if(!empty($urlavatar) && $groupinfo['allowavatar']) {
$avatarimagesize = array();
$avatar = $urlavatar;
if(@preg_match("/^(images\/avatars\/.+?)$/i", $urlavatar)) {
$avatarimagesize = @getimagesize($urlavatar);
} elseif(preg_match("/^(http:\/\/.+?)$/i", $urlavatar)) {
if(ini_get('allow_url_fopen') && (substr(PHP_OS, 0, 3) != 'WIN' || PHP_VERSION >= 5)) {
$avatarimagesize = @getimagesize($urlavatar);
}
} else {
showmessage('profile_avatar_invalid');
}
if(!in_array(strtolower(fileext($avatar)), array('gif', 'jpg', 'png'))) {
showmessage('profile_avatar_invalid');
}
$avatar = dhtmlspecialchars(trim($avatar));
if($avatarwidth == '*' || $avatarheight == '*' || $avatarwidth == '' || $avatarheight == '') {
$avatarwidth = $avatarheight = ($maxavatarpixel ? round($maxavatarpixel * 0.6) : 80);
@list($avatarwidth, $avatarheight) = $avatarimagesize ? $avatarimagesize : array($avatarwidth, $avatarheight);
}
$maxsize = max($avatarwidth, $avatarheight);
if($maxsize > $maxavatarpixel) {
$avatarwidth = $avatarwidth * $maxavatarpixel / $maxsize;
$avatarheight = $avatarheight * $maxavatarpixel / $maxsize;
}
} else {
$avatar = $avatarwidth = $avatarheight = '';
}
$db->query("INSERT INTO {$tablepre}members (username, password, secques, gender, adminid, groupid, regip, regdate, lastvisit, lastactivity, posts, credits, extcredits1, extcredits2, extcredits3, extcredits4, extcredits5, extcredits6, extcredits7, extcredits8, email, bday, sigstatus, tpp, ppp, styleid, dateformat, timeformat, pmsound, showemail, newsletter, invisible, timeoffset)
VALUES ('$username', '$password', '$secques', '$gendernew', '0', '$groupinfo[groupid]', '$onlineip', '$timestamp', '$timestamp', '$timestamp', '0', $initcredits, '$email', '$bday', '$sigstatus', '$tppnew', '$pppnew', '$styleidnew', '$dateformatnew', '$timeformatnew', '$pmsoundnew', '$showemailnew', '$newsletter', '$invisiblenew', '$timeoffsetnew')");
$uid = $db->insert_id();
$db->query("INSERT INTO {$tablepre}memberfields (uid, nickname, site, icq, qq, yahoo, msn, taobao, alipay, location, bio, sightml, customstatus, authstr, avatar, avatarwidth, avatarheight $fieldadd1)
VALUES ('$uid', '$nickname', '$site', '$icq', '$qq', '$yahoo', '$msn', '$taobao', '$alipay', '$locationnew', '$bio', '$sightml', '$cstatus', '$authstr', '$avatar', '$avatarwidth', '$avatarheight' $fieldadd2)");
if($regctrl || $regfloodctrl) {
$db->query("DELETE FROM {$tablepre}regips WHERE dateline<='$timestamp'-".($regctrl > 72 ? $regctrl : 72)."*3600", 'UNBUFFERED');
if($regctrl) {
$db->query("INSERT INTO {$tablepre}regips (ip, count, dateline)
VALUES ('$onlineip', '-1', '$timestamp')");
}
}
if($regverify == 2) {
$db->query("REPLACE INTO {$tablepre}validating (uid, submitdate, moddate, admin, submittimes, status, message, remark)
VALUES ('$uid', '$timestamp', '0', '', '1', '0', '$regmessage', '')");
}
if($invitecode && $regstatus > 1) {
$db->query("UPDATE {$tablepre}invites SET reguid='$uid', regdateline='$timestamp', status='2' WHERE invitecode='$invitecode' AND status='1'");
if($inviteaddbuddy) {
$db->query("INSERT INTO {$tablepre}buddys (uid, buddyid, dateline) VALUES ('$invite[uid]', '$uid', '$timestamp')");
}
if($inviterewardcredit) {
if($inviteaddcredit) {
$db->query("UPDATE {$tablepre}members SET extcredits$inviterewardcredit=extcredits$inviterewardcredit+'$inviteaddcredit' WHERE uid='$uid'");
}
if($invitedaddcredit) {
$db->query("UPDATE {$tablepre}members SET extcredits$inviterewardcredit=extcredits$inviterewardcredit+'$invitedaddcredit' WHERE uid='$invite[uid]'");
}
}
}
$discuz_uid = $uid;
$discuz_user = $username;
$discuz_userss = stripslashes($discuz_user);
$discuz_pw = $password;
$discuz_secques = $secques;
$groupid = $groupinfo['groupid'];
$styleid = $styleid ? $styleid : $_DCACHE['settings']['styleid'];
if($welcomemsg && !empty($welcomemsgtxt)) {
$welcomtitle = !empty($welcomemsgtitle) ? $welcomemsgtitle : "Welcome to $bbname!";
$welcomtitle = addslashes(replacesitevar($welcomtitle));
$welcomemsgtxt = addslashes(replacesitevar($welcomemsgtxt));
if($welcomemsg == 1) {
$db->query("INSERT INTO {$tablepre}pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
VALUES ('System Message', '0', '$uid', 'inbox', '1', '$welcomtitle', '$timestamp','$welcomemsgtxt')");
$db->query("UPDATE {$tablepre}members SET newpm='1' WHERE uid='$uid'");
} elseif($welcomemsg == 2) {
sendmail("$username <$email>", $welcomtitle, $welcomemsgtxt);
}
}
if($fromuid) {
updatecredits($fromuid, $creditspolicy['promotion_register']);
dsetcookie('promotion', '');
}
require_once DISCUZ_ROOT.'./include/cache.func.php';
$_DCACHE['settings']['totalmembers']++;
$_DCACHE['settings']['lastmember'] = $discuz_userss;
updatesettings();
switch($regverify) {
case 1:
sendmail("$username <$email>", 'email_verify_subject', 'email_verify_message');
showmessage('profile_email_verify');
break;
case 2:
showmessage('register_manual_verify', 'memcp.php');
break;
default:
if($_DCACHE['settings']['frameon'] && $_DCOOKIE['frameon'] == 'yes') {
$extrahead .= '<script>if(top != self) {parent.leftmenu.location.reload();}</script>';
}
if($passport_status == 'shopex' && $passport_shopex) {
$dreferer = dreferer();
$verify = md5('login'.$dreferer.$passport_key);
showmessage('register_succeed', 'api/relateshopex.php?action=login&forward='.rawurlencode($dreferer).'&verify='.$verify);
} else {
showmessage('register_succeed', dreferer());
}
break;
}
}
function replacesitevar($string, $replaces = array()) {
global $sitename, $bbname, $timestamp, $timeoffset, $adminemail, $adminemail, $discuz_user;
$sitevars = array(
'{sitename}' => $sitename,
'{bbname}' => $bbname,
'{time}' => gmdate('Y-n-j H:i', $timestamp + $timeoffset * 3600),
'{adminemail}' => $adminemail,
'{username}' => $discuz_user,
'{myname}' => $discuz_user
);
$replaces = array_merge($sitevars, $replaces);
return str_replace(array_keys($replaces), array_values($replaces), $string);
}
?> | zyyhong | trunk/jiaju001/bbs/register.php | PHP | asf20 | 16,279 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: index.php 10486 2007-09-03 06:53:29Z liuqiang $
*/
define('CURSCRIPT', 'index');
require_once './include/common.inc.php';
require_once DISCUZ_ROOT.'./include/forum.func.php';
$discuz_action = 1;
if($cacheindexlife && !$discuz_uid && $showoldetails != 'yes' && (!$_DCACHE['settings']['frameon'] || $_DCACHE['settings']['frameon'] && $_GET['frameon'] != 'yes') && empty($gid)) {
$indexcache = getcacheinfo(0);
if($timestamp - $indexcache['filemtime'] > $cacheindexlife) {
@unlink($indexcache['filename']);
define('CACHE_FILE', $indexcache['filename']);
$styleid = $_DCACHE['settings']['styleid'];
} elseif($indexcache['filename']) {
@readfile($indexcache['filename']);
$debug && debuginfo();
die('<script type="text/javascript">document.getElementById("debuginfo").innerHTML = " '.($debug ? 'Update at '.gmdate("H:i:s", $indexcache['filemtime'] + 3600 * 8).', Processed in '.$debuginfo['time'].' second(s), '.$debuginfo['queries'].' Queries'.($gzipcompress ? ', Gzip enabled' : '') : '').'";</script>');
}
}
$validdays = $discuz_uid && !empty($groupexpiry) && $groupexpiry >= $timestamp ? ceil(($groupexpiry - $timestamp) / 86400) : 0;
if(isset($showoldetails)) {
switch($showoldetails) {
case 'no': dsetcookie('onlineindex', 0, 86400 * 365); break;
case 'yes': dsetcookie('onlineindex', 1, 86400 * 365); break;
}
} else {
$showoldetails = false;
}
$currenttime = gmdate($timeformat, $timestamp + $timeoffset * 3600);
$lastvisittime = gmdate("$dateformat $timeformat", $lastvisit + $timeoffset * 3600);
$memberenc = rawurlencode($lastmember);
$newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
$rsshead = $rssstatus ? ('<link rel="alternate" type="application/rss+xml" title="'.$bbname.'" href="'.$boardurl.'rss.php?auth='.$rssauth."\" />\n") : '';
$customtopics = '';
if($qihoo['maxtopics']) {
foreach(explode("\t", isset($_DCOOKIE['customkw']) ? $_DCOOKIE['customkw'] : '') as $topic) {
$topic = dhtmlspecialchars(trim(stripslashes($topic)));
$customtopics .= '<a href="topic.php?keyword='.rawurlencode($topic).'" target="_blank">'.$topic.'</a> ';
}
}
$supeitemsstatus = $supe['status'] && $supe['items']['status'] && $_DCACHE['supe_updateitems'];
$hottagstatus = $tagstatus && $hottags && $_DCACHE['tags'];
$catlist = $forumlist = $sublist = $pmlist = array();
$threads = $posts = $todayposts = $fids = $announcepm = 0;
$postdata = $historyposts ? explode("\t", $historyposts) : array();
foreach(array('forumlinks', 'birthdays', 'supe_updateusers') as $key) {
if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], $key) === FALSE) {
$collapseimg[$key] = 'collapsed_no.gif';
$collapse[$key] = '';
} else {
$collapseimg[$key] = 'collapsed_yes.gif';
$collapse[$key] = 'display: none';
}
}
$gid = !empty($gid) ? intval($gid) : 0;
if(!$gid) {
$announcements = '';
if($_DCACHE['announcements']) {
$readapmids = !empty($_DCOOKIE['readapmid']) ? explode('D', $_DCOOKIE['readapmid']) : array();
foreach($_DCACHE['announcements'] as $announcement) {
if(empty($announcement['groups']) || in_array($groupid, $announcement['groups'])) {
if(empty($announcement['type'])) {
$announcements .= '<li><a href="announcement.php?id='.$announcement['id'].'#'.$announcement['id'].'">'.$announcement['subject'].
'<em>('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</em></a></li>';
} elseif($announcement['type'] == 1) {
$announcements .= '<li><a href="'.$announcement['message'].'" target="_blank">'.$announcement['subject'].
'<em>('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</em></a></li>';
} elseif($discuz_uid && $announcement['type'] == 2 && !in_array($announcement['pmid'], $readapmids)) {
$announcement['announce'] = TRUE;
$pmlist[] = $announcement;
$announcepm++;
}
}
}
}
unset($_DCACHE['announcements']);
$sql = !empty($accessmasks) ?
"SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, f.forumcolumns, f.simple, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.redirect, a.allowview FROM {$tablepre}forums f
LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid
LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid
WHERE f.status>0 ORDER BY f.type, f.displayorder"
: "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, f.forumcolumns, f.simple, ff.description, ff.moderators, ff.icon, ff.viewperm, ff.redirect FROM {$tablepre}forums f
LEFT JOIN {$tablepre}forumfields ff USING(fid)
WHERE f.status>0 ORDER BY f.type, f.displayorder";
$query = $db->query($sql);
while($forum = $db->fetch_array($query)) {
$forumname[$forum['fid']] = strip_tags($forum['name']);
if($forum['type'] != 'group') {
$threads += $forum['threads'];
$posts += $forum['posts'];
$todayposts += $forum['todayposts'];
if($forum['type'] == 'forum') {
if(forum($forum)) {
$catlist[$forum['fup']]['forums'][] = $forum['fid'];
$forum['orderid'] = $catlist[$forum['fup']]['forumscount']++;
$forum['subforums'] = '';
$forumlist[$forum['fid']] = $forum;
}
} elseif(isset($forumlist[$forum['fup']])) {
$forumlist[$forum['fup']]['threads'] += $forum['threads'];
$forumlist[$forum['fup']]['posts'] += $forum['posts'];
$forumlist[$forum['fup']]['todayposts'] += $forum['todayposts'];
if($subforumsindex && $forumlist[$forum['fup']]['permission'] == 2 && !($forumlist[$forum['fup']]['simple'] & 16) || ($forumlist[$forum['fup']]['simple'] & 8)) {
$forumlist[$forum['fup']]['subforums'] .= '<a href="forumdisplay.php?fid='.$forum['fid'].'">'.$forum['name'].'</a> ';
}
}
} else {
if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], 'category_'.$forum['fid']) === FALSE) {
$forum['collapseimg'] = 'collapsed_no.gif';
$collapse['category_'.$forum['fid']] = '';
} else {
$forum['collapseimg'] = 'collapsed_yes.gif';
$collapse['category_'.$forum['fid']] = 'display: none';
}
if($forum['moderators']) {
$forum['moderators'] = moddisplay($forum['moderators'], 'flat');
}
$forum['forumscount'] = 0;
$catlist[$forum['fid']] = $forum;
}
}
foreach($catlist as $catid => $category) {
if($catlist[$catid]['forumscount'] && $category['forumcolumns']) {
$catlist[$catid]['forumcolwidth'] = floor(100 / $category['forumcolumns']).'%';
$catlist[$catid]['endrows'] = '';
if($colspan = $category['forumscount'] % $category['forumcolumns']) {
while(($category['forumcolumns'] - $colspan) > 0) {
$catlist[$catid]['endrows'] .= '<td> </td>';
$colspan ++;
}
$catlist[$catid]['endrows'] .= '</tr>';
}
} elseif(empty($category['forumscount'])) {
unset($catlist[$catid]);
}
}
if(isset($catlist[0]) && $catlist[0]['forumscount']) {
$catlist[0]['fid'] = 0;
$catlist[0]['type'] = 'group';
$catlist[0]['name'] = $bbname;
$catlist[0]['collapseimg'] = 'collapsed_no.gif';
} else {
unset($catlist[0]);
}
if($whosonlinestatus == 1 || $whosonlinestatus == 3) {
$whosonlinestatus = 1;
$onlineinfo = explode("\t", $onlinerecord);
if(empty($_DCOOKIE['onlineusernum'])) {
$onlinenum = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions"), 0);
if($onlinenum > $onlineinfo[0]) {
$_DCACHE['settings']['onlinerecord'] = $onlinerecord = "$onlinenum\t$timestamp";
$db->query("UPDATE {$tablepre}settings SET value='$onlinerecord' WHERE variable='onlinerecord'");
require_once DISCUZ_ROOT.'./include/cache.func.php';
updatesettings();
$onlineinfo = array($onlinenum, $timestamp);
}
dsetcookie('onlineusernum', intval($onlinenum), 300);
} else {
$onlinenum = intval($_DCOOKIE['onlineusernum']);
}
$onlineinfo[1] = gmdate($dateformat, $onlineinfo[1] + ($timeoffset * 3600));
$detailstatus = $showoldetails == 'yes' || (((!isset($_DCOOKIE['onlineindex']) && !$whosonline_contract) || $_DCOOKIE['onlineindex']) && $onlinenum < 500 && !$showoldetails);
if($detailstatus) {
@include language('actions');
$discuz_uid && updatesession();
$membercount = $invisiblecount = 0;
$whosonline = array();
$maxonlinelist = $maxonlinelist ? $maxonlinelist : 500;
$query = $db->query("SELECT uid, username, groupid, invisible, action, lastactivity, fid FROM {$tablepre}sessions ".(isset($_DCACHE['onlinelist'][7]) ? '' : 'WHERE uid <> 0')." ORDER BY uid DESC LIMIT ".$maxonlinelist);
while($online = $db->fetch_array($query)) {
if($online['uid']) {
$membercount ++;
if($online['invisible']) {
$invisiblecount++;
continue;
} else {
$online['icon'] = isset($_DCACHE['onlinelist'][$online['groupid']]) ? $_DCACHE['onlinelist'][$online['groupid']] : $_DCACHE['onlinelist'][0];
}
} else {
$online['icon'] = $_DCACHE['onlinelist'][7];
$online['username'] = $_DCACHE['onlinelist']['guest'];
}
$online['fid'] = $online['fid'] ? $forumname[$online['fid']] : 0;
$online['action'] = $actioncode[$online['action']];
$online['lastactivity'] = gmdate($timeformat, $online['lastactivity'] + ($timeoffset * 3600));
$whosonline[] = $online;
}
if($onlinenum > $maxonlinelist) {
$membercount = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions WHERE uid <> '0'"), 0);
$invisiblecount = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions WHERE invisible = '1'"), 0);
}
if($onlinenum < $membercount) {
$onlinenum = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions"), 0);
dsetcookie('onlineusernum', intval($onlinenum), 300);
}
$guestcount = $onlinenum - $membercount;
$db->free_result($query);
unset($online);
}
} else {
$whosonlinestatus = 0;
}
if($discuz_uid && $newpm) {
require_once DISCUZ_ROOT.'./include/pmprompt.inc.php';
}
} else {
require_once DISCUZ_ROOT.'./include/category.inc.php';
}
include template('discuz');
?>
| zyyhong | trunk/jiaju001/bbs/index.bak.php | PHP | asf20 | 10,447 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: menu.inc.php 10318 2007-08-25 12:26:40Z heyond $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Discuz! Administrator's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>">
<link rel="stylesheet" type="text/css" id="css" href="./images/admincp/admincp.css">
<script src="include/javascript/common.js" type="text/javascript"></script>
<script src="include/javascript/iframe.js" type="text/javascript"></script>
<script>
var collapsed = getcookie('<?=$tablepre?>collapse');
function collapse_change(menucount) {
if($('menu_' + menucount).style.display == 'none') {
$('menu_' + menucount).style.display = '';collapsed = collapsed.replace('[' + menucount + ']' , '');
$('menuimg_' + menucount).src = './images/admincp/menu_reduce.gif';
} else {
$('menu_' + menucount).style.display = 'none';collapsed += '[' + menucount + ']';
$('menuimg_' + menucount).src = './images/admincp/menu_add.gif';
}
setcookie('<?=$tablepre?>collapse', collapsed, 2592000);
}
</script>
</head>
<body style="margin:5px!important;margin:3px;">
<?
$menu = !empty($menu) ? $menu : 'home';
$collapse = isset($_DCOOKIE['collapse']) ? $_DCOOKIE['collapse'] : '';
$menucount = 0;
if($adminid == 1) {
echo '<table width="146" border="0" cellspacing="0" align="center" cellpadding="0" class="leftmenulist" style="margin-bottom: 5px;">'.
'<tr class="leftmenutext"><td><div align="center"><a href="'.$indexname.'" target="_blank">'.$lang['header_home'].'</a> <a href="#" onClick="parent.menu.location=\'admincp.php?action=menu\'; parent.main.location=\'admincp.php?action=home\';return false;">'.$lang['header_admin'].'</a></div></td></tr>'.
'</table>';
echo '<div id="home">';
showmenu($lang['menu_general'], array(array('name' => $lang['menu_forums_edit'], 'url' => 'admincp.php?action=forumsedit'),
array('name' => $lang['menu_members_edit'], 'url' => 'admincp.php?action=members'),
array('name' => $lang['menu_members_edit_ban_user'], 'url' => 'admincp.php?action=banmember'),
array('name' => $lang['menu_misc_announces'], 'url' => 'admincp.php?action=announcements'),
array('name' => $lang['menu_maint_threads'], 'url' => 'admincp.php?action=threads'),
array('name' => $lang['menu_maint_prune'], 'url' => 'admincp.php?action=prune'),
array('name' => $lang['menu_moderate_modthreads'], 'url' => 'admincp.php?action=modthreads'),
array('name' => $lang['menu_moderate_modreplies'], 'url' => 'admincp.php?action=modreplies'),
$isfounder ? array('name' => $lang['menu_runwizard'], 'url' => 'admincp.php?action=runwizard') : array()));
showmenu($lang['menu_logs'], array(array('name' => $lang['menu_logs_login'], 'url' => 'admincp.php?action=illegallog'),
array('name' => $lang['menu_logs_rating'], 'url' => 'admincp.php?action=ratelog'),
array('name' => $lang['menu_logs_credit'], 'url' => 'admincp.php?action=creditslog'),
array('name' => $lang['menu_logs_mod'], 'url' => 'admincp.php?action=modslog'),
array('name' => $lang['menu_logs_medal'], 'url' => 'admincp.php?action=medalslog'),
array('name' => $lang['menu_logs_ban'], 'url' => 'admincp.php?action=banlog'),
array('name' => $lang['menu_logs_admincp'], 'url' => 'admincp.php?action=cplog'),
array('name' => $lang['menu_logs_magic'], 'url' => 'admincp.php?action=magiclog'),
array('name' => $lang['menu_logs_invite'], 'url' => 'admincp.php?action=invitelog'),
array('name' => $lang['menu_logs_error'], 'url' => 'admincp.php?action=errorlog')));
echo '</div><div id="basic" style="display: none">';
showmenu($lang['menu_settings'],array(array('name' => $lang['settings_general'], 'url' => 'admincp.php?action=settings&do=basic'),
array('name' => $lang['settings_access'], 'url' => 'admincp.php?action=settings&do=access'),
array('name' => $lang['settings_styles'], 'url' => 'admincp.php?action=settings&do=styles'),
array('name' => $lang['settings_seo'], 'url' => 'admincp.php?action=settings&do=seo'),
array('name' => $lang['settings_cachethread'], 'url' => 'admincp.php?action=settings&do=cachethread'),
array('name' => $lang['settings_functions'], 'url' => 'admincp.php?action=settings&do=functions'),
array('name' => $lang['settings_credits'], 'url' => 'admincp.php?action=settings&do=credits'),
array('name' => $lang['settings_serveropti'], 'url' => 'admincp.php?action=settings&do=serveropti'),
$isfounder ? array('name' => $lang['settings_mail'], 'url' => 'admincp.php?action=settings&do=mail') : array(),
array('name' => $lang['settings_seccode'], 'url' => 'admincp.php?action=settings&do=seccode'),
array('name' => $lang['settings_secqaa'], 'url' => 'admincp.php?action=settings&do=secqaa'),
array('name' => $lang['settings_datetime'], 'url' => 'admincp.php?action=settings&do=datetime'),
array('name' => $lang['settings_permissions'], 'url' => 'admincp.php?action=settings&do=permissions'),
array('name' => $lang['settings_attachments'], 'url' => 'admincp.php?action=settings&do=attachments'),
array('name' => $lang['settings_wap'], 'url' => 'admincp.php?action=settings&do=wap'),
array('name' => $lang['settings_space'], 'url' => 'admincp.php?action=settings&do=space')));
echo '</div><div id="forums" style="display: none">';
showmenu($lang['menu_forums'], array(array('name' => $lang['menu_forums_add'], 'url' => 'admincp.php?action=forumadd'),
array('name' => $lang['menu_forums_edit'], 'url' => 'admincp.php?action=forumsedit'),
array('name' => $lang['menu_forums_merge'], 'url' => 'admincp.php?action=forumsmerge'),
array('name' => $lang['menu_forums_threadtypes'], 'url' => 'admincp.php?action=threadtypes')));
showmenu($lang['menu_forums_types'], array(array('name' => $lang['menu_forums_infotypes'], 'url' => 'admincp.php?action=threadtypes&special=1'),
array('name' => $lang['menu_forums_infomodel'], 'url' => 'admincp.php?action=typemodel'),
array('name' => $lang['menu_forums_infooption'], 'url' => 'admincp.php?action=typeoption')));
if($isfounder) {
showmenu($lang['menu_styles'], array(array('name' => $lang['menu_styles'], 'url' => 'admincp.php?action=styles'),
array('name' => $lang['menu_styles_templates'], 'url' => 'admincp.php?action=templates')));
} else {
showmenu($lang['menu_styles'], array(array('name' => $lang['menu_styles'], 'url' => 'admincp.php?action=styles')));
}
echo '</div><div id="users" style="display: none">';
showmenu($lang['menu_members'], array(array('name' => $lang['menu_members_add'], 'url' => 'admincp.php?action=memberadd'),
array('name' => $lang['menu_members_edit'], 'url' => 'admincp.php?action=members'),
array('name' => $lang['menu_members_edit_ban_user'], 'url' => 'admincp.php?action=banmember'),
array('name' => $lang['menu_members_merge'], 'url' => 'admincp.php?action=membersmerge'),
array('name' => $lang['menu_members_ipban'], 'url' => 'admincp.php?action=ipban'),
array('name' => $lang['menu_members_credits'], 'url' => 'admincp.php?action=members&submitname=creditsubmit'),
array('name' => $lang['menu_moderate_modmembers'], 'url' => 'admincp.php?action=modmembers'),
array('name' => $lang['menu_members_profile_fields'], 'url' => 'admincp.php?action=profilefields')));
showmenu($lang['menu_groups'], array(array('name' => $lang['menu_admingroups'], 'url' => 'admincp.php?action=admingroups'),
array('name' => $lang['menu_usergroups'], 'url' => 'admincp.php?action=usergroups'),
array('name' => $lang['menu_ranks'], 'url' => 'admincp.php?action=ranks')));
echo '</div><div id="posts" style="display: none">';
showmenu($lang['menu_moderate'],array(array('name' => $lang['menu_moderate_modthreads'], 'url' => 'admincp.php?action=modthreads'),
array('name' => $lang['menu_moderate_modreplies'], 'url' => 'admincp.php?action=modreplies')));
showmenu($lang['menu_maint'], array(array('name' => $lang['menu_maint_threads'], 'url' => 'admincp.php?action=threads'),
array('name' => $lang['menu_maint_prune'], 'url' => 'admincp.php?action=prune'),
array('name' => $lang['menu_maint_attaches'], 'url' => 'admincp.php?action=attachments'),
array('name' => $lang['menu_recommend'], 'url' => 'admincp.php?action=forumrecommend')));
showmenu($lang['menu_posting'], array(array('name' => $lang['menu_posting_discuzcodes'], 'url' => 'admincp.php?action=discuzcodes'),
array('name' => $lang['menu_posting_tags'], 'url' => 'admincp.php?action=tags'),
array('name' => $lang['menu_posting_censors'], 'url' => 'admincp.php?action=censor'),
array('name' => $lang['menu_posting_smilies'], 'url' => 'admincp.php?action=smilies'),
array('name' => $lang['menu_thread_icon'], 'url' => 'admincp.php?action=icons'),
array('name' => $lang['menu_posting_attachtypes'], 'url' => 'admincp.php?action=attachtypes'),
array('name' => $lang['menu_moderate_recyclebin'], 'url' => 'admincp.php?action=recyclebin')));
echo '</div><div id="api" style="display: none">';
showmenu($lang['menu_plugins'], array(array('name' => $lang['menu_plugins_edit'], 'url' => 'admincp.php?action=plugins'),
array('name' => $lang['menu_plugins_config'], 'url' => 'admincp.php?action=pluginsconfig')));
showmenu($lang['menu_supesite'],array(array('name' => $lang['supe_settings'], 'url' => 'admincp.php?action=xspace')));
showmenu($lang['menu_passport'],array(array('name' => $lang['menu_passport_settings'], 'url' => 'admincp.php?action=passport'),
array('name' => $lang['menu_passport_shopex'], 'url' => 'admincp.php?action=shopex')));
showmenu($lang['menu_google'], array(array('name' => $lang['menu_google_config'], 'url' => 'admincp.php?action=google_config')));
showmenu($lang['menu_qihoo'], array(array('name' => $lang['menu_qihoo_config'], 'url' => 'admincp.php?action=qihoo_config'),
array('name' => $lang['menu_qihoo_topics'], 'url' => 'admincp.php?action=qihoo_topics'),
array('name' => $lang['menu_qihoo_relatedthreads'], 'url' => 'admincp.php?action=qihoo_relatedthreads')));
showmenu($lang['menu_video'],array(array('name' => $lang['menu_video_config'], 'url' => 'admincp.php?action=videoconfig'),
array('name' => $lang['menu_video_bind'], 'url' => 'admincp.php?action=videobind'),
array('name' => $lang['menu_video_class'], 'url' => 'admincp.php?action=videoclass')));
showmenu($lang['menu_ecommerce'], array(
array('name' => $lang['settings_general'], 'url' => 'admincp.php?action=settings&do=ecommerce'),
array('name' => $lang['menu_ecommerce_alipay'], 'url' => 'admincp.php?action=alipay'),
array('name' => $lang['menu_ecommerce_credit'], 'url' => 'admincp.php?action=ec_credit'),
array('name' => $lang['menu_ecommerce_credit_orders'], 'url' => 'admincp.php?action=orders'),
array('name' => $lang['menu_ecommerce_trade_orders'], 'url' => 'admincp.php?action=tradelog')));
echo '</div><div id="others" style="display: none">';
showmenu($lang['menu_magics'], array(array('name' => $lang['menu_magics_config'], 'url' => 'admincp.php?action=magic_config'),
array('name' => $lang['menu_magics_edit'], 'url' => 'admincp.php?action=magic'),
array('name' => $lang['menu_magics_market'], 'url' => 'admincp.php?action=magicmarket')));
showmenu($lang['menu_misc'], array(array('name' => $lang['menu_misc_announces'], 'url' => 'admincp.php?action=announcements'),
array('name' => $lang['menu_misc_medals'], 'url' => 'admincp.php?action=medals'),
array('name' => $lang['menu_misc_advertisements'], 'url' => 'admincp.php?action=adv'),
array('name' => $lang['menu_misc_links'], 'url' => 'admincp.php?action=forumlinks'),
array('name' => $lang['menu_misc_crons'], 'url' => 'admincp.php?action=crons'),
array('name' => $lang['menu_misc_help'], 'url' => 'admincp.php?action=faqlist'),
array('name' => $lang['menu_misc_onlinelist'], 'url' => 'admincp.php?action=onlinelist')));
echo '</div><div id="tools" style="display: none">';
showmenu($lang['menu_tools'], array(array('name' => $lang['menu_members_newsletter'], 'url' => 'admincp.php?action=members&submitname=newslettersubmit'),
array('name' => $lang['menu_tools_updatecaches'], 'url' => 'admincp.php?action=updatecache'),
array('name' => $lang['menu_tools_updatecounters'], 'url' => 'admincp.php?action=counter'),
array('name' => $lang['menu_tools_javascript'], 'url' => 'admincp.php?action=jswizard'),
array('name' => $lang['menu_tools_creditwizard'], 'url' => 'admincp.php?action=creditwizard'),
array('name' => $lang['menu_tools_fileperms'], 'url' => 'admincp.php?action=fileperms'),
array('name' => $lang['menu_tools_filecheck'], 'url' => 'admincp.php?action=filecheck'),
array('name' => $lang['menu_maint_pmprune'], 'url' => 'admincp.php?action=pmprune'),
array('name' => $lang['menu_forum_scheme'], 'url' => 'admincp.php?action=project')
));
if($isfounder) {
showmenu($lang['menu_database'],array(array('name' => $lang['menu_database_export'], 'url' => 'admincp.php?action=export'),
checkpermission('dbimport', 0) ? array('name' => $lang['menu_database_import'], 'url' => 'admincp.php?action=import') : array(),
array('name' => $lang['menu_database_query'], 'url' => 'admincp.php?action=runquery'),
array('name' => $lang['menu_database_optimize'], 'url' => 'admincp.php?action=optimize'),
array('name' => $lang['menu_tools_dbcheck'], 'url' => 'admincp.php?action=dbcheck')));
}
showmenu($lang['menu_logs'], array(array('name' => $lang['menu_logs_login'], 'url' => 'admincp.php?action=illegallog'),
array('name' => $lang['menu_logs_rating'], 'url' => 'admincp.php?action=ratelog'),
array('name' => $lang['menu_logs_credit'], 'url' => 'admincp.php?action=creditslog'),
array('name' => $lang['menu_logs_mod'], 'url' => 'admincp.php?action=modslog'),
array('name' => $lang['menu_logs_medal'], 'url' => 'admincp.php?action=medalslog'),
array('name' => $lang['menu_logs_ban'], 'url' => 'admincp.php?action=banlog'),
array('name' => $lang['menu_logs_admincp'], 'url' => 'admincp.php?action=cplog'),
array('name' => $lang['menu_logs_magic'], 'url' => 'admincp.php?action=magiclog'),
array('name' => $lang['menu_logs_invite'], 'url' => 'admincp.php?action=invitelog'),
array('name' => $lang['menu_logs_error'], 'url' => 'admincp.php?action=errorlog')));
echo '</div>';
echo '</div><div id="insenz" style="display: none">';
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='insenz'");
$insenz = ($insenz = $db->result($query, 0)) ? unserialize($insenz) : array();
showmenu($lang['menu_insenz_settings'], array(array('name' => $lang['menu_insenz_settings_basic'], 'url' => 'admincp.php?action=insenz&operation=settings&do=basic'),
array('name' => $lang['menu_insenz_settings_softad'], 'url' => 'admincp.php?action=insenz&operation=settings&do=softad'),
array('name' => $lang['menu_insenz_settings_hardad'], 'url' => 'admincp.php?action=insenz&operation=settings&do=hardad'),
$insenz['topicrelatedad'] || $insenz['traderelatedad'] ? array('name' => $lang['menu_insenz_settings_relatedad'], 'url' => 'admincp.php?action=insenz&operation=settings&do=relatedad') : '',
$insenz['topicstatus'] ? array('name' => $lang['menu_insenz_settings_virtualforum'], 'url' => 'admincp.php?action=insenz&operation=settings&do=virtualforum') : ''));
showmenu($lang['menu_insenz_softad'], array(array('name' => $lang['menu_insenz_campaigns_new'], 'url' => 'admincp.php?action=insenz&operation=campaignlist&c_status=2'),
array('name' => $lang['menu_insenz_campaigns_accepted'], 'url' => 'admincp.php?action=insenz&operation=campaignlist&c_status=6'),
array('name' => $lang['menu_insenz_campaigns_finished'], 'url' => 'admincp.php?action=insenz&operation=campaignlist&c_status=7')));
$insenz['topicstatus'] && showmenu($lang['menu_insenz_virtualforum'], array(array('name' => $lang['menu_insenz_campaigns_new'], 'url' => 'admincp.php?action=insenz&operation=virtualforum&do=&c_status=2'),
array('name' => $lang['menu_insenz_campaigns_accepted'], 'url' => 'admincp.php?action=insenz&operation=virtualforum&do=&c_status=6'),
array('name' => $lang['menu_insenz_campaigns_finished'], 'url' => 'admincp.php?action=insenz&operation=virtualforum&do=&c_status=7')));
showmenu($lang['menu_insenz_tools'], array(array('name' => $lang['menu_insenz_tools_myinsenz'], 'url' => 'http://www.insenz.com/publishers/', 'target' => '_blank'),
array('name' => $lang['menu_insenz_tools_faq'], 'url' => 'http://www.insenz.com/publishers/faq/', 'target' => '_blank')));
echo '</div>';
echo '<table width="146" border="0" cellspacing="0" align="center" cellpadding="0" class="leftmenulist">'.
'<tr class="leftmenutext"><td><div style="margin-left:48px;"><a href="admincp.php?action=logout" target="_top">'.$lang['menu_logout'].'</a></td></tr>'.
'</table>';
} else {
//showmenu($lang['menu_home'], 'admincp.php?action=home');
$menuarray = array();
$menuarray[] = array('name' => $lang['menu_forums_rules'], 'url' => 'admincp.php?action=forumrules');
if($allowedituser || $allowbanuser || $allowbanip || $allowpostannounce || $allowcensorword || $allowmassprune) {
if($allowedituser) {
$menuarray[] = array('name' => $lang['menu_members_edit'], 'url' => 'admincp.php?action=editmember');
}
if($allowbanuser) {
$menuarray[] = array('name' => $lang['menu_members_edit_ban_user'], 'url' => 'admincp.php?action=banmember');
}
if($allowbanip) {
$menuarray[] = array('name' => $lang['menu_members_ipban'], 'url' => 'admincp.php?action=ipban');
}
if($allowpostannounce) {
$menuarray[] = array('name' => $lang['menu_misc_announces'], 'url' => 'admincp.php?action=announcements');
}
if($allowcensorword) {
$menuarray[] = array('name' => $lang['menu_posting_censors'], 'url' => 'admincp.php?action=censor');
}
if($allowmassprune) {
$menuarray[] = array('name' => $lang['menu_maint_prune'], 'url' => 'admincp.php?action=prune');
}
}
$menuarray[] = array('name' => $lang['menu_recommend'], 'url' => 'admincp.php?action=forumrecommend');
showmenu($lang['menu_moderation'], $menuarray);
unset($menuarray);
if($allowmoduser || $allowmodpost) {
$menuarray = array();
if($allowmoduser) {
$menuarray[] = array('name' => $lang['menu_moderate_modmembers'], 'url' => 'admincp.php?action=modmembers');
}
if($allowmodpost) {
$menuarray[] = array('name' => $lang['menu_moderate_modthreads'], 'url' => 'admincp.php?action=modthreads');
$menuarray[] = array('name' => $lang['menu_moderate_modreplies'], 'url' => 'admincp.php?action=modreplies');
}
showmenu($lang['menu_moderate'], $menuarray);
unset($menuarray);
}
showmenu($lang['menu_plugins'], array(array('name' => $lang['menu_plugins'], 'url' => 'admincp.php?action=plugins')));
if($allowviewlog) {
showmenu($lang['menu_logs'], array(array('name' => $lang['menu_logs_rating'], 'url' => 'admincp.php?action=ratelog'),
array('name' => $lang['menu_logs_mod'], 'url' => 'admincp.php?action=modslog'),
array('name' => $lang['menu_logs_ban'], 'url' => 'admincp.php?action=banlog')));
}
}
?>
</body>
</html> | zyyhong | trunk/jiaju001/bbs/admin/menu.inc.php | PHP | asf20 | 20,185 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: logs.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
$lpp = empty($lpp) ? 50 : $lpp;
if(!in_array($action, array('illegallog', 'ratelog', 'modslog', 'medalslog', 'banlog', 'cplog', 'errorlog', 'invitelog'))) {
cpmsg('undefined_action');
}
$file = $action;
$yearmonth = gmdate('Ym', $timestamp + $_DCACHE['settings']['timeoffset'] * 3600);
$logdir = DISCUZ_ROOT.'./forumdata/logs/';
$logfile = $logdir.$yearmonth.'_'.$file.'.php';
$logs = (array)@file($logfile);
$filesize = @filesize($logfile);
if($filesize < 500000) {
$dir = opendir($logdir);
$length = strlen($file);
$maxid = $id = 0;
while($entry = readdir($dir)) {
if(strexists($entry, $yearmonth.'_'.$file)) {
$id = intval(substr($entry, $length + 8));
$id > $maxid && $maxid = $id;
}
}
closedir($dir);
if($maxid) {
$filename2 = $logdir.$yearmonth.'_'.$file.'_'.$maxid.'.php';
} else {
$lastyearmonth = gmdate('Ym', $timestamp - 86400 * 28 + $_DCACHE['settings']['timeoffset'] * 3600);
$filename2 = $logdir.$lastyearmonth.'_'.$file.'.php';
}
if(file_exists($filename2) && $logs2 = @file($filename2)) {
$logs = array_merge($logs2, $logs);
}
}
$page = max(1, intval($page));
$start = ($page - 1) * $lpp;
$logs = array_reverse($logs);
if(empty($keyword)) {
$num = count($logs);
$multipage = multi($num, $lpp, $page, "admincp.php?action=$action&lpp=$lpp");
$logs = array_slice($logs, $start, $lpp);
} else {
foreach($logs as $key => $value) {
if(strpos($value, $keyword) === FALSE) {
unset($logs[$key]);
}
}
$multipage = '';
}
$lognames = array
(
'illegallog' => 'logs_passwd',
'ratelog' => 'logs_rating',
'modslog' => 'logs_moderate',
'medalslog' => 'logs_medal',
'banlog' => 'logs_banned',
'cplog' => 'logs_cp',
'errorlog' => 'logs_error',
'invitelog' => 'logs_invite'
);
shownav($lang[$lognames[$action]]);
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="3"><?=$lang[$lognames[$action]]?></td></tr>
<form method="post" action="admincp.php?action=<?=$action?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg2"><td width="25%"><?=$lang['logs_lpp']?></td>
<td width="55%"><input type="text" name="lpp" size="40" maxlength="40" value="<?=$lpp?>"></td>
<td width="20%"><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr>
</form>
<? if($action != 'invitelog') {?>
<form method="post" action="admincp.php?action=<?=$action?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg2"><td><?=$lang['logs_search']?></td><td><input type="text" name="keyword" size="40" value="<?=dhtmlspecialchars($keyword)?>"></td>
<td><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr>
</form>
<?
} else {
$inviteoperations = '';
foreach(array('1', '2', '3', '4') as $single) {
$inviteoperations .= '<input class="checkbox" type="checkbox" name="status[]" value="'.$single.'" '.(!empty($status) && is_array($status) && in_array($single, $status) ? 'checked' : '').'> '.$lang['invite_status_'.$single].' ';
}
?>
<form method="post" action="admincp.php?action=<?=$action?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg2"><td><?=$lang['action']?></td><td>
<?=$inviteoperations?>
</td>
<td><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr>
</form>
<?}?>
</table><br />
<?=$multipage?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<?
$usergroup = array();
if(in_array($action, array('ratelog', 'modslog', 'banlog', 'cplog'))) {
$query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups");
while($group = $db->fetch_array($query)) {
$usergroup[$group['groupid']] = $group['grouptitle'];
}
}
if($action == 'illegallog') {
echo "<tr class=\"header\">".
"<td>$lang[logs_passwd_username]</td>".
"<td>$lang[logs_passwd_password]</td>".
"<td>$lang[logs_passwd_security]</td>".
"<td>$lang[ip]</td>".
"<td>$lang[time]</td>".
"</tr>\n";
foreach($logs as $logrow) {
$log = explode("\t", $logrow);
if(empty($log[1])) {
continue;
}
$log[1] = gmdate('y-n-j H:i', $log[1] + $timeoffset * 3600);
if(strtolower($log[2]) == strtolower($discuz_userss)) {
$log[2] = "<b>$log[2]</b>";
}
$log[5] = $allowviewip ? $log[5] : '-';
echo "<tr align=\"center\"><td class=\"altbg1\">$log[2]</td>\n".
"<td class=\"altbg2\">$log[3]</td><td class=\"altbg1\">$log[4]</td>\n".
"<td class=\"altbg2\">$log[5]</td><td class=\"altbg1\">$log[1]</td></tr>\n";
}
} elseif($action == 'ratelog') {
echo "<tr class=\"header\">".
"<td width=\"13%\">$lang[username]</td>".
"<td width=\"12%\">$lang[usergroup]</td>".
"<td width=\"12%\">$lang[time]</td>".
"<td width=\"13%\">$lang[logs_rating_username]</td>".
"<td width=\"14%\">$lang[logs_rating_rating]</td>".
"<td width=\"23%\">$lang[subject]</td>".
"<td width=\"13%\">$lang[reason]</td>".
"</tr>\n";
foreach($logs as $logrow) {
$log = explode("\t", $logrow);
if(empty($log[1])) {
continue;
}
$log[1] = gmdate('y-n-j H:i', $log[1] + $timeoffset * 3600);
$log[2] = "<a href=\"space.php?action=viewpro&username=".rawurlencode($log[2])."\" target=\"_blank\">$log[2]</a>";
$log[3] = $usergroup[$log[3]];
if($log[4] == $discuz_userss) {
$log[4] = "<b>$log[4]</b>";
}
$log[4] = "<a href=\"space.php?action=viewpro&username=".rawurlencode($log[4])."\" target=\"_blank\">$log[4]</a>";
$log[6] = $extcredits[$log[5]]['title'].' '.($log[6] < 0 ? "<b>$log[6]</b>" : "+$log[6]").' '.$extcredits[$log[5]]['unit'];
$log[7] = $log[7] ? "<a href=\"./viewthread.php?tid=$log[7]\" target=\"_blank\" title=\"$log[8]\">".cutstr($log[8], 20)."</a>" : "<i>$lang[logs_rating_manual]</i>";
echo "<tr align=\"center\"><td class=\"altbg1\">$log[2]</a></td><td class=\"altbg2\">$log[3]</td>\n".
"<td class=\"altbg1\">$log[1]</td><td class=\"altbg2\">$log[4]</td>\n".
"<td class=\"altbg1\">".(trim($log[10]) == 'D' ? $lang['logs_rating_delete'] : '')."$log[6]</td><td class=\"altbg2\">$log[7]</td>\n".
"<td class=\"altbg1\">$log[9]</td></tr>\n";
}
} elseif($action == 'modslog') {
include language('modactions');
echo "<tr class=\"header\">".
"<td width=\"13%\">$lang[operator]</td>".
"<td width=\"10%\">$lang[usergroup]</td>".
"<td width=\"10%\">$lang[ip]</td>".
"<td width=\"16%\">$lang[time]</td>".
"<td width=\"12%\">$lang[forum]</td>".
"<td width=\"19%\">$lang[thread]</td>".
"<td width=\"10%\">$lang[action]</td>".
"<td width=\"10%\">$lang[reason]</td>".
"</tr>\n";
foreach($logs as $logrow) {
$log = explode("\t", $logrow);
if(empty($log[1])) {
continue;
}
$log[1] = gmdate('y-n-j H:i', $log[1] + $timeoffset * 3600);
$log[2] = stripslashes($log[2]);
$log[3] = $usergroup[$log[3]];
$log[4] = $allowviewip ? $log[4] : '-';
$log[6] = "<a href=\"./forumdisplay.php?fid=$log[5]\" target=\"_blank\">$log[6]</a>";
$log[8] = "<a href=\"./viewthread.php?tid=$log[7]\" target=\"_blank\" title=\"$log[8]\">".cutstr($log[8], 15)."</a>";
$log[9] = $modactioncode[trim($log[9])];
echo "<tr align=\"center\"><td class=\"altbg1\"><a href=\"space.php?action=viewpro&username=".rawurlencode($log[2])."\" target=\"_blank\">".($log[2] != $discuz_userss ? "<b>$log[2]</b>" : $log[2])."</td>\n".
"<td class=\"altbg2\">$log[3]</td><td class=\"altbg1\">$log[4]</td>\n".
"<td class=\"altbg2\">$log[1]</td><td class=\"altbg1\">$log[6]</td>\n".
"<td class=\"altbg2\">$log[8]</td><td class=\"altbg1\">$log[9]</td>\n".
"<td class=\"altbg2\">$log[10]</td></tr>\n";
}
} elseif($action == 'medalslog') {
$medalsarray = array();
$query = $db->query("SELECT * FROM {$tablepre}medals WHERE available>'0'");
while($medal = $db->fetch_array($query)) {
$medalsarray[$medal['medalid']] = "<img src=\"images/common/$medal[image]\" border=\"0\" align=\"absmiddle\"> $medal[name]";
}
echo "<tr class=\"header\">".
"<td width=\"13%\">$lang[operator]</td>".
"<td width=\"13%\">$lang[ip]</td>".
"<td width=\"13%\">$lang[time]</td>".
"<td width=\"13%\">$lang[username]</td>".
"<td width=\"7%\">$lang[action]</td>".
"<td width=\"18%\">$lang[logs_medal_name]</td>".
"<td width=\"23%\">$lang[reason]</td>".
"</tr>\n";
foreach($logs as $logrow) {
$log = explode("\t", $logrow);
if(empty($log[1])) {
continue;
}
$log[1] = gmdate('y-n-j H:i', $log[1] + $timeoffset * 3600);
$log[3] = $allowviewip ? $log[3] : '-';
$log[4] = "<a href=\"space.php?action=viewpro&username=".rawurlencode($log[4])."\" target=\"_blank\">$log[4]</a>";
$log[5] = isset($medalsarray[$log[5]]) ? $medalsarray[$log[5]] : $lang['members_edit_medals_unavailable'];
$log[6] = $lang['members_edit_medals_'.$log[6]];
echo "<tr align=\"center\"><td class=\"altbg1\"><a href=\"space.php?action=viewpro&username=".rawurlencode($log[2])."\" target=\"_blank\">".($log[2] != $discuz_userss ? "<b>$log[2]</b>" : $log[2])."</td>\n".
"<td class=\"altbg2\">$log[3]</td><td class=\"altbg1\">$log[1]</td>\n".
"<td class=\"altbg2\">$log[4]</td><td class=\"altbg1\">$log[6]</td>\n".
"<td class=\"altbg2\">$log[5]</td><td class=\"altbg2\">$log[7]</td></tr>\n";
}
} elseif($action == 'banlog') {
echo "<tr class=\"header\">".
"<td width=\"10%\">$lang[operator]</td>".
"<td width=\"10%\">$lang[usergroup]</td>".
"<td width=\"10%\">$lang[ip]</td>".
"<td width=\"10%\">$lang[time]</td>".
"<td width=\"10%\">$lang[username]</td>".
"<td width=\"5%\">$lang[operation]</td>".
"<td width=\"20%\">$lang[logs_banned_group]</td>".
"<td width=\"8%\">$lang[validity]</td>".
"<td width=\"17%\">$lang[reason]</td>".
"</tr>\n";
foreach($logs as $logrow) {
$log = explode("\t", $logrow);
if(empty($log[1])) {
continue;
}
$log[1] = gmdate('y-n-j H:i', $log[1] + $timeoffset * 3600);
$log[4] = $allowviewip ? $log[4] : '-';
$log[3] = $usergroup[$log[3]];
$log[8] = trim($log[8]) ? gmdate('y-n-j', $log[8] + $timeoffset * 3600) : '';
echo "<tr align=\"center\"><td class=\"altbg1\"><a href=\"space.php?action=viewpro&username=".rawurlencode($log[2])."\" target=\"_blank\">$log[2]</td>\n".
"<td class=\"altbg2\">$log[3]</td><td class=\"altbg1\">$log[4]</td>\n".
"<td class=\"altbg2\">$log[1]</td><td class=\"altbg1\"><a href=\"space.php?action=viewpro&username=".rawurlencode($log[5])."\" target=\"_blank\">$log[5]</a></td>\n".
"<td class=\"altbg2\">".(in_array($log[6], array(4, 5)) && !in_array($log[7], array(4, 5)) ? '<i>'.$lang['logs_banned_unban'].'</i>' : '<b>'.$lang['logs_banned_ban'].'</b>')."</td>".
"<td class=\"altbg1\">{$usergroup[$log[6]]} / {$usergroup[$log[7]]}</td><td class=\"altbg1\">$log[8]</td>\n".
"<td class=\"altbg1\">$log[9]</td></tr>\n";
}
} elseif($action == 'cplog') {
echo "<tr class=\"header\">".
"<td width=\"10%\">$lang[operator]</td>".
"<td width=\"10%\">$lang[usergroup]</td>".
"<td width=\"10%\">$lang[ip]</td>".
"<td width=\"18%\">$lang[time]</td>".
"<td width=\"15%\">$lang[action]</td>".
"<td width=\"37%\">$lang[other]</td>".
"</tr>\n";
foreach($logs as $logrow) {
$log = explode("\t", $logrow);
if(empty($log[1])) {
continue;
}
$log[1] = gmdate('y-n-j H:i', $log[1] + $timeoffset * 3600);
$log[2] = stripslashes($log[2]);
$log[3] = $usergroup[$log[3]];
$log[4] = $allowviewip ? $log[4] : '-';
$log[5] = $lang['cplog_action_'.rtrim($log[5])];
echo "<tr align=\"center\"><td class=\"altbg1\"><a href=\"space.php?action=viewpro&username=".rawurlencode($log[2])."\" target=\"_blank\">".($log[2] != $discuz_userss ? "<b>$log[2]</b>" : $log[2])."</a></td>\n".
"<td class=\"altbg2\">$log[3]</td><td class=\"altbg1\">$log[4]</td>\n".
"<td class=\"altbg2\">$log[1]</td><td class=\"altbg1\">$log[5]</td>\n".
"<td class=\"altbg2\">$log[6] </td></tr>\n";
}
} elseif($action == 'errorlog') {
echo "<tr class=\"header\">".
"<td width=\"8%\">$lang[type]</td>".
"<td width=\"15%\">$lang[username]</td>".
"<td width=\"15%\">$lang[time]</td>".
"<td width=\"62%\">$lang[message]</td>".
"</tr>\n";
foreach($logs as $logrow) {
$log = explode("\t", $logrow);
if(empty($log[1])) {
continue;
}
$log[1] = gmdate('y-n-j H:i', $log[1] + $timeoffset * 3600);
$tmp = explode('<br>', $log[3]);
$username = $tmp[0];
$ip = $tmp[1];
echo "<tr align=\"center\"><td class=\"altbg1\">$log[2]</td>\n".
"<td class=\"altbg2\"><a href=\"space.php?action=viewpro&username=".rawurlencode($username)."\" target=\"_blank\">$username</a><br />$ip</td><td class=\"altbg1\">$log[1]</td>\n".
"<td class=\"altbg2\">$log[4]</td></tr>\n";
}
} elseif($action == 'invitelog') {
if(!submitcheck('invitesubmit')) {
echo "<form method=\"post\" action=\"admincp.php?action=$action\"><input type=\"hidden\" name=\"formhash\" value=\"".FORMHASH."\">".
"<tr class=\"header\">".
"<td width=\"7%\"><input type=\"checkbox\" name=\"chkall\" class=\"checkbox\" onclick=\"checkall(this.form)\">$lang[del]</td>".
"<td width=\"8%\">$lang[logs_invite_buyer]</td>".
"<td width=\"15%\">$lang[logs_invite_buydate]</td>".
"<td width=\"15%\">$lang[logs_invite_expiration]</td>".
"<td width=\"12%\">$lang[logs_invite_ip]</td>".
"<td width=\"20%\">$lang[logs_invite_code]</td>".
"<td width=\"18%\">$lang[logs_invite_status]</td>".
"</tr>\n";
$tpp = $lpp ? intval($lpp) : $tpp;
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
$addstatus = '';
if($status && is_array($status)) {
foreach($status as $single) {
$statusurl .= '&status[]='.rawurlencode($single);
}
$addstatus = 'AND status IN ('.implodeids($status).')';
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}invites WHERE 1 $addstatus");
$invitecount = $db->result($query, 0);
$multipage = multi($invitecount, $tpp, $page, "admincp.php?action=invitelog&lpp=$lpp$statusurl");
$query = $db->query("SELECT i.*, m.username FROM {$tablepre}invites i, {$tablepre}members m
WHERE i.uid=m.uid $addstatus
ORDER BY i.dateline LIMIT $start_limit,$tpp");
while($invite = $db->fetch_array($query)) {
$invite['status'] = $lang['invite_status_'.$invite['status']];
echo "<tr class=\"altbg1\">".
"<td><input type=\"checkbox\" class=\"checkbox\" name=\"delete[]\" value=\"$invite[invitecode]\"></td>".
"<td>$invite[username]</td>".
"<td>".gmdate('Y-n-j H:i', $invite['dateline'] + $timeoffset * 3600)."</td>".
"<td>".gmdate('Y-n-j H:i', $invite['expiration'] + $timeoffset * 3600)."</td>".
"<td>$invite[inviteip]</td>".
"<td>$invite[invitecode]</td>".
"<td>$invite[status]</td>".
"</tr>\n";
}
} else {
if($deletelist = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}invites WHERE invitecode IN ($deletelist)");
}
header("Location: {$boardurl}admincp.php?action=invitelog");
}
}
?>
</table><?=$multipage?>
<?
if($action == 'invitelog') {
echo '<br/><center><input class="button" type="submit" name="invitesubmit" value="'.$lang['submit'].'"></form></center>';
}
?>
| zyyhong | trunk/jiaju001/bbs/admin/logs.inc.php | PHP | asf20 | 15,611 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: recyclebin.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
require_once DISCUZ_ROOT.'./include/post.func.php';
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
cpheader();
if(!submitcheck('rbsubmit')) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
$forumselect = '<select name="inforum"><option value=""> > '.$lang['select'].'</option>'.
'<option value=""> </option>'.forumselect().'</select>';
if($inforum) {
$forumselect = preg_replace("/(\<option value=\"$inforum\")(\>)/", "\\1 selected=\"selected\" \\2", $forumselect);
}
$authors = dhtmlspecialchars($authors);
$keywords = dhtmlspecialchars($keywords);
$admins = dhtmlspecialchars($admins);
$pstarttime = dhtmlspecialchars($pstarttime);
$pendtime = dhtmlspecialchars($pendtime);
$mstarttime = dhtmlspecialchars($mstarttime);
$mendtime = dhtmlspecialchars($mendtime);
shownav('menu_moderate_recyclebin');
?>
<script type="text/javascript" src="include/javascript/calendar.js"></script>
<form method="post" action="admincp.php?action=recyclebin">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="2"><?=$lang['recyclebin_search']?></td>
</tr>
<tr>
<td class="altbg1" width="45%"><?=$lang['recyclebin_search_forum']?></td>
<td class="altbg2" align="right"><?=$forumselect?></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['recyclebin_search_author']?></td>
<td class="altbg2" align="right"><input type="text" name="authors" size="40" value="<?=$authors?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['recyclebin_search_keyword']?></td>
<td class="altbg2" align="right"><input type="text" name="keywords" size="40" value="<?=$keywords?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['recyclebin_search_admin']?></td>
<td class="altbg2" align="right"><input type="text" name="admins" size="40" value="<?=$admins?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['recyclebin_search_post_time']?></td>
<td class="altbg2" align="right">
<input type="text" name="pstarttime" size="10" value="<?=$pstarttime?>" onclick="showcalendar(event, this)"> -
<input type="text" name="pendtime" size="10" value="<?=$pendtime?>" onclick="showcalendar(event, this)">
</td>
</tr>
<tr>
<td class="altbg1"><?=$lang['recyclebin_search_mod_time']?></td>
<td class="altbg2" align="right">
<input type="text" name="mstarttime" size="10" value="<?=$mstarttime?>" onclick="showcalendar(event, this)"> -
<input type="text" name="mendtime" size="10" value="<?=$mendtime?>" onclick="showcalendar(event, this)">
</td>
</tr>
</table><br />
<center><input class="button" type="submit" name="searchsubmit" value="<?=$lang['submit']?>"></center>
</form>
<br /><form method="post" action="admincp.php?action=recyclebin&prune=yes">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="2"><?=$lang['recyclebin_prune']?></td>
</tr>
<tr>
<td class="altbg1" width="45%"><?=$lang['recyclebin_prune_days']?></td>
<td class="altbg2" align="right"><input type="text" name="days" size="40" value="30"></td>
</tr>
</table><br />
<center><input class="button" type="submit" name="rbsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
$moderation = array('delete' => array(), 'undelete' => array(), 'ignore' => array());
if(empty($prune)) {
foreach($mod as $tid => $action) {
$moderation[$action][] = intval($tid);
}
} else {
$query = $db->query("SELECT tm.tid FROM {$tablepre}threadsmod tm, {$tablepre}threads t
WHERE tm.dateline<$timestamp-'$days'*86400 AND tm.action='DEL' AND t.tid=tm.tid AND t.displayorder='-1'");
while($thread = $db->fetch_array($query)) {
$moderation['delete'][] = $thread['tid'];
}
}
$threadsdel = $threadsundel = 0;
if($moderation['delete']) {
$deletetids = '\''.implode('\',\'', $moderation['delete']).'\'';
$query = $db->query("SELECT attachment, thumb, remote FROM {$tablepre}attachments WHERE tid IN ($deletetids)");
while($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
$db->query("DELETE FROM {$tablepre}posts WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}polloptions WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}polls WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}rewardlog WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}trades WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}attachments WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}threads WHERE tid IN ($deletetids)");
$threadsdel = $db->affected_rows();
}
if($moderation['undelete']) {
$undeletetids = '\''.implode('\',\'', $moderation['undelete']).'\'';
$tuidarray = $ruidarray = $fidarray = array();
$query = $db->query("SELECT fid, first, authorid FROM {$tablepre}posts WHERE tid IN ($undeletetids)");
while($post = $db->fetch_array($query)) {
if($post['first']) {
$tuidarray[] = $post['authorid'];
} else {
$ruidarray[] = $post['authorid'];
}
if(!in_array($post['fid'], $fidarray)) {
$fidarray[] = $post['fid'];
}
}
if($tuidarray) {
updatepostcredits('+', $tuidarray, $creditspolicy['post']);
}
if($ruidarray) {
updatepostcredits('+', $ruidarray, $creditspolicy['reply']);
}
$db->query("UPDATE {$tablepre}posts SET invisible='0' WHERE tid IN ($undeletetids)", 'UNBUFFERED');
$db->query("UPDATE {$tablepre}threads SET displayorder='0', moderated='1' WHERE tid IN ($undeletetids)");
$threadsundel = $db->affected_rows();
updatemodlog($undeletetids, 'UDL');
updatemodworks('UDL', $threadsundel);
foreach($fidarray as $fid) {
updateforumcount($fid);
}
}
cpmsg('recyclebin_succeed');
}
if(submitcheck('searchsubmit')) {
$sql = '';
$sql .= $inforum ? " AND t.fid='$inforum'" : '';
$sql .= $authors != '' ? " AND t.author IN ('".str_replace(',', '\',\'', str_replace(' ', '', $authors))."')" : '';
$sql .= $admins != '' ? " AND tm.username IN ('".str_replace(',', '\',\'', str_replace(' ', '', $admins))."')" : '';
$sql .= $pstarttime != '' ? " AND t.dateline>='".(strtotime($pstarttime) - $timeoffset * 3600)."'" : '';
$sql .= $pendtime != '' ? " AND t.dateline<'".(strtotime($pendtime) - $timeoffset * 3600)."'" : '';
$sql .= $mstarttime != '' ? " AND tm.dateline>='".(strtotime($mstarttime) - $timeoffset * 3600)."'" : '';
$sql .= $mendtime != '' ? " AND tm.dateline<'".(strtotime($mendtime) - $timeoffset * 3600)."'" : '';
if(trim($keywords)) {
$sqlkeywords = $or = '';
foreach(explode(',', str_replace(' ', '', $keywords)) as $keyword) {
$sqlkeywords .= " $or t.subject LIKE '%$keyword%'";
$or = 'OR';
}
$sql .= " AND ($sqlkeywords)";
}
$threads = '';
$query = $db->query("SELECT f.name AS forumname, f.allowsmilies, f.allowhtml, f.allowbbcode, f.allowimgcode,
t.tid, t.fid, t.authorid, t.author, t.subject, t.views, t.replies, t.dateline,
p.message, p.useip, p.attachment, p.htmlon, p.smileyoff, p.bbcodeoff,
tm.uid AS moduid, tm.username AS modusername, tm.dateline AS moddateline, tm.action AS modaction
FROM {$tablepre}threads t
LEFT JOIN {$tablepre}posts p ON p.tid=t.tid AND p.first='1'
LEFT JOIN {$tablepre}threadsmod tm ON tm.tid=t.tid
LEFT JOIN {$tablepre}forums f ON f.fid=t.fid
WHERE t.displayorder='-1' $sql
GROUP BY t.tid ORDER BY t.dateline DESC");
$threadcount = $db->num_rows($query);
while($thread = $db->fetch_array($query)) {
$thread['message'] = discuzcode($thread['message'], $thread['smileyoff'], $thread['bbcodeoff'], sprintf('%00b', $thread['htmlon']), $thread['allowsmilies'], $thread['allowbbcode'], $thread['allowimgcode'], $thread['allowhtml']);
$thread['moddateline'] = gmdate("$dateformat $timeformat", $thread['moddateline'] + $timeoffset * 3600);
$thread['dateline'] = gmdate("$dateformat\<\b\\r\>$timeformat", $thread['dateline'] + $timeoffset * 3600);
$thisbg = $thisbg == 'altbg2' ? 'altbg1' : 'altbg2';
$threads .= "<tr class=\"$thisbg\"><td rowspan=\"2\" valign=\"top\" width=\"15%\" height=\"100%\">\n".
"<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" height=\"100%\">\n".
"<tr><td valign=\"top\" style=\"border:none\"><a href=\"space.php?action=viewpro&uid=$thread[authorid]\" target=\"_blank\"><b>$thread[author]</b></td></tr><tr><td style=\"border:none\">\n".
"<input class=\"radio\" type=\"radio\" name=\"mod[$thread[tid]]\" value=\"delete\" checked>$lang[delete]<br />\n".
"<input class=\"radio\" type=\"radio\" name=\"mod[$thread[tid]]\" value=\"undelete\">$lang[undelete]<br />\n".
"<input class=\"radio\" type=\"radio\" name=\"mod[$thread[tid]]\" value=\"ignore\">$lang[ignore]<br /><br />\n".
"$lang[threads_replies]: $thread[replies]<br />$lang[threads_views]: $thread[views]<br /><br />$thread[dateline]</td>\n".
"</tr></table></td><td style=\"border:none\"><a href=\"forumdisplay.php?fid=$thread[fid]\" target=\"_blank\">$thread[forumname]</a> <b>»</b>\n".
"<b>$thread[subject]</b></td></tr><tr class=\"$thisbg\"><td>".
"<div style=\"border-style: dotted; border-width: 1px; border-color: ".BORDERCOLOR."; padding: 5px; overflow: auto; overflow-y: scroll; width: 95%; height:150px\">".
"<div align=\"right\" style=\"width: 97%\">\n".
"$lang[operator]: <a href=\"space.php?action=viewpro&uid=$thread[moduid]\" target=\"_blank\">$thread[modusername]</a> \n".
"$lang[recyclebin_delete_time]: $thread[moddateline]</div>$thread[message]";
if($thread['attachment']) {
require_once DISCUZ_ROOT.'./include/attachment.func.php';
$queryattach = $db->query("SELECT aid, filename, filetype, filesize FROM {$tablepre}attachments WHERE tid='$thread[tid]'");
while($attach = $db->fetch_array($queryattach)) {
$threads .= "<br /><br />$lang[attachment]: ".attachtype(fileext($thread['filename'])."\t".$attach['filetype']).
" $attach[filename] (".sizecount($attach['filesize']).")";
}
}
$threads .= "</div></td></tr>\n";
}
?>
<br /><form method="post" action="admincp.php?action=recyclebin">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['recyclebin_result']?> <?=$threadcount?></td></tr>
<tr><td colspan="2" class="category">
<input class="button" type="button" value="<?=$lang['recyclebin_all_delete']?>" onclick="checkalloption(this.form, 'delete')">
<input class="button" type="button" value="<?=$lang['recyclebin_all_undelete']?>" onclick="checkalloption(this.form, 'undelete')">
<input class="button" type="button" value="<?=$lang['recyclebin_all_ignore']?>" onclick="checkalloption(this.form, 'ignore')"></td></tr>
<?=$threads?>
</table><br /><center><input class="button" type="submit" name="rbsubmit" value="<?=$lang['submit']?>"></center></form>
<?
}
?> | zyyhong | trunk/jiaju001/bbs/admin/recyclebin.inc.php | PHP | asf20 | 11,600 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: smilies.inc.php 10283 2007-08-25 06:48:46Z monkey $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
if($action == 'smilies' && $export) {
$query = $db->query("SELECT name, directory FROM {$tablepre}imagetypes WHERE typeid='$export' AND type='smiley'");
if(!$smileyarray = $db->fetch_array($query)) {
cpheader();
cpmsg('smilies_export_invalid');
}
$smileyarray['smilies'] = array();
$query = $db->query("SELECT typeid, displayorder, code, url FROM {$tablepre}smilies WHERE type='smiley' AND typeid='$export'");
while($smiley = $db->fetch_array($query)) {
$smileyarray['smilies'][] = $smiley;
}
$smileyarray['version'] = strip_tags($version);
$time = gmdate("$dateformat $timeformat", $timestamp + $timeoffset * 3600);
$smiley_export = "# Discuz! Smilies Dump\n".
"# Version: Discuz! $version\n".
"# Time: $time\n".
"# From: $bbname ($boardurl)\n".
"#\n".
"# This file was BASE64 encoded\n".
"#\n".
"# Discuz! Community: http://www.Discuz.net\n".
"# Please visit our website for latest news about Discuz!\n".
"# --------------------------------------------------------\n\n\n".
wordwrap(base64_encode(serialize($smileyarray)), 50, "\n", 1);
ob_end_clean();
dheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
dheader('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
dheader('Cache-Control: no-cache, must-revalidate');
dheader('Pragma: no-cache');
dheader('Content-Encoding: none');
dheader('Content-Length: '.strlen($smiley_export));
dheader('Content-Disposition: attachment; filename=discuz_smilies_'.$smileyarray['name'].'.txt');
dheader('Content-Type: '.(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? 'application/octetstream' : 'application/octet-stream'));
echo $smiley_export;
dexit();
}
cpheader();
if($action == 'smilies' && !$export) {
if(!submitcheck('smiliessubmit') && !submitcheck('importsubmit') && !$edit && !$export) {
$smileyselect = $smileydirs = '';
$dirfilter = array();
$query = $db->query("SELECT * FROM {$tablepre}imagetypes WHERE type='smiley' ORDER BY displayorder");
while($type = $db->fetch_array($query)) {
$squery = $db->query("SELECT COUNT(*) FROM {$tablepre}smilies WHERE typeid='$type[typeid]'");
$smiliesnum = $db->result($squery, 0);
$smileyselect .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$type[typeid]\" ".($smiliesnum ? 'disabled' : '')."></td>\n".
"<td class=\"altbg2\"><input type=\"text\" name=\"namenew[$type[typeid]]\" value=\"$type[name]\" size=\"15\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" name=\"displayordernew[$type[typeid]]\" value=\"$type[displayorder]\" size=\"2\"></td>\n".
"<td class=\"altbg2\">./images/smilies/$type[directory]</td>\n".
"<td class=\"altbg1\">$smiliesnum</td>\n".
"<td class=\"altbg2\"><a href=\"admincp.php?action=smilies&export=$type[typeid]\">[$lang[download]]</a></td>\n".
"<td class=\"altbg1\"><a href=\"admincp.php?action=smilies&edit=$type[typeid]\">[$lang[detail]]</a></td></tr>\n";
$dirfilter[] = $type['directory'];
}
$smdir = DISCUZ_ROOT.'./images/smilies';
$smiliesdir = dir($smdir);
$dirnum = 0;
while($entry = $smiliesdir->read()) {
if($entry != '.' && $entry != '..' && !in_array($entry, $dirfilter) && preg_match("/^\w+$/", $entry) && strlen($entry) < 30 && is_dir($smdir.'/'.$entry)){
$smileydirs .= '<tr><td class="altbg1">'.($dirnum ? ' ' : $lang['add_new']).'</td><td class="altbg2"><input type="text" name="newname[]" size="15"></td><td class="altbg1"><input type="text" name="newdisplayorder[]" size="2"></td><td class="altbg2">./images/smilies/'.$entry.'<input type="hidden" name="newdirectory[]" value="'.$entry.'"></td><td colspan="3"> </td></tr>';
$dirnum++;
}
}
$smileydirs = $smileydirs ? $smileydirs : '<tr><td class="altbg1">'.$lang['add_new'].'</td><td class="altbg2" colspan="6">'.$lang['smiliesupload_tips'].'</td></tr>';
shownav('smilies_edit');
showtips('smileytypes_tips');
?>
<form method="post" action="admincp.php?action=smilies">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td width="48"><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['smilies_type']?></td><td><?=$lang['display_order']?></td><td><?=$lang['templates_directory']?></td><td><?=$lang['smilies_nums']?></td><td><?=$lang['export']?></td><td><?=$lang['edit']?></td></tr>
<?=$smileyselect?>
<?=$smileydirs?>
</table><br />
<center><input class="button" type="submit" name="smiliessubmit" value="<?=$lang['submit']?>"></center></form><br />
<form method="post" action="admincp.php?action=smilies">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['smilies_import']?></td></tr>
<tr><td class="altbg1"><div align="center"><textarea name="smiliesdata" cols="80" rows="8"></textarea><br /></div></td></tr>
</table><br /><center><input class="button" type="submit" name="importsubmit" value="<?=$lang['submit']?>"></center></form>
<?
} elseif(submitcheck('smiliessubmit')) {
if(is_array($namenew)) {
foreach($namenew as $id => $val) {
$db->query("UPDATE {$tablepre}imagetypes SET name='$val', displayorder='$displayordernew[$id]' WHERE typeid='$id'");
}
}
if($ids = implodeids($delete)) {
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}smilies WHERE type='smiley' AND typeid IN ($ids)");
if($db->result($query, 0)) {
cpmsg('smilies_delete_invalid');
}
$db->query("DELETE FROM {$tablepre}imagetypes WHERE typeid IN ($ids)");
}
if(is_array($newname)) {
foreach($newname AS $key => $val) {
$smurl = './images/smilies/'.$newdiredctory[$key];
if(!is_dir(DISCUZ_ROOT.$smurl)) {
cpmsg('smilies_directory_invalid');
}
$db->query("INSERT INTO {$tablepre}imagetypes (name, type, displayorder, directory) VALUES ('$val', 'smiley', '$newdisplayorder[$key]', '$newdirectory[$key]')");
}
}
updatecache('smileytypes');
cpmsg('smilies_edit_succeed', 'admincp.php?action=smilies');
} elseif(submitcheck('importsubmit')) {
$smiliesdata = preg_replace("/(#.*\s+)*/", '', $smiliesdata);
$smileyarray = daddslashes(unserialize(base64_decode($smiliesdata)), 1);
if(!is_array($smileyarray) || !is_array($smileyarray['smilies'])) {
cpmsg('smilies_import_data_invalid');
}
$renamed = 0;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}imagetypes WHERE type='smiley' AND name='$smileyarray[name]'");
if($db->result($query, 0)) {
$smileyarray['name'] .= '_'.random(4);
$renamed = 1;
}
$db->query("INSERT INTO {$tablepre}imagetypes (name, type, directory)
VALUES ('$smileyarray[name]', 'smiley', '$smileyarray[directory]')");
$typeid = $db->insert_id();
foreach($smileyarray['smilies'] AS $key => $smiley) {
$substitute = @htmlspecialchars($substitute);
$db->query("INSERT INTO {$tablepre}smilies (type, typeid, displayorder, code, url)
VALUES ('smiley', '$typeid', '$smiley[displayorder]', '$smiley[code]', '$smiley[url]')");
}
updatecache(array('smileytypes', 'smilies', 'smilies_display'));
cpmsg($renamed ? 'smilies_import_succeed_renamed' : 'smilies_import_succeed', 'admincp.php?action=smilies');
} elseif($edit) {
if(!submitcheck('editsubmit')) {
$smiliesperpage = 10;
$page = max(1, intval($page));
$start_limit = ($page - 1) * $smiliesperpage;
$query = $db->query("SELECT typeid, name, directory FROM {$tablepre}imagetypes WHERE typeid='$edit' AND type='smiley'");
$type = $db->fetch_array($query);
$smurl = './images/smilies/'.$type['directory'];
$smdir = DISCUZ_ROOT.$smurl;
if(!is_dir($smdir)) {
cpmsg('smilies_directory_invalid');
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}smilies WHERE type='smiley' AND typeid='$edit'");
$num = $db->result($query, 0);
$multipage = multi($num, $smiliesperpage, $page, 'admincp.php?action=smilies&edit='.$edit);
$smileynum = 1;
$smilies = '';
$query = $db->query("SELECT * FROM {$tablepre}smilies WHERE type='smiley' AND typeid='$edit' ORDER BY displayorder LIMIT $start_limit, $smiliesperpage");
while($smiley = $db->fetch_array($query)) {
$smilies .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$smiley[id]\"></td>\n".
"<td class=\"altbg2\">$smiley[id]</td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"2\" name=\"displayorder[$smiley[id]]\" value=\"$smiley[displayorder]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"25\" name=\"code[$smiley[id]]\" value=\"".dhtmlspecialchars($smiley['code'])."\" id=\"code_$smileynum\" smileyid=\"$smiley[id]\"></td>\n".
"<td class=\"altbg1\"><input type=\"hidden\" value=\"$smiley[url]\" id=\"url_$smileynum\">$smiley[url]</td>\n".
"<td class=\"altbg2\"><img src=\"$smurl/$smiley[url]\" border=\"0\" onload=\"if(this.height>30) {this.resized=true; this.height=30; this.title='$lang[image_newwindow]';}\" onmouseover=\"if(this.resized) this.style.cursor='pointer';\" onclick=\"if(!this.resized) {return false;} else {window.open(this.src);}\"></td></tr>\n";
$imgfilter[] = $smiley[url];
$smileynum ++;
}
if($search) {
$newid = 1;
$newimages = '';
$imgextarray = array('jpg', 'gif');
$imgfilter = array();
$query = $db->query("SELECT url FROM {$tablepre}smilies WHERE type='smiley' AND typeid='$edit'");
while($img = $db->fetch_array($query)) {
$imgfilter[] = $img[url];
}
$smiliesdir = dir($smdir);
while($entry = $smiliesdir->read()) {
if(in_array(strtolower(fileext($entry)), $imgextarray) && !in_array($entry, $imgfilter) && preg_match("/^[\w\-\.\[\]\(\)\<\> &]+$/", substr($entry, 0, strrpos($entry, '.'))) && strlen($entry) < 30 && is_file($smdir.'/'.$entry)) {
$newimages .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"add[$newid]\" value=\"\" checked=\"checked\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"2\" name=\"adddisplayorder[$newid]\" value=\"0\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"25\" name=\"addcode[$newid]\" value=\"\" id=\"addcode_$newid\" smileyid=\"$smiley[id]\"></td>\n".
"<td class=\"altbg2\"><input type=\"hidden\" size=\"25\" name=\"addurl[$newid]\" value=\"$entry\" id=\"addurl_$newid\">$entry</td>\n".
"<td class=\"altbg1\"><img src=\"$smurl/$entry\" border=\"0\" onload=\"if(this.height>30) {this.resized=true; this.height=30; this.title='$lang[image_newwindow]';}\" onmouseover=\"if(this.resized) this.style.cursor='pointer';\" onclick=\"if(!this.resized) {return false;} else {window.open(this.src);}\"></td></tr>\n";
$newid ++;
}
}
$smiliesdir->close();
ajaxshowheader();
if($newimages) {
?>
<form method="post" action="admincp.php?action=smilies&edit=<?=$edit?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="6" align="left"><?=$lang['smilies_add']?></td></tr>
<tr align="center" class="category">
<td width="50"><input type="checkbox" name="chkall" onclick="checkall(this.form, 'add')" class="checkbox" checked="checked"><?=$lang['enabled']?></td>
<td><?=$lang['display_order']?></td>
<td><?=$lang['smilies_edit_code']?></td><td><?=$lang['smilies_edit_filename']?></td><td><?=$lang['smilies_edit_image']?></td></tr>
<?=$newimages?>
<tr><td colspan="5"><?=$lang['smilies_edit_add_code']?> <input type="text" size="2" value="<?=$lang['smilies_prefix']?>" id="addprefix" onclick="clearinput(this, '<?=$lang['smilies_prefix']?>')" style="vertical-align: middle"> + <select id="addmiddle" style="vertical-align: middle"><option value="1"><?=$lang['smilies_edit_order_file']?></option><option value="2"><?=$lang['smilies_edit_order_radom']?></option></select> + <input type="text" size="2" value="<?=$lang['smilies_suffix']?>" id="addsuffix" onclick="clearinput(this, '<?=$lang['smilies_suffix']?>')" style="vertical-align: middle"> <button type="button" onclick="addsmileycodes('<?=$newid?>', 'add');" style="vertical-align: middle"><?=$lang['apply']?></button></td></tr>
</table><br />
<center><input class="button" type="submit" name="editsubmit" value="<?=$lang['submit']?>"> <input class="button" type="button" value="<?=$lang['smilies_research']?>" onclick="ajaxget('admincp.php?action=smilies&edit=<?=$edit?>&search=yes', 'addsmilies', 'addsmilies', 'auto');doane(event);"></center></form>
<?
} else {
eval("\$lang[smilies_edit_add_tips] = \"".$lang['smilies_edit_add_tips']."\";");
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder"><tr class="header"><td align="left">'.$lang['smilies_add'].'</td></tr><tr><td class="altbg1">'.$lang['smilies_edit_add_tips'].'</td></tr></table><center><input class="button" type="button" value="'.$lang['smilies_research'].'" onclick="ajaxget(\'admincp.php?action=smilies&edit='.$edit.'&search=yes\', \'addsmilies\', \'addsmilies\', \'auto\');doane(event);"></center>';
}
ajaxshowfooter();
exit;
}
shownav('menu_posting_smilies');
showtips('smilies_tips');
?>
<form method="post" action="admincp.php?action=smilies&edit=<?=$edit?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="6" align="left"><?=$lang['smilies_edit']?> - <?=$type[name]?></td></tr>
<tr align="center" class="category">
<td width="50"><input type="checkbox" name="chkall" onclick="checkall(this.form, 'delete')" class="checkbox"><?=$lang['del']?></td><td><?=$lang['smilies_id']?></td><td><?=$lang['display_order']?></td>
<td><?=$lang['smilies_edit_code']?></td><td><?=$lang['smilies_edit_filename']?></td><td><?=$lang['smilies_edit_image']?></td></tr>
<?=$smilies?>
<tr><td colspan="6"><?=$lang['smilies_edit_add_code']?> <input type="text" size="2" value="<?=$lang['smilies_prefix']?>" id="prefix" onclick="clearinput(this, '<?=$lang['smilies_prefix']?>')" style="vertical-align: middle"> + <select id="middle" style="vertical-align: middle"><option value="1"><?=$lang['smilies_edit_order_file']?></option><option value="2"><?=$lang['smilies_edit_order_radom']?></option><option value="3"><?=$lang['smilies_id']?></option></select> + <input type="text" size="2" value="<?=$lang['smilies_suffix']?>" id="suffix" onclick="clearinput(this, '<?=$lang['smilies_suffix']?>')" style="vertical-align: middle"> <button type="button" onclick="addsmileycodes('<?=$smileynum?>', '');" style="vertical-align: middle"><?=$lang['apply']?></button></td></tr>
</table>
<?=$multipage?>
<center><input class="button" type="submit" name="editsubmit" value="<?=$lang['submit']?>"> <input class="button" type="button" value="<?=$lang['return']?>" onclick="window.location='admincp.php?action=smilies'"></center></form>
<br />
<div id="addsmilies">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2" align="left"><?=$lang['smilies_add']?></td></tr>
<tr><td class="altbg1"><b><?=$lang['smilies_type']?>:</b></td><td class="altbg2"><?=$type[name]?></td></tr>
<tr><td class="altbg1"><b><?=$lang['templates_directory']?>:</b><br><span class="smalltxt"><?=$lang['smilies_add_search']?></span></td><td class="altbg2"><?=$smurl?></td></tr>
</table>
<center><input class="button" type="button" value="<?=$lang['search']?>" onclick="ajaxget('admincp.php?action=smilies&edit=<?=$edit?>&search=yes', 'addsmilies', 'addsmilies', 'auto');doane(event);"></center></div>
<script type="text/javascript">
function addsmileycodes(smiliesnum, pre) {
smiliesnum = parseInt(smiliesnum);
if(smiliesnum > 1) {
for(var i = 1; i < smiliesnum; i++) {
var prefix = trim($(pre + 'prefix').value);
var suffix = trim($(pre + 'suffix').value);
var page = parseInt('<?=$page?>');
var middle = $(pre + 'middle').value == 1 ? $(pre + 'url_' + i).value.substr(0,$(pre + 'url_' + i).value.lastIndexOf('.')) : ($(pre + 'middle').value == 2 ? i + page * 10 : $(pre + 'code_' + i).attributes['smileyid'].nodeValue);
if(!prefix || prefix == '<?=$lang['smilies_prefix']?>') {
alert('<?=$lang[smilies_prefix_tips]?>');
return;
}
suffix = !suffix || suffix == '<?=$lang['smilies_suffix']?>' ? '' : suffix;
$(pre + 'code_' + i).value = prefix + middle + suffix;
}
}
}
function clearinput(obj, defaultval) {
if(obj.value == defaultval) {
obj.value = '';
}
}
</script>
<?
} else {
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}smilies WHERE id IN ($ids)");
}
if(is_array($displayorder)) {
foreach($displayorder AS $id => $val) {
$displayorder[$id] = intval($displayorder[$id]);
$code[$id] = trim($code[$id]);
if(empty($code[$id])) {
$db->query("DELETE FROM {$tablepre}smilies WHERE id='$id'");
} else {
$db->query("UPDATE {$tablepre}smilies SET displayorder='$displayorder[$id]', code='$code[$id]' WHERE id='$id'");
}
}
}
if(is_array($add)) {
foreach($add AS $k => $v) {
$addcode[$k] = trim($addcode[$k]);
if($addcode[$k] != '') {
$db->query("INSERT INTO {$tablepre}smilies (type, displayorder, typeid, code, url)
VALUES ('smiley', '{$adddisplayorder[$k]}', '$edit', '$addcode[$k]', '$addurl[$k]')");
}
}
}
updatecache(array('smilies', 'smilies_display'));
cpmsg('smilies_edit_succeed', "admincp.php?action=smilies&edit=$edit");
}
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/smilies.inc.php | PHP | asf20 | 18,386 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: advertisements.inc.php 10200 2007-08-24 09:52:53Z liuqiang $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
cpheader();
if($action == 'adv') {
if(!submitcheck('advsubmit')) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
$advs = $conditions = '';
$order_by = 'displayorder, advid DESC, targets DESC';
$page = max(1, intval($page));
$start_limit = ($page - 1) * 15;
if(submitcheck('searchsubmit')) {
$conditions .= $title ? " AND title LIKE '%$title%'" : '';
$conditions .= $type ? " AND type='$type'" : '';
$conditions .= $starttime ? " AND starttime>='".($timestamp - $starttime)."'" : '';
$order_by = $orderby == 'starttime' ? 'starttime' : ($orderby == 'type' ? 'type' : ($orderby == 'displayorder' ? 'displayorder' : 'advid DESC'));
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}advertisements WHERE 1 $conditions");
$advnum = $db->result($query, 0);
$query = $db->query("SELECT * FROM {$tablepre}advertisements WHERE 1 $conditions ORDER BY $order_by LIMIT $start_limit, 15");
while($adv = $db->fetch_array($query)) {
$adv['type'] = $lang['advertisements_type_'.$adv['type']];
if($adv['targets'] == '' || $adv['targets'] == 'forum') {
$adv['targets'] = $lang['all'];
} else {
$targetsarray = array();
foreach(explode("\t", $adv['targets']) as $target) {
$targetsarray[] = $target == 'register' ? '<a href="'.$regname.'" target="_blank">'.$lang['advertisements_register'].'</a>' :
($target == 'redirect' ? $lang['advertisements_jump'] :
($target == 'archiver' ? '<a href="archiver/" target="_blank">Archiver</a>' :
($target ? '<a href="forumdisplay.php?fid='.$target.'" target="_blank">'.$_DCACHE['forums'][$target]['name'].'</a>' : '<a href="'.$indexname.'" target="_blank">'.$lang['home'].'</a>')));
}
$adv['targets'] = implode(', ', $targetsarray);
}
$adv['parameters'] = unserialize($adv['parameters']);
$advs .= "<tr align=\"center\" ".($adv['endtime'] && $adv['endtime'] <= $timestamp ? 'style="text-decoration: line-through"' : '')."><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$adv[advid]\"></td>".
"<td class=\"altbg2\"><input class=\"checkbox\" type=\"checkbox\" name=\"availablenew[$adv[advid]]\" value=\"1\" ".($adv['available'] ? 'checked' : '')."></td>".
"<td class=\"altbg1\"><input type=\"text\" size=\"2\" name=\"displayordernew[$adv[advid]]\" value=\"$adv[displayorder]\"></td>".
"<td class=\"altbg2\"><input type=\"text\" size=\"15\" name=\"titlenew[$adv[advid]]\" value=\"".dhtmlspecialchars($adv['title'])."\"></td>".
"<td class=\"altbg1\">$adv[type]</td>".
"<td class=\"altbg2\">".$lang['advertisements_style_'.$adv['parameters']['style']]."</td>".
"<td class=\"altbg1\">".($adv['starttime'] ? gmdate($dateformat, $adv['starttime'] + $_DCACHE['settings']['timeoffset'] * 3600) : $lang['unlimited'])."</td>".
"<td class=\"altbg2\">".($adv['endtime'] ? gmdate($dateformat, $adv['endtime'] + $_DCACHE['settings']['timeoffset'] * 3600) : $lang['unlimited'])."</td>".
"<td class=\"altbg1\">$adv[targets]</td>".
"<td class=\"altbg2\"><a href=\"admincp.php?action=advedit&advid=$adv[advid]\">[$lang[detail]]</a></td></tr>";
}
$multipage = multi($advnum, 15, $page, "admincp.php?action=adv");
shownav('menu_misc_advertisements');
$starttimecheck = array($starttime => 'selected="selected"');
$typecheck = array($type => 'selected="selected"');
$orderbycheck = array($orderby => 'selected="selected"');
$title = isset($title) ? $title : $lang['advertisement_inputtitle'];
?>
<form method="post" action="admincp.php?action=advadd">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['advertisements_add']?></td></tr>
<tr><td class="category">
<?=$lang['advertisements_edit_title']?> <input style="vertical-align: middle" type="text" name="title" value="" size="25" maxlength="50"> <?=$lang['advertisements_edit_style']?> <select style="vertical-align: middle" name="style"><option value="code" <?=$styleselect['code']?>> <?=$lang['advertisements_style_code']?></option><option value="text" <?=$styleselect['text']?>> <?=$lang['advertisements_style_text']?></option><option value="image" <?=$styleselect['image']?>> <?=$lang['advertisements_style_image']?></option><option value="flash" <?=$styleselect['flash']?>> <?=$lang['advertisements_style_flash']?></option></select>
<select onchange="if(this.options[this.selectedIndex].value) {this.form.submit()}" style="vertical-align: middle" name="type"><option value=""> <?=$lang['advertisements_type']?></option><option value="headerbanner"> <?=$lang['advertisements_type_headerbanner']?></option><option value="footerbanner"> <?=$lang['advertisements_type_footerbanner']?></option><option value="text"> <?=$lang['advertisements_type_text']?></option><option value="thread"> <?=$lang['advertisements_type_thread']?></option><option value="interthread"> <?=$lang['advertisements_type_interthread']?></option><option value="float"> <?=$lang['advertisements_type_float']?></option><option value="couplebanner"> <?=$lang['advertisements_type_couplebanner']?></option><option value="intercat"> <?=$lang['advertisements_type_intercat']?></option></select>
</td></tr></table><br />
</form>
<form method="post" action="admincp.php?action=adv" onsubmit="if(this.title.value=='<?=$lang[advertisement_inputtitle]?>') this.title.value=''">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td><?=$multipage?></td>
<td style="text-align: right;"><input style="vertical-align: middle" type="text" name="title" value="<?=$title?>" size="15" onclick="this.value=''">
<select style="vertical-align: middle" name="starttime"><option value=""> <?=$lang['start_time']?></option><option value="0" <?=$starttimecheck['0']?>> <?=$lang['all']?></option><option value="86400" <?=$starttimecheck['86400']?>> <?=$lang['1_day']?></option><option value="604800" <?=$starttimecheck['604800']?>> <?=$lang['7_day']?></option><option value="2592000" <?=$starttimecheck['2592000']?>> <?=$lang['30_day']?></option><option value="7776000" <?=$starttimecheck['7776000']?>> <?=$lang['90_day']?></option><option value="15552000" <?=$starttimecheck['15552000']?>> <?=$lang['180_day']?></option><option value="31536000" <?=$starttimecheck['31536000']?>> <?=$lang['365_day']?></option></select>
<select style="vertical-align: middle" name="type"><option value=""> <?=$lang['advertisements_type']?></option><option value="0" <?=$typecheck['0']?>> <?=$lang['all']?></option><option value="headerbanner" <?=$typecheck['headerbanner']?>> <?=$lang['advertisements_type_headerbanner']?></option><option value="footerbanner" <?=$typecheck['footerbanner']?>> <?=$lang['advertisements_type_footerbanner']?></option><option value="text" <?=$typecheck['text']?>> <?=$lang['advertisements_type_text']?></option><option value="thread" <?=$typecheck['thread']?>> <?=$lang['advertisements_type_thread']?></option><option value="interthread" <?=$typecheck['interthread']?>> <?=$lang['advertisements_type_interthread']?></option><option value="float" <?=$typecheck['float']?>> <?=$lang['advertisements_type_float']?></option><option value="couplebanner" <?=$typecheck['couplebanner']?>> <?=$lang['advertisements_type_couplebanner']?></option><option value="intercat" <?=$typecheck['intercat']?>> <?=$lang['advertisements_type_intercat']?></option></select>
<select style="vertical-align: middle" name="orderby"><option value=""> <?=$lang[advertisement_orderby]?></option><option value="starttime" <?=$orderbycheck['starttime']?>> <?=$lang[advertisement_addtime]?></option><option value="type" <?=$orderbycheck['type']?>> <?=$lang['advertisements_type']?></option><option value="displayorder" <?=$orderbycheck['displayorder']?>> <?=$lang['display_order']?></option></select> <input class="button" type="submit" name="searchsubmit" value="<?=$lang[search]?>" style="vertical-align: middle">
</td>
</tr></table></form>
<form method="post" action="admincp.php?action=adv">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td width="3%" nowrap><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form,'delete')"><?=$lang['del']?></td>
<td width="5%" nowrap><?=$lang['available']?></td>
<td width="8%" nowrap><?=$lang['display_order']?></td>
<td width="15%" nowrap><?=$lang['subject']?></td>
<td width="12%" nowrap><?=$lang['type']?></td>
<td width="5%" nowrap><?=$lang['advertisements_style']?></td>
<td width="10%" nowrap><?=$lang['start_time']?></td>
<td width="10%" nowrap><?=$lang['end_time']?></td>
<td width="20%" nowrap><?=$lang['advertisements_targets']?></td>
<td width="6%" nowrap><?=$lang['edit']?></td></tr>
<?=$advs?>
</table>
<?=$multipage?>
<br /><center><input class="button" type="submit" name="advsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
if($advids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}advertisements WHERE advid IN ($advids)");
}
if(is_array($titlenew)) {
foreach($titlenew as $advid => $title) {
$db->query("UPDATE {$tablepre}advertisements SET available='$availablenew[$advid]', displayorder='$displayordernew[$advid]', title='".cutstr($titlenew[$advid], 50)."' WHERE advid='$advid'", 'UNBUFFERED');
}
}
updatecache(array('settings', 'advs_archiver', 'advs_register', 'advs_index', 'advs_forumdisplay', 'advs_viewthread'));
cpmsg('advertisements_update_succeed', 'admincp.php?action=adv');
}
} elseif($action == 'advadd' && in_array($type, array('headerbanner', 'footerbanner', 'text', 'thread', 'interthread', 'float', 'couplebanner', 'intercat')) || ($action == 'advedit' && $advid)) {
if(!submitcheck('advsubmit')) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
shownav('menu_misc_advertisements');
if($action == 'advedit') {
$query = $db->query("SELECT * FROM {$tablepre}advertisements WHERE advid='$advid'");
if(!$adv = $db->fetch_array($query)) {
cpmsg('undefined_action');
}
$adv['parameters'] = unserialize($adv['parameters']);
if(in_array($adv['type'], array('footerbanner', 'thread'))) {
$adv['parameters']['position'] = isset($adv['parameters']['position']) && in_array($adv['parameters']['position'], array(2, 3)) ? $adv['parameters']['position'] : 1;
$positionchecked = array($adv['parameters']['position'] => 'checked');
if($adv['type'] == 'thread') {
$dispchecked = array();
foreach((isset($adv['parameters']['displayorder']) ? explode("\t", $adv['parameters']['displayorder']) : array('0')) AS $postcount) {
$dispchecked[$postcount] = ' selected="selected"';
}
}
} elseif($adv['type'] == 'intercat') {
if(is_array($adv['parameters']['position'])) {
$positionchecked = array();
foreach($adv['parameters']['position'] AS $position) {
$positionchecked[$position] = ' selected="selected"';
}
} else {
$positionchecked = array(0 => ' selected="selected"');
}
}
$type = $adv['type'];
} else {
$title = cutstr($title, 50);
$style = in_array($style, array('text', 'image', 'flash')) ? $style : 'code';
$adv = array('type' => $type, 'title' => $title, 'parameters' => array('style' => $style), 'starttime' => $timestamp);
$positionchecked = $type == 'intercat' ? array(0 => ' selected="selected"') : array(1 => 'checked');
$dispchecked = array(0 => ' selected="selected"');
}
$adv['targets'] = $adv['targets'] != '' && $adv['targets'] != 'forum' ? explode("\t", $adv['targets']) : array('all');
if($type == 'intercat') {
$targetsselect = '<select name="advnew[targets][]" selected="selected"><option value="0"> > '.$lang['home'].'</option></select>';
} else {
$targetsselect = '<select name="advnew[targets][]" size="10" multiple="multiple"><option value="all"> > '.$lang['all'].'</option>'.
'<option value=""> </option>'.
(in_array($type, array('thread', 'interthread')) ? '' : '<option value="0"> > '.$lang['home'].'</option>').
(in_array($type, array('headerbanner', 'footerbanner')) ? '</option><option value="register"> > '.$lang['advertisements_register'].'</option>'.
'</option><option value="redirect"> > '.$lang['advertisements_jump'].'</option>'.
'</option><option value="archiver"> > Archiver</option>' : '').
'</option>'.forumselect().'</select>';
foreach($adv['targets'] as $target) {
$targetsselect = preg_replace("/(\<option value=\"$target\")(\>)/", "\\1 selected=\"selected\" \\2", $targetsselect);
}
}
if($type == 'thread') {
$dispselect = '<select name="advnew[displayorder][]" size="10" multiple="multiple"><option value="0"'.$dispchecked[0].'> > '.$lang['all'].'</option><option value="0"> </option>';
for($i = 1; $i <= $ppp; $i ++) {
$dispselect .= '<option value="'.$i.'"'.$dispchecked[$i].'> > #'.$i.'</option>';
}
$dispselect .= '</select>';
} elseif($type == 'intercat') {
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
$positionselect = '<select name="advnew[position][]" size="10" multiple="multiple"><option value="0"'.$positionchecked[0].'> > '.$lang['all'].'</option><option value=""> </option>';
foreach($_DCACHE['forums'] AS $fid => $forum) {
if($forum['type'] == 'group') {
$positionselect .= '<option value="'.$fid.'"'.$positionchecked[$fid].'>'.$forum['name'].'</option>';
}
}
$positionselect .= '</select>';
}
$adv['starttime'] = $adv['starttime'] ? gmdate('Y-n-j', $adv['starttime'] + $_DCACHE['settings']['timeoffset'] * 3600) : '';
$adv['endtime'] = $adv['endtime'] ? gmdate('Y-n-j', $adv['endtime'] + $_DCACHE['settings']['timeoffset'] * 3600) : '';
$styleselect = array($adv['parameters']['style'] => 'selected');
showtips('advertisements_type_'.$adv['type'].'_tips');
?>
<script type="text/javascript" src="include/javascript/calendar.js"></script>
<form method="post" name="settings" action="admincp.php?action=<?=$action.($action == 'advadd' ? '&type='.$type : '&advid='.$advid)?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
if($action == 'advadd') {
$title = $lang['advertisements_add'].' - '.$lang['advertisements_type_'.$type];
} else {
$title = $lang['advertisements_edit'].' - '.$lang['advertisements_type_'.$adv['type']].' - '.$adv['title'];
}
showtype($title, 'top');
showsetting('advertisements_edit_style', '', '', '<select name="advnew[style]" onchange="var styles, key;styles=new Array(\'code\',\'text\',\'image\',\'flash\'); for(key in styles) {var obj=$(\'style_\'+styles[key]); obj.style.display=styles[key]==this.options[this.selectedIndex].value?\'\':\'none\';}"><option value="code" '.$styleselect['code'].'> '.$lang['advertisements_style_code'].'</option><option value="text" '.$styleselect['text'].'> '.$lang['advertisements_style_text'].'</option><option value="image" '.$styleselect['image'].'> '.$lang['advertisements_style_image'].'</option><option value="flash" '.$styleselect['flash'].'> '.$lang['advertisements_style_flash'].'</option></select>');
showsetting('advertisements_edit_title', 'advnew[title]', $adv['title'], 'text');
showsetting('advertisements_edit_targets', '', '', $targetsselect);
if($adv['type'] == 'thread') {
showsetting('advertisements_edit_position_thread', '', '', '<input type="radio" name="advnew[position]" class="radio" value="1" '.$positionchecked[1].'>'.$lang['advertisement_thread_down'].' <input type="radio" name="advnew[position]" class="radio" value="2" '.$positionchecked[2].'>'.$lang['advertisement_thread_up'].' <input type="radio" name="advnew[position]" class="radio" value="3" '.$positionchecked[3].'>'.$lang['advertisement_thread_right']);
showsetting('advertisements_edit_display_position', '', '', $dispselect);
} elseif($adv['type'] == 'footerbanner') {
showsetting('advertisements_edit_position_footerbanner', '', '', '<input type="radio" name="advnew[position]" class="radio" value="1" '.$positionchecked[1].'>'.$lang['advertisement_up'].' <input type="radio" name="advnew[position]" class="radio" value="2" '.$positionchecked[2].'>'.$lang['advertisement_middle'].' <input type="radio" name="advnew[position]" class="radio" value="3" '.$positionchecked[3].'>'.$lang['advertisement_down']);
} elseif($adv['type'] == 'intercat') {
showsetting('advertisements_edit_position_intercat', '', '', $positionselect);
} elseif($adv['type'] == 'float') {
showsetting('advertisements_edit_floath', 'advnew[floath]', ($adv['parameters']['floath'] > 0 ? $adv['parameters']['floath'] : 200), 'text');
}
showsetting('advertisements_edit_starttime', 'advnew[starttime]', $adv['starttime'], 'calendar');
showsetting('advertisements_edit_endtime', 'advnew[endtime]', $adv['endtime'], 'calendar');
echo '<div>';
showadvtype('code', $adv['parameters']['style']);
showsetting('advertisements_edit_style_code_html', 'advnew[code][html]', $type == 'float' && $adv['parameters']['sourcecode'] ? $adv['parameters']['sourcecode'] : $adv['parameters']['html'], 'textarea');
showadvtype('text', $adv['parameters']['style']);
showsetting('advertisements_edit_style_text_title', 'advnew[text][title]', $adv['parameters']['title'], 'text');
showsetting('advertisements_edit_style_text_link', 'advnew[text][link]', $adv['parameters']['link'], 'text');
showsetting('advertisements_edit_style_text_size', 'advnew[text][size]', $adv['parameters']['size'], 'text');
showadvtype('image', $adv['parameters']['style']);
showsetting('advertisements_edit_style_image_url', 'advnew[image][url]', $adv['parameters']['url'], 'text');
showsetting('advertisements_edit_style_image_link', 'advnew[image][link]', $adv['parameters']['link'], 'text');
showsetting('advertisements_edit_style_image_width', 'advnew[image][width]', $adv['parameters']['width'], 'text');
showsetting('advertisements_edit_style_image_height', 'advnew[image][height]', $adv['parameters']['height'], 'text');
showsetting('advertisements_edit_style_image_alt', 'advnew[image][alt]', $adv['parameters']['alt'], 'text');
showadvtype('flash', $adv['parameters']['style']);
showsetting('advertisements_edit_style_flash_url', 'advnew[flash][url]', $adv['parameters']['url'], 'text');
showsetting('advertisements_edit_style_flash_width', 'advnew[flash][width]', $adv['parameters']['width'], 'text');
showsetting('advertisements_edit_style_flash_height', 'advnew[flash][height]', $adv['parameters']['height'], 'text');
showtype('', 'bottom');
echo '</div><center><input class="button" type="submit" name="advsubmit" value="'.$lang['submit'].'"></center></form>';
} else {
$advnew['starttime'] = $advnew['starttime'] ? strtotime($advnew['starttime']) : 0;
$advnew['endtime'] = $advnew['endtime'] ? strtotime($advnew['endtime']) : 0;
if(!$advnew['title']) {
cpmsg('advertisements_title_invalid');
} elseif(strlen($advnew['title']) > 50) {
cpmsg('advertisements_title_more');
} elseif($advnew['endtime'] && ($advnew['endtime'] <= $timestamp || $advnew['endtime'] <= $advnew['starttime'])) {
cpmsg('advertisements_endtime_invalid');
} elseif(($advnew['style'] == 'code' && !$advnew['code']['html'])
|| ($advnew['style'] == 'text' && (!$advnew['text']['title'] || !$advnew['text']['link']))
|| ($advnew['style'] == 'image' && (!$advnew['image']['url'] || !$advnew['image']['link']))
|| ($advnew['style'] == 'flash' && (!$advnew['flash']['url'] || !$advnew['flash']['width'] || !$advnew['flash']['height']))) {
cpmsg('advertisements_parameter_invalid');
}
if($action == 'advadd') {
$db->query("INSERT INTO {$tablepre}advertisements (available, type)
VALUES ('1', '$type')");
$advid = $db->insert_id();
} else {
$query = $db->query("SELECT type FROM {$tablepre}advertisements WHERE advid='$advid'");
$type = $db->result($query, 0);
}
foreach($advnew[$advnew['style']] as $key => $val) {
$advnew[$advnew['style']][$key] = stripslashes($val);
}
$targetsarray = array();
if(is_array($advnew['targets'])) {
foreach($advnew['targets'] as $target) {
if($target == 'all') {
$targetsarray = in_array($type, array('thread', 'interthread')) ? array('forum') : array();
break;
} elseif(in_array($target, array('register', 'redirect', 'archiver')) || preg_match("/^\d+$/", $target) && ($target == 0 || in_array($_DCACHE['forums'][$target]['type'], array('forum', 'sub')))) {
$targetsarray[] = $target;
}
}
}
$advnew['targets'] = implode("\t", $targetsarray);
$advnew['displayorder'] = isset($advnew['displayorder']) ? implode("\t", $advnew['displayorder']) : '';
switch($advnew['style']) {
case 'code':
$advnew['code'] = $advnew['code']['html'];
break;
case 'text':
$advnew['code'] = '<a href="'.$advnew['text']['link'].'" target="_blank" '.($advnew['text']['size'] ? 'style="font-size: '.$advnew['text']['size'].'"' : '').'>'.$advnew['text']['title'].'</a>';
break;
case 'image':
$advnew['code'] = '<a href="'.$advnew['image']['link'].'" target="_blank"><img src="'.$advnew['image']['url'].'"'.($advnew['image']['height'] ? ' height="'.$advnew['image']['height'].'"' : '').($advnew['image']['width'] ? ' width="'.$advnew['image']['width'].'"' : '').($advnew['image']['alt'] ? ' alt="'.$advnew['image']['alt'].'"' : '').' border="0"></a>';
break;
case 'flash':
$advnew['code'] = '<embed width="'.$advnew['flash']['width'].'" height="'.$advnew['flash']['height'].'" src="'.$advnew['flash']['url'].'" type="application/x-shockwave-flash"></embed>';
break;
}
if($type == 'float') {
$sourcecode = $advnew['code'];
$advnew['floath'] = $advnew['floath'] >= 40 && $advnew['floath'] <= 600 ? intval($advnew['floath']) : 200;
$advnew['code'] = str_replace(array("\r\n", "\r", "\n"), '<br />', $advnew['code']);
$advnew['code'] = addslashes($advnew['code'].'<br /><img src="images/common/advclose.gif" onMouseOver="this.style.cursor=\'pointer\'" onClick="closeBanner();">');
$advnew['code'] = 'theFloaters.addItem(\'floatAdv1\',6,\'document.documentElement.clientHeight-'.$advnew['floath'].'\',\'<div style="position: absolute; left: 6px; top: 6px;">'.$advnew['code'].'</div>\');';
} elseif($type == 'couplebanner') {
$advnew['code'] = addslashes($advnew['code'].'<br /><img src="images/common/advclose.gif" onMouseOver="this.style.cursor=\'pointer\'" onClick="closeBanner();">');
$advnew['code'] = 'theFloaters.addItem(\'coupleBannerL\',6,0,\'<div style="position: absolute; left: 6px; top: 6px;">'.$advnew['code'].'</div>\');theFloaters.addItem(\'coupleBannerR\',\'document.body.clientWidth-6\',0,\'<div style="position: absolute; right: 6px; top: 6px;">'.$advnew['code'].'</div>\');';
} elseif($type == 'intercat') {
$advnew['position'] = is_array($advnew['position']) && !in_array('0', $advnew['position']) ? $advnew['position'] : '';
}
if($advnew['style'] == 'code') {
$advnew['parameters'] = addslashes(serialize(array_merge(array('style' => $advnew['style']), array('html' => $advnew['code']), array('position' => $advnew['position']), array('displayorder' => $advnew['displayorder']), ($sourcecode ? array('sourcecode' => $sourcecode) : array()), ($advnew['floath'] ? array('floath' => $advnew['floath']) : array()))));
} else {
$advnew['parameters'] = addslashes(serialize(array_merge(array('style' => $advnew['style']), $advnew[$advnew['style']], array('html' => $advnew['code']), array('position' => $advnew['position']), array('displayorder' => $advnew['displayorder']), ($advnew['floath'] ? array('floath' => $advnew['floath']) : array()))));
}
$advnew['code'] = addslashes($advnew['code']);
$query = $db->query("UPDATE {$tablepre}advertisements SET title='$advnew[title]', targets='$advnew[targets]', parameters='$advnew[parameters]', code='$advnew[code]', starttime='$advnew[starttime]', endtime='$advnew[endtime]' WHERE advid='$advid'");
if($type == 'intercat') {
updatecache('advs_index');
} elseif(in_array($type, array('thread', 'interthread'))) {
updatecache('advs_viewthread');
} elseif($type == 'text') {
updatecache(array('advs_index', 'advs_forumdisplay', 'advs_viewthread'));
} else {
updatecache(array('settings', 'advs_archiver', 'advs_register', 'advs_index', 'advs_forumdisplay', 'advs_viewthread'));
}
cpmsg('advertisements_succeed', "admincp.php?action=adv");
}
}
function showadvtype($type, $curtype) {
echo '</table><br /></div><div id="style_'.$type.'" style="'.($type != $curtype ? 'display: none' : '').'" class="maintablediv">'.
'<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'.
'<tr class="header"><td colspan="2">'.$GLOBALS['lang']['advertisements_edit_style_'.$type].'</td></tr>';
}
?> | zyyhong | trunk/jiaju001/bbs/admin/advertisements.inc.php | PHP | asf20 | 25,806 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: tools.inc.php 10487 2007-09-03 07:09:12Z liuqiang $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if($action == 'updatecache') {
updatecache();
if($tplrefresh) {
$tpl = dir(DISCUZ_ROOT.'./forumdata/templates');
while($entry = $tpl->read()) {
if(preg_match("/\.tpl\.php$/", $entry)) {
@unlink(DISCUZ_ROOT.'./forumdata/templates/'.$entry);
}
}
$tpl->close();
}
if($jsstatus) {
$js = dir(DISCUZ_ROOT.'./forumdata/cache');
while($entry = $js->read()) {
if(preg_match("/^javascript_/", $entry)) {
@unlink(DISCUZ_ROOT.'./forumdata/cache/'.$entry);
}
}
$js->close();
}
cpmsg('update_cache_succeed');
} elseif($action == 'jswizard') {
if(!$jsstatus) {
header('location: admincp.php?action=settings&do=javascript');
}
shownav('menu_tools_javascript');
showtype('jswizard', 'top');
echo '<tr><td class="altbg2"><a href="admincp.php?action=settings&do=javascript">'.$lang['jswizard_basesettings'].'</a> ';
if($jsstatus) {
echo '<a href="admincp.php?action=jswizard">'.$lang['jswizard_project'].'</a>';
}
echo '</td></tr>';
showtype('', 'bottom');
echo '<br />';
$jswizard = array();
$query = $db->query("SELECT * FROM {$tablepre}settings WHERE variable LIKE 'jswizard_".($jssetting != '' ? $jssetting : ($jskey != '' ? $jskey : '%'))."'");
while($settings = $db->fetch_array($query)) {
$jswizard[substr($settings['variable'], 9)] = unserialize($settings['value']);
}
$type = !empty($function) ? $function : (isset($type) ? $type : '');
$edit = isset($edit) ? $edit : NULL;
$editext = ($jssetting || $edit) ? '<input type="hidden" name="edit" value="'.dhtmlspecialchars($jssetting ? $jssetting : $edit).'">' : '';
ksort($jswizard);
if(!empty($type)) {
if(empty($jskey)) {
$jskey = $type.'_'.random(3);
}
$jspreview = '';
if(!empty($function) && !empty($jssetting) && isset($jswizard[$jssetting]['url'])) {
$parameter = $jswizard[$jssetting]['parameter'];
$jskey = $jssetting;
$jssetting = $jswizard[$jssetting]['url'];
$preview = $jssubmit = TRUE;
} else {
$jssetting = '';
}
}
$jskey = trim($jskey);
if(empty($type)) {
if(!submitcheck('jsdelsubmit') && !submitcheck('jsexportsubmit') && !submitcheck('importsubmit')) {
$jstypes = array('threads', 'forums', 'memberrank', 'stats', 'images', -1 => 'custom');
showtype('jswizard_addjs', 'top');
echo '<tr><td class="altbg2">';
foreach($jstypes as $jstype) {
echo '<input type="button" class="button" value="'.$lang['jswizard_'.$jstype].'" onclick="location.href=\'admincp.php?action=jswizard&type='.$jstype.'\'"> ';
}
echo '</td></tr>';
showtype('', 'bottom');
echo '<br />';
?>
<form method="post" action="admincp.php?action=jswizard">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td width="3%"><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form,'keyarray')"></td>
<td><?=$lang['jswizard_key']?></td><td><?=$lang['type']?></td></tr>
<?
foreach($jswizard as $key => $jssetting) {
echo '<tr><td class="altbg1"><input class="checkbox" type="checkbox" name="keyarray[]" value="'.dhtmlspecialchars($key).'">';
echo '<td class="altbg2"><a href="admincp.php?action=jswizard&function='.$jstypes[$jssetting['type']].'&jssetting='.rawurlencode($key).'">'.$key.'</a></td><td class="altbg1">'.$lang['jswizard_'.$jstypes[$jssetting['type']]].'</td>';
}
echo '</td></tr>';
showtype('', 'bottom');
?>
<br /><center><input class="button" type="submit" name="jsdelsubmit" value="<?=$lang['jswizard_delete']?>"> <input class="button" type="submit" name="jsexportsubmit" value="<?=$lang['jswizard_download']?>"></center>
</form>
<br />
<form method="post" action="admincp.php?action=jswizard">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['jswizard_import_stick']?></td></tr>
<tr><td class="altbg1"> <div align="center"><textarea name="importdata" cols="80" rows="8"></textarea><br />
<input class="checkbox" type="radio" name="importrewrite" value="0" checked><?=$lang['jswizard_import_default']?>
<input class="checkbox" type="radio" name="importrewrite" value="1"><?=$lang['jswizard_import_norewrite']?>
<input class="checkbox" type="radio" name="importrewrite" value="2"><?=$lang['jswizard_import_rewrite']?>
</td></tr>
</table><br />
<center><input class="button" type="submit" name="importsubmit" value="<?=$lang['submit']?>"></center></form>
<?
} elseif(submitcheck('jsdelsubmit')) {
if(is_array($keyarray)) {
$keys = implode("','jswizard_", $keyarray);
$db->query("DELETE FROM {$tablepre}settings WHERE variable IN ('jswizard_$keys')");
updatecache('jswizard');
cpmsg('jswizard_succeed', 'admincp.php?action=jswizard');
} else {
header("location: {$boardurl}admincp.php?action=jswizard");
dexit();
}
} elseif(submitcheck('jsexportsubmit')) {
if(is_array($keyarray)) {
$keys = implode("','jswizard_", $keyarray);
$query = $db->query("SELECT * FROM {$tablepre}settings WHERE variable IN ('jswizard_$keys')");
$exportdataarray = array();
while($exportdata = $db->fetch_array($query)) {
$value = unserialize($exportdata['value']);
switch($value['type']) {
case 0:
unset($value['parameter']['threads_forums']);
unset($value['parameter']['tids']);
unset($value['parameter']['typeids']);
break;
case 1:
unset($value['parameter']['forums_forums']);
break;
case 4:
unset($value['parameter']['images_forums']);
break;
}
$exportdataarray[preg_replace("/^jswizard_/", '', $exportdata['variable'])] = serialize($value);
}
$time = gmdate("$dateformat $timeformat", $timestamp + $timeoffset * 3600);
$jswizard_export = "# Discuz! JSWizard Dump\n".
"# Version: Discuz! $version\n".
"# Time: $time \n".
"# From: $bbname ($boardurl) \n".
"#\n".
"# Discuz! Community: http://www.Discuz.net\n".
"# Please visit our website for latest news about Discuz!\n".
"# --------------------------------------------------------\n\n\n".
wordwrap(base64_encode(serialize($exportdataarray)), 60, "\n", 1);
ob_end_clean();
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
header('Content-Encoding: none');
header('Content-Length: '.strlen($jswizard_export));
header('Content-Disposition: attachment; filename=discuz_jswizard_'.date('Ymd').'.txt');
header('Content-Type: '.(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? 'application/octetstream' : 'application/octet-stream'));
echo $jswizard_export;
dexit();
} else {
header("location: {$boardurl}admincp.php?action=jswizard");
dexit();
}
} elseif(submitcheck('importsubmit')) {
$importdata = preg_replace("/(#.*\s+)*/", '', $importdata);
$importarray = unserialize(base64_decode($importdata));
$keys = implode("','jswizard_", array_keys($importarray));
if($importrewrite != 2) {
$query = $db->query("SELECT variable FROM {$tablepre}settings WHERE variable IN ('jswizard_$keys')");
$existkeyarray = array();
while($existkey = $db->fetch_array($query)) {
if($importrewrite == 1) {
unset($importarray[preg_replace("/^jswizard_/", '', $existkey['variable'])]);
} else {
$existkeyarray[] = $existkey['variable'];
}
}
if($importrewrite == 0 && $existkeyarray) {
$existkeys = implode(", ", $existkeyarray);
cpmsg('jswizard_import_exist');
}
}
foreach($importarray as $key => $value) {
$value = addslashes($value);
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('jswizard_$key', '$value')");
}
updatecache('jswizard');
cpmsg('jswizard_succeed', 'admincp.php?action=jswizard');
}
} elseif($type == 'threads') {
/* Threads == Start == */
$tcheckorderby = array((isset($parameter['orderby']) ? $parameter['orderby'] : 'lastpost') => 'checked');
for($i = 0; $i <= 6; $i++) {
$tcheckspecial[$i] = !empty($parameter['special'][$i]) ? 'checked' : '';
$tcheckdigest[$i] = !empty($parameter['digest'][$i]) ? 'checked' : '';
$tcheckstick[$i] = !empty($parameter['stick'][$i]) ? 'checked' : '';
}
$parameter['newwindow'] = isset($parameter['newwindow']) ? intval($parameter['newwindow']) : 1;
$tradionewwindow[$parameter['newwindow']] = 'checked';
$jsthreadtypeselect = '<select multiple="multiple" name="parameter[typeids][]" size="5"><option value="all">'.$lang['jswizard_all_typeids'].'</optoin><option value=""> </option>';
$query = $db->query("SELECT typeid, name FROM {$tablepre}threadtypes ORDER BY typeid DESC");
while($threadtype = $db->fetch_array($query)) {
$jsthreadtypeselect .= '<option value="'.$threadtype['typeid'].'" '.(isset($parameter['typeids']) && in_array($threadtype['typeid'], $parameter['typeids']) ? 'selected' : '').'>'.$threadtype['name'].'</option>';
}
$jsthreadtypeselect .= '</select>';
$trewardstatus = array(intval($parameter['rewardstatus']) => 'checked');
if($jssubmit && $function == 'threads') {
$jsurl = $jssetting ? $jssetting : "function=$function".
($parameter['threads_forums'] && !in_array('all', $parameter['threads_forums'])? '&fids='.jsfids($parameter['threads_forums']) : '').
"&maxlength=$parameter[maxlength]".
"&fnamelength=$parameter[fnamelength]".
"&blog=$parameter[blog]".
"&startrow=$parameter[startrow]".
"&picpre=".rawurlencode($parameter['picpre']).
"&items=$parameter[items]".
"&tag=".rawurlencode($parameter[tag]).
'&tids='.str_replace(',', '_', $parameter['tids']).
($parameter['keyword'] ? '&keyword='.rawurlencode($parameter['keyword']) : '').
($parameter['typeids'] && !in_array('all', $parameter['typeids'])? '&typeids='.jsfids($parameter['typeids']) : '').
"&special=".bindec(intval($parameter['special'][1]).intval($parameter['special'][2]).intval($parameter['special'][3]).intval($parameter['special'][4]).intval($parameter['special'][5]).intval($parameter['special'][6]).intval($parameter['special'][0])).
"&rewardstatus=$parameter[rewardstatus]".
"&digest=".bindec(intval($parameter['digest'][1]).intval($parameter['digest'][2]).intval($parameter['digest'][3]).intval($parameter['digest'][4])).
"&stick=".bindec(intval($parameter['stick'][1]).intval($parameter['stick'][2]).intval($parameter['stick'][3]).intval($parameter['stick'][4])).
"&newwindow=$parameter[newwindow]".
"&threadtype=$parameter[threadtype]".
"&highlight=$parameter[highlight]".
"&orderby=$parameter[orderby]".
"&jscharset=$parameter[jscharset]".
($parameter['cachelife'] != '' ? "&cachelife=$parameter[cachelife]" : '').
(!empty($parameter['jstemplate']) ? '&jstemplate='.rawurlencode($parameter['jstemplate']) : '');
$jsurlview = "$jsurl&nocache=yes";
$jsurlview = "{$boardurl}api/javascript.php?$jsurlview&verify=".md5($authkey.$jsurlview);
if(!$preview) {
jssavesetting(0);
}
$jsurl = "{$boardurl}api/javascript.php?$jsurl&verify=".md5($authkey.$jsurl);
$jspreview = "<textarea rows=\"3\" style=\"width: 100%; word-break: break-all\" onMouseOver=\"this.focus()\" onFocus=\"this.select()\">".
dhtmlspecialchars("<script language=\"JavaScript\" src=\"{$boardurl}api/javascript.php?key=".rawurlencode($jskey)."\"></script>").
"</textarea><br /><div class=\"jswizard\"><script language=\"JavaScript\" src=\"$jsurlview\"></script></div><br />";
}
if($jspreview) {
showtype('preview', 'top');
echo '<tr><td class="altbg1">'.$jspreview;
showtype('', 'bottom');
echo '<br />';
}
echo '<form method="post" action="admincp.php?action=jswizard&function=threads#'.$lang['jswizard_threads'].'">';
showtype('jswizard_jstemplate', 'top');
echo '<tr><td class="altbg1" colspan="2">'.$lang['jswizard_threads_jstemplate_comment'].'<br />';
echo '<img src="images/admincp/zoomin.gif" onmouseover="this.style.cursor=\'pointer\'" onclick="zoomtextarea(\'jstemplate\', 1)"> <img src="images/admincp/zoomout.gif" onmouseover="this.style.cursor=\'pointer\'" onclick="zoomtextarea(\'jstemplate\', 0)"><br />';
jsinsertunit();
echo '<textarea cols="100" rows="5" id="jstemplate" name="parameter[jstemplate]" style="width: 95%;">'.($parameter['jstemplate'] != '' ? stripslashes($parameter['jstemplate']) : '{prefix} {subject}<br />').'</textarea></td></tr>';
showtype('', 'bottom');
echo '<br />';
showtype('jswizard_threads', 'top');
showsetting('jswizard_jskey', 'jskey', $jskey, 'text');
showsetting('jswizard_cachelife', 'parameter[cachelife]', $parameter['cachelife'] != '' ? intval($parameter['cachelife']) : '', 'text');
showsetting('jswizard_threads_fids', '', '', jsforumselect('threads'));
showsetting('jswizard_threads_startrow', 'parameter[startrow]', intval($parameter['startrow']), 'text');
showsetting('jswizard_threads_items', 'parameter[items]', isset($parameter['items']) ? $parameter['items'] : 10, 'text');
showsetting('jswizard_threads_maxlength', 'parameter[maxlength]', isset($parameter['maxlength']) ? $parameter['maxlength'] : 50, 'text');
showsetting('jswizard_threads_fnamelength', 'parameter[fnamelength]', $parameter['fnamelength'], 'radio');
showsetting('jswizard_threads_picpre', 'parameter[picpre]', $parameter['picpre'], 'text');
showsetting('jswizard_threads_tids', 'parameter[tids]', ($parameter['tids'] ? str_replace('_', ',', $parameter['tids']) : ''), 'text');
showsetting('jswizard_threads_keyword', 'parameter[keyword]', $parameter['keyword'], 'text');
showsetting('jswizard_threads_tag', 'parameter[tag]', $parameter['tag'], 'text');
showsetting('jswizard_threads_typeids', '', '', $jsthreadtypeselect);
showsetting('jswizard_threads_threadtype', 'parameter[threadtype]', $parameter['threadtype'], 'radio');
showsetting('jswizard_threads_highlight', 'parameter[highlight]', $parameter['highlight'], 'radio');
showsetting('jswizard_threads_blog', 'parameter[blog]', $parameter['blog'], 'radio');
showsetting('jswizard_threads_special', '', '', '<input class="checkbox" type="checkbox" name="parameter[special][1]" value="1" '.$tcheckspecial[1].'> '.$lang['jswizard_special_1'].'<br /><input class="checkbox" type="checkbox" name="parameter[special][2]" value="1" '.$tcheckspecial[2].'> '.$lang['jswizard_special_2'].'<br /><input class="checkbox" type="checkbox" onclick="$(\'special_reward_ext\').style.display = this.checked ? \'\' : \'none\'" name="parameter[special][3]" value="1" '.$tcheckspecial[3].'> '.$lang['jswizard_special_3'].'<br /><input class="checkbox" type="checkbox" name="parameter[special][4]" value="1" '.$tcheckspecial[4].'> '.$lang['jswizard_special_4'].'<br /><input class="checkbox" type="checkbox" name="parameter[special][5]" value="1" '.$tcheckspecial[5].'> '.$lang['jswizard_special_5'].'<br /><input class="checkbox" type="checkbox" name="parameter[special][6]" value="1" '.$tcheckspecial[6].'> '.$lang['jswizard_special_6'].'<br /><input class="checkbox" type="checkbox" name="parameter[special][0]" value="1" '.$tcheckspecial[0].'> '.$lang['jswizard_special_0']);
echo '</tbody><tbody class="sub" id="special_reward_ext" style="display: '.($tcheckspecial[3] ? '' : 'none').'">';
showsetting('jswizard_threads_special_reward', '', '', '<input class="radio" type="radio" name="parameter[rewardstatus]" value="0" '.$trewardstatus[0].'> '.$lang['jswizard_threads_special_reward_0'].'<br /><input class="radio" type="radio" name="parameter[rewardstatus]" value="1" '.$trewardstatus[1].'> '.$lang['jswizard_threads_special_reward_1'].'<br /><input class="radio" type="radio" name="parameter[rewardstatus]" value="2" '.$trewardstatus[2].'> '.$lang['jswizard_threads_special_reward_2']);
echo '</tbody><tbody>';
showsetting('jswizard_threads_digest', '', '', '<input class="checkbox" type="checkbox" name="parameter[digest][1]" value="1" '.$tcheckdigest[1].'> '.$lang['jswizard_digest_1'].'<br /><input class="checkbox" type="checkbox" name="parameter[digest][2]" value="1" '.$tcheckdigest[2].'> '.$lang['jswizard_digest_2'].'<br /><input class="checkbox" type="checkbox" name="parameter[digest][3]" value="1" '.$tcheckdigest[3].'> '.$lang['jswizard_digest_3'].'<br /><input class="checkbox" type="checkbox" name="parameter[digest][4]" value="1" '.$tcheckdigest[4].'> '.$lang['jswizard_digest_0'].'');
showsetting('jswizard_threads_stick', '', '', '<input class="checkbox" type="checkbox" name="parameter[stick][1]" value="1" '.$tcheckstick[1].'> '.$lang['jswizard_stick_1'].'<br /><input class="checkbox" type="checkbox" name="parameter[stick][2]" value="1" '.$tcheckstick[2].'> '.$lang['jswizard_stick_2'].'<br /><input class="checkbox" type="checkbox" name="parameter[stick][3]" value="1" '.$tcheckstick[3].'> '.$lang['jswizard_stick_3'].'<br /><input class="checkbox" type="checkbox" name="parameter[stick][4]" value="1" '.$tcheckstick[4].'> '.$lang['jswizard_stick_0'].'');
showsetting('jswizard_threads_newwindow', 'parameter[newwindow]', '', '<input class="radio" type="radio" name="parameter[newwindow]" value="0" '.$tradionewwindow[0].'> '.$lang['jswizard_newwindow_self'].'<br /><input class="radio" type="radio" name="parameter[newwindow]" value="1" '.$tradionewwindow[1].'> '.$lang['jswizard_newwindow_blank'].'<br /><input class="radio" type="radio" name="parameter[newwindow]" value="2" '.$tradionewwindow[2].'> '.$lang['jswizard_newwindow_main']);
showsetting('jswizard_threads_orderby', '', '', '<input class="radio" type="radio" name="parameter[orderby]" value="lastpost" '.$tcheckorderby['lastpost'].'> '.$lang['jswizard_threads_orderby_lastpost'].'<br /><input class="radio" type="radio" name="parameter[orderby]" value="dateline" '.$tcheckorderby['dateline'].'> '.$lang['jswizard_threads_orderby_dateline'].'<br /><input class="radio" type="radio" name="parameter[orderby]" value="replies" '.$tcheckorderby['replies'].'> '.$lang['jswizard_threads_orderby_replies'].'<br /><input class="radio" type="radio" name="parameter[orderby]" value="views" '.$tcheckorderby['views'].'> '.$lang['jswizard_threads_orderby_views']);
if(strtoupper($charset) != 'UTF-8') {
showsetting('jswizard_charset', 'parameter[jscharset]', $parameter['jscharset'], 'radio');
} else {
showsetting('jswizard_charsetr', array('parameter[jscharset]', array(array(0, $lang['none']), array(1, 'GBK'), array(2, 'BIG5'))), intval($parameter['jscharset']), 'mradio');
}
showtype('', 'bottom');
echo $editext.'<br /><center><input class="button" type="submit" name="jssubmit" value="'.$lang['jswizard_preview'].'"> <input class="button" type="button" onclick="this.form.preview.value=0;this.form.jssubmit.click()" value="'.$lang['submit'].'"><input name="preview" type="hidden" value="1"></center></form><br />';
/* Threads == End == */
} elseif($type == 'forums') {
/* Forums == Start == */
$fcheckorderby = array((isset($parameter['orderby']) ? $parameter['orderby'] : 'displayorder') => 'checked');
$parameter['newwindow'] = isset($parameter['newwindow']) ? intval($parameter['newwindow']) : 1;
$tradionewwindow[$parameter['newwindow']] = 'checked';
if($jssubmit && $function == 'forums') {
$jsurl = $jssetting ? $jssetting : "function=$function".
($parameter['forums_forums'] && !in_array('all', $parameter['forums_forums'])? '&fups='.jsfids($parameter['forums_forums']) : '').
"&startrow=$parameter[startrow]".
"&items=$parameter[items]".
"&newwindow=$parameter[newwindow]".
"&orderby=$parameter[orderby]".
"&jscharset=$parameter[jscharset]".
($parameter['cachelife'] != '' ? "&cachelife=$parameter[cachelife]" : '').
(!empty($parameter['jstemplate']) ? '&jstemplate='.rawurlencode($parameter['jstemplate']) : '');
$jsurlview = "$jsurl&nocache=yes";
$jsurlview = "{$boardurl}api/javascript.php?$jsurlview&verify=".md5($authkey.$jsurlview);
if(!$preview) {
jssavesetting(1);
}
$jsurl = "{$boardurl}api/javascript.php?$jsurl&verify=".md5($authkey.$jsurl);
$jspreview = "<textarea rows=\"3\" style=\"width: 100%; word-break: break-all\" onMouseOver=\"this.focus()\" onFocus=\"this.select()\">".
dhtmlspecialchars("<script language=\"JavaScript\" src=\"{$boardurl}api/javascript.php?key=".rawurlencode($jskey)."\"></script>").
"</textarea><br /><div class=\"jswizard\"><script language=\"JavaScript\" src=\"$jsurlview\"></script></div><br />";
}
if($jspreview) {
showtype('preview', 'top');
echo '<tr><td class="altbg1">'.$jspreview;
showtype('', 'bottom');
echo '<br />';
}
echo '<form method="post" action="admincp.php?action=jswizard&function=forums#'.$lang['jswizard_forums'].'">';
showtype('jswizard_jstemplate', 'top');
echo '<tr><td class="altbg1" colspan="2">'.$lang['jswizard_forums_jstemplate_comment'].'<br />';
echo '<img src="images/admincp/zoomin.gif" onmouseover="this.style.cursor=\'pointer\'" onclick="zoomtextarea(\'jstemplate\', 1)"> <img src="images/admincp/zoomout.gif" onmouseover="this.style.cursor=\'pointer\'" onclick="zoomtextarea(\'jstemplate\', 0)"><br />';
jsinsertunit();
echo '<textarea cols="100" rows="5" id="jstemplate" name="parameter[jstemplate]" style="width: 95%;">'.($parameter['jstemplate'] != '' ? stripslashes($parameter['jstemplate']) : '{forumname}<br />').'</textarea></td></tr>';
showtype('', 'bottom');
echo '<br />';
showtype('jswizard_forums', 'top');
showsetting('jswizard_jskey', 'jskey', $jskey, 'text');
showsetting('jswizard_cachelife', 'parameter[cachelife]', $parameter['cachelife'] != '' ? intval($parameter['cachelife']) : '', 'text');
showsetting('jswizard_forums_fups', '', '', jsforumselect('forums'));
showsetting('jswizard_forums_startrow', 'parameter[startrow]', intval($parameter['startrow']), 'text');
showsetting('jswizard_forums_items', 'parameter[items]', intval($parameter['items']), 'text');
showsetting('jswizard_forums_newwindow', 'parameter[newwindow]', '', '<input class="radio" type="radio" name="parameter[newwindow]" value="0" '.$tradionewwindow[0].'> '.$lang['jswizard_newwindow_self'].'<br /><input class="radio" type="radio" name="parameter[newwindow]" value="1" '.$tradionewwindow[1].'> '.$lang['jswizard_newwindow_blank'].'<br /><input class="radio" type="radio" name="parameter[newwindow]" value="2" '.$tradionewwindow[2].'> '.$lang['jswizard_newwindow_main']);
showsetting('jswizard_forums_orderby', '', '', '<input class="radio" type="radio" name="parameter[orderby]" value="displayorder" '.$fcheckorderby['displayorder'].'> '.$lang['jswizard_forums_orderby_displayorder'].'<br /><input class="radio" type="radio" name="parameter[orderby]" value="threads" '.$fcheckorderby['threads'].'> '.$lang['jswizard_forums_orderby_threads'].'<br /><input class="radio" type="radio" name="parameter[orderby]" value="posts" '.$fcheckorderby['posts'].'> '.$lang['jswizard_forums_orderby_posts']);
if(strtoupper($charset) != 'UTF-8') {
showsetting('jswizard_charset', 'parameter[jscharset]', $parameter['jscharset'], 'radio');
} else {
showsetting('jswizard_charsetr', array('parameter[jscharset]', array(array(0, $lang['none']), array(1, 'GBK'), array(2, 'BIG5'))), intval($parameter['jscharset']), 'mradio');
}
showtype('', 'bottom');
echo $editext.'<br /><center><input class="button" type="submit" name="jssubmit" value="'.$lang['jswizard_preview'].'"> <input class="button" type="button" onclick="this.form.preview.value=0;this.form.jssubmit.click()" value="'.$lang['submit'].'"><input name="preview" type="hidden" value="1"></center></form><br />';
/* Forums == End == */
} elseif($type == 'memberrank') {
/* Member Rank == Start == */
$mcheckorderby = array((isset($parameter['orderby']) ? $parameter['orderby'] : 'credits') => 'checked');
$parameter['newwindow'] = isset($parameter['newwindow']) ? intval($parameter['newwindow']) : 1;
$tradionewwindow[$parameter['newwindow']] = 'checked';
if($jssubmit && $function == 'memberrank') {
$jsurl = $jssetting ? $jssetting : "function=$function".
"&startrow=$parameter[startrow]".
"&items=$parameter[items]".
"&newwindow=$parameter[newwindow]".
"&orderby=$parameter[orderby]".
"&jscharset=$parameter[jscharset]".
($parameter['cachelife'] != '' ? "&cachelife=$parameter[cachelife]" : '').
(!empty($parameter['jstemplate']) ? '&jstemplate='.rawurlencode($parameter['jstemplate']) : '');
$jsurlview = "$jsurl&nocache=yes";
$jsurlview = "{$boardurl}api/javascript.php?$jsurlview&verify=".md5($authkey.$jsurlview);
if(!$preview) {
jssavesetting(2);
}
$jsurl = "{$boardurl}api/javascript.php?$jsurl&verify=".md5($authkey.$jsurl);
$jspreview = "<textarea rows=\"3\" style=\"width: 100%; word-break: break-all\" onMouseOver=\"this.focus()\" onFocus=\"this.select()\">".
dhtmlspecialchars("<script language=\"JavaScript\" src=\"{$boardurl}api/javascript.php?key=".rawurlencode($jskey)."\"></script>").
"</textarea><br /><div class=\"jswizard\"><script language=\"JavaScript\" src=\"$jsurlview\"></script></div><br />";
}
if($jspreview) {
showtype('preview', 'top');
echo '<tr><td class="altbg1">'.$jspreview;
showtype('', 'bottom');
echo '<br />';
}
echo '<form method="post" action="admincp.php?action=jswizard&function=memberrank#'.$lang['jswizard_memberrank'].'">';
showtype('jswizard_jstemplate', 'top');
echo '<tr><td class="altbg1" colspan="2">'.$lang['jswizard_memberrank_jstemplate_comment'].'<br />';
echo '<img src="images/admincp/zoomin.gif" onmouseover="this.style.cursor=\'pointer\'" onclick="zoomtextarea(\'jstemplate\', 1)"> <img src="images/admincp/zoomout.gif" onmouseover="this.style.cursor=\'pointer\'" onclick="zoomtextarea(\'jstemplate\', 0)"><br />';
jsinsertunit();
echo '<textarea cols="100" rows="5" id="jstemplate" name="parameter[jstemplate]" style="width: 95%;">'.($parameter['jstemplate'] != '' ? stripslashes($parameter['jstemplate']) : '{regdate} {member} {value}<br />').'</textarea></td></tr>';
showtype('', 'bottom');
echo '<br />';
showtype('jswizard_memberrank', 'top');
showsetting('jswizard_jskey', 'jskey', $jskey, 'text');
showsetting('jswizard_cachelife', 'parameter[cachelife]', $parameter['cachelife'] != '' ? intval($parameter['cachelife']) : '', 'text');
showsetting('jswizard_memberrank_startrow', 'parameter[startrow]', intval($parameter['startrow']), 'text');
showsetting('jswizard_memberrank_items', 'parameter[items]', isset($parameter['items']) ? $parameter['items'] : 10, 'text');
showsetting('jswizard_memberrank_newwindow', 'parameter[newwindow]', '', '<input class="radio" type="radio" name="parameter[newwindow]" value="0" '.$tradionewwindow[0].'> '.$lang['jswizard_newwindow_self'].'<br /><input class="radio" type="radio" name="parameter[newwindow]" value="1" '.$tradionewwindow[1].'> '.$lang['jswizard_newwindow_blank'].'<br /><input class="radio" type="radio" name="parameter[newwindow]" value="2" '.$tradionewwindow[2].'> '.$lang['jswizard_newwindow_main']);
showsetting('jswizard_memberrank_orderby', '', '', '<input class="radio" type="radio" name="parameter[orderby]" value="credits" '.$mcheckorderby['credits'].'> '.$lang['jswizard_memberrank_orderby_credits'].'<br /><input class="radio" type="radio" name="parameter[orderby]" value="posts" '.$mcheckorderby['posts'].'> '.$lang['jswizard_memberrank_orderby_posts'].'<br /><input class="radio" type="radio" name="parameter[orderby]" value="digestposts" '.$mcheckorderby['digestposts'].'> '.$lang['jswizard_memberrank_orderby_digestposts'].'<br /><input class="radio" type="radio" name="parameter[orderby]" value="regdate" '.$mcheckorderby['regdate'].'> '.$lang['jswizard_memberrank_orderby_regdate'].'<br /><input class="radio" type="radio" name="parameter[orderby]" value="todayposts" '.$mcheckorderby['todayposts'].'> '.$lang['jswizard_memberrank_orderby_todayposts']);
if(strtoupper($charset) != 'UTF-8') {
showsetting('jswizard_charset', 'parameter[jscharset]', $parameter['jscharset'], 'radio');
} else {
showsetting('jswizard_charsetr', array('parameter[jscharset]', array(array(0, $lang['none']), array(1, 'GBK'), array(2, 'BIG5'))), intval($parameter['jscharset']), 'mradio');
}
showtype('', 'bottom');
echo $editext.'<br /><center><input class="button" type="submit" name="jssubmit" value="'.$lang['jswizard_preview'].'"> <input class="button" type="button" onclick="this.form.preview.value=0;this.form.jssubmit.click()" value="'.$lang['submit'].'"><input name="preview" type="hidden" value="1"></center></form><br />';
/* Member Rank == End == */
} elseif($type == 'stats') {
/* Stats == Start == */
$predefined = array('forums', 'threads', 'posts', 'members', 'online', 'onlinemembers');
if($jssubmit && $function == 'stats') {
if($jssetting) {
$jsurl = $jssetting;
} else {
$jsurl = "function=$function".
"&jscharset=$parameter[jscharset]";
asort($displayorder);
foreach($displayorder as $key => $order) {
if($parameter[$key]['display']) {
$jsurl .= "&info[$key]=".rawurlencode($parameter[$key]['title']);
}
}
}
$jsurl .= ($parameter['cachelife'] != '' ? "&cachelife=$parameter[cachelife]" : '').
(!empty($parameter['jstemplate']) ? '&jstemplate='.rawurlencode($parameter['jstemplate']) : '');
$jsurlview = "$jsurl&nocache=yes";
$jsurlview = "{$boardurl}api/javascript.php?$jsurlview&verify=".md5($authkey.$jsurlview);
if(!$preview) {
jssavesetting(3);
}
$jsurl = "{$boardurl}api/javascript.php?$jsurl&verify=".md5($authkey.$jsurl);
$jspreview = "<textarea rows=\"3\" style=\"width: 100%; word-break: break-all\" onMouseOver=\"this.focus()\" onFocus=\"this.select()\">".
dhtmlspecialchars("<script language=\"JavaScript\" src=\"{$boardurl}api/javascript.php?key=".rawurlencode($jskey)."\"></script>").
"</textarea><br /><div class=\"jswizard\"><script language=\"JavaScript\" src=\"$jsurlview\"></script></div><br />";
}
if($jspreview) {
showtype('preview', 'top');
echo '<tr><td class="altbg1">'.$jspreview;
showtype('', 'bottom');
echo '<br />';
}
echo '<form method="post" action="admincp.php?action=jswizard&function=stats#'.$lang['jswizard_stats'].'"><a name="'.$lang['jswizard_stats'].'"></a>';
showtype('jswizard_jstemplate', 'top');
echo '<tr><td class="altbg1" colspan="2">'.$lang['jswizard_stats_jstemplate_comment'].'<br />';
echo '<img src="images/admincp/zoomin.gif" onmouseover="this.style.cursor=\'pointer\'" onclick="zoomtextarea(\'jstemplate\', 1)"> <img src="images/admincp/zoomout.gif" onmouseover="this.style.cursor=\'pointer\'" onclick="zoomtextarea(\'jstemplate\', 0)"><br />';
jsinsertunit();
echo '<textarea cols="100" rows="5" id="jstemplate" name="parameter[jstemplate]" style="width: 95%;">'.($parameter['jstemplate'] != '' ? stripslashes($parameter['jstemplate']) : '{name} {value}<br />').'</textarea></td></tr>';
showtype('', 'bottom');
echo '<br />';
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder"><tr class="header"><td colspan="4">'.$lang['jswizard_stats'].'</td></tr>';
showsetting('jswizard_jskey', 'jskey', $jskey, 'text');
showsetting('jswizard_cachelife', 'parameter[cachelife]', $parameter['cachelife'] != '' ? intval($parameter['cachelife']) : '', 'text');
if(strtoupper($charset) != 'UTF-8') {
showsetting('jswizard_charset', 'parameter[jscharset]', $parameter['jscharset'], 'radio');
} else {
showsetting('jswizard_charsetr', array('parameter[jscharset]', array(array(0, $lang['none']), array(1, 'GBK'), array(2, 'BIG5'))), intval($parameter['jscharset']), 'mradio');
}
echo '</table><br />';
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">';
echo '<tr class="category" align="center"><td>'.$lang['jswizard_stats_display'].'</td><td>'.$lang['jswizard_stats_display_title'].'</td><td>'.$lang['jswizard_stats_display_name'].'</td><td>'.$lang['display_order'].'</td></tr>';
$order = 0;
foreach($predefined as $key) {
echo '<tr align="center"><td class="altbg1"><input class="checkbox" type="checkbox" name="parameter['.$key.'][display]" value="1" '.(!isset($parameter[$key]) || $parameter[$key]['display'] ? 'checked' : '').'></td>'.
'<td class="altbg1">'.$lang['jswizard_stats_'.$key].'</td>'.
'<td class="altbg2"><input type="text" name="parameter['.$key.'][title]" size="15" value="'.($parameter[$key]['title'] ? $parameter[$key]['title'] : $lang['jswizard_stats_'.$key].':').'"></td>'.
'<td class="altbg2"><input type="text" name="displayorder['.$key.']" size="3" value="'.(isset($displayorder[$key]) ? intval($displayorder[$key]) : ++$order).'"></td></tr>';
}
echo '</table>'.$editext.'<br /><center><input class="button" type="submit" name="jssubmit" value="'.$lang['jswizard_preview'].'"> <input class="button" type="button" onclick="this.form.preview.value=0;this.form.jssubmit.click()" value="'.$lang['submit'].'"><input name="preview" type="hidden" value="1"></center></form><br />';
/* Stats == End == */
} elseif($type == 'images') {
/* Images == Start == */
for($i = 1; $i <= 4; $i++) {
$icheckdigest[$i] = !empty($parameter['digest'][$i]) ? 'checked' : '';
}
$parameter['newwindow'] = isset($parameter['newwindow']) ? intval($parameter['newwindow']) : 1;
$tradionewwindow[$parameter['newwindow']] = 'checked';
if($jssubmit && $function == 'images') {
$jsurl = $jssetting ? $jssetting : "function=$function".
($parameter['images_forums'] && !in_array('all', $parameter['images_forums'])? '&fids='.jsfids($parameter['images_forums']) : '').
"&maxwidth=$parameter[maxwidth]".
"&maxheight=$parameter[maxheight]".
"&startrow=$parameter[startrow]".
"&items=$parameter[items]".
"&blog=$parameter[blog]".
"&digest=".bindec(intval($parameter['digest'][1]).intval($parameter['digest'][2]).intval($parameter['digest'][3]).intval($parameter['digest'][4])).
"&newwindow=$parameter[newwindow]".
"&jscharset=$parameter[jscharset]".
($parameter['cachelife'] != '' ? "&cachelife=$parameter[cachelife]" : '').
(!empty($parameter['jstemplate']) ? '&jstemplate='.rawurlencode($parameter['jstemplate']) : '');
$jsurlview = "$jsurl&nocache=yes";
$jsurlview = "{$boardurl}api/javascript.php?$jsurlview&verify=".md5($authkey.$jsurlview);
if(!$preview) {
jssavesetting(4);
}
$jsurl = "{$boardurl}api/javascript.php?$jsurl&verify=".md5($authkey.$jsurl);
$jspreview = "<textarea rows=\"3\" style=\"width: 100%; word-break: break-all\" onMouseOver=\"this.focus()\" onFocus=\"this.select()\">".
dhtmlspecialchars("<script language=\"JavaScript\" src=\"{$boardurl}api/javascript.php?key=".rawurlencode($jskey)."\"></script>").
"</textarea><br /><div class=\"jswizard\"><script language=\"JavaScript\" src=\"$jsurlview\"></script></div><br />";
}
if($jspreview) {
showtype('preview', 'top');
echo '<tr><td class="altbg1">'.$jspreview;
showtype('', 'bottom');
echo '<br />';
}
echo '<form method="post" action="admincp.php?action=jswizard&function=images#'.$lang['jswizard_images'].'">';
showtype('jswizard_jstemplate', 'top');
echo '<tr><td class="altbg1" colspan="2">'.$lang['jswizard_images_jstemplate_comment'].'<br />';
echo '<img src="images/admincp/zoomin.gif" onmouseover="this.style.cursor=\'pointer\'" onclick="zoomtextarea(\'jstemplate\', 1)"> <img src="images/admincp/zoomout.gif" onmouseover="this.style.cursor=\'pointer\'" onclick="zoomtextarea(\'jstemplate\', 0)"><br />';
jsinsertunit();
echo '<textarea cols="100" rows="5" id="jstemplate" name="parameter[jstemplate]" style="width: 95%;">'.($parameter['jstemplate'] != '' ? stripslashes($parameter['jstemplate']) : '{image}').'</textarea></td></tr>';
showtype('', 'bottom');
echo '<br />';
showtype('jswizard_images', 'top');
showsetting('jswizard_jskey', 'jskey', $jskey, 'text');
showsetting('jswizard_cachelife', 'parameter[cachelife]', $parameter['cachelife'] != '' ? intval($parameter['cachelife']) : '', 'text');
showsetting('jswizard_images_fids', '', '', jsforumselect('images'));
showsetting('jswizard_images_startrow', 'parameter[startrow]', intval($parameter['startrow']), 'text');
showsetting('jswizard_images_items', 'parameter[items]', isset($parameter['items']) ? $parameter['items'] : 5, 'text');
showsetting('jswizard_images_maxwidth', 'parameter[maxwidth]', isset($parameter['maxwidth']) ? $parameter['maxwidth'] : 200, 'text');
showsetting('jswizard_images_maxheight', 'parameter[maxheight]', isset($parameter['maxheight']) ? $parameter['maxheight'] : 200, 'text');
showsetting('jswizard_images_blog', 'parameter[blog]', $parameter['blog'], 'radio');
showsetting('jswizard_images_digest', '', '', '<input class="checkbox" type="checkbox" name="parameter[digest][1]" value="1" '.$icheckdigest[1].'> '.$lang['jswizard_digest_1'].'<br /><input class="checkbox" type="checkbox" name="parameter[digest][2]" value="1" '.$icheckdigest[2].'> '.$lang['jswizard_digest_2'].'<br /><input class="checkbox" type="checkbox" name="parameter[digest][3]" value="1" '.$icheckdigest[3].'> '.$lang['jswizard_digest_3'].'<br /><input class="checkbox" type="checkbox" name="parameter[digest][4]" value="1" '.$icheckdigest[4].'> '.$lang['jswizard_digest_0']);
showsetting('jswizard_images_newwindow', 'parameter[newwindow]', '', '<input class="radio" type="radio" name="parameter[newwindow]" value="0" '.$tradionewwindow[0].'> '.$lang['jswizard_newwindow_self'].'<br /><input class="radio" type="radio" name="parameter[newwindow]" value="1" '.$tradionewwindow[1].'> '.$lang['jswizard_newwindow_blank'].'<br /><input class="radio" type="radio" name="parameter[newwindow]" value="2" '.$tradionewwindow[2].'> '.$lang['jswizard_newwindow_main']);
if(strtoupper($charset) != 'UTF-8') {
showsetting('jswizard_charset', 'parameter[jscharset]', $parameter['jscharset'], 'radio');
} else {
showsetting('jswizard_charsetr', array('parameter[jscharset]', array(array(0, $lang['none']), array(1, 'GBK'), array(2, 'BIG5'))), intval($parameter['jscharset']), 'mradio');
}
showtype('', 'bottom');
echo $editext.'<br /><center><input class="button" type="submit" name="jssubmit" value="'.$lang['jswizard_preview'].'"> <input class="button" type="button" onclick="this.form.preview.value=0;this.form.jssubmit.click()" value="'.$lang['submit'].'"><input name="preview" type="hidden" value="1"></center></form><br />';
/* Images == End == */
} elseif($type == 'custom') {
/* Custom == Start == */
if($jssubmit && $function == 'custom') {
$jsurl = $jssetting ? $jssetting : "function=$function".
"&jscharset=$parameter[jscharset]".
($parameter['cachelife'] != '' ? "&cachelife=$parameter[cachelife]" : '').
(!empty($parameter['jstemplate']) ? '&jstemplate='.rawurlencode($parameter['jstemplate']) : '');
$jsurlview = "$jsurl&nocache=yes";
$jsurlview = "{$boardurl}api/javascript.php?$jsurlview&verify=".md5($authkey.$jsurlview);
if(!$preview) {
jssavesetting(-1);
}
$jsurl = "{$boardurl}api/javascript.php?$jsurl&verify=".md5($authkey.$jsurl);
$jspreview = "<textarea rows=\"3\" style=\"width: 100%; word-break: break-all\" onMouseOver=\"this.focus()\" onFocus=\"this.select()\">".
dhtmlspecialchars("<script language=\"JavaScript\" src=\"{$boardurl}api/javascript.php?key=".rawurlencode($jskey)."\"></script>").
"</textarea><br /><div class=\"jswizard\"><script language=\"JavaScript\" src=\"$jsurlview\"></script></div><br />";
}
if($jspreview) {
showtype('preview', 'top');
echo '<tr><td class="altbg1">'.$jspreview;
showtype('', 'bottom');
echo '<br />';
}
echo '<form method="post" action="admincp.php?action=jswizard&function=custom#'.$lang['jswizard_custom'].'">';
showtype('jswizard_jstemplate', 'top');
echo '<tr><td class="altbg1" colspan="2">'.$lang['jswizard_custom_jstemplate_comment'].'<br />';
echo '<img src="images/admincp/zoomin.gif" onmouseover="this.style.cursor=\'pointer\'" onclick="zoomtextarea(\'jstemplate\', 1)"> <img src="images/admincp/zoomout.gif" onmouseover="this.style.cursor=\'pointer\'" onclick="zoomtextarea(\'jstemplate\', 0)"><br />';
jsinsertunit();
echo '<textarea cols="100" rows="5" id="jstemplate" name="parameter[jstemplate]" style="width: 95%;">'.($parameter['jstemplate'] != '' ? stripslashes($parameter['jstemplate']) : '').'</textarea></td></tr>';
showtype('', 'bottom');
echo '<br />';
showtype('jswizard_custom', 'top');
showsetting('jswizard_jskey', 'jskey', $jskey, 'text');
showsetting('jswizard_cachelife', 'parameter[cachelife]', $parameter['cachelife'] != '' ? intval($parameter['cachelife']) : '', 'text');
if(strtoupper($charset) != 'UTF-8') {
showsetting('jswizard_charset', 'parameter[jscharset]', $parameter['jscharset'], 'radio');
} else {
showsetting('jswizard_charsetr', array('parameter[jscharset]', array(array(0, $lang['none']), array(1, 'GBK'), array(2, 'BIG5'))), intval($parameter['jscharset']), 'mradio');
}
showtype('', 'bottom');
echo $editext.'<br /><center><input class="button" type="submit" name="jssubmit" value="'.$lang['jswizard_preview'].'"> <input class="button" type="button" onclick="this.form.preview.value=0;this.form.jssubmit.click()" value="'.$lang['submit'].'"><input name="preview" type="hidden" value="1"></center></form><br />';
/* Custom == End == */
}
} elseif($action == 'fileperms') {
shownav('menu_tools_fileperms');
showtips('fileperms_tips');
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['fileperms_check']?></td></tr>
<tr><td class="altbg1"><br /><ul>
<?
$entryarray = array(
'attachments',
'forumdata',
'customavatars',
'forumdata/threadcaches'
);
foreach(array('templates', 'forumdata/cache', 'forumdata/logs', 'forumdata/templates') as $directory) {
getdirentry($directory);
}
$fault = 0;
foreach($entryarray as $entry) {
$fullentry = DISCUZ_ROOT.'./'.$entry;
if(!is_dir($fullentry) && !file_exists($fullentry)) {
continue;
} else {
if(!is_writeable($fullentry)) {
echo '<li style="color: #FF0000">'.(is_dir($fullentry) ? $lang['fileperms_dir'] : $lang['fileperms_file'])." ./$entry $lang[fileperms_unwritable]";
$fault = 1;
}
}
}
echo ($fault ? '' : '<li>'.$lang['fileperms_check_ok']).'</ul><br /></td></tr></table>';
}
function jsforumselect($function) {
global $parameter, $lang, $db, $tablepre;
if(empty($function) || in_array($function, array('forums', 'threads', 'images'))) {
$forumselect = '<select name="parameter['.$function.'_forums][]" size="5" multiple="multiple">'.
'<option value="all" '.(is_array($parameter[$function.'_forums']) && in_array('all', $parameter[$function.'_forums']) ? 'selected="selected"' : '').'> '.$lang['jswizard_all_forums'].'</option>'.
'<option value=""> </option>';
if($function == 'forums') {
$query = $db->query("SELECT fid, name FROM {$tablepre}forums WHERE type='group' AND status>0 ORDER BY displayorder");
while($category = $db->fetch_array($query)) {
$forumselect .= '<option value="'.$category['fid'].'">'.strip_tags($category['name']).'</option>';
}
} else {
require_once DISCUZ_ROOT.'./include/forum.func.php';
$forumselect .= forumselect();
}
$forumselect .= '</select>';
if(is_array($parameter[$function.'_forums'])) {
foreach($parameter[$function.'_forums'] as $key => $value) {
if(!$value) {
unset($parameter[$function.'_forums'][$key]);
}
}
if(!in_array('all', $parameter[$function.'_forums'])) {
$forumselect = preg_replace("/(\<option value=\"(".implode('|', $parameter[$function.'_forums']).")\")(\>)/", "\\1 selected=\"selected\"\\3", $forumselect);
}
}
return $forumselect;
}
}
function jsfids($fidarray) {
foreach($fidarray as $key => $val) {
if(empty($val)) {
unset($fidarray[$key]);
}
}
return implode('_', $fidarray);
}
function jssavesetting($type) {
global $db, $tablepre, $jswizard, $jsurl, $parameter, $jskey, $edit;
$editadd = $edit ? "AND variable!='jswizard_$edit'" : '';
if($db->result($db->query("SELECT variable FROM {$tablepre}settings WHERE variable='jswizard_$jskey' $editadd"), 0)) {
cpmsg('jswizard_jskey_exists');
}
$jskey = str_replace('&', '', $jskey);
$jswizard = addslashes(serialize(array('type' => $type, 'url' => $jsurl, 'parameter' => $parameter)));
if(strlen($jswizard) > 65535) {
cpmsg('jswizard_overflow');
}
if($edit) {
$db->query("UPDATE {$tablepre}settings SET variable='jswizard_$jskey', value='$jswizard' WHERE variable='jswizard_$edit'");
} else {
$db->query("INSERT INTO {$tablepre}settings (variable, value) VALUES ('jswizard_$jskey', '$jswizard')");
}
updatecache('jswizard');
@unlink(DISCUZ_ROOT.'./forumdata/cache/javascript_'.$jskey.'.php');
cpmsg('jswizard_succeed', 'admincp.php?action=jswizard');
}
function jsinsertunit() {
?>
<script>
function isUndefined(variable) {
return typeof variable == 'undefined' ? true : false;
}
function insertunit(text) {
$('jstemplate').focus();
if(!isUndefined($('jstemplate').selectionStart)) {
var opn = $('jstemplate').selectionStart + 0;
$('jstemplate').value = $('jstemplate').value.substr(0, $('jstemplate').selectionStart) + text + $('jstemplate').value.substr($('jstemplate').selectionEnd);
} else if(document.selection && document.selection.createRange) {
var sel = document.selection.createRange();
sel.text = text.replace(/\r?\n/g, '\r\n');
sel.moveStart('character', -strlen(text));
} else {
$('jstemplate').value += text;
}
}
</script>
<?
}
function getdirentry($directory) {
global $entryarray;
$dir = dir(DISCUZ_ROOT.'./'.$directory);
while($entry = $dir->read()) {
if($entry != '.' && $entry != '..') {
if(is_dir(DISCUZ_ROOT.'./'.$directory.'/'.$entry)) {
$entryarray[] = $directory.'/'.$entry;
getdirentry($directory."/".$entry);
} else {
$entryarray[] = $directory.'/'.$entry;
}
}
}
$dir->close();
}
?> | zyyhong | trunk/jiaju001/bbs/admin/tools.inc.php | PHP | asf20 | 47,364 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: members.inc.php 10463 2007-09-03 01:23:37Z tiger $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
@set_time_limit(600);
cpheader();
if($action == 'memberadd') {
if(!submitcheck('addsubmit')) {
$groupselect = '';
$query = $db->query("SELECT groupid, type, grouptitle, creditshigher FROM {$tablepre}usergroups WHERE type='member' AND creditshigher='0' OR (groupid NOT IN ('5', '6', '7') AND radminid<>'1' AND type<>'member') ORDER BY type DESC, (creditshigher<>'0' || creditslower<>'0'), creditslower");
while($group = $db->fetch_array($query)) {
if($group['type'] == 'member' && $group['creditshigher'] == 0) {
$groupselect .= "<option value=\"$group[groupid]\" selected>$group[grouptitle]</option>\n";
} else {
$groupselect .= "<option value=\"$group[groupid]\">$group[grouptitle]</option>\n";
}
}
shownav('menu_members_add');
?>
<form method="post" action="admincp.php?action=memberadd">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['members_add']?></td></tr>
<tr><td class="altbg1" width="50%"><?=$lang['members_add_uid_range']?></td>
<td align="right" class="altbg2"><input type="text" name="uidlowerlimit" size="5"> - <input type="text" name="uidupperlimit" size="5"></td></tr>
<tr><td class="altbg1"><?=$lang['username']?>:</td>
<td align="right" class="altbg2"><input type="text" name="newusername"></td></tr>
<tr><td class="altbg1"><?=$lang['password']?>:</td>
<td align="right" class="altbg2"><input type="text" name="newpassword"></td></tr>
<tr><td class="altbg1"><?=$lang['email']?>:</td>
<td align="right" class="altbg2"><input type="text" name="newemail"></td></tr>
<tr>
<td class="altbg1"><?=$lang['usergroup']?>:</td>
<td align="right" class="altbg2"><select name="newgroupid"><?=$groupselect?></select></td>
</tr>
<tr><td class="altbg1"><?=$lang['members_add_email_notify']?></td>
<td align="right" class="altbg2"><input class="checkbox" type="checkbox" name="emailnotify" value="yes"></td></tr>
</table><br />
<center><input class="button" type="submit" name="addsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
$newusername = trim($newusername);
$newpassword = trim($newpassword);
$newemail = trim($newemail);
if(!$newusername || !$newpassword || !$newemail) {
cpmsg('members_add_invalid');
}
if(strlen($newusername) < 3) {
cpmsg('members_add_tooshort');
} elseif(strlen($newusername) > 15) {
cpmsg('members_add_toolong');
}
$guestexp = '\xA1\xA1|\xAC\xA3|^Guest|^\xD3\xCE\xBF\xCD|\xB9\x43\xAB\xC8';
$censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($censoruser = trim($censoruser)), '/')).')$/i';
if(preg_match("/^\s*$|^c:\\con\\con$|[%,\*\"\s\t\<\>\&]|$guestexp/is", $newusername) || ($censoruser && @preg_match($censorexp, $newusername))) {
cpmsg('members_add_illegal');
}
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE username='$newusername'");
if($db->num_rows($query)) {
cpmsg('members_add_username_duplicate');
}
$uidadd1 = $uidadd2 = '';
$uidupperlimit = intval($uidupperlimit);
$uidlowerlimit = intval($uidlowerlimit);
if($uidlowerlimit && $uidupperlimit >= $uidlowerlimit) {
$uid = $uidlowerlimit;
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE uid BETWEEN '$uidlowerlimit' AND '$uidupperlimit' ORDER BY uid");
while($member = $db->fetch_array($query)) {
if($member['uid'] > $uid) {
break;
} else {
$uid ++;
}
}
if($uid <= $uidupperlimit) {
$uidadd1 = 'uid, ';
$uidadd2 = $uid.', ';
} else {
cpmsg('members_add_uid_invalid');
}
}
$query = $db->query("SELECT groupid, radminid, type FROM {$tablepre}usergroups WHERE groupid='$newgroupid'");
$group = $db->fetch_array($query);
$newadminid = in_array($group['radminid'], array(1, 2, 3)) ? $group['radminid'] : ($group['type'] == 'special' ? -1 : 0);
if($group['radminid'] == 1) {
cpmsg('members_add_admin_none');
}
if(in_array($group['groupid'], array(5, 6, 7))) {
cpmsg('members_add_ban_all_none');
}
$db->query("INSERT INTO {$tablepre}members ($uidadd1 username, password, secques, gender, adminid, groupid, regip, regdate, lastvisit, lastactivity, posts, credits, email, bday, sigstatus, tpp, ppp, styleid, dateformat, timeformat, showemail, newsletter, invisible, timeoffset)
VALUES ($uidadd2 '$newusername', '".md5($newpassword)."', '', '0', '$newadminid', '$newgroupid', 'Manual Acting', '$timestamp', '$timestamp', '$timestamp', '0', '0', '$newemail', '0000-00-00', '0', '0', '0', '0', '0', '{$_DCACHE[settings][timeformat]}', '1', '1', '0', '{$_DCACHE[settings][timeoffset]}')");
$uid = $db->insert_id();
$db->query("REPLACE INTO {$tablepre}memberfields (uid) VALUES ('$uid')");
if($emailnotify == 'yes') {
sendmail("$newusername <$newemail>", 'add_member_subject', 'add_member_message');
}
updatecache('settings');
$newusername = stripslashes($newusername);
cpmsg('members_add_succeed');
}
} elseif($action == 'members') {
switch($submitname) {
case 'newslettersubmit': shownav('menu_members_newsletter'); $adminnavtitle = $lang['menu_members_newsletter']; break;
case 'creditsubmit': shownav('menu_members_credits'); $adminnavtitle = $lang['menu_members_credits']; break;
case 'deletesubmit': shownav('menu_members_delete'); $adminnavtitle = $lang['menu_members_delete']; break;
default : shownav('menu_members_edit'); $adminnavtitle = $lang['menu_members_edit']; break;
}
if(!submitcheck('searchsubmit', 1) && !submitcheck('deletesubmit', 1) && !submitcheck('sendsubmit', 1) && !submitcheck('editsubmit') && !submitcheck('updatecreditsubmit',1)) {
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='insenz'");
$insenz = ($insenz = $db->result($query, 0)) ? unserialize($insenz) : array();
$insenzgid = !empty($insenz['groupid']) ? "'$insenz[groupid]'" : "'0'";
$groupselect = '';
$usergroupid = isset($usergroupid) && is_array($usergroupid) ? $usergroupid : array();
$query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups WHERE groupid NOT IN ($insenzgid, '6', '7') ORDER BY (creditshigher<>'0' || creditslower<>'0'), creditslower");
while($group = $db->fetch_array($query)) {
$groupselect .= "<option value=\"$group[groupid]\" ".(in_array($group['groupid'], $usergroupid) ? 'selected' : '').">$group[grouptitle]</option>\n";
}
$monthselect = $dayselect = '';
for($m=1; $m<=12; $m++) {
$m = sprintf("%02d", $m);
$monthselect .= "<option value=\"$m\" ".($birthmonth == $m ? 'selected' : '').">$m</option>\n";
}
for($d=1; $d<=31; $d++) {
$d = sprintf("%02d", $d);
$dayselect .= "<option value=\"$d\" ".($birthday == $d ? 'selected' : '').">$d</option>\n";
}
$searchcredits = '';
if(!empty($extcredits)) {
foreach($extcredits as $id => $credit) {
$searchcredits .= "<tr><td class=\"altbg1\">$credit[title] $lang[members_search_lower]:</td>\n".
"<td align=\"right\" class=\"altbg2\"><input type=\"text\" name=\"lower[extcredits$id]\" value=\"".dhtmlspecialchars($lower['extcredits'.$id])."\" size=\"40\"></td></tr>\n".
"<tr><td class=\"altbg1\">$credit[title] $lang[members_search_higher]:</td>\n".
"<td align=\"right\" class=\"altbg2\"><input type=\"text\" name=\"higher[extcredits$id]\" value=\"".dhtmlspecialchars($higher['extcredits'.$id])."\" size=\"40\"></td></tr>\n";
}
}
?>
<form method="post" action="admincp.php?action=members&submitname=<?=$submitname?>" onSubmit="if($('updatecredittype1') && $('updatecredittype1').checked && !window.confirm('<?=$lang['members_credits_clean_alarm']?>')){return false;} else {return true;}">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$adminnavtitle?> - <?=$lang['members_search']?></td></tr>
<tr><td class="altbg1" width="45%"><?=$lang['members_search_user']?></td>
<td align="right" class="altbg2" width="40%">
<?=$lang['case_insensitive']?> <input type="checkbox" name="cins" value="1" class="checkbox" checked>
<br /><input type="text" name="username" size="40" value="<?=dhtmlspecialchars($username)?>"></td></tr>
<tr><td class="altbg1" valign="top"><?=$lang['members_search_group']?><br /><?=$lang['members_search_comment']?></td>
<td align="right" class="altbg2">
<select name="usergroupid[]" size="5" multiple="multiple" style="width: 65%">
<option value="all"<?php echo in_array('all', $usergroupid) ? ' selected' : '';?>><?=$lang['unlimited']?></option>
<?=$groupselect?>
</select></td></tr>
<tr><td class="altbg1"> </td>
<td align="right" class="altbg2" style="text-align: right;"><input class="checkbox" type="checkbox" value="1" onclick="$('advanceoption').style.display = $('advanceoption').style.display == 'none' ? '' : 'none'; this.value = this.value == 1 ? 0 : 1; this.checked = this.value == 1 ? false : true"><?=$lang['more_options']?> </td></tr>
<tbody id="advanceoption" style="display: none">
<tr><td class="altbg1"><?=$lang['members_search_email']?></td>
<td align="right" class="altbg2"><input type="text" name="srchemail" size="40" value="<?=dhtmlspecialchars($srchemail)?>"></td></tr>
<tr><td class="altbg1"><?=$lang['credits']?> <?=$lang['members_search_lower']?>:</td>
<td align="right" class="altbg2"><input type="text" name="lower[credits]" size="40" value="<?=dhtmlspecialchars($lower[credits])?>"></td></tr>
<tr><td class="altbg1"><?=$lang['credits']?> <?=$lang['members_search_higher']?>:</td>
<td align="right" class="altbg2"><input type="text" name="higher[credits]" size="40" value="<?=dhtmlspecialchars($higher[credits])?>"></td></tr>
<?=$searchcredits?>
<tr><td class="altbg1"><?=$lang['members_postslower']?>:</td>
<td align="right" class="altbg2"><input type="text" name="postslower" value="<?=dhtmlspecialchars($postslower)?>" size="40"></td></tr>
<tr><td class="altbg1"><?=$lang['members_postshigher']?>:</td>
<td align="right" class="altbg2"><input type="text" name="postshigher" size="40" value="<?=dhtmlspecialchars($postshigher)?>"></td></tr>
<tr><td class="altbg1"><?=$lang['members_search_regip']?></td>
<td align="right" class="altbg2"><input type="text" name="regip" size="40" value="<?=dhtmlspecialchars($regip)?>"></td></tr>
<tr><td class="altbg1"><?=$lang['members_search_lastip']?></td>
<td align="right" class="altbg2"><input type="text" name="lastip" size="40" value="<?=dhtmlspecialchars($lastip)?>"></td></tr>
<tr><td class="altbg1"><?=$lang['members_search_regdatebefore']?></td>
<td align="right" class="altbg2"><input type="text" name="regdatebefore" size="40" value="<?=dhtmlspecialchars($regdatebefore)?>"></td></tr>
<tr><td class="altbg1"><?=$lang['members_search_regdateafter']?></td>
<td align="right" class="altbg2"><input type="text" name="regdateafter" size="40" value="<?=dhtmlspecialchars($regdateafter)?>"></td></tr>
<tr><td class="altbg1"><?=$lang['members_search_lastvisitbefore']?></td>
<td align="right" class="altbg2"><input type="text" name="lastvisitbefore" size="40" value="<?=dhtmlspecialchars($lastvisitbefore)?>"></td></tr>
<tr><td class="altbg1"><?=$lang['members_search_lastvisitafter']?></td>
<td align="right" class="altbg2"><input type="text" name="lastvisitafter" size="40" value="<?=dhtmlspecialchars($lastvisitafter)?>"></td></tr>
<tr><td class="altbg1"><?=$lang['members_search_lastpostbefore']?></td>
<td align="right" class="altbg2"><input type="text" name="lastpostbefore" size="40" value="<?=dhtmlspecialchars($lastpostbefore)?>"></td></tr>
<tr><td class="altbg1"><?=$lang['members_search_lastpostafter']?></td>
<td align="right" class="altbg2"><input type="text" name="lastpostafter" size="40" value="<?=dhtmlspecialchars($lastpostafter)?>"></td></tr>
<tr><td class="altbg1"><?=$lang['members_search_birthday']?></td>
<td align="right" class="altbg2"><input type="text" name="birthyear" size="5" value="<?=dhtmlspecialchars($year)?>"> <?=$lang['year']?> <select name="birthmonth"><option value=""> </option><?=$monthselect?></select> <?=$lang['month']?> <select name="birthday"><option value=""> </option><?=$dayselect?></select> <?=$lang['day']?></td></tr>
</tbody>
</table><br /><center>
<?
switch($submitname) {
case 'newslettersubmit': echo '<input class="button" type="submit" name="newslettersubmit" value="'.$lang['members_newsletter'].'">'; break;
case 'creditsubmit': echo '<input class="button" type="submit" name="creditsubmit" value="'.$lang['members_credits'].'">'; break;
default : echo '<input class="button" type="submit" name="searchsubmit" value="'.$lang['members_search'].'">  <input class="button" type="submit" name="deletesubmit" value="'.$lang['members_delete'].'">'; break;
}
echo '</center>';
}
if(submitcheck('searchsubmit', 1) || submitcheck('deletesubmit', 1) || submitcheck('newslettersubmit') || submitcheck('sendsubmit', 1) || submitcheck('creditsubmit') || submitcheck('updatecreditsubmit', 1)) {
$memberperpage = 100;
$page = max(1, intval($page));
$start_limit = ($page - 1) * $memberperpage;
$dateoffset = date('Z') - ($timeoffset * 3600);
$username = trim($username);
$conditions = '';
if($username != '') {
$usernames = explode(',', $username);
foreach($usernames as $username) {
$usernameary[] = ($cins ? '' : 'BINARY')." username LIKE '".str_replace(array('%', '*', '_'), array('\%', '%', '\_'), $username)."'";
}
$conditions .= " AND (".implode(' OR ', $usernameary).")";
}
$conditions .= $srchemail != '' ? " AND email LIKE '".str_replace('*', '%', $srchemail)."'" : '';
$conditions .= !empty($usergroupid) && !in_array('all', $usergroupid) != '' ? " AND groupid IN ('".implode('\',\'', $usergroupid)."')" : '';
if(is_array($higher)) {
foreach($higher as $credit => $value) {
$credit = intval(substr($credit, 10));
if($value != '' && $credit > 0 && $credit < 9) {
$value = intval($value);
$conditions .= " AND extcredits$credit>'$value'";
}
}
}
if(is_array($lower)) {
foreach($lower as $credit => $value) {
$credit = intval(substr($credit, 10));
if($value != '' && $credit > 0 && $credit < 9) {
$value = intval($value);
$conditions .= " AND extcredits$credit<'$value'";
}
}
}
$conditions .= $postshigher != '' ? " AND posts>'$postshigher'" : '';
$conditions .= $postslower != '' ? " AND posts<'$postslower'" : '';
$conditions .= $higher['credits'] != '' ? " AND credits>'$higher[credits]'" : '';
$conditions .= $lower['credits'] != '' ? " AND credits<'$lower[credits]'" : '';
$conditions .= $regip != '' ? " AND regip LIKE '$regip%'" : '';
$conditions .= $lastip != '' ? " AND lastip LIKE '$lastip%'" : '';
$conditions .= $regdatebefore != '' ? " AND regdate<'".(strtotime($regdatebefore) + $dateoffset)."'" : '';
$conditions .= $regdateafter != '' ? " AND regdate>'".(strtotime($regdateafter) + $dateoffset)."'" : '';
$conditions .= $lastvisitafter != '' ? " AND lastvisit>'".(strtotime($lastvisitafter) + $dateoffset)."'" : '';
$conditions .= $lastvisitbefore != '' ? " AND lastvisit<'".(strtotime($lastvisitbefore) + $dateoffset)."'" : '';
$conditions .= $lastpostafter != '' ? " AND lastpost>'".(strtotime($lastpostafter) + $dateoffset)."'" : '';
$conditions .= $lastpostbefore != '' ? " AND lastpost<'".(strtotime($lastpostbefore) + $dateoffset)."'" : '';
$conditions .= $birthyear != '' || $birthmonth != '' || $birthday != '' ? " AND bday LIKE '".(($birthyear ? $birthyear : '%').'-'.($birthmonth ? $birthmonth : '%').'-'.($birthday ? $birthday : '%'))."'" : '';
$conditions .= submitcheck('newslettersubmit') || submitcheck('sendsubmit', 1) ? " AND newsletter='1'" : '';
if(!$conditions && !$uidarray && submitcheck('deletesubmit', 1)) {
cpmsg('members_search_invalid');
} else {
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='insenz'");
$insenz = ($insenz = $db->result($query, 0)) ? unserialize($insenz) : array();
$conditions = (!empty($insenz['groupid']) ? "groupid<>$insenz[groupid]" : '1').$conditions;
}
$urladd = '';
if(is_array($usergroupid)) {
foreach($usergroupid as $gid => $value) {
if($value != '') {
$urladd .= '&usergroupid[]='.rawurlencode($value);
}
}
}
foreach(array('lower', 'higher') as $key) {
if(is_array($$key)) {
foreach($$key as $column => $value) {
$urladd .= '&'.$key.'['.$column.']='.rawurlencode($value);
}
}
}
$conditionurladd = "$urladd&cins=".rawurlencode($cins)."&username=".rawurlencode($username)."&srchemail=".rawurlencode($srchemail)."®datebefore=".rawurlencode($regdatebefore)."®dateafter=".rawurlencode($regdateafter)."&postshigher=".rawurlencode($postshigher)."&postslower=".rawurlencode($postslower)."®ip=".rawurlencode($regip)."&lastip=".rawurlencode($lastip)."&lastvisitafter=".rawurlencode($lastvisitafter)."&lastvisitbefore=".rawurlencode($lastvisitbefore)."&lastpostafter=".rawurlencode($lastpostafter)."&lastpostbefore=".rawurlencode($lastpostbefore)."&birthyear=".rawurlencode($birthyear)."&birthmonth=".rawurlencode($birthmonth)."&birthday=".rawurlencode($birthday);
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}members WHERE $conditions");
$membernum = $db->result($query, 0);
if(submitcheck('newslettersubmit') || submitcheck('creditsubmit')) {
if(submitcheck('creditsubmit', 1)) {
$next = 'updatecreditsubmit';
$variable = 'creditsnotify';
} else {
$next = 'sendsubmit';
$variable = 'newsletter';
}
?>
<br /><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="9"><?=$lang['members_search_result']?> <?=$membernum?></td></tr>
<?
if(!$membernum) {
echo '<tr><td bgcolor="'.ALTBG2.'" colspan="2">'.$lang['members_search_nonexistence'].'</td></tr></table><br /></form>';
} else {
if($next == 'updatecreditsubmit') {
$creditscols = $creditsvalue = $resetcredits = $js_extcreditids = '';
for($i=1; $i<=8; $i++) {
$js_extcreditids .= (isset($extcredits[$i]) ? ($js_extcreditids ? ',' : '').$i : '');
$creditscols .= '<td width="10%">'.(isset($extcredits[$i]) ? $extcredits[$i]['title'] : 'extcredits'.$i).'</td>';
$creditsvalue .= '<td class="altbg'.($i % 2 + 1).'">'.(isset($extcredits[$i]) ? '<input type="text" size="3" name="addextcredits['.$i.']" value="0"> '.$extcredits['$i']['unit'] : '<input type="text" size="3" value="N/A" disabled>').'</td>';
$resetcredits .= '<td class="altbg'.($i % 2 + 1).'">'.(isset($extcredits[$i]) ? '<input type="checkbox" name="resetextcredits['.$i.']" value="1" class="radio" disabled> '.$extcredits['$i']['unit'] : '<input type="checkbox" disabled class="radio">').'</td>';
}
?>
<tr class="category" align="center"><td width="20%"><?=$lang['credits_title']?></td><?=$creditscols?></tr>
<tr align="center"><td class="altbg1"><input type="radio" name="updatecredittype" id="updatecredittype0" value="0" class="radio" onclick="var extcredits = new Array(<?=$js_extcreditids?>); for(k in extcredits) {$('resetextcredits['+extcredits[k]+']').disabled = true; $('addextcredits['+extcredits[k]+']').disabled = false;}" checked><?=$lang['members_credits_value']?></td><?=$creditsvalue?></tr>
<tr align="center"><td class="altbg1"><input type="radio" name="updatecredittype" id="updatecredittype1" value="1" class="radio" onclick="var extcredits = new Array(<?=$js_extcreditids?>); for(k in extcredits) {$('addextcredits['+extcredits[k]+']').disabled = true; $('resetextcredits['+extcredits[k]+']').disabled = false;}"><?=$lang['members_credits_clean']?> </td><?=$resetcredits?></tr>
</table>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><input class="checkbox" type="checkbox" name="sendcreditsletter" value="1" onclick="$('messagebody').disabled=!this.checked; $('messagebody').style.display = $('messagebody').style.display == '' ? 'none' : ''" class="checkbox"> <?=$lang['members_credits_notify']?></td></tr>
<?
}
$subject = $message = '';
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='$variable'");
if($settings = $db->result($query, 0)) {
$settings = unserialize($settings);
$subject = $settings['subject'];
$message = $settings['message'];
}
?>
<tbody id="messagebody"<?php echo $next == 'updatecreditsubmit' ? ' disabled style="display: none;"' : '';?>>
<tr>
<td class="altbg1"><?=$lang['subject']?>:</td>
<td class="altbg2"><input type="text" name="subject" size="80" value=<?=dhtmlspecialchars($subject)?>></td>
</tr>
<tr>
<td class="altbg1" valign="top"><?=$lang['message']?>:</td><td class="altbg2">
<textarea cols="80" rows="10" name="message"><?=dhtmlspecialchars($message)?></textarea></td></tr>
<tr>
<td class="altbg1"><?=$lang['members_newsletter_send_via']?></td>
<td class="altbg2">
<input class="radio" type="radio" value="email" name="sendvia" onclick="$('pertask').value = 1"> <?=$lang['email']?>
<input class="radio" type="radio" value="pm" checked name="sendvia" onclick="$('pertask').value = 100"> <?=$lang['pm']?>
</td></tr>
<tr>
<td class="altbg1"><?=$lang['members_newsletter_num']?></td>
<td class="altbg2"><input type="text" name="pertask" id="pertask" value="100" size="10"></td>
</tr>
</tbody>
</table><br />
<center><input class="button" type="submit" name="<?=$next?>" value="<?=$lang['submit']?>"></center></form>
<?
}
}
if(submitcheck('sendsubmit', 1) || submitcheck('updatecreditsubmit', 1)) {
if(submitcheck('updatecreditsubmit', 1)) {
$submit = 'updatecreditsubmit';
$variable = 'creditsnotify';
} else {
$submit = 'sendsubmit';
$variable = 'newsletter';
}
if(!empty($current)) {
$subject = $message = '';
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='$variable'");
if($settings = $db->result($query, 0)) {
$settings = unserialize($settings);
$subject = $settings['subject'];
$message = $settings['message'];
}
} else {
$current = 0;
if(($submit == 'sendsubmit' || !empty($sendcreditsletter)) && (!($subject = trim($subject)) || !($message = trim(str_replace("\t", ' ', $message))))) {
cpmsg('members_newsletter_sm_invalid');
}
if($submit == 'updatecreditsubmit') {
$updatesql = '';
if($updatecredittype == 0) {
if(is_array($addextcredits) && !empty($addextcredits)) {
foreach($addextcredits as $key => $value) {
$value = intval($value);
if(isset($extcredits[$key]) && !empty($value)) {
$updatesql .= ", extcredits{$key}=extcredits{$key}+($value)";
}
}
}
} else {
if(is_array($resetextcredits) && !empty($resetextcredits)) {
foreach($resetextcredits as $key => $value) {
$value = intval($value);
if(isset($extcredits[$key]) && !empty($value)) {
$updatesql .= ", extcredits{$key}=0";
}
}
}
}
if(!empty($updatesql)) {
$db->query("UPDATE {$tablepre}members set uid=uid $updatesql WHERE $conditions", 'UNBUFFTERED');
} else {
cpmsg('members_credits_invalid');
}
if(!$sendcreditsletter) {
cpmsg('members_credits_succeed');
}
}
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('$variable', '".
addslashes(serialize(array('subject' => $subject, 'message' => $message)))."')");
}
$pertask = intval($pertask);
$current = intval($current);
$uids = $emails = $comma = '';
if($sendvia == 'pm') {
$query = $db->query("SELECT groupid FROM {$tablepre}usergroups WHERE maxpmnum>0");
while($group = $db->fetch_array($query)) {
$groupmaxpm[$group['groupid']] = 1;
}
$query = $db->query("SELECT uid, username, groupid, email FROM {$tablepre}members WHERE $conditions LIMIT $current, $pertask");
} else {
$query = $db->query("SELECT uid, username, email FROM {$tablepre}members WHERE $conditions LIMIT $current, $pertask");
}
while($member = $db->fetch_array($query)) {
if($sendvia == 'pm' && isset($groupmaxpm[$member['groupid']])) {
$uids .= $comma.$member['uid'];
$db->query("INSERT INTO {$tablepre}pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
VALUES('$discuz_user', '$discuz_uid', '$member[uid]', 'inbox', '1', '".dhtmlspecialchars($subject)."', '$timestamp', '$message')");
$comma = ',';
} elseif($sendvia == 'email') {
$emails .= $comma."$member[username] <$member[email]>";
$comma = ',';
}
}
if($uids || $emails) {
if($sendvia == 'pm') {
$db->query("UPDATE {$tablepre}members SET newpm='1' WHERE uid IN ($uids)");
} elseif($sendvia == 'email') {
sendmail($emails, $subject, $message);
}
$next = $current + $pertask;
cpmsg("$lang[members_newsletter_send]: $lang[members_newsletter_processing]", "admincp.php?action=members&{$submit}=yes¤t=$next&pertask=$pertask&sendvia=".rawurlencode($sendvia).$conditionurladd);
} else {
cpmsg(($submit == 'sendsubmit') ? 'members_newsletter_succeed' : 'members_credits_notify_succeed');
}
} elseif(submitcheck('searchsubmit', 1)) {
$multipage = multi($membernum, $memberperpage, $page, "admincp.php?action=members&searchsubmit=yes$urladd&cins=".rawurlencode($cins)."&username=".rawurlencode($username)."&srchemail=".rawurlencode($srchemail)."®datebefore=".rawurlencode($regdatebefore)."®dateafter=".rawurlencode($regdateafter)."&postshigher=".rawurlencode($postshigher)."&postslower=".rawurlencode($postslower)."®ip=".rawurlencode($regip)."&lastip=".rawurlencode($lastip)."&lastvisitafter=".rawurlencode($lastvisitafter)."&lastvisitbefore=".rawurlencode($lastvisitbefore)."&lastpostafter=".rawurlencode($lastpostafter)."&lastpostbefore=".rawurlencode($lastpostbefore)."&birthyear=".rawurlencode($birthyear)."&birthmonth=".rawurlencode($birthmonth)."&day=".rawurlencode($birthday));
$usergroups = array();
$query = $db->query("SELECT groupid, type, grouptitle FROM {$tablepre}usergroups");
while($group = $db->fetch_array($query)) {
switch($group['type']) {
case 'system': $group['grouptitle'] = '<b>'.$group['grouptitle'].'</b>'; break;
case 'special': $group['grouptitle'] = '<i>'.$group['grouptitle'].'</i>'; break;
}
$usergroups[$group['groupid']] = $group;
}
$altbg1 = 'altbg'.((count($extcredits) + 3) % 2 ? '2' : '1');
$altbg2 = $altbg1 == 'altbg1' ? 'altbg2' : 'altbg1';
$query = $db->query("SELECT uid, username, adminid, groupid, credits, extcredits1, extcredits2,
extcredits3, extcredits4, extcredits5, extcredits6, extcredits7, extcredits8, posts FROM {$tablepre}members WHERE $conditions LIMIT $start_limit, $memberperpage");
while($member = $db->fetch_array($query)) {
$memberextcredits = array();
foreach($extcredits as $id => $credit) {
$memberextcredits[] = $extcredits[$id]['title'].': '.$member['extcredits'.$id];
}
$members .= "<tr align=\"center\" class=\"smalltxt\"><td class=\"altbg1\"><input type=\"checkbox\" name=\"uidarray[]\" value=\"$member[uid]\"".($member['adminid'] == 1 ? 'disabled' : '')." class=\"checkbox\"></td>\n".
"<td class=\"altbg2\"><a href=\"space.php?action=viewpro&uid=$member[uid]\" target=\"_blank\">$member[username]</a></td>\n".
"<td class=\"altbg1\" title=\"".implode("\n", $memberextcredits)."\">$member[credits]</td>\n<td class=\"$altbg1\">$member[posts]</td>\n".
"<td class=\"$altbg2\">{$usergroups[$member[adminid]][grouptitle]}</td>\n".
"<td class=\"$altbg1\">{$usergroups[$member[groupid]][grouptitle]}</td>\n".
"<td class=\"$altbg2\"><a href=\"admincp.php?action=editgroups&uid=$member[uid]\">[$lang[usergroup]]</a> ".
"<a href=\"admincp.php?action=access&uid=$member[uid]\">[$lang[access]]</a> ".
($extcredits ? "<a href=\"admincp.php?action=editcredits&uid=$member[uid]\">[$lang[credits]]</a> " : "<span disabled>[$lang[edit]]</span> ").
"<a href=\"admincp.php?action=editmedals&uid=$member[uid]\">[$lang[medals]]</a> ".
"<a href=\"admincp.php?action=memberprofile&uid=$member[uid]\">[$lang[detail]]</a></td></tr>\n";
}
showtips('members_tips');
?>
<?=$multipage?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder" style="table-layout: fixed">
<form method="post" action="admincp.php?action=members">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr align="center" class="header">
<td width="48"><input type="checkbox" name="chkall" onclick="checkall(this.form, 'uidarray')" class="checkbox"><?=$lang['del']?></td>
<td width="100"><?=$lang['username']?></td><td width="60"><?=$lang['credits']?></td><td width="60"><?=$lang['posts']?></td><td width="80"><?=$lang['admingroup']?><td width="80"><?=$lang['usergroup']?></td><td width="250"><?=$lang['edit']?></td></tr>
<?=$members?>
</table>
<?=$multipage?>
<br /><center><input class="button" type="submit" name="deletesubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} elseif(submitcheck('deletesubmit', 1)) {
$uids = 0;
$extra = '';
if(empty($uidarray)) {
$query = $db->query("SELECT uid, groupid, adminid FROM {$tablepre}members WHERE $conditions AND adminid<>1 AND groupid<>1");
} else {
$uids = is_array($uidarray) ? '\''.implode('\', \'', $uidarray).'\'' : '0';
$query = $db->query("SELECT uid, groupid, adminid FROM {$tablepre}members WHERE uid IN($uids) AND adminid<>1 AND groupid<>1");
}
$membernum = $db->num_rows($query);
$uids = $comma = '';
while($member = $db->fetch_array($query)) {
if($membernum < 2000 || !empty($uidarray)) {
$extra .= '<input type="hidden" name="uidarray[]" value="'.$member['uid'].'">';
}
$uids .= $comma.$member['uid'];
$comma = ',';
}
$extraincludepost .= '<br /><br /><input type="checkbox" name="includepost" value="1" class="checkbox">'.$lang['members_delete_post'];
if((empty($membernum) || empty($uids))) {
cpmsg('members_no_find_deluser');
}
if(!$confirmed) {
cpmsg('members_delete_confirm', "admincp.php?action=members&deletesubmit=yes&confirmed=yes".$conditionurladd, 'form', $extra.$extraincludepost);
} else {
if(empty($includepost)) {
$query = $db->query("DELETE FROM {$tablepre}members WHERE uid IN ($uids)");
$numdeleted = $db->affected_rows();
$db->query("DELETE FROM {$tablepre}access WHERE uid IN ($uids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}memberfields WHERE uid IN ($uids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}buddys WHERE uid IN ($uids) OR buddyid IN ($uids)",'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}favorites WHERE uid IN ($uids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}moderators WHERE uid IN ($uids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}pms WHERE msgfromid IN ($uids) OR msgtoid IN ($uids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}subscriptions WHERE uid IN ($uids)", 'UNBUFFERED');
cpmsg('members_delete_succeed');
} else {
$numdeleted = $numdeleted ? $numdeleted : count($uidarray);
$pertask = 1000;
$current = intval($current);
$next = $current + $pertask;
$threads = $fids = $threadsarray = array();
$query = $db->query("SELECT f.fid, t.tid FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON t.fid=f.fid WHERE t.authorid IN ($uids) ORDER BY f.fid LIMIT $pertask");
while($thread = $db->fetch_array($query)) {
$threads[$thread['fid']] .= ($threads[$thread['fid']] ? ',' : '').$thread['tid'];
}
$nextlink = "admincp.php?action=members&confirmed=yes&deletesubmit=yes&includepost=yes¤t=$next&pertask=$pertask&lastprocess=$processed".$conditionurladd;
if($threads) {
foreach($threads as $fid=>$tids) {
$query = $db->query("SELECT attachment, thumb, remote FROM {$tablepre}attachments WHERE tid IN ($tids)");
while($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
foreach(array('threads', 'threadsmod', 'relatedthreads', 'posts', 'polls', 'polloptions', 'trades', 'activities', 'activityapplies', 'debates', 'debateposts', 'attachments', 'favorites', 'mythreads', 'myposts', 'subscriptions', 'typeoptionvars', 'forumrecommend') as $value) {
$db->query("DELETE FROM {$tablepre}$value WHERE tid IN ($tids)", 'UNBUFFERED');
}
require_once DISCUZ_ROOT.'./include/post.func.php';
updateforumcount($fid);
}
if($globalstick && $stickmodify) {
require_once DISCUZ_ROOT.'./include/cache.func.php';
updatecache('globalstick');
}
?>
<br /><br /><br /><br /><br /><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['discuz_message']?></td></tr><tr><td class="altbg2" align="center" style="text-align: center;">
<br /><br />
<?=$lang['members_delete_post']?>: <?php eval('echo "'.$lang['members_delete_processing'].'";');?>
<form action="<?=$nextlink?>" id="deleteform" method="post">
<?=$extra?>
<br /><br /><a href="###" onclick="$('deleteform').submit();"><?=$lang['message_redirect']?></a>
</form>
<script>
setTimeout("$('deleteform').submit();", 3000);
</script>
<br /><br />
</td></tr></table>
<br /><br /><br />
<?
cpfooter();
dexit();
} elseif($uids) {
$query = $db->query("DELETE FROM {$tablepre}members WHERE uid IN ($uids)");
$numdeleted = $db->affected_rows();
$db->query("DELETE FROM {$tablepre}access WHERE uid IN ($uids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}memberfields WHERE uid IN ($uids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}buddys WHERE uid IN ($uids) OR buddyid IN ($uids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}favorites WHERE uid IN ($uids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}moderators WHERE uid IN ($uids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}pms WHERE msgfromid IN ($uids) OR msgtoid IN ($uids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}subscriptions WHERE uid IN ($uids)", 'UNBUFFERED');
$query = $db->query("SELECT uid, attachment, thumb, remote FROM {$tablepre}attachments WHERE uid IN ($uids) LIMIT $pertask");
while($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
$db->query("DELETE FROM {$tablepre}attachments WHERE uid IN ($uids)");
$db->query("DELETE FROM {$tablepre}posts WHERE authorid IN ($uids)");
$db->query("DELETE FROM {$tablepre}trades WHERE sellerid IN ($uids)");
cpmsg('members_delete_succeed');
} else {
cpmsg('members_no_find_deluser');
}
}
}
}
} else {
echo '</form>';
}
} elseif($action == 'membersmerge') {
if(!submitcheck('mergesubmit')) {
shownav('menu_members_merge');
?>
<form method="post" action="admincp.php?action=membersmerge">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="3"><?=$lang['members_merge']?></td></tr>
<tr align="center"><td class="altbg1" width="40%"><?=$lang['members_merge_source']?> 1:</td>
<td class="altbg2" width="45%"><input type="text" name="source[]" size="20"></td></tr>
<tr align="center"><td class="altbg1" width="40%"><?=$lang['members_merge_source']?> 2:</td>
<td class="altbg2" width="45%"><input type="text" name="source[]" size="20"></td></tr>
<tr align="center"><td class="altbg1" width="40%"><?=$lang['members_merge_source']?> 3:</td>
<td class="altbg2" width="45%"><input type="text" name="source[]" size="20"></td></tr>
<tr align="center"><td class="altbg1" width="40%"><?=$lang['members_merge_target']?>:</td>
<td class="altbg2" width="45%"><input type="text" name="target" size="20"></td></tr>
</table><br /><center><input class="button" type="submit" name="mergesubmit" value="<?=$lang['submit']?>"></center></form>
<?
} else {
$suids = $susernames = $comma = $tuid = $tusername = $sourcemember = $targetmember = '';
if(is_array($source)) {
$query = $db->query("SELECT uid, username, adminid, groupid FROM {$tablepre}members WHERE username IN ('".implode('\',\'', $source)."') AND username<>''");
while($member = $db->fetch_array($query)) {
if($member['adminid'] == 1 || $member['groupid'] == 1) {
cpmsg('members_dont_contain_admin_merge');
}
$suids .= $comma.$member['uid'];
$susernames .= $comma.'\''.addslashes($member['username']).'\'';
$sourcemember .= $comma.$member['username'];
$comma = ', ';
}
}
$query = $db->query("SELECT uid, username FROM {$tablepre}members WHERE username='$target'");
if(!($member = $db->fetch_array($query)) || !$suids) {
cpmsg('members_merge_invalid');
}
if(in_array($target, $source)) {
cpmsg('members_sameness');
}
$tuid = $member['uid'];
$tusername = addslashes($member['username']);
$targetmember = $member['username'];
if(!$confirmed) {
$extra = '<input type="hidden" name="target" value="'.dhtmlspecialchars($target).'">';
foreach($source as $username) {
$extra .= '<input type="hidden" name="source[]" value="'.dhtmlspecialchars($username).'">';
}
cpmsg('members_merge_confirm', "admincp.php?action=membersmerge&mergesubmit=yes", 'form', $extra);
} else {
$db->query("DELETE FROM {$tablepre}access WHERE uid IN ($suids)");
$db->query("UPDATE {$tablepre}adminnotes SET admin='$tusername' WHERE admin IN ($susernames)");
$db->query("UPDATE {$tablepre}adminsessions SET uid='$tuid' WHERE uid IN ($suids)");
$db->query("UPDATE {$tablepre}announcements SET author='$tusername' WHERE author IN ($susernames)");
$db->query("UPDATE {$tablepre}banned SET admin='$tusername' WHERE admin IN ($susernames)");
$db->query("DELETE FROM {$tablepre}buddys WHERE uid IN ($suids) OR buddyid IN ($suids)");
$db->query("UPDATE {$tablepre}favorites SET uid='$tuid' WHERE uid IN ($suids)");
$db->query("DELETE FROM {$tablepre}memberfields WHERE uid IN ($suids)");
$db->query("DELETE FROM {$tablepre}moderators WHERE uid IN ($suids)");
$db->query("UPDATE {$tablepre}myposts SET uid='$tuid' WHERE uid IN ($suids)", 'SILENT');
$db->query("DELETE FROM {$tablepre}myposts WHERE uid IN ($suids)");
$db->query("UPDATE {$tablepre}mythreads SET uid='$tuid' WHERE uid IN ($suids)");
$db->query("UPDATE {$tablepre}pms SET msgfromid='$tuid', msgfrom='$tusername' WHERE msgfromid IN ($suids)");
$db->query("UPDATE {$tablepre}pms SET msgtoid='$tuid' WHERE msgtoid IN ($suids)");
$db->query("UPDATE {$tablepre}posts SET author='$tusername', authorid='$tuid' WHERE authorid IN ($suids)");
$db->query("UPDATE {$tablepre}ratelog SET uid='$tuid', username='$tusername' WHERE uid IN ($suids)");
$db->query("DELETE FROM {$tablepre}subscriptions WHERE uid IN ($suids)");
$db->query("UPDATE {$tablepre}threads SET author='$tusername', authorid='$tuid' WHERE authorid IN ($suids)");
$db->query("UPDATE {$tablepre}threads SET lastposter='$tusername' WHERE lastposter IN ($susernames)");
$db->query("UPDATE {$tablepre}threadsmod SET uid='$tuid', username='$tusername' WHERE uid IN ($suids)");
$db->query("DELETE FROM {$tablepre}validating WHERE uid IN ($suids)");
$db->query("UPDATE {$tablepre}validating SET admin='$tusername' WHERE admin IN ($susernames)");
$db->query("DELETE FROM {$tablepre}onlinetime WHERE uid IN ($suids)");
$db->query("DELETE FROM {$tablepre}spacecaches WHERE uid IN ($suids)");
$query = $db->query("SELECT SUM(credits) AS credits, SUM(extcredits1) AS extcredits1,
SUM(extcredits2) AS extcredits2, SUM(extcredits3) AS extcredits3,
SUM(extcredits4) AS extcredits4, SUM(extcredits5) AS extcredits5,
SUM(extcredits6) AS extcredits6, SUM(extcredits7) AS extcredits7,
SUM(extcredits8) AS extcredits8, SUM(posts) AS posts,
SUM(digestposts) AS digestposts, SUM(pageviews) AS pageviews,
SUM(oltime) AS oltime
FROM {$tablepre}members WHERE uid IN ($suids)");
$member = $db->fetch_array($query);
$db->query("UPDATE {$tablepre}members SET credits=credits+$member[credits],
extcredits1=extcredits1+$member[extcredits1], extcredits2=extcredits2+$member[extcredits2],
extcredits3=extcredits3+$member[extcredits3], extcredits4=extcredits4+$member[extcredits4],
extcredits5=extcredits5+$member[extcredits5], extcredits6=extcredits6+$member[extcredits6],
extcredits7=extcredits7+$member[extcredits7], extcredits8=extcredits8+$member[extcredits8],
posts=posts+$member[posts], digestposts=digestposts+$member[digestposts],
pageviews=pageviews+$member[pageviews], oltime=oltime+$member[oltime]
WHERE uid='$tuid'");
$db->query("DELETE FROM {$tablepre}members WHERE uid IN ($suids)");
updatecache('settings');
cpmsg('members_merge_succeed');
}
}
} elseif($action == 'editgroups') {
$query = $db->query("SELECT m.uid, m.username, m.adminid, m.groupid, m.groupexpiry, m.extgroupids, m.credits,
mf.groupterms, u.type AS grouptype, u.grouptitle
FROM {$tablepre}members m
LEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid
LEFT JOIN {$tablepre}usergroups u ON u.groupid=m.groupid
WHERE m.uid='$uid'");
if(!$member = $db->fetch_array($query)) {
cpmsg('members_edit_nonexistence');
} elseif(!$isfounder && ($member['adminid'] == 1 || $member['groupid'] == 1)) {
cpmsg('members_super_edit_admin_allow');
}
if(!submitcheck('editsubmit')) {
$checkadminid = array(($member['adminid'] >= 0 ? $member['adminid'] : 0) => 'checked');
$member['groupterms'] = unserialize($member['groupterms']);
if($member['groupterms']['main']) {
$expirydate = gmdate('Y-n-j', $member['groupterms']['main']['time'] + $timeoffset * 3600);
$expirydays = ceil(($member['groupterms']['main']['time'] - $timestamp) / 86400);
$selecteaid = array($member['groupterms']['main']['adminid'] => 'selected');
$selectegid = array($member['groupterms']['main']['groupid'] => 'selected');
} else {
$expirydate = $expirydays = '';
$selecteaid = array($member['adminid'] => 'selected');
$selectegid = array(($member['grouptype'] == 'member' ? 0 : $member['groupid']) => 'selected');
}
$class = 'altbg1';
$extgroupcount = 0;
$extgroups = $expgroups = $curtype = $thisbg = '';
$extgrouparray = explode("\t", $member['extgroupids']);
$groups = array('system' => '', 'special' => '', 'member' => '');
$group = array('groupid' => 0, 'radminid' => 0, 'type' => '', 'grouptitle' => $lang['usergroups_system_0'], 'creditshigher' => 0, 'creditslower' => '0');
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='insenz'");
$insenz = ($insenz = $db->result($query, 0)) ? unserialize($insenz) : array();
$insenzgid = !empty($insenz['groupid']) ? "'$insenz[groupid]'" : "'0'";
$query = $db->query("SELECT groupid, radminid, type, grouptitle, creditshigher, creditslower
FROM {$tablepre}usergroups WHERE groupid NOT IN ($insenzgid, '6', '7') ORDER BY creditshigher, groupid");
do {
if($group['groupid'] && !in_array($group['groupid'], array(4, 5, 6, 7, 8)) && ($group['type'] == 'system' || $group['type'] == 'special')) {
$extgroups .= ($extgroupcount++ % 2 == 0 ? '</tr><tr>' : '').
'<td class="altbg2"><input class="checkbox" type="checkbox" name="extgroupidsnew[]" value="'.$group['groupid'].'" '.(in_array($group['groupid'], $extgrouparray) ? 'checked' : '').'> '.$group['grouptitle'].'</td><td align="center" class="altbg2"><input type="text" size="9" name="extgroupexpirynew['.$group['groupid'].']" value="'.(in_array($group['groupid'], $extgrouparray) && !empty($member['groupterms']['ext'][$group['groupid']]) ? gmdate('Y-n-j', $member['groupterms']['ext'][$group['groupid']] + $timeoffset * 3600) : '').'" onclick="showcalendar(event, this)"></td>';
}
if($group['groupid'] && $group['type'] == 'member' && !($member['credits'] >= $group['creditshigher'] && $member['credits'] < $group['creditslower']) && $member['groupid'] != $group['groupid']) {
continue;
}
$expgroups .= '<option name="expgroupidnew" value="'.$group['groupid'].'" '.$selectegid[$group['groupid']].'>'.$group['grouptitle'].'</option>';
if($group['groupid'] != 0) {
$thisbg = $curtype == $group['type'] && $thisbg == 'altbg2' ? 'altbg1' : 'altbg2';
$curtype = $group['type'];
$groupradmin = $group['type'] == 'special' && !$group['radminid'] ? '<select name="adminidnew['.$group['groupid'].']"><option value="0"'.($member['adminid'] == 0 ? ' selected' : '').'>'.$lang['usergroups_system_0'].'</option><option value="3"'.($member['adminid'] == 3 ? ' selected' : '').'>'.$lang['usergroups_system_3'].'</option><option value="2"'.($member['adminid'] == 2 ? ' selected' : '').'>'.$lang['usergroups_system_2'].'</option><option value="1"'.($member['adminid'] == 1 ? ' selected' : '').'>'.$lang['usergroups_system_1'].'</option></select>' : ($group['radminid'] ? $lang['usergroups_system_'.$group['radminid']] : '<span class="warning">X</span>');
$groups[$group['type']] .= '<tr class="'.$thisbg.'"><td><input class="radio" type="radio" name="groupidnew" value="'.$group['groupid'].'" '.($member['groupid'] == $group['groupid'] ? 'checked' : '').'> '.$group['grouptitle'].'</td><td>'.$groupradmin.'</td></tr>';
}
} while($group = $db->fetch_array($query));
$extgroups .= $extgroupcount++ % 2 != 0 ? '<td colspan="2" class="altbg2"> </tr><tr>' : '';
if(!$groups['member']) {
$query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups WHERE type='member' AND creditshigher>='0' ORDER BY creditshigher LIMIT 1");
$group = $db->fetch_array($query);
$groups['member'] = '<tr><td class="altbg1"><input class="radio" type="radio" name="groupidnew" value="'.$group['groupid'].'"> '.$group['grouptitle'].'</td></tr>';
}
shownav('members_edit_groups');
?>
<script src="include/javascript/calendar.js" type="text/javascript"></script>
<form method="post" action="admincp.php?action=editgroups&uid=<?=$member['uid']?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['members_edit_groups']?> - <?=$member['username']?></td></tr>
<tr class="altbg1"><td><table cellspacing="0" cellpadding="10" width="100%" align="center">
<tr><td width="35%" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['usergroup']?></td><td><?=$lang['members_edit_groups_related_adminid']?></td></tr>
<tr><td class="category" colspan="2"><span class="bold"><?=$lang['usergroups_system']?></span></td></tr>
<?=$groups['system']?>
<tr><td class="category" colspan="2"><span class="bold"><?=$lang['usergroups_special']?></span></td></tr>
<?=$groups['special']?>
<tr><td class="category" colspan="2"><span class="bold"><?=$lang['usergroups_member']?></span></td></tr>
<?=$groups['member']?>
</table>
</td>
<td width="65%" align="right" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="4"><?=$lang['members_edit_groups_extended']?></td></tr>
<tr align="center" class="category"><td width="30%"><?=$lang['usergroup']?></td><td width="20%"><?=$lang['validity']?></td><td width="30%"><?=$lang['usergroup']?></td><td width="20%"><?=$lang['validity']?></td>
<?=$extgroups?>
<tr><td colspan="4" class="altbg2"><?=$lang['members_edit_groups_extended_comment']?></td></tr>
</table><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['validity']?></td></tr>
<tr><td class="altbg1" width="45%"><b><?=$lang['members_edit_groups_validity']?></b><br /><span class="smalltxt"><?=$lang['members_edit_groups_validity_comment']?></span></td>
<td class="altbg2" width="40%">
<input class="radio" type="radio" name="expirytype" value="date" checked> <input type="text" name="expirydatenew" value="<?=$expirydate?>" size="15"> <?=$lang['members_edit_groups_validity_date']?><br />
<input class="radio" type="radio" name="expirytype" value="days"> <input type="text" name="expirydaysnew" value="<?=$expirydays?>" size="15"> <?=$lang['members_edit_groups_validity_days']?><br /></td></tr>
<tr><td class="altbg1" width="45%"><b><?=$lang['members_edit_groups_orig_groupid']?></b></td><td class="altbg2" width="40%">
<select name="expadminidnew">
<option value="0" <?=$selecteaid[0]?>><?=$lang['usergroups_system_0']?></option>
<option value="1" <?=$selecteaid[1]?>><?=$lang['usergroups_system_1']?></option>
<option value="2" <?=$selecteaid[2]?>><?=$lang['usergroups_system_2']?></option>
<option value="3" <?=$selecteaid[3]?>><?=$lang['usergroups_system_3']?></option>
</select></td></tr>
<tr><td class="altbg1" width="45%"><b><?=$lang['members_edit_groups_orig_adminid']?></b></td><td class="altbg2" width="40%">
<select name="expgroupidnew"><?=$expgroups?></select></td></tr>
</table><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['members_edit_reason']?></td></tr>
<tr><td class="altbg1" width="45%"><b><?=$lang['members_edit_groups_ban_reason']?></b><br /><span class="smalltxt"><?=$lang['members_edit_groups_ban_reason_comment']?></span></td>
<td class="altbg2" width="40%"><textarea name="reason" rows="5" cols="30"></textarea></td></tr>
</table><br /><br /><center><input class="button" type="submit" name="editsubmit" value="<?=$lang['submit']?>"></center>
</td></tr></table>
</td></tr>
</table></form>
<?
} else {
$query = $db->query("SELECT groupid, radminid, type FROM {$tablepre}usergroups WHERE groupid='$groupidnew'");
if(!$group = $db->fetch_array($query)) {
cpmsg('undefined_action');
}
if(strlen(is_array($extgroupidsnew) ? implode("\t", $extgroupidsnew) : '') > 60) {
cpmsg('members_edit_groups_toomany');
}
$adminidnew = $adminidnew[$groupidnew];
switch($group['type']) {
case 'member':
$groupidnew = in_array($adminidnew, array(1, 2, 3)) ? $adminidnew : $groupidnew;
break;
case 'special':
if($group['radminid']) {
$adminidnew = $group['radminid'];
} elseif(!in_array($adminidnew, array(1, 2, 3))) {
$adminidnew = -1;
}
break;
case 'system':
$adminidnew = in_array($groupidnew, array(1, 2, 3)) ? $groupidnew : -1;
break;
}
$groupterms = array();
if($expirytype == 'date' && $expirydatenew) {
$maingroupexpirynew = strtotime($expirydatenew) - date('Z') + $timeoffset * 3600;
} elseif($expirytype == 'days' && $expirydaysnew) {
$maingroupexpirynew = $timestamp + $expirydaysnew * 86400;
} else {
$maingroupexpirynew = 0;
}
if($maingroupexpirynew) {
$query = $db->query("SELECT groupid, radminid, type FROM {$tablepre}usergroups WHERE groupid='$expgroupidnew'");
if(!$group = $db->fetch_array($query)) {
$expgroupidnew = in_array($expadminidnew, array(1, 2, 3)) ? $expadminidnew : $expgroupidnew;
} else {
switch($group['type']) {
case 'special':
if($group['radminid']) {
$expadminidnew = $group['radminid'];
} elseif(!in_array($expadminidnew, array(1, 2, 3))) {
$expadminidnew = -1;
}
break;
case 'system':
$expadminidnew = in_array($expgroupidnew, array(1, 2, 3)) ? $expgroupidnew : -1;
break;
}
}
if($expgroupidnew == $groupidnew) {
cpmsg('members_edit_groups_illegal');
} elseif($maingroupexpirynew > $timestamp) {
if($expgroupidnew || $expadminidnew) {
$groupterms['main'] = array('time' => $maingroupexpirynew, 'adminid' => $expadminidnew, 'groupid' => $expgroupidnew);
} else {
$groupterms['main'] = array('time' => $maingroupexpirynew);
}
$groupterms['ext'][$groupidnew] = $maingroupexpirynew;
}
}
if(is_array($extgroupexpirynew)) {
foreach($extgroupexpirynew as $extgroupid => $expiry) {
if(is_array($extgroupidsnew) && in_array($extgroupid, $extgroupidsnew) && !isset($groupterms['ext'][$extgroupid]) && $expiry && ($expiry = strtotime($expiry) - date('Z') + $timeoffset * 3600) > $timestamp) {
$groupterms['ext'][$extgroupid] = $expiry;
}
}
}
$grouptermsnew = addslashes(serialize($groupterms));
$groupexpirynew = groupexpiry($groupterms);
$extgroupidsnew = $extgroupidsnew && is_array($extgroupidsnew) ? implode("\t", $extgroupidsnew) : '';
$db->query("UPDATE {$tablepre}members SET groupid='$groupidnew', adminid='$adminidnew', extgroupids='$extgroupidsnew', groupexpiry='$groupexpirynew' WHERE uid='$member[uid]'");
$db->query("UPDATE {$tablepre}memberfields SET groupterms='$grouptermsnew' WHERE uid='$member[uid]'");
if($groupidnew != $member['groupid'] && (in_array($groupidnew, array(4, 5)) || in_array($member['groupid'], array(4, 5)))) {
banlog($member['username'], $member['groupid'], $groupidnew, $groupexpirynew, $reason);
}
cpmsg('members_edit_groups_succeed', "admincp.php?action=editgroups&uid=$member[uid]");
}
} elseif($action == 'editcredits' && $uid && $extcredits) {
$query = $db->query("SELECT m.*, u.grouptitle, u.type, u.creditslower, u.creditshigher
FROM {$tablepre}members m
LEFT JOIN {$tablepre}usergroups u ON u.groupid=m.groupid
WHERE uid='$uid'");
if(!$member = $db->fetch_array($query)) {
cpmsg('members_edit_nonexistence');
} elseif(!$isfounder && ($member['adminid'] == 1 || $member['groupid'] == 1)) {
cpmsg('members_super_edit_admin_allow');
}
if(!submitcheck('creditsubmit')) {
eval("\$membercredit = @round($creditsformula);");
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='creditsformula'");
if($jscreditsformula = $db->result($query, 0)) {
$jscreditsformula = str_replace(array('digestposts', 'posts', 'pageviews', 'oltime'), array($member['digestposts'], $member['posts'],$member['pageviews'],$member['oltime']), $jscreditsformula);
}
$creditscols = $creditsvalue = '';
for($i = 1; $i <= 8; $i++) {
$jscreditsformula = str_replace('extcredits'.$i, "extcredits[$i]", $jscreditsformula);
$creditscols .= '<td width="9%">'.(isset($extcredits[$i]) ? $extcredits[$i]['title'] : 'extcredits'.$i).'</td>';
$creditsvalue .= '<td class="altbg'.(($i + 1) % 2 + 1).'">'.(isset($extcredits[$i]) ? '<input type="text" size="3" name="extcreditsnew['.$i.']" id="extcreditsnew['.$i.']" value="'.$member['extcredits'.$i].'" onkeyup="membercredits()"> '.$extcredits['$i']['unit'] : '<input type="text" size="3" value="N/A" disabled>').'</td>';
}
$creditsrangs = $member['type'] == 'member' ? "$member[creditshigher]~$member[creditslower]" : 'N/A';
shownav('members_edit_credits');
showtips('credits_tips');
?>
<form name="input" method="post" action="admincp.php?action=editcredits&uid=<?=$uid?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="10"><?=$lang['members_edit_credits']?> - <?=$member['username']?>(<?=$member['grouptitle']?>)</td></tr>
<tr class="category" align="center"><td width="14%"><?=$lang['members_edit_credits_ranges']?></td><td width="14%"><?=$lang['credits']?></td><?=$creditscols?></tr>
<tr align="center"><td class="altbg1"><?=$creditsrangs?></td><td class="altbg2"><input type="text" name="jscredits" id="jscredits" value="<?=$membercredit?>" size="3" disabled></td><?=$creditsvalue?></tr>
</table><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['members_edit_reason']?></td></tr>
<tr><td class="altbg1" width="45%"><b><?=$lang['members_edit_credits_reason']?></b><br /><span class="smalltxt"><?=$lang['members_edit_credits_reason_comment']?></span></td>
<td class="altbg2" width="40%"><textarea name="reason" rows="5" cols="30" style="width: 90%"></textarea></td></tr>
</table><br /><center>
<script language="JavaScript">
var extcredits = new Array();
function membercredits() {
var credits = 0;
for(var i = 1; i <= 8; i++) {
e = $('extcreditsnew['+i+']');
if(e && parseInt(e.value)) {
extcredits[i] = parseInt(e.value);
} else {
extcredits[i] = 0;
}
}
$('jscredits').value = Math.round(<?=$jscreditsformula?>);
}
</script>
<input class="button" type="submit" name="creditsubmit" value="<?=$lang['submit']?>">
</center></form>
<?
} else {
$diffarray = array();
$sql = $comma = '';
if(is_array($extcreditsnew)) {
foreach($extcreditsnew as $id => $value) {
if($member['extcredits'.$id] != ($value = intval($value))) {
$diffarray[$id] = $value - $member['extcredits'.$id];
$sql .= $comma."extcredits$id='$value'";
$comma = ', ';
}
}
}
if($diffarray) {
if(empty($reason)) {
cpmsg('members_edit_reason_invalid');
}
foreach($diffarray as $id => $diff) {
$logs[] = dhtmlspecialchars("$timestamp\t$discuz_userss\t$adminid\t$member[username]\t$id\t$diff\t0\t\t$reason");
}
$db->query("UPDATE {$tablepre}members SET $sql WHERE uid='$uid'");
writelog('ratelog', $logs);
}
cpmsg('members_edit_credits_succeed', "admincp.php?action=editcredits&uid=$uid");
}
} elseif($action == 'editmedals' && $uid) {
$query = $db->query("SELECT m.uid, m.username, mf.medals
FROM {$tablepre}memberfields mf, {$tablepre}members m
WHERE mf.uid='$uid' AND m.uid=mf.uid");
if(!$member = $db->fetch_array($query)) {
cpmsg('members_edit_nonexistence');
}
if(!submitcheck('medalsubmit')) {
$medals = '';
$membermedals = explode("\t", $member['medals']);
$query = $db->query("SELECT * FROM {$tablepre}medals WHERE available='1'");
while($medal = $db->fetch_array($query)) {
$medals .= "<tr align=\"center\">\n".
"<td class=\"altbg1\"><img src=\"images/common/$medal[image]\"></td>\n".
"<td class=\"altbg2\">$medal[name]</td>\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"medals[$medal[medalid]]\" value=\"1\" ".(in_array($medal['medalid'], $membermedals) ? 'checked' : '')."></td></td>\n";
}
if(!$medals) {
cpmsg('members_edit_medals_nonexistence');
}
shownav('medals_edit');
?>
<form method="post" action="admincp.php?action=editmedals&uid=<?=$uid?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="3"><?=$lang['medals_edit']?> - <?=$member['username']?></td></tr>
<tr class="category" align="center"><td><?=$lang['medals_image']?></td><td><?=$lang['name']?></td><td><?=$lang['medals_grant']?></td></tr>
<?=$medals?>
</table><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['members_edit_reason']?></td></tr>
<tr><td class="altbg1" width="45%"><b><?=$lang['members_edit_medals_reason']?></b><br /><span class="smalltxt"><?=$lang['members_edit_medals_reason_comment']?></span></td>
<td class="altbg2" width="40%"><textarea name="reason" rows="5" cols="30"></textarea></td></tr>
</table><br /><center>
<input class="button" type="submit" name="medalsubmit" value="<?=$lang['submit']?>">
</center></form>
<?
} else {
$medalsarray = array();
if(is_array($medals)) {
foreach($medals as $medalid => $newgranted) {
if($newgranted) {
$medalsarray[] = intval($medalid);
}
}
}
$medalsnew = implode("\t", $medalsarray);
$reason = preg_replace("/(\r\n|\r|\n)/", '<br />', dhtmlspecialchars(trim($reason)));
if($member['medals'] != $medalsnew) {
if(empty($reason)) {
cpmsg('members_edit_reason_invalid');
} else {
$db->query("UPDATE {$tablepre}memberfields SET medals='$medalsnew' WHERE uid='$uid'");
}
}
$origmedalsarray = explode("\t", $member['medals']);
$logs = array();
foreach(array_unique(array_merge($origmedalsarray, $medalsarray)) as $medalid) {
if($medalid) {
$orig = in_array($medalid, $origmedalsarray);
$new = in_array($medalid, $medalsarray);
if($orig != $new) {
if($orig && !$new) {
$medalaction = 'revoke';
} elseif(!$orig && $new) {
$medalaction = 'grant';
}
$logs[] = dhtmlspecialchars("$timestamp\t$discuz_userss\t$onlineip\t$member[username]\t$medalid\t$medalaction\t$reason");
}
}
}
writelog('medalslog', $logs);
cpmsg('members_edit_medals_succeed', "admincp.php?action=editmedals&uid=$uid");
}
} elseif($action == 'banmember') {
if(!$allowbanuser) {
cpmsg('action_noaccess');
}
$member = $currentstatus = array();
if(!empty($username) || !empty($uid)) {
$query = $db->query("SELECT m.*, mf.*, u.type AS grouptype, u.allowsigbbcode, u.allowsigimgcode FROM {$tablepre}members m
LEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid
LEFT JOIN {$tablepre}usergroups u ON u.groupid=m.groupid
WHERE ".($uid ? "m.uid='$uid'" : "m.username='$username'"));
if(!$member = $db->fetch_array($query)) {
cpmsg('members_edit_nonexistence');
} elseif(($member['grouptype'] == 'system' && in_array($member['groupid'], array(1, 2, 3, 6, 7, 8))) || $member['grouptype'] == 'special') {
cpmsg('members_edit_illegal');
}
$member['groupterms'] = unserialize($member['groupterms']);
$member['banexpiry'] = !empty($member['groupterms']['main']['time']) && ($member['groupid'] == 4 || $member['groupid'] == 5) ? gmdate('Y-n-j', $member['groupterms']['main']['time'] + $timeoffset * 3600) : '';
if($member['groupid'] == 4) {
$check['post'] = 'checked';
$currentstatus['post'] = ' ('.$lang['members_edit_current_status'].')';
} elseif($member['groupid'] == 5) {
$check['visit'] = 'checked';
$currentstatus['visit'] = ' ('.$lang['members_edit_current_status'].')';
} else {
$check['none'] = 'checked';
$currentstatus['none'] = ' ('.$lang['members_edit_current_status'].')';
}
}
if(!submitcheck('bansubmit')) {
echo '<script src="include/javascript/calendar.js" type="text/javascript"></script>';
shownav('members_edit_ban_user');
echo '<form method="post" action="admincp.php?action=banmember&uid=&formhash='.FORMHASH.'">';
showtype($lang['members_edit_ban_user'].($member['username'] ? ' -'.$member['username'] : ''), 'top');
showsetting('members_edit_username', 'username', $member['username'], 'text');
showsetting('members_edit_ban', '', '', '<input type="radio" name="bannew" value="" '.$check['none'].' class="radio"> '.$lang['members_edit_ban_none'].$currentstatus['none'].'<br /><input type="radio" name="bannew" value="post" '.$check['post'].' class="radio"> '.$lang['members_edit_ban_post'].$currentstatus['post'].'<br /><input type="radio" name="bannew" value="visit" '.$check['visit'].' class="radio"> '.$lang['members_edit_ban_visit'].$currentstatus['visit']);
showsetting('members_edit_ban_validity', '', '', selectday('banexpirynew', array(0, 1, 3, 5, 7, 14, 30, 60, 90, 180, 365)));
if($adminid == 1) {
showsetting('members_edit_ban_delpost', 'delpost', '', 'radio');
}
showsetting('members_edit_ban_reason', 'reason', '', 'textarea');
showtype('', 'bottom');
echo '<br /><center><input class="button" type="submit" name="bansubmit" value="'.$lang['submit'].'"></center></form>';
} else {
$sql = 'uid=uid';
$reason = trim($reason);
if(!$reason && ($reasonpm == 1 || $reasonpm == 3)) {
cpmsg('members_edit_reason_invalid');
}
if($bannew == 'post' || $bannew == 'visit') {
$groupidnew = $bannew == 'post' ? 4 : 5;
$banexpirynew = !empty($banexpirynew) ? $timestamp + $banexpirynew * 86400 : 0;
$banexpirynew = $banexpirynew > $timestamp ? $banexpirynew : 0;
if($banexpirynew) {
$member['groupterms']['main'] = array('time' => $banexpirynew, 'adminid' => $member['adminid'], 'groupid' => $member['groupid']);
$member['groupterms']['ext'][$groupidnew] = $banexpirynew;
$sql .= ', groupexpiry=\''.groupexpiry($member['groupterms']).'\'';
} else {
$sql .= ', groupexpiry=0';
}
$adminidnew = -1;
} elseif($member['groupid'] == 4 || $member['groupid'] == 5) {
if(!empty($member['groupterms']['main']['groupid'])) {
$groupidnew = $member['groupterms']['main']['groupid'];
$adminidnew = $member['groupterms']['main']['adminid'];
unset($member['groupterms']['main']);
unset($member['groupterms']['ext'][$member['groupid']]);
$sql .= ', groupexpiry=\''.groupexpiry($member['groupterms']).'\'';
} else {
$query = $db->query("SELECT groupid FROM {$tablepre}usergroups WHERE type='member' AND creditshigher<='$member[credits]' AND creditslower>'$member[credits]'");
$groupidnew = $db->result($query, 0);
$adminidnew = 0;
}
} else {
$groupidnew = $member['groupid'];
$adminidnew = $member['adminid'];
}
$sql .= ", adminid='$adminidnew', groupid='$groupidnew'";
$db->query("UPDATE {$tablepre}members SET $sql WHERE uid='$member[uid]'");
if($allowbanuser && ($db->affected_rows($query))) {
banlog($member['username'], $member['groupid'], $groupidnew, $banexpirynew, $reason);
}
$db->query("UPDATE {$tablepre}memberfields SET groupterms='".($member['groupterms'] ? addslashes(serialize($member['groupterms'])) : '')."' WHERE uid='$member[uid]'");
if($delpost && $bannew && $adminid == 1) {
$query = $db->query("SELECT attachment, thumb, remote FROM {$tablepre}attachments WHERE uid='$member[uid]'");
while($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
$db->query("DELETE FROM {$tablepre}threads WHERE authorid='$member[uid]'", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}posts WHERE authorid='$member[uid]'", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}trades WHERE sellerid='$member[uid]'", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}attachments WHERE uid='$member[uid]'", 'UNBUFFERED');
}
cpmsg('members_edit_succeed', 'admincp.php?action=banmember');
}
} elseif($action == 'editmember') {
shownav('members_edit');
if(empty($uid) && empty($username)) {
?>
<form method="post" action="admincp.php?action=editmember">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['members_edit']?> - <?=$lang['members_search']?></td></tr>
<tr class="altbg2">
<td><?=$lang['username']?>:</td><td><input type="text" name="username"></td></tr>
</table><br /><center>
<input class="button" type="submit" name="membersubmit" value="<?=$lang['submit']?>">
</center></form><br />
<?
} else {
$query = $db->query("SELECT m.*, mf.*, u.type AS grouptype, u.allowsigbbcode, u.allowsigimgcode, u.allowcusbbcode, u.allowbiobbcode, u.allowbioimgcode, u.allowcusbbcode FROM {$tablepre}members m
LEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid
LEFT JOIN {$tablepre}usergroups u ON u.groupid=m.groupid
WHERE ".($uid ? "m.uid='$uid'" : "m.username='$username'"));
if(!$member = $db->fetch_array($query)) {
cpmsg('members_edit_nonexistence');
} elseif(($member['grouptype'] == 'system' && in_array($member['groupid'], array(1, 2, 3, 6, 7, 8))) || $member['grouptype'] == 'special') {
cpmsg('members_edit_illegal');
}
$member['groupterms'] = unserialize($member['groupterms']);
if(!submitcheck('editsubmit')) {
echo "<br /><form method=\"post\" action=\"admincp.php?action=editmember&uid=$member[uid]&formhash=".FORMHASH."\">";
require_once DISCUZ_ROOT.'./include/editor.func.php';
$member['bio'] = html2bbcode($member['bio']);
$member['signature'] = html2bbcode($member['sightml']);
if($allowedituser) {
showtype($lang['members_edit'].' - '.$member[username], 'top');
showsetting('members_edit_location', 'locationnew', $member['location'], 'text');
showsetting('members_edit_bio', 'bionew', $member['bio'], 'textarea');
showsetting('members_edit_signature', 'signaturenew', $member['signature'], 'textarea');
showtype('', 'bottom');
}
echo '<br /><br /><center><input class="button" type="submit" name="editsubmit" value="'.$lang['submit'].'"></center></form>';
} else {
$sql = 'uid=uid';
if($allowedituser) {
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
$signaturenew = censor($signaturenew);
$sightmlnew = addslashes(discuzcode(stripslashes($signaturenew), 1, 0, 0, 0, $member['allowsigbbcode'], $member['allowsigimgcode'], 0));
$bionew = censor(dhtmlspecialchars($bionew));
$biohtmlnew = addslashes(discuzcode(stripslashes($bionew), 1, 0, 0, 0, ($member['allowbiobbcode'] ? ($member['allowcusbbcode'] ? 2 : 1) : 0), $member['allowbioimgcode'], 0));
$locationnew = dhtmlspecialchars($locationnew);
$sql .= ', sigstatus=\''.($signaturenew ? 1 : 0).'\'';
$db->query("UPDATE {$tablepre}memberfields SET location='$locationnew', bio='$biohtmlnew', sightml='$sightmlnew' WHERE uid='$member[uid]'");
}
$db->query("UPDATE {$tablepre}members SET $sql WHERE uid='$member[uid]'");
$db->query("UPDATE {$tablepre}memberfields SET groupterms='".($member['groupterms'] ? addslashes(serialize($member['groupterms'])) : '')."' WHERE uid='$member[uid]'");
cpmsg('members_edit_succeed', 'admincp.php?action=editmember');
}
}
} elseif($action == 'access') {
$query = $db->query("SELECT username, adminid, groupid FROM {$tablepre}members WHERE uid='$uid'");
if(!$member = $db->fetch_array($query)) {
cpmsg('undefined_action');
} elseif(!$isfounder && ($member['adminid'] == 1 || $member['groupid'] == 1)) {
cpmsg('members_super_edit_admin_allow');
}
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
if(!submitcheck('accesssubmit')) {
$accessmasks = array();
$query = $db->query("SELECT * FROM {$tablepre}access WHERE uid='$uid'");
while($access = $db->fetch_array($query)) {
$accessmasks[$access['fid']] = $access;
}
$members = '';
foreach($_DCACHE['forums'] as $fid => $forum) {
if($forum['type'] != 'group') {
if(isset($accessmasks[$fid])) {
$check = array( 'default' => '',
'view' => ($accessmasks[$fid]['allowview'] ? 'checked' : ''),
'post' => ($accessmasks[$fid]['allowpost'] ? 'checked' : ''),
'reply' => ($accessmasks[$fid]['allowreply'] ? 'checked' : ''),
'getattach' => ($accessmasks[$fid]['allowgetattach'] ? 'checked' : ''),
'postattach' => ($accessmasks[$fid]['allowpostattach'] ? 'checked' : ''));
} else {
$check = array( 'default' => 'checked',
'view' => '',
'post' => '',
'reply' => '',
'getattach' => '',
'postattach' => '');
}
$members .= "<tr><td class=\"altbg1\" width=\"22%\"><input class=\"checkbox\" title=\"$lang[select_all]\" type=\"checkbox\" name=\"chkallv$fid\" onclick=\"checkallvalue(this.form, $fid, 'chkallv$fid')\">";
$members .= $forum['type'] == 'forum' ? '' : ' ';
$members .= " <a href=\"admincp.php?action=forumdetail&fid=$fid\">$forum[name]</a></td>".
"<td class=\"altbg2\" width=\"15%\" align=\"center\"><input class=\"checkbox\" type=\"checkbox\" name=\"defaultnew[$fid]\" value=\"1\" $check[default]></td>\n".
"<td class=\"altbg1\" width=\"10%\" align=\"center\"><input class=\"checkbox\" type=\"checkbox\" name=\"allowviewnew[$fid]\" value=\"$fid\" $check[view]></td>\n".
"<td class=\"altbg2\" width=\"12%\" align=\"center\"><input class=\"checkbox\" type=\"checkbox\" name=\"allowpostnew[$fid]\" value=\"$fid\" $check[post]></td>\n".
"<td class=\"altbg1\" width=\"10%\" align=\"center\"><input class=\"checkbox\" type=\"checkbox\" name=\"allowreplynew[$fid]\" value=\"$fid\" $check[reply]></td>\n".
"<td class=\"altbg2\" width=\"18%\" align=\"center\"><input class=\"checkbox\" type=\"checkbox\" name=\"allowgetattachnew[$fid]\" value=\"$fid\" $check[getattach]></td>\n".
"<td class=\"altbg1\" width=\"13%\" align=\"center\"><input class=\"checkbox\" type=\"checkbox\" name=\"allowpostattachnew[$fid]\" value=\"$fid\" $check[postattach]></td></tr>";
}
}
shownav('access_edit');
showtips('access_tips');
?>
<form method="post" action="admincp.php?action=access&uid=<?=$uid?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="7"><?=$lang['access_edit']?> - <?=$member['username']?></td></tr>
<tr class="category" align="center">
<td><?=$lang['forum']?></td>
<td><input class="checkbox" type="checkbox" name="chkall1" onclick="checkall(this.form, 'defaultnew', 'chkall1')"> <?=$lang['access_default']?></td>
<td><input class="checkbox" type="checkbox" name="chkall2" onclick="checkall(this.form, 'allowviewnew', 'chkall2')"> <?=$lang['access_view']?></td>
<td><input class="checkbox" type="checkbox" name="chkall3" onclick="checkall(this.form, 'allowpostnew', 'chkall3')"> <?=$lang['access_post']?></td>
<td><input class="checkbox" type="checkbox" name="chkall4" onclick="checkall(this.form, 'allowreplynew', 'chkall4')"> <?=$lang['access_reply']?></td>
<td><input class="checkbox" type="checkbox" name="chkall5" onclick="checkall(this.form, 'allowgetattachnew', 'chkall5')"> <?=$lang['access_getattach']?></td>
<td><input class="checkbox" type="checkbox" name="chkall6" onclick="checkall(this.form, 'allowpostattachnew', 'chkall6')"> <?=$lang['access_postattach']?></td></tr>
<?=$members?>
</table><br />
<center>
<input class="button" type="reset" name="accesssubmit" value="<?=$lang['reset']?>">
<input class="button" type="submit" name="accesssubmit" value="<?=$lang['submit']?>">
</center></form>
<?
} else {
$accessarray = array();
if(is_array($_DCACHE['forums'])) {
foreach($_DCACHE['forums'] as $fid => $forum) {
if($forum['type'] != 'group') {
if(!$defaultnew[$fid] && ($allowviewnew[$fid] || $allowpostnew[$fid] || $allowreplynew[$fid] || $allowgetattachnew[$fid] || $allowpostattachnew[$fid])) {
$accessarray[$fid] = "'$allowviewnew[$fid]', '$allowpostnew[$fid]', '$allowreplynew[$fid]', '$allowgetattachnew[$fid]', '$allowpostattachnew[$fid]'";
}
}
}
}
$db->query("DELETE FROM {$tablepre}access WHERE uid='$uid'");
$db->query("UPDATE {$tablepre}members SET accessmasks='".($accessarray ? 1 : 0)."' WHERE uid='$uid'");
foreach($accessarray as $fid => $access) {
$db->query("INSERT INTO {$tablepre}access (uid, fid, allowview, allowpost, allowreply, allowgetattach, allowpostattach)
VALUES ('$uid', '$fid', $access)");
}
updatecache('forums');
cpmsg('access_succeed');
}
} elseif($action == 'memberprofile') {
$query = $db->query("SELECT m.*, mf.*, o.*, u.type, u.allowsigbbcode, u.allowsigimgcode, u.allowcusbbcode, u.allowbiobbcode, u.allowbioimgcode, u.allowcusbbcode FROM {$tablepre}members m
LEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid
LEFT JOIN {$tablepre}onlinetime o ON o.uid=m.uid
LEFT JOIN {$tablepre}usergroups u ON u.groupid=m.groupid
WHERE m.uid='$uid'");
if(!$member = $db->fetch_array($query)) {
cpmsg('undefined_action');
} elseif(!$isfounder && ($member['adminid'] == 1 || $member['groupid'] == 1)) {
cpmsg('members_super_edit_admin_allow');
}
$member['uid'] = intval($uid);
require_once DISCUZ_ROOT.'./forumdata/cache/cache_profilefields.php';
$fields = array_merge($_DCACHE['fields_required'], $_DCACHE['fields_optional']);
if(!submitcheck('editsubmit')) {
require_once DISCUZ_ROOT.'./include/editor.func.php';
$styleselect = "<select name=\"styleidnew\">\n<option value=\"\">$lang[use_default]</option>";
$query = $db->query("SELECT styleid, name FROM {$tablepre}styles");
while($style = $db->fetch_array($query)) {
$styleselect .= "<option value=\"$style[styleid]\" ".($style['styleid'] == $member['styleid'] ? 'selected="selected"' : '').">$style[name]</option>\n";
}
$styleselect .= '</select>';
$tfcheck = array($member['timeformat'] => 'checked');
$gendercheck = array($member['gender'] => 'checked');
$pscheck = array($member['pmsound'] => 'checked');
$member['regdate'] = gmdate('Y-n-j h:i A', $member['regdate'] + $timeoffset * 3600);
$member['lastvisit'] = gmdate('Y-n-j h:i A', $member['lastvisit'] + $timeoffset * 3600);
$member['bio'] = html2bbcode($member['bio']);
$member['signature'] = html2bbcode($member['sightml']);
shownav('members_edit');
echo "<form method=\"post\" action=\"admincp.php?action=memberprofile&uid=$uid&formhash=".FORMHASH."\">";
showtype("$lang[members_edit] - $member[username]", 'top');
showsetting('members_edit_username', 'usernamenew', $member['username'], 'text');
showsetting('members_edit_password', 'passwordnew', '', 'text');
showsetting('members_edit_clearquestion', 'clearquestion', !$member['secques'], 'radio');
showsetting('members_edit_clearspacecache', 'clearspacecache', '', 'radio');
showsetting('members_edit_nickname', 'nicknamenew', $member['nickname'], 'text');
showsetting('members_edit_gender', '', '', '<input class="radio" type="radio" name="gendernew" value="1" '.$gendercheck[1].'> '.$lang['members_edit_gender_male'].' <input class="radio" type="radio" name="gendernew" value="2" '.$gendercheck[2].'> '.$lang['members_edit_gender_female'].' <input class="radio" type="radio" name="gendernew" value="0" '.$gendercheck[0].'> '.$lang['members_edit_gender_secret']);
showsetting('members_edit_email', 'emailnew', $member['email'], 'text');
showsetting('members_edit_posts', 'postsnew', $member['posts'], 'text');
showsetting('members_edit_digestposts', 'digestpostsnew', $member['digestposts'], 'text');
showsetting('members_edit_pageviews', 'pageviewsnew', $member['pageviews'], 'text');
showsetting('members_edit_online_total', 'totalnew', $member['total'], 'text');
showsetting('members_edit_online_thismonth', 'thismonthnew', $member['thismonth'], 'text');
showsetting('members_edit_regip', 'regipnew', $member['regip'], 'text');
showsetting('members_edit_regdate', 'regdatenew', $member['regdate'], 'text');
showsetting('members_edit_lastvisit', 'lastvisitnew', $member['lastvisit'], 'text');
showsetting('members_edit_lastip', 'lastipnew', $member['lastip'], 'text');
showtype('members_edit_info');
showsetting('members_edit_site', 'sitenew', $member['site'], 'text');
showsetting('members_edit_qq', 'qqnew', $member['qq'], 'text');
showsetting('members_edit_icq', 'icqnew', $member['icq'], 'text');
showsetting('members_edit_yahoo', 'yahoonew', $member['yahoo'], 'text');
showsetting('members_edit_msn', 'msnnew', $member['msn'], 'text');
showsetting('members_edit_taobao', 'taobaonew', $member['taobao'], 'text');
showsetting('members_edit_alipay', 'alipaynew', $member['alipay'], 'text');
showsetting('members_edit_location', 'locationnew', $member['location'], 'text');
showsetting('members_edit_bday', 'bdaynew', $member['bday'], 'text');
showsetting('members_edit_avatar', 'avatarnew', $member['avatar'], 'text');
showsetting('members_edit_avatar_width', 'avatarwidthnew', $member['avatarwidth'], 'text');
showsetting('members_edit_avatar_height', 'avatarheightnew', $member['avatarheight'], 'text');
showsetting('members_edit_bio', 'bionew', $member['bio'], 'textarea');
showsetting('members_edit_signature', 'signaturenew', $member['signature'], 'textarea');
showtype('members_edit_option');
showsetting('members_edit_style', '', '', $styleselect);
showsetting('members_edit_tpp', 'tppnew', $member['tpp'], 'text');
showsetting('members_edit_ppp', 'pppnew', $member['ppp'], 'text');
showsetting('members_edit_cstatus', 'cstatusnew', $member['customstatus'], 'text');
showsetting('members_edit_timeformat', '', '', '<input class="radio" type="radio" name="timeformatnew" value="0" '.$tfcheck[0].'> '.$lang['default'].' <input class="radio" type="radio" name="timeformatnew" value="1" '.$tfcheck[1].'> '.$lang['members_edit_timeformat_12'].' <input class="radio" type="radio" name="timeformatnew" value="2" '.$tfcheck[2].'> '.$lang['members_edit_timeformat_24']);
showsetting('members_edit_timeoffset', 'timeoffsetnew', $member['timeoffset'], 'text');
showsetting('members_edit_pmsound', '', '', '<input class="radio" type="radio" value="0" name="pmsoundnew" '.$pscheck[0].'>'.$lang['none'].' <input class="radio" type="radio" value="1" name="pmsoundnew" '.$pscheck[1].'><a href="images/sound/pm_1.wav">#1</a> <input class="radio" type="radio" value="2" name="pmsoundnew" '.$pscheck[2].'><a href="images/sound/pm_2.wav">#2</a> <input class="radio" type="radio" value="3" name="pmsoundnew" '.$pscheck[3].'><a href="images/sound/pm_3.wav">#3</a>');
showsetting('members_edit_invisible', 'invisiblenew', $member['invisible'], 'radio');
showsetting('members_edit_showemail', 'showemailnew', $member['showemail'], 'radio');
showsetting('members_edit_newsletter', 'newsletternew', $member['newsletter'], 'radio');
showsetting('members_edit_ignorepm', 'ignorepmnew', $member['ignorepm'], 'textarea');
if($fields) {
showtype('members_edit_profilefield');
foreach($fields as $field) {
if($field['selective']) {
$fieldselect = "<select name=\"field_$field[fieldid]new\"><option value=\"\"> </option>";
foreach($field['choices'] as $index => $choice) {
$fieldselect .= "<option value=\"$index\" ".($index == $member['field_'.$field['fieldid']] ? 'selected="selected"' : '').">$choice</option>";
}
$fieldselect .= '</select>';
showsetting($field['title'], '', '', $fieldselect);
} else {
showsetting($field['title'], "field_$field[fieldid]new", $member['field_'.$field['fieldid']], 'text');
}
}
}
showtype('', 'bottom');
echo '<br /><br /><center><input class="button" type="submit" name="editsubmit" value="'.$lang['submit'].'"></center></form>';
} else {
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
$usernameold = addslashes($member['username']);
if($usernamenew && $usernameold != $usernamenew) {
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE username='$usernamenew'");
if(($db->result($query, 0)) && ($db->result($query, 0)) != $member['uid']) {
cpmsg('members_edit_duplicate');
}
$db->query("UPDATE {$tablepre}announcements SET author='$usernamenew' WHERE author='$usernameold'");
$db->query("UPDATE {$tablepre}banned SET admin='$usernamenew' WHERE admin='$usernameold'");
$db->query("UPDATE {$tablepre}forums SET lastpost=REPLACE(lastpost, '\t$usernameold', '\t$usernamenew')");
$db->query("UPDATE {$tablepre}members SET username='$usernamenew' WHERE uid='$member[uid]'");
$db->query("UPDATE {$tablepre}pms SET msgfrom='$usernamenew' WHERE msgfromid='$member[uid]'");
$db->query("UPDATE {$tablepre}posts SET author='$usernamenew' WHERE authorid='$member[uid]'");
$db->query("UPDATE {$tablepre}threads SET author='$usernamenew' WHERE authorid='$member[uid]'");
$db->query("UPDATE {$tablepre}threads SET lastposter='$usernamenew' WHERE lastposter='$usernameold'");
$db->query("UPDATE {$tablepre}threadsmod SET username='$usernamenew' WHERE uid='$member[uid]'");
$username = $usernamenew;
}
$creditsnew = intval($creditsnew);
$regdatenew = strtotime($regdatenew);
$lastvisitnew = strtotime($lastvisitnew);
$passwordadd = $passwordnew ? ", password='".md5($passwordnew)."'" : '';
$secquesadd = $clearquestion ? ", secques=''" : '';
$signaturenew = censor($signaturenew);
$sigstatusnew = $signaturenew ? 1 : 0;
$sightmlnew = addslashes(discuzcode(stripslashes($signaturenew), 1, 0, 0, 0, ($member['allowsigbbcode'] ? ($member['allowcusbbcode'] ? 2 : 1) : 0), $member['allowsigimgcode'], 0));
$bionew = censor(dhtmlspecialchars($bionew));
$biohtmlnew = addslashes(discuzcode(stripslashes($bionew), 1, 0, 0, 0, ($member['allowbiobbcode'] ? ($member['allowcusbbcode'] ? 2 : 1) : 0), $member['allowbioimgcode'], 0));
$oltimenew = round($totalnew / 60);
$fieldadd = '';
foreach(array_merge($_DCACHE['fields_required'], $_DCACHE['fields_optional']) as $field) {
$field_key = 'field_'.$field['fieldid'];
$field_val = trim(${'field_'.$field['fieldid'].'new'});
if($field['selective'] && $field_val != '' && !isset($field['choices'][$field_val])) {
cpmsg('undefined_action');
} else {
$fieldadd .= ", $field_key='".dhtmlspecialchars($field_val)."'";
}
}
if($clearspacecache) {
$db->query("DELETE FROM {$tablepre}spacecaches WHERE uid='$uid'");
}
$db->query("UPDATE {$tablepre}members SET gender='$gendernew', email='$emailnew', posts='$postsnew', digestposts='$digestpostsnew',
pageviews='$pageviewsnew', regip='$regipnew', regdate='$regdatenew', lastvisit='$lastvisitnew', lastip='$lastipnew', bday='$bdaynew',
styleid='$styleidnew', tpp='$tppnew', ppp='$pppnew', timeformat='$timeformatnew', oltime='$oltimenew',
showemail='$showemailnew', newsletter='$newsletternew', invisible='$invisiblenew', timeoffset='$timeoffsetnew',
pmsound='$pmsoundnew', sigstatus='$sigstatusnew' $passwordadd $secquesadd WHERE uid='$uid'");
$db->query("UPDATE {$tablepre}memberfields SET nickname='$nicknamenew', site='$sitenew', qq='$qqnew', icq='$icqnew', yahoo='$yahoonew', msn='$msnnew',
taobao='$taobaonew', alipay='$alipaynew', location='$locationnew', bio='$biohtmlnew', customstatus='$cstatusnew', ignorepm='$ignorepmnew', avatar='$avatarnew',
avatarwidth='$avatarwidthnew', avatarheight='$avatarheightnew', sightml='$sightmlnew'
$fieldadd WHERE uid='$uid'");
$db->query("REPLACE INTO {$tablepre}onlinetime (uid, thismonth, total)
VALUES ('$uid', '$thismonthnew', '$totalnew')");
cpmsg('members_edit_succeed');
}
} elseif($action == 'profilefields') {
if(!submitcheck('fieldsubmit') && !submitcheck('editsubmit') && !$edit) {
$query = $db->query("SELECT * FROM {$tablepre}profilefields");
while($field = $db->fetch_array($query)) {
$profilefields .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[{$field[fieldid]}]\" value=\"$field[fieldid]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"18\" name=\"titlenew[{$field[fieldid]}]\" value=\"$field[title]\">\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"availablenew[{$field[fieldid]}]\" value=\"1\" ".($field['available'] ? 'checked' : '')."></td>\n".
"<td class=\"altbg2\"><input class=\"checkbox\" type=\"checkbox\" name=\"invisiblenew[{$field[fieldid]}]\" value=\"1\" ".($field['invisible'] ? 'checked' : '')."></td>\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"unchangeablenew[{$field[fieldid]}]\" value=\"1\" ".($field['unchangeable'] ? 'checked' : '')."></td>\n".
"<td class=\"altbg2\"><input class=\"checkbox\" type=\"checkbox\" name=\"showinthreadnew[{$field[fieldid]}]\" value=\"1\" ".($field['showinthread'] ? 'checked' : '')."></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"2\" name=\"displayordernew[{$field[fieldid]}]\" value=\"$field[displayorder]\"></td>\n".
"<td class=\"altbg2\"><a href=\"admincp.php?action=profilefields&edit=$field[fieldid]\">[$lang[detail]]</a></td></tr>\n";
}
shownav('members_edit_profilefields');
showtips('members_edit_profilefields_tips');
?>
<form method="post" action="admincp.php?action=profilefields">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td width="48"><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['fields_title']?></td><td><?=$lang['available']?></td><td><?=$lang['fields_invisible']?></td><td><?=$lang['fields_unchangeable']?></td><td><?=$lang['fields_show_in_thread']?></td><td><?=$lang['display_order']?></td><td><?=$lang['edit']?></td></tr>
<?=$profilefields?>
<tr align="center" class="altbg1"><td><?=$lang['add_new']?></td>
<td><input type='text' name="newtitle" size="18"></td>
<td colspan="6"> </td>
</tr></table><br />
<center><input class="button" type="submit" name="fieldsubmit" value="<?=$lang['submit']?>"></center></form>
<?
} elseif(submitcheck('fieldsubmit')) {
if(is_array($titlenew)) {
foreach($titlenew as $id => $val) {
$db->query("UPDATE {$tablepre}profilefields SET title='$titlenew[$id]', available='$availablenew[$id]', invisible='$invisiblenew[$id]', displayorder='$displayordernew[$id]', unchangeable='$unchangeablenew[$id]', showinthread='$showinthreadnew[$id]' WHERE fieldid='$id'");
}
}
if(is_array($delete)) {
$ids = implode('\',\'', $delete);
$dropfields = implode(',DROP field_', $delete);
$db->query("DELETE FROM {$tablepre}profilefields WHERE fieldid IN ('$ids')");
$db->query("ALTER TABLE {$tablepre}memberfields DROP field_$dropfields");
}
if($newtitle) {
$db->query("INSERT INTO {$tablepre}profilefields (available, invisible, title, size)
VALUES ('1', '0', '$newtitle', '50')");
$fieldid = $db->insert_id();
$db->query("ALTER TABLE {$tablepre}memberfields ADD field_$fieldid varchar(50) NOT NULL", 'SILENT');
}
updatecache(array('fields_required', 'fields_optional', 'custominfo'));
cpmsg('fields_edit_succeed', 'admincp.php?action=profilefields');
} elseif($edit) {
$query = $db->query("SELECT * FROM {$tablepre}profilefields WHERE fieldid='$edit'");
if(!$field = $db->fetch_array($query)) {
cpmsg('undefined_action');
}
if(!submitcheck('editsubmit')) {
echo "<form method=\"post\" action=\"admincp.php?action=profilefields&edit=$edit&formhash=".FORMHASH."\">\n";
showtype("$lang[fields_edit] - $field[title]", 'top');
showsetting('fields_edit_title', 'titlenew', $field['title'], 'text');
showsetting('fields_edit_desc', 'descriptionnew', $field['description'], 'text');
showsetting('fields_edit_size', 'sizenew', $field['size'], 'text');
showsetting('fields_edit_invisible', 'invisiblenew', $field['invisible'], 'radio');
showsetting('fields_edit_required', 'requirednew', $field['required'], 'radio');
showsetting('fields_edit_unchangeable', 'unchangeablenew', $field['unchangeable'], 'radio');
showsetting('fields_edit_show_in_thread', 'showinthreadnew', $field['showinthread'], 'radio');
showsetting('fields_edit_selective', 'selectivenew', $field['selective'], 'radio');
showsetting('fields_edit_choices', 'choicesnew', $field['choices'], 'textarea');
showtype('', 'bottom');
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"editsubmit\" value=\"$lang[submit]\"></center></form>";
} else {
$titlenew = trim($titlenew);
$sizenew = $sizenew <= 255 ? $sizenew : 255;
if(!$titlenew || !$sizenew) {
cpmsg('fields_edit_invalid');
}
if($sizenew != $field['size']) {
$db->query("ALTER TABLE {$tablepre}memberfields CHANGE field_$edit field_$edit varchar($sizenew) NOT NULL");
}
$db->query("UPDATE {$tablepre}profilefields SET title='$titlenew', description='$descriptionnew', size='$sizenew', invisible='$invisiblenew', required='$requirednew', unchangeable='$unchangeablenew', showinthread='$showinthreadnew', selective='$selectivenew', choices='$choicesnew' WHERE fieldid='$edit'");
updatecache(array('fields_required', 'fields_optional', 'custominfo'));
cpmsg('fields_edit_succeed', 'admincp.php?action=profilefields');
}
}
} elseif($action == 'ipban') {
if(!submitcheck('ipbansubmit')) {
require_once DISCUZ_ROOT.'./include/misc.func.php';
$iptoban = explode('.', $ip);
$ipbanned = '';
$query = $db->query("SELECT * FROM {$tablepre}banned ORDER BY dateline");
while($banned = $db->fetch_array($query)) {
for($i = 1; $i <= 4; $i++) {
if($banned["ip$i"] == -1) {
$banned["ip$i"] = '*';
}
}
$disabled = $adminid != 1 && $banned['admin'] != $discuz_userss ? 'disabled' : '';
$banned['dateline'] = gmdate($dateformat, $banned['dateline'] + $timeoffset * 3600);
$banned['expiration'] = gmdate($dateformat, $banned['expiration'] + $timeoffset * 3600);
$theip = "$banned[ip1].$banned[ip2].$banned[ip3].$banned[ip4]";
$ipbanned .= "<tr align=\"center\">\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[$banned[id]]\" value=\"$banned[id]\" $disabled></td>\n".
"<td class=\"altbg2\">$theip</td>\n".
"<td class=\"altbg1\">".convertip($theip, "./")."</td>\n".
"<td class=\"altbg2\">$banned[admin]</td>\n".
"<td class=\"altbg1\">$banned[dateline]</td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"10\" name=\"expirationnew[$banned[id]]\" value=\"$banned[expiration]\" $disabled></td></tr>\n";
}
shownav('menu_members_ipban');
showtips('ipban_tips');
?>
<form method="post" action="admincp.php?action=ipban">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td width="48"><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['ip']?></td><td><?=$lang['ipban_location']?></td><td><?=$lang['operator']?></td><td><?=$lang['start_time']?></td><td><?=$lang['end_time']?></td></tr>
<?=$ipbanned?>
<tr align="center" class="altbg1">
<td><?=$lang['add_new']?></td>
<td colspan="3"><b>
<input type="text" name="ip1new" value="<?=$iptoban[0]?>" size="3" maxlength="3"> .
<input type="text" name="ip2new" value="<?=$iptoban[1]?>" size="3" maxlength="3"> .
<input type="text" name="ip3new" value="<?=$iptoban[2]?>" size="3" maxlength="3"> .
<input type="text" name="ip4new" value="<?=$iptoban[3]?>" size="3" maxlength="3"></b></td>
<td colspan="2"><?=$lang['validity']?>: <input type="text" name="validitynew" value="30" size="3"> <?=$lang['ipban_days']?></td>
</tr></table><br />
<center><input class="button" type="submit" name="ipbansubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}banned WHERE id IN ($ids) AND ('$adminid'='1' OR admin='$discuz_user')");
}
if($ip1new != '' && $ip2new != '' && $ip3new != '' && $ip4new != '') {
$own = 0;
$ip = explode('.', $onlineip);
for($i = 1; $i <= 4; $i++) {
if(!is_numeric(${'ip'.$i.'new'}) || ${'ip'.$i.'new'} < 0) {
if($adminid != 1) {
cpmsg('ipban_nopermission');
}
${'ip'.$i.'new'} = -1;
$own++;
} elseif(${'ip'.$i.'new'} == $ip[$i - 1]) {
$own++;
}
${'ip'.$i.'new'} = intval(${'ip'.$i.'new'});
}
if($own == 4) {
cpmsg('ipban_illegal');
}
$query = $db->query("SELECT * FROM {$tablepre}banned");
while($banned = $db->fetch_array($query)) {
$exists = 0;
for($i = 1; $i <= 4; $i++) {
if($banned["ip$i"] == -1) {
$exists++;
} elseif($banned["ip$i"] == ${"ip".$i."new"}) {
$exists++;
}
}
if($exists == 4) {
cpmsg('ipban_invalid');
}
}
$expiration = $timestamp + $validitynew * 86400;
$db->query("UPDATE {$tablepre}sessions SET groupid='6' WHERE ('$ip1new'='-1' OR ip1='$ip1new') AND ('$ip2new'='-1' OR ip2='$ip2new') AND ('$ip3new'='-1' OR ip3='$ip3new') AND ('$ip4new'='-1' OR ip4='$ip4new')");
$db->query("INSERT INTO {$tablepre}banned (ip1, ip2, ip3, ip4, admin, dateline, expiration)
VALUES ('$ip1new', '$ip2new', '$ip3new', '$ip4new', '$discuz_user', '$timestamp', '$expiration')");
}
if(is_array($expirationnew)) {
foreach($expirationnew as $id => $expiration) {
$db->query("UPDATE {$tablepre}banned SET expiration='".strtotime($expiration)."' WHERE id='$id' AND ('$adminid'='1' OR admin='$discuz_user')");
}
}
updatecache('ipbanned');
cpmsg('ipban_succeed', 'admincp.php?action=ipban');
}
}
function banlog($username, $origgroupid, $newgroupid, $expiration, $reason) {
global $discuz_userss, $groupid, $onlineip, $timestamp, $forum, $reason;
writelog('banlog', dhtmlspecialchars("$timestamp\t$discuz_userss\t$groupid\t$onlineip\t$username\t$origgroupid\t$newgroupid\t$expiration\t$reason"));
}
function selectday($varname, $dayarray) {
global $timestamp, $dateformat, $timeformat, $timeoffset, $lang;
$selectday = '<select name="'.$varname.'">';
if($dayarray && is_array($dayarray)) {
foreach($dayarray as $day) {
$langday = $day.'_day';
$daydate = $day ? '('.gmdate("$dateformat $timeformat", ($timestamp + $day * 86400) + $timeoffset * 3600).')' : '';
$selectday .= '<option value='.$day.'>'.$lang[$langday].' '.$daydate.'</option>';
}
}
$selectday .= '</select>';
return $selectday;
}
?> | zyyhong | trunk/jiaju001/bbs/admin/members.inc.php | PHP | asf20 | 99,561 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: magics.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if(!isfounder()) cpmsg('noaccess_isfounder');
if($action == 'magic_config') {
if(!submitcheck('magicsubmit')) {
$settings = array();
$query = $db->query("SELECT variable, value FROM {$tablepre}settings WHERE variable IN ('magicstatus', 'magicmarket', 'maxmagicprice')");
while($setting = $db->fetch_array($query)) {
$settings[$setting['variable']] = $setting['value'];
}
shownav('magics');
?>
<form method="post" name="settings" action="admincp.php?action=magic_config">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
showtype('magics_config', 'top');
showsetting('magics_open', 'settingsnew[magicstatus]', $settings['magicstatus'], 'radio');
showsetting('magics_market_open', 'settingsnew[magicmarket]', $settings['magicmarket'], 'radio');
showsetting('magics_market_percent', 'settingsnew[maxmagicprice]', $settings['maxmagicprice'], 'text');
showtype('', 'bottom');
?>
<br /><center><input type="submit" class="button" name="magicsubmit" value="<?=$lang['submit']?>"></form>
<?
} else {
if(is_array($settingsnew)) {
foreach($settingsnew as $variable => $value) {
$db->query("UPDATE {$tablepre}settings SET value='$value' WHERE variable='$variable'");
}
}
updatecache('settings');
cpmsg('magics_config_succeed', 'admincp.php?action=magic_config');
}
} elseif($action == 'magic') {
if(!submitcheck('magicsubmit')) {
$magiclist = '';
$addtype = $typeid ? "WHERE type='".intval($typeid)."'" : '';
$query = $db->query("SELECT * FROM {$tablepre}magics $addtype ORDER BY displayorder");
while($magic = $db->fetch_array($query)) {
$magictype = $lang['magics_type_'.$magic['type']];
$magiclist .= "<tr align=\"center\">\n".
"<td class=\"altbg1\"><input type=\"checkbox\" class=\"checkbox\" name=\"delete[]\" value=\"$magic[magicid]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"3\" name=\"displayorder[$magic[magicid]]\" value=\"$magic[displayorder]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"10\" name=\"name[$magic[magicid]]\" value=\"$magic[name]\"></td>\n".
"<td class=\"altbg2\"><a href=\"admincp.php?action=magic&typeid=$magic[type]\">$magictype</a></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"5\" name=\"price[$magic[magicid]]\" value=\"$magic[price]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"5\" name=\"num[$magic[magicid]]\" value=\"$magic[num]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"25\" name=\"description[$magic[magicid]]\" value=\"$magic[description]\"></td>\n".
"<td class=\"altbg2\"><input type=\"hidden\" name=\"identifier[$magic[magicid]]\" value=\"$magic[identifier]\">$magic[identifier]</td>\n".
"<td class=\"altbg1\"><input type=\"checkbox\" class=\"checkbox\" name=\"available[$magic[magicid]]\" value=\"1\" ".(!$magic['name'] || !$magic['identifier'] || !$magic['filename'] ? 'disabled' : ($magic['available'] ? 'checked' : ''))."></td>\n".
"<td class=\"altbg2\"><a href=\"admincp.php?action=magicedit&magicid=$magic[magicid]\">[$lang[detail]]</a></td>\n";
}
shownav('magics');
showtips('magics_tips');
?>
<form method="post" action="admincp.php?action=magic">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="10"><?=$lang['magics_edit']?></td></tr>
<tr align="center" class="category">
<td><input type="checkbox" name="chkall" class="checkbox" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['display_order']?></td><td><?=$lang['name']?></td><td><?=$lang['type']?></td>
<td><?=$lang['price']?></td><td><?=$lang['num']?></td><td><?=$lang['description']?></td><td><?=$lang['magics_identifier']?></td><td><?=$lang['available']?></td><td><?=$lang['detail']?></td>
</tr>
<?=$magiclist?>
<tr class="altbg1" align="center">
<td><?=$lang['add_new']?></td>
<td><input type="text" size="3" name="newdisplayorder"></td>
<td><input type="text" size="10" name="newname"></td>
<td><select name="newtype"><option value="1" selected><?=$lang['magics_type_1']?></option><option value="2"><?=$lang['magics_type_2']?></option><option value="3"><?=$lang['magics_type_3']?></option></select></td>
<td><input type="text" size="5" name="newprice"></td>
<td><input type="text" size="5" name="newnum"></td>
<td><input type="text" size="25" name="newdescription"></td>
<td><input type="text" size="5" name="newidentifier"></td>
<td></td><td></td>
</tr></table><br />
<center><input type="submit" class="button" name="magicsubmit" value="<?=$lang['submit']?>"></center></form></td></tr>
<?
} else {
$newname = dhtmlspecialchars(trim($newname));
$newidentifier = dhtmlspecialchars(trim(strtoupper($newidentifier)));
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}magics WHERE magicid IN ($ids)");
$db->query("DELETE FROM {$tablepre}membermagics WHERE magicid IN ($ids)");
$db->query("DELETE FROM {$tablepre}magicmarket WHERE magicid IN ($ids)");
$db->query("DELETE FROM {$tablepre}magiclog WHERE magicid IN ($ids)");
}
if(is_array($name)) {
foreach($name as $id => $val) {
$db->query("UPDATE {$tablepre}magics SET available='$available[$id]', name='$name[$id]', identifier='$identifier[$id]', description='$description[$id]', displayorder='$displayorder[$id]', price='$price[$id]', num='$num[$id]' WHERE magicid='$id'");
}
}
if($newname != '') {
$query = $db->query("SELECT magicid FROM {$tablepre}magics WHERE identifier='$newidentifier'");
if($db->num_rows($query)) {
cpmsg('magics_identifier_invalid');
}
$db->query("INSERT INTO {$tablepre}magics (type, name, identifier, description, displayorder, price, num) VALUES ('$newtype', '$newname', '$newidentifier', '$newdescription', '$newdisplayorder', '$newprice', '$newnum')");
}
updatecache('magics');
cpmsg('magics_data_succeed', 'admincp.php?action=magic');
}
} elseif($action == 'magicedit') {
if(!submitcheck('magiceditsubmit')) {
$magicid = intval($magicid);
$query = $db->query("SELECT * FROM {$tablepre}magics WHERE magicid='$magicid'");
$magic = $db->fetch_array($query);
$magicperm = unserialize($magic['magicperm']);
$groups = $fourms = array();
$query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups");
while($group = $db->fetch_array($query)) {
$groups[] = $group;
}
$query = $db->query("SELECT fid, name FROM {$tablepre}forums WHERE type NOT IN ('group') AND status>0");
while($forum = $db->fetch_array($query)) {
$forums[] = $forum;
}
$usergroupsperm = $targetgroupsperm = $forumperm = '';
$num = -1;
$usergroupsperm = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" align=\"center\"><tr>";
foreach($groups as $group) {
$num++;
if($num && $num % 4 == 0) {
$usergroupsperm .= "</tr><tr>";
}
$checked = strstr($magicperm['usergroups'], "\t$group[groupid]\t") ? 'checked' : NULL;
$usergroupsperm .= "<td style=\"border:0px\"><input type=\"checkbox\" class=\"checkbox\" name=\"usergroupsperm[]\" value=\"$group[groupid]\" $checked> $group[grouptitle]</td>\n";
}
$usergroupsperm .= '</tr></table>';
$num = -1;
$targetgroupsperm = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" align=\"center\"><tr>";
foreach($groups as $group) {
$num++;
if($num && $num % 4 == 0) {
$targetgroupsperm .= "</tr><tr>";
}
$checked = strstr($magicperm['targetgroups'], "\t$group[groupid]\t") ? 'checked' : NULL;
$targetgroupsperm .= "<td style=\"border:0px\"><input type=\"checkbox\" class=\"checkbox\" name=\"targetgroupsperm[]\" value=\"$group[groupid]\" $checked> $group[grouptitle]</td>\n";
}
$targetgroupsperm .= '</tr></table>';
$num = -1;
$forumperm = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" align=\"center\"><tr>";
foreach($forums as $forum) {
$num++;
if($num && $num % 4 == 0) {
$forumperm .= "</tr><tr>";
}
$checked = strstr($magicperm['forum'], "\t$forum[fid]\t") ? 'checked' : NULL;
$forumperm .= "<td style=\"border:0px\"><input type=\"checkbox\" class=\"checkbox\" name=\"forumperm[]\" value=\"$forum[fid]\" $checked> $forum[name]</td>\n";
}
$forumperm .= '</tr></table>';
$checksupplytype = array($magic['supplytype'] => 'checked');
shownav('magics');
showtips('magics_edit_tips');
?>
<form method="post" action="admincp.php?action=magicedit&magicid=<?=$magicid?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
$typeselect = array($magic['type'] => 'selected');
showtype($lang['magics_edit'].' - '.$magic['name'], 'top');
showsetting('magics_edit_name', 'namenew', $magic['name'], 'text');
showsetting('magics_edit_identifier', 'identifiernew', $magic['identifier'], 'text');
showsetting('magics_edit_type', '', '', '<select name="typenew"><option value="1" '.$typeselect[1].'>'.$lang['magics_type_1'].'</option><option value="2" '.$typeselect[2].'>'.$lang['magics_type_2'].'</option><option value="3" '.$typeselect[3].'>'.$lang['magics_type_3'].'</option></select>');
showsetting('magics_edit_price', 'pricenew', $magic['price'], 'text');
showsetting('magics_edit_num', 'numnew', $magic['num'], 'text');
showsetting('magics_edit_weight', 'weightnew', $magic['weight'], 'text');
showsetting('magics_edit_supplytype', '', '', '<input name="supplytypenew" type="radio" class="radio" value="0" '.$checksupplytype[0].'> '.$lang['magics_goods_stack_none'].'<br /><input name="supplytypenew" type="radio" class="radio" value="1" '.$checksupplytype[1].'> '.$lang['magics_goods_stack_day'].'<br /><input name="supplytypenew" type="radio" class="radio" value="2" '.$checksupplytype[2].'> '.$lang['magics_goods_stack_week'].'<br /><input name="supplytypenew" type="radio" class="radio" value="3" '.$checksupplytype[3].'> '.$lang['magics_goods_stack_month']);
showsetting('magics_edit_supplynum', 'supplynumnew', $magic['supplynum'], 'text');
showsetting('magics_edit_filename', 'filenamenew', $magic['filename'], 'text');
showsetting('magics_edit_description', 'descriptionnew', $magic['description'], 'textarea');
showtype('magics_edit_perm');
showsetting('magics_edit_usergroupperm', '', '', $usergroupsperm, '15%');
if($magic['type'] == 2 || $magic['type'] == 3) {
showsetting('magics_edit_targetgroupperm', '', '', $targetgroupsperm, '15%');
}
if($magic['type'] == 1) {
showsetting('magics_edit_forumperm', '', '', $forumperm, '15%');
}
showtype('', 'bottom');
?>
<br /><center><input type="submit" class="button" name="magiceditsubmit" value="<?=$lang['submit']?>"></center>
</form><br />
<?
} else {
$namenew = dhtmlspecialchars(trim($namenew));
$identifiernew = dhtmlspecialchars(trim(strtoupper($identifiernew)));
$descriptionnew = dhtmlspecialchars($descriptionnew);
$filenamenew = dhtmlspecialchars($filenamenew);
$typenew = ($typenew > 0 && $typenew <= 3) ? $typenew : 1;
$availablenew = !$identifiernew || !$filenamenew ? 0 : 1;
$magicperm['usergroups'] = is_array($usergroupsperm) && !empty($usergroupsperm) ? "\t".implode("\t",$usergroupsperm)."\t" : '';
$magicperm['targetgroups'] = is_array($targetgroupsperm) && !empty($targetgroupsperm) ? "\t".implode("\t",$targetgroupsperm)."\t" : '';
$magicperm['forum'] = is_array($forumperm) && !empty($forumperm) ? "\t".implode("\t",$forumperm)."\t" : '';
$magicpermnew = addslashes(serialize($magicperm));
$supplytypenew = intval($supplytypenew);
$supplynumnew = $supplytypenew ? intval($supplynumnew) : 0;
if(!$namenew) {
cpmsg('magics_parameter_invalid');
}
$query = $db->query("SELECT magicid FROM {$tablepre}magics WHERE identifier='$identifiernew' AND magicid!='$magicid'");
if($db->num_rows($query)) {
cpmsg('magics_identifier_invalid');
}
if(preg_match("/[\\\\\/\:\*\?\"\<\>\|]+/", $filenamenew)) {
cpmsg('magics_filename_illegal');
} elseif(!is_readable(DISCUZ_ROOT.($magicfile = "./include/magic/$filenamenew"))) {
cpmsg('magics_filename_invalid');
}
$db->query("UPDATE {$tablepre}magics SET available='$availablenew', type='$typenew', name='$namenew', identifier='$identifiernew', description='$descriptionnew', price='$pricenew', num='$numnew', supplytype='$supplytypenew', supplynum='$supplynumnew', weight='$weightnew', filename='$filenamenew', magicperm='$magicpermnew' WHERE magicid='$magicid'");
updatecache('magics');
cpmsg('magics_data_succeed', 'admincp.php?action=magic');
}
} elseif($action == 'magicmarket') {
if(!submitcheck('marketsubmit')) {
$marketlist = '';
$query = $db->query("SELECT ma.*, m.name, m.description, m.weight FROM {$tablepre}magicmarket ma, {$tablepre}magics m WHERE m.magicid=ma.magicid");
while($market = $db->fetch_array($query)) {
$market['weight'] = $market['weight'] * $market['num'];
$marketlist .= "<tr align=\"center\">\n".
"<td class=\"altbg1\"><input type=\"checkbox\" class=\"checkbox\" name=\"delete[]\" value=\"$market[mid]\"></td>\n".
"<td class=\"altbg2\">$market[name]</td>\n".
"<td class=\"altbg1\">$market[username]</td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"5\" name=\"price[$market[mid]]\" value=\"$market[price]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"5\" name=\"num[$market[mid]]\" value=\"$market[num]\"></td>\n".
"<td class=\"altbg2\">$market[weight]</td>\n".
"<td class=\"altbg1\">$market[description]</td>\n";
}
shownav('magics_market');
?>
<form method="post" action="admincp.php?action=magicmarket">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="10"><?=$lang['magics_market']?></td></tr>
<tr align="center" class="category">
<td width="6%"><input type="checkbox" name="chkall" class="checkbox" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['name']?></td><td><?=$lang['magics_market_seller']?></td><td><?=$lang['price']?></td><td><?=$lang['num']?></td><td><?=$lang['weight']?></td>
<td width="40%"><?=$lang['description']?></td>
</tr>
<?=$marketlist?>
</table><br />
<center><input type="submit" class="button" name="marketsubmit" value="<?=$lang['submit']?>"></center></form></td></tr>
<?
} else {
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}magicmarket WHERE mid IN ($ids)");
}
if(is_array($price)) {
foreach($price as $id => $val) {
$db->query("UPDATE {$tablepre}magicmarket SET price='$price[$id]', num='$num[$id]' WHERE mid='$id'");
}
}
cpmsg('magics_data_succeed', 'admincp.php?action=magicmarket');
}
} elseif($action == 'magiclog') {
require_once DISCUZ_ROOT.'./forumdata/cache/cache_magics.php';
$lpp = empty($lpp) ? 50 : $lpp;
$page = max(1, intval($page));
$start_limit = ($page - 1) * $lpp;
$mpurl = "admincp.php?action=magiclog&lpp=$lpp";
if(!empty($operations) && is_array($operations)) {
$operationadd = "AND ma.action IN ('".implode('\',\'', $operations)."')";
foreach($operations as $operation) {
$mpurl .= '&operations[]='.rawurlencode($operation);
}
} else {
$operationadd = '';
}
if(!empty($magicid)) {
$magicidadd = "AND ma.magicid='$magicid'";
} else {
$magicidadd = '';
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}magiclog ma WHERE 1 $magicidadd $operationadd");
$num = $db->result($query, 0);
$multipage = multi($num, $lpp, $page, $mpurl);
$check = array();
$check[$magicid] = 'selected="selected"';
$magicselect = '';
foreach($_DCACHE['magics'] as $id => $magic) {
$magicselect .= '<option value="'.$id.'" '.$check[$id].'>'.$magic['name'].'</option>';
}
$magicoperations = '';
foreach(array('1', '2', '3', '4', '5') as $operation) {
$magicoperations .= '<input class="checkbox" type="checkbox" name="operations[]" value="'.$operation.'" '.(!empty($operations) && is_array($operations) && in_array($operation, $operations) ? 'checked' : '').'> '.$lang['logs_magic_operation_'.$operation].' ';
}
$query = $db->query("SELECT ma.*, m.username FROM {$tablepre}magiclog ma
LEFT JOIN {$tablepre}members m USING (uid)
WHERE 1 $magicidadd $operationadd ORDER BY dateline DESC LIMIT $start_limit, $lpp");
while($log = $db->fetch_array($query)) {
$log['name'] = $_DCACHE['magics'][$log['magicid']]['name'];
$log['dateline'] = gmdate('Y-n-j H:i', $log['dateline'] + $timeoffset * 3600);
$log['action'] = $lang['logs_magic_operation_'.$log['action']];
$logs .= "<tr align=\"center\"><td class=\"altbg1\"><a href=\"space.php?action=viewpro&username=".rawurlencode($log['username'])."\" target=\"_blank\">$log[username]</td>".
"<td class=\"altbg2\">$log[name]</td>".
"<td class=\"altbg1\">$log[dateline]</td>".
"<td class=\"altbg2\">$log[amount]</td>".
"<td class=\"altbg1\">$log[price]</td>".
"<td class=\"altbg2\">$log[action]</td></tr>";
}
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="3"><?=$lang['logs_magic']?></td></tr>
<form method="post" action="admincp.php?action=magiclog">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg2"><td width="20%"><?=$lang['logs_lpp']?></td>
<td width="62%"><input type="text" name="lpp" size="40" maxlength="40" value="<?=$lpp?>"></td>
<td width="18%"><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr>
</form>
<form method="post" action="admincp.php?action=magiclog">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg1"><td><?=$lang['magics_type']?></td><td><select name="magicid"><option value="0"><?=$lang['magics_type_all']?></option><?=$magicselect?></select></td>
<td><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr>
</form>
<form method="post" action="admincp.php?action=magiclog">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg2"><td><?=$lang['action']?></td><td><?=$magicoperations?></td>
<td><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr>
</form>
</table><br />
<?=$multipage?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td width="16%"><?=$lang['username']?></td>
<td width="16%"><?=$lang['name']?></td>
<td width="17%"><?=$lang['time']?></td>
<td width="16%"><?=$lang['num']?></td>
<td width="15%"><?=$lang['price']?></td>
<td width="20%"><?=$lang['action']?></td>
</tr>
<?=$logs?>
</table>
<?=$multipage?>
<?
}
?> | zyyhong | trunk/jiaju001/bbs/admin/magics.inc.php | PHP | asf20 | 19,308 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: announcements.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if($action == 'announcements') {
if(!submitcheck('announcesubmit') && !submitcheck('addsubmit') && !$edit) {
$groupselect = $announcements = '';
$query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups WHERE groupid<4 OR groupid>6");
while($group = $db->fetch_array($query)) {
$groupselect .= "<option value=\"$group[groupid]\">$group[grouptitle]</option>\n";
}
$announce_type = array(0=>$lang['announce_words'], 1=>$lang['announce_url'], 2=>$lang['announce_pms']);
$query = $db->query("SELECT * FROM {$tablepre}announcements ORDER BY displayorder, starttime DESC, id DESC");
while($announce = $db->fetch_array($query)) {
$disabled = $adminid != 1 && $announce['author'] != $discuz_userss ? 'disabled' : NULL;
$announce['starttime'] = $announce['starttime'] ? gmdate($dateformat, $announce['starttime'] + $_DCACHE['settings']['timeoffset'] * 3600) : $lang['unlimited'];
$announce['endtime'] = $announce['endtime'] ? gmdate($dateformat, $announce['endtime'] + $_DCACHE['settings']['timeoffset'] * 3600) : $lang['unlimited'];
$announcements .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$announce[id]\" $disabled></td>\n".
"<td class=\"altbg2\"><a href=\"./space.php?action=viewpro&username=".rawurlencode($announce['author'])."\" target=\"_blank\">$announce[author]</a></td>\n".
"<td class=\"altbg1\"><a href=\"admincp.php?action=announcements&edit=$announce[id]\" $disabled>".dhtmlspecialchars($announce['subject'])."</a></td>\n".
"<td class=\"altbg2\"><a href=\"admincp.php?action=announcements&edit=$announce[id]\">".cutstr(strip_tags($announce['message']), 20)."</a></td>\n".
"<td class=\"altbg1\">".$announce_type[$announce['type']]."</td>\n".
"<td class=\"altbg2\">$announce[starttime]</td>\n".
"<td class=\"altbg1\">$announce[endtime]</td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"2\" name=\"displayordernew[$announce[id]]\" value=\"$announce[displayorder]\" $disabled></td></tr>\n";
}
$newstarttime = gmdate('Y-n-j', $timestamp + $_DCACHE['settings']['timeoffset'] * 3600);
shownav('menu_misc_announces');
showtips('announce_tips');
?>
<form method="post" action="admincp.php?action=announcements">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="8"><?=$lang['announce_edit']?></td></tr>
<tr align="center" class="category">
<td width="48"><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['author']?></td><td><?=$lang['subject']?></td><td><?=$lang['message']?></td><td><?=$lang['announce_type']?></td><td><?=$lang['start_time']?></td><td><?=$lang['end_time']?></td><td><?=$lang['display_order']?></td></tr>
<?=$announcements?></table>
<br />
<center><input class="button" type="submit" name="announcesubmit" value="<?=$lang['submit']?>"></center>
</form><br />
<script type="text/javascript" src="include/javascript/calendar.js"></script>
<form method="post" action="admincp.php?action=announcements&">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['announce_add']?></td></tr>
<tr><td width="40%" class="altbg1"><b><?=$lang['subject']?>:</b></td>
<td width="45%" class="altbg2"><input type="text" size="45" name="newsubject"></td></tr>
<tr><td width="40%" class="altbg1"><b><?=$lang['start_time']?>:</b><br /><?=$lang['announce_time_comment']?></td>
<td width="45%" class="altbg2"><input type="text" size="45" name="newstarttime" value="<?=$newstarttime?>" onclick="showcalendar(event, this)"></td></tr>
<tr><td width="40%" class="altbg1"><b><?=$lang['end_time']?>:</b><br /><?=$lang['announce_time_comment']?></td>
<td width="45%" class="altbg2"><input type="text" size="45" name="newendtime" onclick="showcalendar(event, this)"> <?=$lang['announce_end_time_comment']?></td></tr>
<tr><td width="40%" class="altbg1" valign="top"><b><?=$lang['announce_type']?>:</b></td>
<td width="45%" class="altbg2">
<input name="newtype" class="radio" type="radio" value="0" checked> <?=$lang['announce_words']?>
<input name="newtype" class="radio" type="radio" value="1"> <?=$lang['announce_url']?>
<input name="newtype" class="radio" type="radio" value="2"> <?=$lang['announce_pms']?>
</td></tr>
<tr><td width="40%" class="altbg1" valign="top"><b><?=$lang['usergroup']?>:</b><br /><?=$lang['announce_usergroup_comment']?></td>
<td width="45%" class="altbg2">
<select name="usergroupid[]" size="5" multiple="multiple" style="width: 65%">
<option value='' selected><?=$lang['all']?></option>
<?=$groupselect?>
</select>
</td></tr>
<tr><td width="40%" class="altbg1" valign="top"><b><?=$lang['message']?>:</b><br /><?=$lang['announce_message_comment']?>
<td width="45%" class="altbg2"><textarea name="newmessage" cols="60" rows="10"></textarea></td></tr>
</table>
<br />
<center><input class="button" type="submit" name="addsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} elseif($edit) {
$query = $db->query("SELECT * FROM {$tablepre}announcements WHERE id='$edit' AND ('$adminid'='1' OR author='$discuz_user')");
if(!$announce = $db->fetch_array($query)) {
cpmsg('announce_nonexistence');
}
if(!submitcheck('editsubmit')) {
$groupselect = '';
$query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups WHERE groupid<4 OR groupid>6");
$pmgroups = explode(',', $announce['groups']);
$groupselectall = empty($announce['groups']) || in_array(0, $pmgroups) ? ' selected' : '';
while($group = $db->fetch_array($query)) {
$groupselect .= "<option value=\"$group[groupid]\" ".(!$groupselectall && in_array($group['groupid'], $pmgroups) ? 'selected' : '').">$group[grouptitle]</option>\n";
}
$announce['starttime'] = $announce['starttime'] ? gmdate('Y-n-j', $announce['starttime'] + $_DCACHE['settings']['timeoffset'] * 3600) : "";
$announce['endtime'] = $announce['endtime'] ? gmdate('Y-n-j', $announce['endtime'] + $_DCACHE['settings']['timeoffset'] * 3600) : "";
$announcecheck = array(intval($announce['type']) => 'checked');
shownav('menu_misc_announces');
?>
<form method="post" action="admincp.php?action=announcements&edit=<?=$edit?>&">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['announce_edit']?></td></tr>
<tr><td width="21%" class="altbg1"><b><?=$lang['subject']?>:</b></td>
<td width="79%" class="altbg2"><input type="text" size="45" name="subjectnew" value="<?=dhtmlspecialchars($announce['subject'])?>"></td></tr>
<tr><td width="21%" class="altbg1"><b><?=$lang['start_time']?>:</b><br /><?=$lang['announce_time_comment']?></td>
<td width="79%" class="altbg2"><input type="text" size="45" name="starttimenew" value="<?=$announce[starttime]?>"></td></tr>
<tr><td width="21%" class="altbg1"><b><?=$lang['end_time']?>:</b><br /><?=$lang['announce_time_comment']?></td>
<td width="79%" class="altbg2"><input type="text" size="45" name="endtimenew" value="<?=$announce[endtime]?>"> <?=$lang['announce_end_time_comment']?></td></tr>
<tr><td width="40%" class="altbg1" valign="top"><b><?=$lang['announce_type']?></b></td>
<td width="45%" class="altbg2">
<input name="typenew" class="radio" type="radio" value="0" <?=$announcecheck[0]?>> <?=$lang['announce_words']?>
<input name="typenew" class="radio" type="radio" value="1" <?=$announcecheck[1]?>> <?=$lang['announce_url']?>
<input name="typenew" class="radio" type="radio" value="2" <?=$announcecheck[2]?>> <?=$lang['announce_pms']?>
</td></tr>
<tr><td width="40%" class="altbg1" valign="top"><b><?=$lang['usergroup']?>:</b><br /><?=$lang['announce_usergroup_comment']?></td>
<td width="45%" class="altbg2">
<select name="usergroupid[]" size="5" multiple="multiple" style="width: 65%">
<option value='' <?=$groupselectall?>><?=$lang['all']?></option>
<?=$groupselect?>
</select>
</td></tr>
<tr><td width="21%" class="altbg1" valign="top"><b><?=$lang['message']?>:</b><br /><?=$lang['announce_message_comment']?></td>
<td width="79%" class="altbg2"><textarea name="messagenew" cols="60" rows="10"><?=dhtmlspecialchars($announce['message'])?></textarea></td></tr>
</table><br /><center><input class="button" type="submit" name="editsubmit" value="<?=$lang['submit']?>">
</form>
<?
} else {
if(strpos($starttimenew, '-')) {
$time = explode('-', $starttimenew);
$starttimenew = gmmktime(0, 0, 0, $time[1], $time[2], $time[0]) - $_DCACHE['settings']['timeoffset'] * 3600;
} else {
$starttimenew = 0;
}
if(strpos($endtimenew, '-')) {
$time = explode('-', $endtimenew);
$endtimenew = gmmktime(0, 0, 0, $time[1], $time[2], $time[0]) - $_DCACHE['settings']['timeoffset'] * 3600;
} else {
$endtimenew = 0;
}
if(!$starttimenew || ($endtimenew && $endtimenew <= $timestamp)) {
cpmsg('announce_time_invalid');
} elseif(!($subjectnew = trim($subjectnew)) || !($messagenew = trim($messagenew))) {
cpmsg('announce_invalid');
} else {
$messagenew = $typenew == 1 ? explode("\n", $messagenew) : array(0 => $messagenew);
$groups = in_array(0, $usergroupid) ? '' : implode(',', $usergroupid);
$db->query("UPDATE {$tablepre}announcements SET subject='$subjectnew', type='$typenew', starttime='$starttimenew', endtime='$endtimenew', message='{$messagenew[0]}', groups='$groups' WHERE id='$edit' AND ('$adminid'='1' OR author='$discuz_user')");
updatecache('announcements');
updatecache('announcements_forum');
updatecache('pmlist');
cpmsg('announce_succeed', 'admincp.php?action=announcements');
}
}
} elseif(submitcheck('announcesubmit')) {
if(is_array($delete)) {
$ids = $comma = '';
foreach($delete as $id) {
$ids .= "$comma'$id'";
$comma = ',';
}
$db->query("DELETE FROM {$tablepre}announcements WHERE id IN ($ids) AND ('$adminid'='1' OR author='$discuz_user')");
}
if(is_array($displayordernew)) {
foreach($displayordernew as $id => $displayorder) {
$db->query("UPDATE {$tablepre}announcements SET displayorder='$displayorder' WHERE id='$id' AND ('$adminid'='1' OR author='$discuz_user')");
}
}
updatecache(array('pmlist', 'announcements', 'announcements_forum'));
cpmsg('announce_update_succeed', 'admincp.php?action=announcements');
} elseif(submitcheck('addsubmit')) {
$newstarttime = $newstarttime ? strtotime($newstarttime) : 0;
$newendtime = $newendtime ? strtotime($newendtime) : 0;
if(!$newstarttime) {
cpmsg('announce_time_invalid');
} elseif(!($newsubject = trim($newsubject)) || !($newmessage = trim($newmessage))) {
cpmsg('announce_invalid');
} else {
$newmessage = $newtype == 1 ? explode("\n", $newmessage) : array(0 => $newmessage);
$groups = in_array(0, $usergroupid) ? '' : implode(',', $usergroupid);
$db->query("INSERT INTO {$tablepre}announcements (author, subject, type, starttime, endtime, message, groups)
VALUES ('$discuz_user', '$newsubject', '$newtype', '$newstarttime', '$newendtime', '{$newmessage[0]}', '".$groups."')");
updatecache('announcements');
updatecache('announcements_forum');
updatecache('pmlist');
cpmsg('announce_succeed', 'admincp.php?action=announcements');
}
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/announcements.inc.php | PHP | asf20 | 12,027 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: tradelog.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
require_once DISCUZ_ROOT.'./api/alipayapi.php';
include_once language('misc');
cpheader();
if(!isfounder()) cpmsg('noaccess_isfounder');
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
$filter = !isset($filter) ? -1 : $filter;
$sqlfilter = $filter >= 0 ? "WHERE status='$filter'" : '';
$query = $db->query("SELECT sum(price) as pricesum, sum(tax) as taxsum FROM {$tablepre}tradelog status $sqlfilter");
$count = $db->fetch_array($query);
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}tradelog $sqlfilter");
$num = $db->result($query, 0);
$multipage = multi($num, $tpp, $page, "admincp.php?action=tradelog&filter=$filter");
$query = $db->query("SELECT * FROM {$tablepre}tradelog $sqlfilter ORDER BY lastupdate DESC LIMIT $start_limit, $tpp");
shownav('menu_ecommerce_trade_orders');
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan=6"><?=$lang['tradelog_order_status']?>: <select style="vertical-align: middle" onchange="location.href='admincp.php?action=tradelog&filter=' + this.value"><option value='-1'><?=$lang['tradelog_all_order']?></option>
<?
$statuss = trade_getstatus(0, -1);
foreach($statuss as $key => $value) {
echo "<option value=\"$key\" ".($filter == $key ? 'selected' : '').">$value</option>";
}
?>
</select>
</td></tr>
<tr class="altbg1"><td colspan=6"><?=$lang['tradelog_order_count']?> <? echo $num;if($count['pricesum']) {?>, <?=$lang['tradelog_trade_total']?> <?=$count['pricesum']?> <?=$lang['rmb_yuan']?>, <?=$lang['tradelog_fee_total']?> <?=$count['taxsum']?> <?=$lang['rmb_yuan']?><?}?></td></tr>
</table><br />
<?=$multipage?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td align="center" width="10%"><?=$lang['tradelog_trade_no']?></td>
<td align="center" width="15%"><?=$lang['tradelog_trade_name']?></td>
<td align="center" width="7%"><?=$lang['tradelog_buyer']?></td>
<td align="center" width="7%"><?=$lang['tradelog_seller']?></td>
<td align="center" width="10%"><?=$lang['tradelog_money']?></td>
<td align="center" width="10%"><?=$lang['tradelog_fee']?></td>
<td align="center" width="20%"><?=$lang['tradelog_order_status']?></td>
</tr>
<?
while($tradelog = $db->fetch_array($query)) {
$tradelog['status'] = trade_getstatus($tradelog['status']);
$tradelog['lastupdate'] = gmdate("$dateformat $timeformat", $tradelog['lastupdate'] + $timeoffset * 3600);
$tradelog['tradeno'] = $tradelog['offline'] ? $lang['tradelog_offline'] : $tradelog['tradeno'];
?>
<tr>
<td align="center" class="altbg1"> <?=$tradelog['tradeno']?></td>
<td align="center" class="altbg2"><a target="_blank" href="viewthread.php?do=tradeinfo&tid=<?=$tradelog['tid']?>&pid=<?=$tradelog['pid']?>"><?=$tradelog['subject']?></a></td>
<td align="center" class="altbg1"><a target="_blank" href="space.php?action=viewpro&uid=<?=$tradelog['buyerid']?>"><?=$tradelog['buyer']?></a></td>
<td align="center" class="altbg2"><a target="_blank" href="space.php?action=viewpro&uid=<?=$tradelog['sellerid']?>"><?=$tradelog['seller']?></a></td>
<td align="center" class="altbg1"><?=$tradelog['price']?></td>
<td align="center" class="altbg2"><?=$tradelog['tax']?></td>
<td align="center" class="altbg1"><a target="_blank" href="trade.php?orderid=<?=$tradelog['orderid']?>"><?=$tradelog['status']?><br /><?=$tradelog['lastupdate']?></td>
</tr>
<?}?>
</table>
<?=$multipage?> | zyyhong | trunk/jiaju001/bbs/admin/tradelog.inc.php | PHP | asf20 | 3,781 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: prune.inc.php 10115 2007-08-24 00:58:08Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
$page = max(1, intval($page));
if($action == 'prune') {
require_once DISCUZ_ROOT.'./include/misc.func.php';
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
if(!submitcheck('prunesubmit')) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
if($adminid == 1 || $adminid == 2) {
$forumselect = '<select name="forums"><option value=""> > '.$lang['select'].'</option>'.
'<option value=""> </option>'.forumselect().'</select>';
if($forums) {
$forumselect = preg_replace("/(\<option value=\"$forums\")(\>)/", "\\1 selected=\"selected\" \\2", $forumselect);
}
} else {
$forumselect = $comma = '';
$query = $db->query("SELECT f.name FROM {$tablepre}moderators m, {$tablepre}forums f WHERE m.uid='$discuz_uid' AND m.fid=f.fid");
while($forum = $db->fetch_array($query)) {
$forumselect .= $comma.$forum['name'];
$comma = ', ';
}
$forumselect = $forumselect ? $forumselect : $lang['none'];
}
$checkcins = empty($cins) ? '' : 'checked';
$starttime = !preg_match("/^(0|\d{4}\-\d{1,2}\-\d{1,2})$/", $starttime) ? gmdate('Y-n-j', $timestamp + $timeoffset * 3600 - 86400 * 7) : $starttime;
$endtime = $adminid == 3 || !preg_match("/^(0|\d{4}\-\d{1,2}\-\d{1,2})$/", $endtime) ? gmdate('Y-n-j', $timestamp + $timeoffset * 3600) : $endtime;
shownav('menu_maint_prune');
showtips('prune_tips');
?>
<script type="text/javascript" src="include/javascript/calendar.js"></script>
<script type="text/javascript">
function page(number) {
$('pruneforum').page.value=number;
$('pruneforum').searchsubmit.click();
}
</script>
<form id="pruneforum" method="post" action="admincp.php?action=prune">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="page" value="<?=$page?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="2"><?=$lang['prune_search']?></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['prune_search_detail']?></td>
<td align="right" class="altbg2"><input class="checkbox" type="checkbox" name="detail" checked value="1"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['prune_search_forum']?></td>
<td align="right" class="altbg2"><?=$forumselect?></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['prune_search_time']?></td>
<td align="right" class="altbg2">
<input type="text" name="starttime" size="10" value="<?=$starttime?>" onclick="showcalendar(event, this)"> -
<input type="text" name="endtime" size="10" value="<?=dhtmlspecialchars($endtime)?>" <?=($adminid != 1 ? 'disabled' : '')?> onclick="showcalendar(event, this)">
</td>
</tr>
<tr>
<td class="altbg1"><?=$lang['prune_search_user']?></td>
<td align="right" class="altbg2">
<?=$lang['case_insensitive']?> <input class="checkbox" type="checkbox" name="cins" value="1" <?=$checkcins?>>
<br /><input type="text" name="users" value="<?=dhtmlspecialchars($users)?>" size="40"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['prune_search_ip']?></td>
<td align="right" class="altbg2"><input type="text" name="useip" value="<?=dhtmlspecialchars($useip)?>" size="40"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['prune_search_keyword']?></td>
<td align="right" class="altbg2"><input type="text" name="keywords" value="<?=dhtmlspecialchars($keywords)?>" size="40"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['prune_search_lengthlimit']?></td>
<td align="right" class="altbg2"><input type="text" name="lengthlimit" value="<?=dhtmlspecialchars($lengthlimit)?>" size="40"></td>
</tr>
</table><br />
<center><input class="button" type="submit" name="searchsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
$tidsdelete = $pidsdelete = '0';
$pids = authcode($pids, 'DECODE');
$pidsadd = $pids ? 'pid IN ('.$pids.')' : 'pid IN ('.implodeids($pidarray).')';
$query = $db->query("SELECT fid, tid, pid, first, authorid FROM {$tablepre}posts WHERE $pidsadd");
while($post = $db->fetch_array($query)) {
$prune['forums'][] = $post['fid'];
$prune['thread'][$post['tid']]++;
$pidsdelete .= ",$post[pid]";
$tidsdelete .= $post['first'] ? ",$post[tid]" : '';
}
if($pidsdelete) {
require_once DISCUZ_ROOT.'./include/post.func.php';
$query = $db->query("SELECT attachment, thumb, remote FROM {$tablepre}attachments WHERE pid IN ($pidsdelete) OR tid IN ($tidsdelete)");
while($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
if(!$donotupdatemember) {
$postsarray = $tuidarray = $ruidarray = array();
$query1 = $db->query("SELECT pid, first, authorid FROM {$tablepre}posts WHERE pid IN ($pidsdelete)");
$query2 = $db->query("SELECT pid, first, authorid FROM {$tablepre}posts WHERE tid IN ($tidsdelete)");
while(($post = $db->fetch_array($query1)) || ($post = $db->fetch_array($query2))) {
$postsarray[$post['pid']] = $post;
}
foreach($postsarray as $post) {
if($post['first']) {
$tuidarray[] = $post['authorid'];
} else {
$ruidarray[] = $post['authorid'];
}
}
if($tuidarray) {
updatepostcredits('-', $tuidarray, $creditspolicy['post']);
}
if($ruidarray) {
updatepostcredits('-', $ruidarray, $creditspolicy['reply']);
}
}
$db->query("DELETE FROM {$tablepre}attachments WHERE pid IN ($pidsdelete)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}attachments WHERE tid IN ($tidsdelete)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}threadsmod WHERE tid IN ($tidsdelete)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}threadsmod WHERE tid IN ($tidsdelete)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}threads WHERE tid IN ($tidsdelete)");
$deletedthreads = $db->affected_rows();
$db->query("DELETE FROM {$tablepre}posts WHERE pid IN ($pidsdelete)");
$deletedposts = $db->affected_rows();
$db->query("DELETE FROM {$tablepre}posts WHERE tid IN ($tidsdelete)");
$deletedposts += $db->affected_rows();
$db->query("DELETE FROM {$tablepre}polloptions WHERE tid IN ($tidsdelete)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}polls WHERE tid IN ($tidsdelete)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}rewardlog WHERE tid IN ($tidsdelete)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}trades WHERE tid IN ($tidsdelete)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}rewardlog WHERE tid IN ($tidsdelete)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}activities WHERE tid IN ($tidsdelete)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}activityapplies WHERE tid IN ($tidsdelete)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}typeoptionvars WHERE tid IN ($tidsdelete)", 'UNBUFFERED');
if(count($prunt['thread']) < 50) {
foreach($prune['thread'] as $tid => $decrease) {
updatethreadcount($tid);
}
} else {
$repliesarray = array();
foreach($prune['thread'] as $tid => $decrease) {
$repliesarray[$decrease][] = $tid;
}
foreach($repliesarray as $decrease => $tidarray) {
$db->query("UPDATE {$tablepre}threads SET replies=replies-$decrease WHERE tid IN (".implode(',', $tidarray).")");
}
}
if($globalstick) {
updatecache('globalstick');
}
foreach(array_unique($prune['forums']) as $fid) {
updateforumcount($fid);
}
}
$deletedthreads = intval($deletedthreads);
$deletedposts = intval($deletedposts);
updatemodworks('DLP', $deletedposts);
eval("\$cpmsg = \"".$msglang['prune_succeed']."\";");
?>
<script>alert('<?=$cpmsg?>');parent.$('pruneforum').searchsubmit.click();</script>
<?
}
if(submitcheck('searchsubmit')) {
$pids = $postcount = '0';
$sql = $error = '';
$keywords = trim($keywords);
$users = trim($users);
if(($starttime == '0' && $endtime == '0') || ($keywords == '' && $useip == '' && $users == '')) {
$error = 'prune_condition_invalid';
}
if($adminid == 1 || $adminid == 2) {
if($forums) {
$sql .= " AND p.fid='$forums'";
}
} else {
$forums = '0';
$query = $db->query("SELECT fid FROM {$tablepre}moderators WHERE uid='$discuz_uid'");
while($forum = $db->fetch_array($query)) {
$forums .= ','.$forum['fid'];
}
$sql .= " AND p.fid IN ($forums)";
}
if($users != '') {
$uids = '-1';
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE ".(empty($cins) ? 'BINARY' : '')." username IN ('".str_replace(',', '\',\'', str_replace(' ', '', $users))."')");
while($member = $db->fetch_array($query)) {
$uids .= ",$member[uid]";
}
$sql .= " AND p.authorid IN ($uids)";
}
if($useip != '') {
$sql .= " AND p.useip LIKE '".str_replace('*', '%', $useip)."'";
}
if($keywords != '') {
$sqlkeywords = '';
$or = '';
$keywords = explode(',', str_replace(' ', '', $keywords));
for($i = 0; $i < count($keywords); $i++) {
if(preg_match("/\{(\d+)\}/", $keywords[$i])) {
$keywords[$i] = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($keywords[$i], '/'));
$sqlkeywords .= " $or p.subject REGEXP '".$keywords[$i]."' OR p.message REGEXP '".$keywords[$i]."'";
} else {
$sqlkeywords .= " $or p.subject LIKE '%".$keywords[$i]."%' OR p.message LIKE '%".$keywords[$i]."%'";
}
$or = 'OR';
}
$sql .= " AND ($sqlkeywords)";
}
if($lengthlimit != '') {
$lengthlimit = intval($lengthlimit);
$sql .= " AND LENGTH(p.message) < $lengthlimit";
}
if($starttime != '0') {
$starttime = strtotime($starttime);
$sql .= " AND p.dateline>'$starttime'";
}
if($adminid == 1 && $endtime != gmdate('Y-n-j', $timestamp + $timeoffset * 3600)) {
if($endtime != '0') {
$endtime = strtotime($endtime);
$sql .= " AND p.dateline<'$endtime'";
}
} else {
$endtime = $timestamp;
}
if(($adminid == 2 && $endtime - $starttime > 86400 * 16) || ($adminid == 3 && $endtime - $starttime > 86400 * 8)) {
$error = 'prune_mod_range_illegal';
}
if(!$error) {
if($detail) {
$pagetmp = $page;
do{
$query = $db->query("SELECT p.fid, p.tid, p.pid, p.author, p.authorid, p.dateline, t.subject, p.message FROM {$tablepre}posts p LEFT JOIN {$tablepre}threads t USING(tid) WHERE t.digest!='-1' $sql LIMIT ".(($pagetmp - 1) * $ppp).",$ppp");
$pagetmp--;
} while(!$db->num_rows($query) && $pagetmp);
$posts = '';
while($post = $db->fetch_array($query)) {
$post['dateline'] = gmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600);
$post['subject'] = cutstr($post['subject'], 30);
$post['message'] = dhtmlspecialchars(cutstr($post['message'], 50));
$posts .= "<tr><td align=\"center\" class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"pidarray[]\" value=\"$post[pid]\" checked>\n".
"<td class=\"altbg2\"><a href=\"redirect.php?goto=findpost&pid=$post[pid]&ptid=$post[tid]\" target=\"_blank\">$post[subject]</a></td>\n".
"<td class=\"altbg1\">$post[message]</td>\n".
"<td align=\"center\" class=\"altbg2\"><a href=\"forumdisplay.php?fid=$post[fid]\" target=\"_blank\">{$_DCACHE[forums][$post[fid]][name]}</a></td>\n".
"<td align=\"center\" class=\"altbg1\"><a href=\"space.php?action=viewpro&uid=$post[authorid]\" target=\"_blank\">$post[author]</a></td>\n".
"<td align=\"center\" class=\"altbg2\">$post[dateline]</td></tr>\n";
}
$postcount = $db->result($db->query("SELECT count(*) FROM {$tablepre}posts p LEFT JOIN {$tablepre}threads t USING(tid) WHERE t.digest!='-1' $sql"), 0);
$multi = multi($postcount, $ppp, $page, "admincp.php?action=prune");
$multi = preg_replace("/href=\"admincp.php\?action=prune&page=(\d+)\"/", "href=\"javascript:page(\\1)\"", $multi);
$multi = str_replace("window.location='admincp.php?action=prune&page='+this.value", "page(this.value)", $multi);
} else {
$postcount = 0;
$query = $db->query("SELECT pid FROM {$tablepre}posts p LEFT JOIN {$tablepre}threads t USING(tid) WHERE t.digest!='-1' $sql");
while($post = $db->fetch_array($query)) {
$pids .= ','.$post['pid'];
$postcount++;
}
$multi = '';
}
if(!$postcount) {
$error = 'prune_post_nonexistence';
}
}
?>
<br /><br /><form method="post" action="admincp.php?action=prune" target="pruneframe">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="pids" value="<?=authcode($pids, 'ENCODE')?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="2"><?=$lang['prune_result']?> <?=$postcount?></td>
</tr>
<?
if($error) {
echo "<tr><td class=\"altbg2\"><b>$lang[discuz_message]: $lang[$error]</b></td></tr>";
} else {
?>
<tr>
<td class="altbg1"><?=$lang['prune']?></td>
<td class="altbg2"><input class="checkbox" type="checkbox" name="donotupdatemember" value="1" checked> <?=$lang['prune_no_update_member']?></td>
</tr>
<?
if($detail) {
?>
</table><br /><br /><?=$multi?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><input name="chkall" type="checkbox" class="checkbox" checked onclick="checkall(this.form, 'pidarray', 'chkall')"><?=$lang['del']?></td><td><?=$lang['subject']?></td><td><?=$lang['message']?></td><td><?=$lang['forum']?></td><td><?=$lang['author']?></td><td><?=$lang['time']?></td></tr>
<?=$posts?>
<?
}
}
echo '</table>'.$multi.'<br /><center><input class="button" type="submit" name="prunesubmit" value="'.$lang['submit'].'" '.($error ? 'disabled' : '').'></center></form><iframe name="pruneframe" style="display:none"></iframe>';
}
} elseif($action == 'pmprune') {
if(!submitcheck('prunesubmit', 1)) {
shownav('menu_maint_pmprune');
?>
<form method="post" action="admincp.php?action=pmprune">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['prune_pm']?></td></tr>
<tr><td class="altbg1"><?=$lang['prune_pm_ignore_new']?></td>
<td class="altbg2" align="right"><input class="checkbox" type="checkbox" name="ignorenew" value="1"></td></tr>
<tr><td class="altbg1"><?=$lang['prune_pm_day']?></td>
<td class="altbg2" align="right"><input type="text" name="days" size="7"></td></tr>
<tr><td class="altbg1"><?=$lang['prune_pm_user']?></td>
<td class="altbg2" align="right">
<?=$lang['case_insensitive']?> <input class="checkbox" type="checkbox" name="cins" value="1">
<br /><input type="text" name="users" size="40"></td></tr>
<tr><td class="altbg1"><?=$lang['prune_search_keywords']?></td>
<td class="altbg2" align="right">
<input class="radio" type="radio" name="srchtype" value="title" checked> <?=$lang['prune_search_title']?> <input class="radio" type="radio" name="srchtype" value="fulltext"> <?=$lang['prune_search_fulltext']?>
<br /><input type="text" name="srchtxt" size="40" maxlength="40"><br /><?=$lang['pruce_rules']?></td></tr>
</table><br />
<center><input class="button" type="submit" name="prunesubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
if(!$confirmed || !isset($pmids) || !preg_match("/[\d,]/", $pmids)) {
if($days == '') {
cpmsg('prune_pm_range_invalid');
} else {
$uids = 0;
$users = str_replace(',', '\',\'', str_replace(' ', '', $users));
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE ".(empty($cins) ? 'BINARY' : '')." username IN ('$users')");
while($member = $db->fetch_array($query)) {
$uids .= ','.$member['uid'];
}
$prunedateadd = $days != 0 ? "AND dateline<='".($timestamp - $days * 86400)."'" : '';
$pruneuseradd = $users ? "AND ((msgfromid IN ($uids) AND folder='outbox') OR (msgtoid IN ($uids) AND folder='inbox'))" : '';
$prunenewadd = $ignorenew ? "AND new='0'" : '';
$prunetxtadd = '';
if($srchtxt) {
if(preg_match("(AND|\+|&|\s)", $srchtxt) && !preg_match("(OR|\|)", $srchtxt)) {
$andor = ' AND ';
$sqltxtsrch = '1';
$srchtxt = preg_replace("/( AND |&| )/is", "+", $srchtxt);
} else {
$andor = ' OR ';
$sqltxtsrch = '0';
$srchtxt = preg_replace("/( OR |\|)/is", "+", $srchtxt);
}
$srchtxt = str_replace('*', '%', addcslashes($srchtxt, '%_'));
foreach(explode('+', $srchtxt) as $text) {
$text = trim($text);
if($text) {
$sqltxtsrch .= $andor;
$sqltxtsrch .= $srchtype == 'fulltext' ? "(message LIKE '%".str_replace('_', '\_', $text)."%' OR subject LIKE '%$text%')" : "subject LIKE '%$text%'";
}
}
$prunetxtadd = " AND ($sqltxtsrch)";
}
$pmids = 0;
$query = $db->query("SELECT pmid FROM {$tablepre}pms WHERE 1 $prunedateadd $pruneuseradd $prunetxtadd $prunenewadd");
while($pm = $db->fetch_array($query)) {
$pmids .= ','.$pm['pmid'];
}
$pmnum = $db->num_rows($query);
cpmsg('prune_pm_confirm', "admincp.php?action=pmprune&prunesubmit=yes", 'form', '<input type="hidden" name="pmids" value="'.$pmids.'">');
}
} else {
$db->query("DELETE FROM {$tablepre}pms WHERE pmid IN ($pmids)");
$num = $db->affected_rows();
cpmsg('prune_pm_succeed');
}
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/prune.inc.php | PHP | asf20 | 17,873 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: attachments.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if(!submitcheck('deletesubmit') && !submitcheck('searchsubmit')) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
shownav('menu_maint_attaches');
?>
<form method="post" action="admincp.php?action=attachments">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['menu_maint_attaches']?></td></tr>
<tr><td class="altbg1"><?=$lang['attachments_nomatched']?></td>
<td class="altbg2" align="right"><input class="checkbox" type="checkbox" name="nomatched" value="1"></td></tr>
<tr><td class="altbg1"><?=$lang['attachments_forum']?></td>
<td class="altbg2" align="right"><select name="inforum"><option value="all"> > <?=$lang['all']?></option>
<option value=""> </option><?=forumselect()?></select></td></tr>
<tr><td class="altbg1"><?=$lang['attachments_sizeless']?></td>
<td class="altbg2" align="right"><input type="text" name="sizeless" size="40"></td></tr>
<tr><td class="altbg1"><?=$lang['attachments_sizemore']?></td>
<td class="altbg2" align="right"><input type="text" name="sizemore" size="40"></td></tr>
<tr><td class="altbg1"><?=$lang['attachments_dlcountless']?></td>
<td class="altbg2" align="right"><input type="text" name="dlcountless" size="40"></td></tr>
<tr><td class="altbg1"><?=$lang['attachments_dlcountmore']?></td>
<td class="altbg2" align="right"><input type="text" name="dlcountmore" size="40"></td></tr>
<tr><td class="altbg1"><?=$lang['attachments_daysold']?></td>
<td class="altbg2" align="right"><input type="text" name="daysold" size="40"></td></tr>
<tr><td class="altbg1"><?=$lang['attachments_filename']?></td>
<td class="altbg2" align="right"><input type="text" name="filename" size="40"></td></tr>
<tr><td class="altbg1"><?=$lang['attachments_keyword']?></td>
<td class="altbg2" align="right"><input type="text" name="keywords" size="40"></td></tr>
<tr><td class="altbg1"><?=$lang['attachments_author']?></td>
<td class="altbg2" align="right"><input type="text" name="author" size="40"></td></tr>
</table><br /><center>
<input class="button" type="submit" name="searchsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} elseif(submitcheck('searchsubmit')) {
require_once DISCUZ_ROOT.'./include/attachment.func.php';
$sql = "a.pid=p.pid";
if($inforum != 'all') {
if($inforum) {
$sql .= " AND p.fid='$inforum'";
} else {
cpmsg('attachments_forum_invalid');
}
}
if($daysold) {
$sql .= " AND p.dateline<='".($timestamp - (86400 * $daysold))."'";
}
if($author) {
$sql .= " AND p.author='$author'";
}
if($filename) {
$sql .= " AND a.filename LIKE '%$filename%'";
}
if($keywords) {
$sqlkeywords = $or = '';
foreach(explode(',', str_replace(' ', '', $keywords)) as $keyword) {
$sqlkeywords .= " $or a.description LIKE '%$keyword%'";
$or = 'OR';
}
$sql .= " AND ($sqlkeywords)";
}
if($sizeless) {
$sql .= " AND a.filesize<'$sizeless'";
}
if($sizemore) {
$sql .= " AND a.filesize>'$sizemore' ";
}
if($dlcountless) {
$sql .= " AND a.downloads<'$dlcountless'";
}
if($dlcountmore) {
$sql .= " AND a.downloads>'$dlcountmore'";
}
$attachments = '';
$page = max(1, intval($page));
$query = $db->query("SELECT a.*, p.fid, p.author, t.tid, t.tid, t.subject, f.name AS fname
FROM {$tablepre}attachments a, {$tablepre}posts p, {$tablepre}threads t, {$tablepre}forums f
WHERE t.tid=a.tid AND f.fid=p.fid AND t.displayorder>='0' AND p.invisible='0' AND $sql LIMIT ".(($page - 1) * $ppp).','.$ppp);
while($attachment = $db->fetch_array($query)) {
if(!$attachment['remote']) {
$matched = file_exists($attachdir.'/'.$attachment['attachment']) ? '' : "$lang[attachments_lost]";
$attachment['url'] = $attachurl;
} else {
@set_time_limit(0);
if(@fclose(@fopen($ftp['attachurl'].'/'.$attachment['attachment'], 'r'))) {
$matched = '';
} else {
$matched = $lang['attachments_far'];
}
$attachment['url'] = $ftp['attachurl'];
}
$attachsize = sizecount($attachment['filesize']);
if(!$nomatched || ($nomatched && $matched)) {
$attachments .= "<tr><td class=\"altbg1\" align=\"center\" valign=\"middle\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$attachment[aid]\"></td>\n".
"<td class=\"altbg2\" align=\"center\"><b>$attachment[filename]</b><br />$attachment[description]</td>\n".
"<td class=\"altbg1\" align=\"center\"><b>".($matched ? $matched : "<a href=\"attachment.php?aid=$attachment[aid]\" target=\"_blank\">[$lang[attachments_download]]</a>")."</b><br /><a href=\"$attachment[url]/$attachment[attachment]\" class=\"smalltxt\" target=\"_blank\">".cutstr($attachment['attachment'], 30)."</a></td>\n".
"<td class=\"altbg2\" align=\"center\">$attachment[author]</td>\n".
"<td class=\"altbg1\" valign=\"middle\"><a href=\"viewthread.php?tid=$attachment[tid]\" target=\"_blank\"><b>".cutstr($attachment['subject'], 20)."</b></a><br />$lang[forum]:<a href=\"forumdisplay.php?fid=$attachment[fid]\" target=\"_blank\">$attachment[fname]</a></td>\n".
"<td class=\"altbg2\" valign=\"middle\" align=\"center\">$attachsize</td>\n".
"<td class=\"altbg1\" valign=\"middle\" align=\"center\">$attachment[downloads]</td></tr>\n";
}
}
$attachmentcount = $db->result($db->query("SELECT count(*) FROM {$tablepre}attachments a, {$tablepre}posts p, {$tablepre}threads t, {$tablepre}forums f
WHERE t.tid=a.tid AND f.fid=p.fid AND t.displayorder>='0' AND p.invisible='0' AND $sql"), 0);
$multi = multi($attachmentcount, $ppp, $page, "admincp.php?action=attachments");
$multi = preg_replace("/href=\"admincp.php\?action=attachments&page=(\d+)\"/", "href=\"javascript:page(\\1)\"", $multi);
$multi = str_replace("window.location='admincp.php?action=attachments&page='+this.value", "page(this.value)", $multi);
shownav('menu_maint_attaches');
?>
<script type="text/javascript">
function page(number) {
$('attachmentforum').page.value=number;
$('attachmentforum').searchsubmit.click();
}
</script>
<form id="attachmentforum" method="post" action="admincp.php?action=attachments" style="display:none">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="nomatched" value="<?=$nomatched?>">
<input type="hidden" name="inforum" value="<?=$inforum?>">
<input type="hidden" name="sizeless" value="<?=dhtmlspecialchars($sizeless)?>">
<input type="hidden" name="sizemore" value="<?=dhtmlspecialchars($sizemore)?>">
<input type="hidden" name="dlcountless" value="<?=dhtmlspecialchars($dlcountless)?>">
<input type="hidden" name="dlcountmore" value="<?=dhtmlspecialchars($dlcountmore)?>">
<input type="hidden" name="daysold" value="<?=dhtmlspecialchars($daysold)?>">
<input type="hidden" name="filename" value="<?=dhtmlspecialchars($filename)?>">
<input type="hidden" name="keywords" value="<?=dhtmlspecialchars($keywords)?>">
<input type="hidden" name="author" value="<?=dhtmlspecialchars($author)?>">
<input class="button" type="submit" name="searchsubmit">
</form>
<form method="post" action="admincp.php?action=attachments" target="attachmentframe">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?=$multi?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td width="5%"><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td width="15%" align="center"><?=$lang['attachments_name']?></td>
<td width="27%" align="center"><?=$lang['filename']?></td>
<td width="15%" align="center"><?=$lang['author']?></td>
<td width="17%" align="center"><?=$lang['attachments_thread']?></td>
<td width="13%" align="center"><?=$lang['size']?></td>
<td width="13%" align="center"><?=$lang['download']?></td></tr>
<?=$attachments?>
</table>
<?=$multi?>
<center><input class="button" type="submit" name="deletesubmit" value="<?=$lang['submit']?>"></center></form><iframe name="attachmentframe" style="display:none"></iframe>
<?
} elseif(submitcheck('deletesubmit')) {
if(is_array($delete)) {
$ids = '\''.implode('\',\'', $delete).'\'';
$tids = $pids = 0;
$query = $db->query("SELECT tid, pid, attachment, thumb, remote FROM {$tablepre}attachments WHERE aid IN ($ids)");
while($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
$tids .= ','.$attach['tid'];
$pids .= ','.$attach['pid'];
}
$db->query("DELETE FROM {$tablepre}attachments WHERE aid IN ($ids)");
$db->query("UPDATE {$tablepre}posts SET attachment='0' WHERE pid IN ($pids)");
$attachtids = 0;
$query = $db->query("SELECT tid FROM {$tablepre}attachments WHERE tid IN ($tids) GROUP BY tid ORDER BY pid DESC");
while($attach = $db->fetch_array($query)) {
$attachtids .= ','.$attach['tid'];
}
$db->query("UPDATE {$tablepre}threads SET attachment='' WHERE tid IN ($tids)".($attachtids ? " AND tid NOT IN ($attachtids)" : NULL));
eval("\$cpmsg = \"".$msglang['attachments_edit_succeed']."\";");
} else {
eval("\$cpmsg = \"".$msglang['attachments_edit_invalid']."\";");
}
?>
<script>alert('<?=$cpmsg?>');parent.$('attachmentforum').searchsubmit.click();</script>
<?
}
?> | zyyhong | trunk/jiaju001/bbs/admin/attachments.inc.php | PHP | asf20 | 9,752 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: groups.inc.php 10115 2007-08-24 00:58:08Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if($action == 'admingroups') {
$actionarray = array('settings', 'xspace', 'passport', 'shopex', 'forumadd', 'forumsedit', 'forumsmerge',
'forumdetail', 'forumdelete', 'forumcopy', 'moderators', 'threadtypes', 'memberadd', 'members', 'membersmerge',
'editgroups', 'access', 'editcredits', 'editmedals', 'memberprofile', 'profilefields', 'ipban', 'usergroups',
'admingroups', 'ranks', 'announcements', 'styles', 'templates', 'tpladd', 'tpledit', 'modmembers',
'modthreads', 'modreplies', 'recyclebin', 'alipay', 'orders', 'forumlinks', 'onlinelist', 'medals',
'censor', 'discuzcodes', 'tags', 'smilies', 'icons', 'attachtypes', 'adv', 'advadd', 'advedit', 'export', 'import',
'runquery', 'optimize', 'attachments', 'counter', 'threads', 'prune', 'pmprune', 'updatecache', 'jswizard', 'creditwizard',
'fileperms', 'crons', 'google_config', 'qihoo_config', 'qihoo_topics',
'pluginsconfig', 'plugins', 'pluginsedit', 'pluginhooks', 'pluginvars', 'illegallog', 'ratelog', 'modslog', 'medalslog',
'banlog', 'cplog', 'creditslog', 'errorlog');
if(!submitcheck('groupsubmit')) {
if(!isset($edit) || empty($edit)) {
$grouplist = '';
$query = $db->query("SELECT a.*, u.radminid, u.grouptitle FROM {$tablepre}admingroups a
LEFT JOIN {$tablepre}usergroups u ON u.groupid=a.admingid
WHERE a.admingid<>'1' ORDER BY u.radminid, a.admingid");
while($group = $db->fetch_array($query)) {
$grouplist .= "<tr align=\"center\"><td class=\"altbg1\">$group[grouptitle]</td><td class=\"altbg2\">".
($group['admingid'] <= 3 ? $lang['admingroups_type_system'] : $lang['admingroups_type_user'])."</td><td class=\"altbg1\">".$lang['usergroups_system_'.$group['radminid']].
"</td><td class=\"altbg2\"><a href=\"admincp.php?action=usergroups&edit={$group[admingid]}&return=admingroups\">[{$lang[edit]}]</a></td><td class=\"altbg1\"><a href=\"admincp.php?action=admingroups&edit=$group[admingid]\">[{$lang[edit]}]</a></td></tr>\n";
}
shownav('menu_admingroups');
showtips('admingroups_tips');
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['name']?></td><td><?=$lang['type']?></td><td><?=$lang['admingroups_level']?></td><td><?=$lang['admingroups_settings_user']?></td><td><?=$lang['admingroups_settings_admin']?></td></tr>
<?=$grouplist?>
</table>
<?
} else {
$edit = intval($edit);
$query = $db->query("SELECT a.*, aa.disabledactions, u.radminid, u.grouptitle FROM {$tablepre}admingroups a
LEFT JOIN {$tablepre}usergroups u ON u.groupid=a.admingid
LEFT JOIN {$tablepre}adminactions aa ON aa.admingid=a.admingid
WHERE a.admingid='$edit' AND a.admingid<>'1'");
if(!$group = $db->fetch_array($query)) {
cpmsg('undefined_action');
}
?>
<br /><br /><form method="post" action="admincp.php?action=admingroups&edit=<?=$edit?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
if($group['radminid'] == 1) {
$group['disabledactions'] = $group['disabledactions'] ? unserialize($group['disabledactions']) : array();
showtype($lang['admingroups_edit'].' - '.$group['grouptitle'], 'top');
foreach($actionarray as $actionstr) {
showsetting('admingroups_edit_action_'.$actionstr, 'disabledactionnew['.$actionstr.']', !in_array($actionstr, $group['disabledactions']), 'radio');
}
showtype('', 'bottom');
} else {
$checkstick = array($group['allowstickthread'] => 'checked');
showtype($lang['admingroups_edit'].' - '.$group['grouptitle'], 'top');
showsetting('admingroups_edit_edit_post', 'alloweditpostnew', $group['alloweditpost'], 'radio');
showsetting('admingroups_edit_edit_poll', 'alloweditpollnew', $group['alloweditpoll'], 'radio');
showsetting('admingroups_edit_stick_thread', '', '', '<input class="radio" type="radio" name="allowstickthreadnew" value="0" '.$checkstick[0].'> '.$lang['admingroups_edit_stick_thread_none'].'<br /><input class="radio" type="radio" name="allowstickthreadnew" value="1" '.$checkstick[1].'> '.$lang['admingroups_edit_stick_thread_1'].'<br /><input class="radio" type="radio" name="allowstickthreadnew" value="2" '.$checkstick[2].'> '.$lang['admingroups_edit_stick_thread_2'].'<br /><input class="radio" type="radio" name="allowstickthreadnew" value="3" '.$checkstick[3].'> '.$lang['admingroups_edit_stick_thread_3'].'');
showsetting('admingroups_edit_mod_post', 'allowmodpostnew', $group['allowmodpost'], 'radio');
showsetting('admingroups_edit_del_post', 'allowdelpostnew', $group['allowdelpost'], 'radio');
showsetting('admingroups_edit_ban_post', 'allowbanpostnew', $group['allowbanpost'], 'radio');
showsetting('admingroups_edit_mass_prune', 'allowmassprunenew', $group['allowmassprune'], 'radio');
showsetting('admingroups_edit_refund', 'allowrefundnew', $group['allowrefund'], 'radio');
showsetting('admingroups_edit_censor_word', 'allowcensorwordnew', $group['allowcensorword'], 'radio');
showsetting('admingroups_edit_view_ip', 'allowviewipnew', $group['allowviewip'], 'radio');
showsetting('admingroups_edit_ban_ip', 'allowbanipnew', $group['allowbanip'], 'radio');
showsetting('admingroups_edit_edit_user', 'alloweditusernew', $group['allowedituser'], 'radio');
showsetting('admingroups_edit_ban_user', 'allowbanusernew', $group['allowbanuser'], 'radio');
showsetting('admingroups_edit_mod_user', 'allowmodusernew', $group['allowmoduser'], 'radio');
showsetting('admingroups_edit_post_announce', 'allowpostannouncenew', $group['allowpostannounce'], 'radio');
showsetting('admingroups_edit_view_log', 'allowviewlognew', $group['allowviewlog'], 'radio');
showsetting('admingroups_edit_disable_postctrl', 'disablepostctrlnew', $group['disablepostctrl'], 'radio');
if($supe['status']) {
showsetting('admingroups_supe_pushthread', 'supe_allowpushthreadnew', $group['supe_allowpushthread'], 'radio');
}
showtype('', 'bottom');
}
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"groupsubmit\" value=\"$lang[submit]\"><center></form>";
}
} else {
$query = $db->query("SELECT groupid, radminid FROM {$tablepre}usergroups WHERE groupid='$edit'");
if(!$group = $db->fetch_array($query)) {
cpmsg('undefined_action');
}
if($group['radminid'] == 1) {
$dactionarray = array();
if(is_array($disabledactionnew)) {
foreach($disabledactionnew as $key => $value) {
if(in_array($key, $actionarray) && !$value) {
$dactionarray[] = $key;
}
}
}
$db->query("REPLACE INTO {$tablepre}adminactions (admingid, disabledactions)
VALUES ('$group[groupid]', '".addslashes(serialize($dactionarray))."')");
} else {
$supe_allowpushthread_add = $supe['status'] ? ", supe_allowpushthread='$supe_allowpushthreadnew'" : '';
$db->query("UPDATE {$tablepre}admingroups SET alloweditpost='$alloweditpostnew', alloweditpoll='$alloweditpollnew',
allowstickthread='$allowstickthreadnew', allowmodpost='$allowmodpostnew', allowbanpost='$allowbanpostnew', allowdelpost='$allowdelpostnew',
allowmassprune='$allowmassprunenew', allowrefund='$allowrefundnew', allowcensorword='$allowcensorwordnew',
allowviewip='$allowviewipnew', allowbanip='$allowbanipnew', allowedituser='$alloweditusernew', allowbanuser='$allowbanusernew',
allowmoduser='$allowmodusernew', allowpostannounce='$allowpostannouncenew', allowviewlog='$allowviewlognew',
disablepostctrl='$disablepostctrlnew'$supe_allowpushthread_add WHERE admingid='$group[groupid]' AND admingid<>'1'");
}
updatecache('usergroups');
updatecache('admingroups');
cpmsg('admingroups_edit_succeed', 'admincp.php?action=admingroups');
}
} elseif($action == 'usergroups') {
if($do == 'viewsgroup') {
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}members WHERE groupid='$sgroupid'");
$num = $db->result($query, 0);
$query = $db->query("SELECT uid, username FROM {$tablepre}members WHERE groupid='$sgroupid' LIMIT 80");
$sgroups = '';
while($member = $db->fetch_array($query)) {
$sgroups .= '<span style="display: block; float: left; width: 8em; overflow: hidden; margin: 2px; height: 1.5em;"><a href="space.php?action=viewpro&uid='.$member['uid'].'" target="_blank">'.$member['username'].'</a></span> ';
}
$sgroups .= '<div align="right" style="clear: both;"><br />'.$lang['usernum'].$num.($num > 80 ? ' <a href="admincp.php?action=members&searchsubmit=yes&usergroupid[]='.$sgroupid.'">'.$lang['more'].'»</a>' : '').' </div>';
ajaxshowheader();
echo $sgroups;
ajaxshowfooter();
exit;
}
if(!submitcheck('groupsubmit')) {
if(!$edit) {
$sgroups = $smembers = array();
$sgroupids = '0';
$smembernum = $membergroup = $specialgroup = $sysgroup = '';
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='insenz'");
$insenz = ($insenz = $db->result($query, 0)) ? unserialize($insenz) : array();
$conditions = !empty($insenz['groupid']) ? "WHERE groupid<>$insenz[groupid]" : '';
$query = $db->query("SELECT groupid, type, grouptitle, creditshigher, creditslower, stars, color, groupavatar FROM {$tablepre}usergroups $conditions ORDER BY creditshigher");
while($group = $db->fetch_array($query)) {
if($group['type'] == 'member') {
$membergroup .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[$group[groupid]]\" value=\"$group[groupid]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"12\" name=\"groupnew[$group[groupid]][grouptitle]\" value=\"$group[grouptitle]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"6\" name=\"groupnew[$group[groupid]][creditshigher]\" value=\"$group[creditshigher]\">\n".
"<td class=\"altbg2\">$group[creditslower]\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"2\"name=\"groupnew[$group[groupid]][stars]\" value=\"$group[stars]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"6\"name=\"groupnew[$group[groupid]][color]\" value=\"$group[color]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"12\" name=\"groupnew[$group[groupid]][groupavatar]\" value=\"$group[groupavatar]\"></td>".
"<td class=\"altbg2\" nowrap><a href=\"admincp.php?action=usergroups&edit=$group[groupid]\">[$lang[detail]]</a></td></tr>\n";
} elseif($group['type'] == 'system') {
$sysgroup .= "<tr align=\"center\">\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"12\" name=\"group_title[$group[groupid]]\" value=\"$group[grouptitle]\"></td>\n".
"<td class=\"altbg1\">".$lang['usergroups_system_'.$group['groupid']]."</td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"2\"name=\"group_stars[$group[groupid]]\" value=\"$group[stars]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"6\"name=\"group_color[$group[groupid]]\" value=\"$group[color]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"12\" name=\"group_avatar[$group[groupid]]\" value=\"$group[groupavatar]\"></td>\n".
"<td class=\"altbg1\" nowrap><a href=\"admincp.php?action=usergroups&edit=$group[groupid]\">[$lang[detail]]</a></td></tr>\n";
} elseif($group['type'] == 'special') {
$sgroups[] = $group;
$sgroupids .= ','.$group['groupid'];
}
}
$projectselect = '';
$project = array();
$query = $db->query("SELECT id, name FROM {$tablepre}projects WHERE type='group'");
while($project = $db->fetch_array($query)) {
$projectselect .= '<option value="'.$project['id'].'">'.$project['name'].'</option>';
}
foreach($sgroups as $group) {
if(is_array($smembers[$group['groupid']])) {
$num = count($smembers[$group['groupid']]);
$specifiedusers = implode('', $smembers[$group['groupid']]).($num > $smembernum[$group['groupid']] ? '<br /><div style="float: right; clear: both; margin:5px"><a href="admincp.php?action=members&searchsubmit=yes&usergroupid[]='.$group['groupid'].'" style="text-align: right;">'.$lang['more'].'»</a> </div>' : '<br /><br />');
unset($smembers[$group['groupid']]);
} else {
$specifiedusers = '';
$num = 0;
}
$specifiedusers = "<style>#specifieduser span{width: 9em; height: 2em; float: left; overflow: hidden; margin: 2px;}</style><div id=\"specifieduser\">$specifiedusers</div>";
$specialgroup .= "<tr align=\"center\" valign=\"top\">
<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[$group[groupid]]\" value=\"$group[groupid]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"12\" name=\"group_title[$group[groupid]]\" value=\"$group[grouptitle]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"2\"name=\"group_stars[$group[groupid]]\" value=\"$group[stars]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"6\"name=\"group_color[$group[groupid]]\" value=\"$group[color]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"12\" name=\"group_avatar[$group[groupid]]\" value=\"$group[groupavatar]\"></td>\n".
"<td class=\"altbg2\" nowrap><a href=\"admincp.php?action=usergroups&sgroupid=$group[groupid]&do=viewsgroup\" onclick=\"ajaxget(this.href, 'sgroup_$group[groupid]', 'sgroup_$group[groupid]', 'auto');doane(event);\">[$lang[view]]</a></td>\n".
"<td class=\"altbg1\" nowrap><a href=\"admincp.php?action=usergroups&edit=$group[groupid]\">[$lang[detail]]</a></td></tr>\n";
$specialgroup .= "<tbody><tr><td colspan=\"7\" id=\"sgroup_$group[groupid]\" style=\"display: none\"></td></tr></tbody>";
}
shownav('menu_usergroups');
showtips('usergroups_tips');
?>
<form method="post" action="admincp.php?action=usergroups&type=member">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="8"><?=$lang['usergroups_member']?> - <?=$lang['usergroups_detail']?></td></tr>
<tr class="category" align="center"><td width="48"><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['usergroups_title']?></td><td><?=$lang['members_creditshigher']?></td><td><?=$lang['members_creditslower']?></td><td><?=$lang['usergroups_stars']?></td><td><?=$lang['usergroups_color']?></td><td><?=$lang['usergroups_avatar']?></td><td><?=$lang['edit']?></td></tr>
<?=$membergroup?>
<tbody id="addnewusergroup">
<tr align="center" class="altbg1"><td><?=$lang['add_new']?> <a href="###" onclick="newnode = $('addnewusergroup2').firstChild.cloneNode(true); $('addnewusergroup').appendChild(newnode)">[+]</a></td>
<td><input type="text" size="12" name="groupnewadd[grouptitle][]"></td>
<td><input type="text" size="6" name="groupnewadd[creditshigher][]"></td>
<td> </td>
<td><input type="text" size="2" name="groupnewadd[stars][]"></td>
<td align="right"><?=$lang['usergroups_scheme']?></td><td colspan="3"><select name="groupnewadd[projectid][]" style="vertical-align: middle;"><option value="0"><?=$lang['none']?></option><?=$projectselect?></select></td>
</tr>
</tbody>
<tbody id="addnewusergroup2" style="display: none;"><tr align="center" class="altbg1"><td> </td>
<td><input type="text" size="12" name="groupnewadd[grouptitle][]"></td>
<td><input type="text" size="6" name="groupnewadd[creditshigher][]"></td>
<td> </td>
<td><input type="text" size="2" name="groupnewadd[stars][]"></td>
<td align="right"><?=$lang['usergroups_scheme']?></td><td colspan="3"><select name="groupnewadd[projectid][]" style="vertical-align: middle;"><option value="0"><?=$lang['none']?></option><?=$projectselect?></select></td>
</tr></tbody>
</table><br />
<center><?=$warning?><input class="button" type="submit" name="groupsubmit" value="<?=$lang['submit']?>"> </form><br />
<form method="post" action="admincp.php?action=usergroups&type=special">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="7"><?=$lang['usergroups_special']?> - <?=$lang['usergroups_detail']?></td></tr>
<tr class="category" align="center">
<td width="48"><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td nowrap width="20%"><?=$lang['usergroups_title']?></td>
<td nowrap width="20%"><?=$lang['usergroups_stars']?></td>
<td nowrap width="15%"><?=$lang['usergroups_color']?></td>
<td nowrap width="15%"><?=$lang['usergroups_avatar']?></td>
<td nowrap width="10%"><?=$lang['view']?></td>
<td nowrap width="10%"><?=$lang['edit']?></td></tr>
<?=$specialgroup?>
<tbody id="addnewspecialgroup">
<tr class="altbg1" align="center">
<td><?=$lang['add_new']?> <a href="###" onclick="newnode = $('addnewspecialgroup2').firstChild.cloneNode(true); $('addnewspecialgroup').appendChild(newnode)">[+]</a></td>
<td><input type="text" size="12" name="grouptitlenewadd[]"></td>
<td><input type="text" size="2" name="starsnewadd[]"></td>
<td><input type="text" size="6" name="colornewadd[]"></td>
<td><input type="text" size="12" name="groupavatarnewadd[]"></td>
<td> </td>
<td> </td>
</tr>
</tbody>
<tbody id="addnewspecialgroup2" style="display: none;"><tr align="center" class="altbg1">
<td><?=$lang['add_new']?></td>
<td><input type="text" size="12" name="grouptitlenewadd[]"></td>
<td><input type="text" size="2" name="starsnewadd[]"></td>
<td><input type="text" size="6" name="colornewadd[]"></td>
<td><input type="text" size="12" name="groupavatarnewadd[]"></td>
<td> </td>
<td> </td>
</tr><tbody>
</table><br /><center>
<input class="button" type="submit" name="groupsubmit" value="<?=$lang['submit']?>"></center></form><br />
<form method="post" action="admincp.php?action=usergroups&type=system">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="6"><?=$lang['usergroups_system']?> - <?=$lang['usergroups_detail']?></td></tr>
<tr class="category" align="center">
<td><?=$lang['usergroups_title']?></td><td><?=$lang['usergroups_status']?></td><td><?=$lang['usergroups_stars']?></td><td><?=$lang['usergroups_color']?><td><?=$lang['usergroups_avatar']?></td><td><?=$lang['edit']?></td></tr>
<?=$sysgroup?>
</table><br /><center>
<input class="button" type="submit" name="groupsubmit" value="<?=$lang['submit']?>"></center></form>
<?
} else {
$query = $db->query("SELECT * FROM {$tablepre}usergroups WHERE groupid='$edit'");
$group = $db->fetch_array($query);
if(!submitcheck('detailsubmit') && !submitcheck('saveconfigsubmit')) {
$projectselect = "<select name=\"projectid\" onchange=\"window.location='admincp.php?action=usergroups&edit=$edit&projectid='+this.options[this.options.selectedIndex].value\"><option value=\"0\" selected=\"selected\">".$lang['none']."</option>";
$query = $db->query("SELECT id, name FROM {$tablepre}projects WHERE type='group'");
while($project = $db->fetch_array($query)) {
$projectselect .= "<option value=\"$project[id]\" ".($project['id'] == $projectid ? 'selected="selected"' : NULL).">$project[name]</option>\n";
}
$projectselect .= '</select>';
if(!empty($projectid)) {
$query = $db->query("SELECT value FROM {$tablepre}projects WHERE id='$projectid'");
$group = @array_merge($group, unserialize($db->result($query, 0)));
}
echo "<form method=\"post\" action=\"admincp.php?action=usergroups&edit=$edit&formhash=".FORMHASH.($return == 'admingroups' ? '&return=admingroups' : '')."\">\n";
showtype('usergroups_edit', 'top');
showsetting('usergroups_edit_title', 'grouptitlenew', $group['grouptitle'], 'text');
showsetting('usergroups_scheme', '', '', $projectselect);
if($group['type'] == 'special') {
$selectra = array($group['radminid'] => 'selected="selected"');
showsetting('usergroups_edit_radminid', '', '', "<select name=\"radminidnew\"><option value=\"0\" $selectra[0]>$lang[none]</option><option value=\"1\" $selectra[1]>$lang[usergroups_system_1]</option><option value=\"2\" $selectra[2]>$lang[usergroups_system_2]</option><option value=\"3\" $selectra[3]>$lang[usergroups_system_3]</option>");
showtype('usergroups_edit_system');
echo '<tr><td colspan="2" class="altbg2">'.$lang['usergroups_edit_system_comment'].'</td></tr>';
if($group['system'] == 'private') {
$system = array('public' => 0, 'dailyprice' => 0, 'minspan' => 0);
} else {
$system = array('public' => 1, 'dailyprice' => 0, 'minspan' => 0);
list($system['dailyprice'], $system['minspan']) = explode("\t", $group['system']);
}
showsetting('usergroups_edit_system_public', 'system_publicnew', $system['public'], 'radio');
showsetting('usergroups_edit_system_dailyprice', 'system_dailypricenew', $system['dailyprice'], 'text');
showsetting('usergroups_edit_system_minspan', 'system_minspannew', $system['minspan'], 'text');
}
showtype('usergroups_edit_basic');
if($group['groupid'] == 7) {
echo '<input type="hidden" name="allowvisitnew" value="1">';
} else {
showsetting('usergroups_edit_visit', 'allowvisitnew', $group['allowvisit'], 'radio');
}
showsetting('usergroups_edit_read_access', 'readaccessnew', $group['readaccess'], 'text');
showsetting('usergroups_edit_view_profile', 'allowviewpronew', $group['allowviewpro'], 'radio');
showsetting('usergroups_edit_view_stats', 'allowviewstatsnew', $group['allowviewstats'], 'radio');
showsetting('usergroups_edit_invisible', 'allowinvisiblenew', $group['allowinvisible'], 'radio');
showsetting('usergroups_edit_multigroups', 'allowmultigroupsnew', $group['allowmultigroups'], 'radio');
showsetting('usergroups_edit_allowtransfer', 'allowtransfernew', $group['allowtransfer'], 'radio');
showsetting('usergroups_edit_search', array('allowsearchnew', array(
array(0, $lang['usergroups_edit_search_disable']),
array(1, $lang['usergroups_edit_search_thread']),
array(2, $lang['usergroups_edit_search_post']))), $group['allowsearch'], 'mradio');
showsetting('usergroups_edit_avatar', array('allowavatarnew', array(
array(0, $lang['usergroups_edit_avatar_disable']),
array(1, $lang['usergroups_edit_avatar_board']),
array(2, $lang['usergroups_edit_avatar_custom']),
array(3, $lang['usergroups_edit_avatar_upload']))), $group['allowavatar'], 'mradio');
showsetting('usergroups_edit_reasonpm', array('reasonpmnew', array(
array(0, $lang['usergroups_edit_reasonpm_none']),
array(1, $lang['usergroups_edit_reasonpm_reason']),
array(2, $lang['usergroups_edit_reasonpm_pm']),
array(3, $lang['usergroups_edit_reasonpm_both']))), $group['reasonpm'], 'mradio');
showsetting('usergroups_edit_blog', 'allowuseblognew', $group['allowuseblog'], 'radio');
showsetting('usergroups_edit_nickname', 'allownicknamenew', $group['allownickname'], 'radio');
showsetting('usergroups_edit_cstatus', 'allowcstatusnew', $group['allowcstatus'], 'radio');
showsetting('usergroups_edit_disable_periodctrl', 'disableperiodctrlnew', $group['disableperiodctrl'], 'radio');
showsetting('usergroups_edit_max_pm_num', 'maxpmnumnew', $group['maxpmnum'], 'text');
showsetting('usergroups_edit_hour_posts', 'maxpostsperhournew', $group['maxpostsperhour'], 'text');
showtype('usergroups_specialthread');
showsetting('usergroups_special_activity', 'allowpostactivitynew', $group['allowpostactivity'], 'radio');
showsetting('usergroups_edit_post_poll', 'allowpostpollnew', $group['allowpostpoll'], 'radio');
showsetting('usergroups_edit_vote', 'allowvotenew', $group['allowvote'], 'radio');
showsetting('usergroups_special_reward', 'allowpostrewardnew', $group['allowpostreward'], 'radio');
showsetting('usergroups_special_reward_min', 'minrewardpricenew', $group['minrewardprice'], "text");
showsetting('usergroups_special_reward_max', 'maxrewardpricenew', $group['maxrewardprice'], "text");
showsetting('usergroups_special_trade', 'allowposttradenew', $group['allowposttrade'], 'radio');
showsetting('usergroups_special_trade_min', 'mintradepricenew', $group['mintradeprice'], "text");
showsetting('usergroups_special_trade_max', 'maxtradepricenew', $group['maxtradeprice'], "text");
showsetting('usergroups_special_trade_stick', 'tradesticknew', $group['tradestick'], "text");
showsetting('usergroups_special_debate', 'allowpostdebatenew', $group['allowpostdebate'], "radio");
$videoopen && showsetting('usergroups_special_video', 'allowpostvideonew', $group['allowpostvideo'], "radio");
showtype('usergroups_edit_thread');
showsetting('usergroups_edit_post', 'allowpostnew', $group['allowpost'], 'radio');
showsetting('usergroups_edit_reply', 'allowreplynew', $group['allowreply'], 'radio');
showsetting('usergroups_edit_direct_post', array('allowdirectpostnew', array(
array(0, $lang['usergroups_edit_direct_post_none']),
array(1, $lang['usergroups_edit_direct_post_reply']),
array(2, $lang['usergroups_edit_direct_post_thread']),
array(3, $lang['usergroups_edit_direct_post_all']))), $group['allowdirectpost'], 'mradio');
showsetting('usergroups_edit_anonymous', 'allowanonymousnew', $group['allowanonymous'], 'radio');
showsetting('usergroups_edit_set_read_perm', 'allowsetreadpermnew', $group['allowsetreadperm'], 'radio');
showsetting('usergroups_edit_maxprice', 'maxpricenew', $group['maxprice'], 'text');
showsetting('usergroups_edit_hide_code', 'allowhidecodenew', $group['allowhidecode'], 'radio');
showsetting('usergroups_edit_html', 'allowhtmlnew', $group['allowhtml'], 'radio');
showsetting('usergroups_edit_custom_bbcode', 'allowcusbbcodenew', $group['allowcusbbcode'], 'radio');
showsetting('usergroups_edit_bio_bbcode', 'allowbiobbcodenew', $group['allowbiobbcode'], 'radio');
showsetting('usergroups_edit_bio_img_code', 'allowbioimgcodenew', $group['allowbioimgcode'], 'radio');
showsetting('usergroups_edit_max_bio_size', 'maxbiosizenew', $group['maxbiosize'], 'text');
showsetting('usergroups_edit_sig_bbcode', 'allowsigbbcodenew', $group['allowsigbbcode'], 'radio');
showsetting('usergroups_edit_sig_img_code', 'allowsigimgcodenew', $group['allowsigimgcode'], 'radio');
showsetting('usergroups_edit_max_sig_size', 'maxsigsizenew', $group['maxsigsize'], 'text');
showtype('usergroups_edit_attachment');
showsetting('usergroups_edit_get_attach', 'allowgetattachnew', $group['allowgetattach'], 'radio');
showsetting('usergroups_edit_post_attach', 'allowpostattachnew', $group['allowpostattach'], 'radio');
showsetting('usergroups_edit_set_attach_perm', 'allowsetattachpermnew', $group['allowsetattachperm'], 'radio');
showsetting('usergroups_edit_max_attach_size', 'maxattachsizenew', $group['maxattachsize'], 'text');
showsetting('usergroups_edit_max_size_per_day', 'maxsizeperdaynew', $group['maxsizeperday'], 'text');
showsetting('usergroups_edit_attach_ext', 'attachextensionsnew', $group['attachextensions'], 'text');
showtype('usergroups_magic');
showsetting('usergroups_magic_permission', array('allowmagicsnew', array(
array(0, $lang['usergroups_magic_unallowed']),
array(1, $lang['usergroups_magic_allow']),
array(2, $lang['usergroups_magic_allow_and_pass']))), $group['allowmagics'], 'mradio');
showsetting('usergroups_magic_discount', 'magicsdiscountnew', $group['magicsdiscount'], 'text');
showsetting('usergroups_magic_max', 'maxmagicsweightnew', $group['maxmagicsweight'], 'text');
showtype('usergroups_invite');
showsetting('usergroups_invite_permission', 'allowinvitenew', $group['allowinvite'], 'radio');
showsetting('usergroups_invitesend_permission', 'allowmailinvitenew', $group['allowmailinvite'], 'radio');
showsetting('usergroups_invite_price', 'invitepricenew', $group['inviteprice'], 'text');
showsetting('usergroups_invite_buynum', 'maxinvitenumnew', $group['maxinvitenum'], 'text');
showsetting('usergroups_invite_maxinviteday', 'maxinvitedaynew', $group['maxinviteday'], 'text');
showtype('', 'bottom');
$raterangearray = array();
foreach(explode("\n", $group['raterange']) as $range) {
$range = explode("\t", $range);
$raterangearray[$range[0]] = array('min' => $range[1], 'max' => $range[2], 'mrpd' => $range[3]);
}
echo '<br /><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'.
'<tr class="header"><td colspan="6">'.$lang['usergroups_edit_credits'].'-'.$lang['usergroups_edit_raterange'].'</td></tr>'.
'<tr align="center" class="category"><td> </td><td>'.$lang['credits_id'].'</td><td>'.$lang['credits_title'].'</td><td>'.$lang['usergroups_edit_raterange_min'].'</td><td>'.$lang['usergroups_edit_raterange_max'].'</td><td>'.$lang['usergroups_edit_raterange_mrpd'].'</td></tr>';
for($i = 1; $i <= 8; $i++) {
if(isset($extcredits[$i])) {
echo '<tr align="center"><td class="altbg1"><input class="checkbox" type="checkbox" name="raterangenew['.$i.'][allowrate]" value="1" '.(empty($raterangearray[$i]) ? '' : 'checked').'></td>'.
'<td class="altbg2">extcredits'.$i.'</td>'.
'<td class="altbg1">'.$extcredits[$i]['title'].'</td>'.
'<td class="altbg2"><input type="text" name="raterangenew['.$i.'][min]" size="3" value="'.$raterangearray[$i]['min'].'"></td>'.
'<td class="altbg1"><input type="text" name="raterangenew['.$i.'][max]" size="3" value="'.$raterangearray[$i]['max'].'"></td>'.
'<td class="altbg2"><input type="text" name="raterangenew['.$i.'][mrpd]" size="3" value="'.$raterangearray[$i]['mrpd'].'"></td></tr>';
}
}
echo '<tr><td colspan="6" class="altbg2">'.$lang['usergroups_edit_raterange_comment'].'</td></tr></td></tr>';
echo "</table><br /><center><input class=\"button\" type=\"submit\" name=\"detailsubmit\" value=\"$lang[submit]\">";
echo " <input class=\"button\" type=\"submit\" name=\"saveconfigsubmit\" value=\"".$lang['saveconf']."\"><center></form>";
} else {
$systemnew = 'private';
if($group['type'] == 'special') {
if($system_publicnew) {
if($radminidnew) {
cpmsg('usergroups_edit_public_invalid');
} else {
if($system_dailypricenew > 0) {
if(!$creditstrans) {
cpmsg('usergroups_edit_creditstrans_disabled');
} else {
$system_minspannew = $system_minspannew <= 0 ? 1 : $system_minspannew;
$systemnew = intval($system_dailypricenew)."\t".intval($system_minspannew);
}
} else {
$systemnew = "0\t0";
}
}
}
if(in_array($radminidnew, array(1, 2, 3))) {
$query = $db->query("SELECT admingid FROM {$tablepre}admingroups WHERE admingid='$group[groupid]'");
if(!$db->num_rows($query)) {
if($radminidnew == 1) {
$db->query("REPLACE INTO {$tablepre}admingroups (admingid, alloweditpost, alloweditpoll, allowstickthread, allowmodpost, allowdelpost, allowmassprune, allowcensorword, allowviewip, allowbanip, allowedituser, allowmoduser, allowbanuser, allowpostannounce, allowviewlog, disablepostctrl)
VALUES ('$group[groupid]', 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)");
$db->query("REPLACE INTO {$tablepre}adminactions (admingid, disabledactions)
VALUES ('$group[groupid]', '')");
} else {
$db->query("REPLACE INTO {$tablepre}admingroups (admingid)
VALUES ('$group[groupid]')");
}
}
} else {
$radminidnew = 0;
$db->query("DELETE FROM {$tablepre}admingroups WHERE admingid='$group[groupid]'");
}
} else {
$radminidnew = $group['type'] == 'system' && in_array($group['groupid'], array(1, 2, 3)) ? $group['groupid'] : 0;
}
if(is_array($raterangenew)) {
foreach($raterangenew as $id => $rate) {
if($id >= 1 && $id <= 8 && $rate['allowrate']) {
$rate['min'] = intval($rate['min'] < -999 ? -999 : $rate['min']);
$rate['max'] = intval($rate['max'] > 999 ? 999 : $rate['max']);
$rate['mrpd'] = intval($rate['mrpd'] > 99999 ? 99999 : $rate['mrpd']);
if(!$rate['mrpd'] || $rate['max'] <= $rate['min'] || $rate['mrpd'] < max(abs($rate['min']), abs($rate['max']))) {
cpmsg('usergroups_edit_rate_invalid');
} else {
$raterangenew[$id] = implode("\t", array($id, $rate['min'], $rate['max'], $rate['mrpd']));
}
} else {
unset($raterangenew[$id]);
}
}
}
$raterangenew = $raterangenew ? implode("\n", $raterangenew) : '';
$maxpricenew = $maxpricenew < 0 ? 0 : intval($maxpricenew);
$maxpostsperhournew = $maxpostsperhournew > 255 ? 255 : intval($maxpostsperhournew);
$extensionarray = array();
foreach(explode(',', $attachextensionsnew) as $extension) {
if($extension = trim($extension)) {
$extensionarray[] = $extension;
}
}
$attachextensionsnew = implode(', ', $extensionarray);
if($maxtradepricenew == $mintradepricenew || $maxtradepricenew < 0 || $mintradepricenew <= 0 || ($maxtradepricenew && $maxtradepricenew < $mintradepricenew)) {
cpmsg('trade_fee_error');
} elseif(($maxrewardpricenew != 0 && $minrewardpricenew >= $maxrewardpricenew) || $minrewardpricenew < 1 || $minrewardpricenew < 0 || $maxrewardpricenew < 0) {
cpmsg('reward_credits_error');
}
$tradesticknew = $tradesticknew > 0 ? intval($tradesticknew) : 0;
$maxinvitedaynew = $maxinvitedaynew > 0 ? intval($maxinvitedaynew) : 10;
$db->query("UPDATE {$tablepre}usergroups SET grouptitle='$grouptitlenew', radminid='$radminidnew', system='$systemnew', allowvisit='$allowvisitnew',
readaccess='$readaccessnew', allowmultigroups='$allowmultigroupsnew', allowtransfer='$allowtransfernew', allowviewpro='$allowviewpronew',
allowviewstats='$allowviewstatsnew', allowinvisible='$allowinvisiblenew', allowsearch='$allowsearchnew', allowavatar='$allowavatarnew',
reasonpm='$reasonpmnew', allowuseblog='$allowuseblognew', allownickname='$allownicknamenew', allowcstatus='$allowcstatusnew',
disableperiodctrl='$disableperiodctrlnew', maxpmnum='$maxpmnumnew', maxpostsperhour='$maxpostsperhournew', maxinvitenum='$maxinvitenumnew', maxinviteday='$maxinvitedaynew', allowpost='$allowpostnew', allowreply='$allowreplynew',
allowanonymous='$allowanonymousnew', allowsetreadperm='$allowsetreadpermnew', maxprice='$maxpricenew', allowhidecode='$allowhidecodenew',
allowhtml='$allowhtmlnew', allowpostpoll='$allowpostpollnew', allowdirectpost='$allowdirectpostnew', allowvote='$allowvotenew',
allowcusbbcode='$allowcusbbcodenew', allowsigbbcode='$allowsigbbcodenew', allowsigimgcode='$allowsigimgcodenew', allowinvite='$allowinvitenew', allowmailinvite='$allowmailinvitenew', raterange='$raterangenew',
maxsigsize='$maxsigsizenew', allowgetattach='$allowgetattachnew', allowpostattach='$allowpostattachnew',
allowsetattachperm='$allowsetattachpermnew', allowpostreward='$allowpostrewardnew', maxrewardprice='$maxrewardpricenew', minrewardprice='$minrewardpricenew', inviteprice='$invitepricenew',
maxattachsize='$maxattachsizenew', maxsizeperday='$maxsizeperdaynew', attachextensions='$attachextensionsnew',
allowbiobbcode='$allowbiobbcodenew', allowbioimgcode='$allowbioimgcodenew', maxbiosize='$maxbiosizenew',
maxtradeprice='$maxtradepricenew', mintradeprice='$mintradepricenew', tradestick='$tradesticknew', allowposttrade='$allowposttradenew', allowpostactivity='$allowpostactivitynew', ".($videoopen ? "allowpostvideo='$allowpostvideonew', " : '')."allowmagics='$allowmagicsnew', maxmagicsweight='$maxmagicsweightnew', magicsdiscount='$magicsdiscountnew', allowpostdebate='$allowpostdebatenew' WHERE groupid='$edit'");
if($allowinvisiblenew == 0 && $group['allowinvisible'] != $allowinvisiblenew) {
$db->query("UPDATE {$tablepre}members SET invisible='0' WHERE groupid='$edit'");
}
if($group['type'] == 'special' && $radminidnew != $group['radminid']) {
$db->query("UPDATE {$tablepre}members SET adminid='".($radminidnew ? $radminidnew : -1)."' WHERE groupid='$edit' AND adminid='$group[radminid]'");
}
updatecache('usergroups');
if(submitcheck('saveconfigsubmit')) {
$projectid = intval($projectid);
dheader("Location: {$boardurl}admincp.php?action=projectadd&id=$edit&type=group&projectid=$projectid");
} else {
cpmsg('usergroups_edit_succeed', 'admincp.php?action='.($return != 'admingroups' ? 'usergroups' : 'admingroups'));
}
}
}
} else {
if($type == 'member') {
$groupnewadd = array_flip_keys($groupnewadd);
foreach($groupnewadd as $k=>$v) {
if(!$v['grouptitle'] || !$v['creditshigher']) {
unset($groupnewadd[$k]);
}
}
$groupnewkeys = array_keys($groupnew);
$maxgroupid = max($groupnewkeys);
foreach($groupnewadd as $k=>$v) {
$groupnew[$k+$maxgroupid+1] = $v;
}
$orderarray = array();
if(is_array($groupnew)) {
foreach($groupnew as $id => $group) {
if((is_array($delete) && in_array($id, $delete)) || ($id == 0 && (!$group['grouptitle'] || $group['creditshigher'] == ''))) {
unset($groupnew[$id]);
} else {
$orderarray[$group['creditshigher']] = $id;
}
}
}
if(empty($orderarray[0]) || min(array_flip($orderarray)) >= 0) {
cpmsg('usergroups_update_credits_invalid');
}
ksort($orderarray);
$rangearray = array();
$lowerlimit = array_keys($orderarray);
for($i = 0; $i < count($lowerlimit); $i++) {
$rangearray[$orderarray[$lowerlimit[$i]]] = array
(
'creditshigher' => isset($lowerlimit[$i - 1]) ? $lowerlimit[$i] : -999999999,
'creditslower' => isset($lowerlimit[$i + 1]) ? $lowerlimit[$i + 1] : 999999999
);
}
$project = $projects = array();
$query = $db->query("SELECT * FROM {$tablepre}projects WHERE type='group'");
while($project = $db->fetch_array($query)) {
$project['value'] = unserialize($project['value']);
$sqladd = '';
foreach($project['value'] as $k=>$v) {
$sqladd .= ",$k='$v'";
}
$project['sqladd'] = $sqladd;
$projects[$project['id']] = $project;
}
foreach($groupnew as $id => $group) {
$creditshighernew = $rangearray[$id]['creditshigher'];
$creditslowernew = $rangearray[$id]['creditslower'];
if($creditshighernew == $creditslowernew) {
cpmsg('usergroups_update_credits_duplicate');
}
if(in_array($id, $groupnewkeys)) {
$db->query("UPDATE {$tablepre}usergroups SET grouptitle='$group[grouptitle]', creditshigher='$creditshighernew', creditslower='$creditslowernew', stars='$group[stars]', color='$group[color]', groupavatar='$group[groupavatar]' WHERE groupid='$id' AND type='member'");
} elseif($group['grouptitle'] && $group['creditshigher'] != '') {
$project = $projects[$group['projectid']];
$db->query("INSERT INTO {$tablepre}usergroups SET grouptitle='$group[grouptitle]', creditshigher='$creditshighernew', creditslower='$creditslowernew', stars='$group[stars]' $project[sqladd]");
}
}
if(!empty($delete)) {
$db->query("DELETE FROM {$tablepre}usergroups WHERE groupid IN ('".implode('\',\'', $delete)."') AND type='member'");
}
} elseif($type == 'special') {
if(is_array($grouptitlenewadd)) {
foreach($grouptitlenewadd as $k=>$v) {
if($v) {
$db->query("INSERT INTO {$tablepre}usergroups (type, grouptitle, stars, color, groupavatar, allowvisit, readaccess, allowpost, allowsigbbcode)
VALUES ('special', '$grouptitlenewadd[$k]', '$starsnewadd[$k]', '$colornewadd[$k]', '$groupavatarnewadd[$k]', '1', '1', '1', '1')");
}
}
}
$ids = $comma = '';
if(is_array($group_title)) {
foreach($group_title as $id => $title) {
if($delete[$id]) {
$ids .= "$comma'$id'";
$comma = ',';
} else {
$db->query("UPDATE {$tablepre}usergroups SET grouptitle='$group_title[$id]', stars='$group_stars[$id]', color='$group_color[$id]', groupavatar='$group_avatar[$id]' WHERE groupid='$id'");
}
}
}
if($ids) {
$db->query("DELETE FROM {$tablepre}usergroups WHERE groupid IN ($ids) AND type='special'");
$db->query("DELETE FROM {$tablepre}admingroups WHERE admingid IN ($ids)");
$db->query("DELETE FROM {$tablepre}adminactions WHERE admingid IN ($ids)");
$query = $db->query("SELECT groupid FROM {$tablepre}usergroups WHERE type='member' AND creditslower>'0' ORDER BY creditslower LIMIT 1");
$db->query("UPDATE {$tablepre}members SET groupid='".$db->result($query, 0)."', adminid='0' WHERE groupid IN ($ids)", 'UNBUFFERED');
//$db->query("UPDATE {$tablepre}members SET groupid='".$db->result($query, 0)."', adminid='0' WHERE groupid IN ($ids) AND adminid='-1'", 'UNBUFFERED');
//$db->query("UPDATE {$tablepre}members SET groupid=adminid WHERE groupid IN ($ids) AND adminid IN ('1', '2', '3')", 'UNBUFFERED');
}
} elseif($type == 'system') {
if(is_array($group_title)) {
foreach($group_title as $id => $title) {
$db->query("UPDATE {$tablepre}usergroups SET grouptitle='$group_title[$id]', stars='$group_stars[$id]', color='$group_color[$id]', groupavatar='$group_avatar[$id]' WHERE groupid='$id'");
}
}
}
updatecache('usergroups');
cpmsg('usergroups_update_succeed', 'admincp.php?action=usergroups');
}
} elseif($action == 'ranks') {
if(!submitcheck('ranksubmit')) {
$ranks = '';
$query = $db->query("SELECT * FROM {$tablepre}ranks ORDER BY postshigher");
while($rank = $db->fetch_array($query)) {
$ranks .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[{$rank[rankid]}]\" value=\"$rank[rankid]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"12\" name=\"ranktitlenew[{$rank[rankid]}]\" value=\"$rank[ranktitle]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"6\" name=\"postshighernew[{$rank[rankid]}]\" value=\"$rank[postshigher]\">\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"2\"name=\"starsnew[{$rank[rankid]}]\" value=\"$rank[stars]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"6\"name=\"colornew[{$rank[rankid]}]\" value=\"$rank[color]\"></td>";
}
shownav('menu_ranks');
showtips('ranks_tips');
?>
<form method="post" action="admincp.php?action=ranks">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td width="48"><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['ranks_title']?></td><td><?=$lang['ranks_postshigher']?></td><td><?=$lang['ranks_stars']?></td><td><?=$lang['ranks_color']?></td></tr>
<?=$ranks?>
<tr align="center" class="altbg1"><td><?=$lang['add_new']?></td>
<td><input type="text" size="12" name="newranktitle"></td>
<td><input type="text" size="6" name="newpostshigher"></td>
<td><input type="text" size="2" name="newstars"></td>
<td><input type="text" size="6" name="newcolor"></td>
</tr></table><br />
<center><input class="button" type="submit" name="ranksubmit" value="<?=$lang['submit']?>"></center></form>
<?
} else {
if($delete) {
$ids = implode('\',\'', $delete);
$db->query("DELETE FROM {$tablepre}ranks WHERE rankid IN ('$ids')");
}
foreach($ranktitlenew as $id => $value) {
$db->query("UPDATE {$tablepre}ranks SET ranktitle='$ranktitlenew[$id]', postshigher='$postshighernew[$id]', stars='$starsnew[$id]', color='$colornew[$id]' WHERE rankid='$id'");
}
if($newranktitle) {
$db->query("INSERT INTO {$tablepre}ranks (ranktitle, postshigher, stars, color)
VALUES ('$newranktitle', '$newpostshigher', '$newstars', '$newcolor')");
}
updatecache('ranks');
cpmsg('ranks_succeed', 'admincp.php?action=ranks');
}
}
function array_flip_keys($arr) {
$arr2 = array();
$arrkeys = array_keys($arr);
list(, $first) = each(array_slice($arr, 0, 1));
if($first) {
foreach($first as $k=>$v) {
foreach($arrkeys as $key) {
$arr2[$k][$key] = $arr[$key][$k];
}
}
}
return $arr2;
}
?> | zyyhong | trunk/jiaju001/bbs/admin/groups.inc.php | PHP | asf20 | 45,296 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: passport.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if(!in_array($action, array('passport', 'shopex'))) {
cpmsg('undefined_action');
}
$query = $db->query("SELECT * FROM {$tablepre}settings WHERE variable LIKE 'passport_%'");
while($setting = $db->fetch_array($query)) {
$settings[$setting['variable']] = $setting['value'];
}
if($settings['passport_status'] && $settings['passport_status'] != $action) {
cpmsg('passport_notmatch');
}
if(!submitcheck('ppsubmit')) {
shownav($action == 'passport' ? 'menu_passport_settings' : 'menu_passport_'.$action);
showtips($action == 'passport' ? 'passport_tips' : 'passport_'.$action.'_tips');
?>
<form method="post" name="settings" action="admincp.php">
<input type="hidden" name="action" value="<?=$action?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
$passportcredits = '<select name="settingsnew[passport_extcredits]">';
for($i = 0; $i <= 8; $i++) {
$passportcredits .= '<option value="'.$i.'" '.($settings['passport_extcredits'] == $i ? 'selected' : '').'>'.($i ? 'extcredits'.$i.(!empty($extcredits[$i]['title']) ? ' ('.$extcredits[$i]['title'].')' : '') : $lang['passport_extcredits_none']).'</option>';
}
$passportcredits .= '</select>';
showtype('passport_settings', 'top');
showsetting('passport_status', 'settingsnew[passport_status]', $settings['passport_status'] == $action, 'radio', '', '', 1);
if($action == 'shopex') {
showsetting('passport_shopex', 'settingsnew[passport_shopex]', $settings['passport_shopex'], 'radio');
}
showsetting('passport_url', 'settingsnew[passport_url]', $settings['passport_url'], 'text');
showsetting('passport_key', 'settingsnew[passport_key]', $settings['passport_key'], 'text');
showsetting('passport_expire', 'settingsnew[passport_expire]', $settings['passport_expire'], 'text');
if($action == 'shopex') {
echo '<input type="hidden" name="settingsnew[passport_register_url]" value="index.php?gOo=cmVnaXN0ZXJfMS5kd3Q=">'.
'<input type="hidden" name="settingsnew[passport_login_url]" value="index.php?gOo=bG9naW4uZHd0">'.
'<input type="hidden" name="settingsnew[passport_logout_url]" value="index.php?gOo=bG9nb3V0X2FjdC5kbw==">';
} else {
showsetting('passport_register_url', 'settingsnew[passport_register_url]', $settings['passport_register_url'], 'text');
showsetting('passport_login_url', 'settingsnew[passport_login_url]', $settings['passport_login_url'], 'text');
showsetting('passport_logout_url', 'settingsnew[passport_logout_url]', $settings['passport_logout_url'], 'text');
}
showsetting('passport_extcredits', '', '', $passportcredits);
showtype('', 'bottom');
echo '<br /><center><input class="button" type="submit" name="ppsubmit" value="'.$lang['submit'].'"></center></form>';
} else {
if($settingsnew['passport_status']) {
if(!$settingsnew['passport_url'] || !$settingsnew['passport_register_url'] || !$settingsnew['passport_login_url'] || !$settingsnew['passport_logout_url']) {
cpmsg('passport_url_invalid');
} elseif(strlen($settingsnew['passport_key']) < 10) {
cpmsg('passport_key_invalid');
}
$settingsnew['passport_status'] = $action;
$settingsnew['passport_expire'] = $settingsnew['passport_expire'] < 0 ? 0 : $settingsnew['passport_expire'];
if(substr(($settingsnew['passport_url'] = trim($settingsnew['passport_url'])), -1) != '/') {
$settingsnew['passport_url'] = $settingsnew['passport_url'].'/';
}
} else {
$settingsnew['passport_status']
= $settingsnew['passport_register_url']
= $settingsnew['passport_login_url']
= $settingsnew['passport_logout_url']
= '';
}
foreach($settingsnew as $key => $val) {
if(isset($settings[$key]) && $settings[$key] != $val) {
$db->query("REPLACE INTO {$tablepre}settings (variable, value)
VALUES ('$key', '$val')");
}
}
updatecache('settings');
cpmsg('passport_update_succeed');
}
?> | zyyhong | trunk/jiaju001/bbs/admin/passport.inc.php | PHP | asf20 | 4,191 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: quickqueries.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
$simplequeries = array(
array('comment' => '快速开启论坛版块功能', 'sql' => ''),
array('comment' => '开启 所有版块 主题回收站', 'sql' => 'UPDATE {tablepre}forums SET recyclebin=\'1\''),
array('comment' => '开启 所有版块 Discuz! 代码”', 'sql' => 'UPDATE {tablepre}forums SET allowbbcode=\'1\''),
array('comment' => '开启 所有版块 [IMG] 代码”', 'sql' => 'UPDATE {tablepre}forums SET allowimgcode=\'1\''),
array('comment' => '开启 所有版块 Smilies 代码', 'sql' => 'UPDATE {tablepre}forums SET allowsmilies=\'1\''),
array('comment' => '开启 所有版块 内容干扰码', 'sql' => 'UPDATE {tablepre}forums SET jammer=\'1\''),
array('comment' => '开启 所有版块 允许匿名发贴”', 'sql' => 'UPDATE {tablepre}forums SET allowanonymous=\'1\''),
array('comment' => '开启 所有版块 支付宝求购按钮”', 'sql' => 'UPDATE {tablepre}forums SET allowpaytoauthor=\'1\''),
array('comment' => '快速关闭论坛版块功能', 'sql' => ''),
array('comment' => '关闭 所有版块 主题回收站', 'sql' => 'UPDATE {tablepre}forums SET recyclebin=\'0\''),
array('comment' => '关闭 所有版块 HTML 代码', 'sql' => 'UPDATE {tablepre}forums SET allowhtml=\'0\''),
array('comment' => '关闭 所有版块 Discuz! 代码', 'sql' => 'UPDATE {tablepre}forums SET allowbbcode=\'0\''),
array('comment' => '关闭 所有版块 [IMG] 代码', 'sql' => 'UPDATE {tablepre}forums SET allowimgcode=\'0\''),
array('comment' => '关闭 所有版块 Smilies 代码', 'sql' => 'UPDATE {tablepre}forums SET allowsmilies=\'0\''),
array('comment' => '关闭 所有版块 内容干扰码', 'sql' => 'UPDATE {tablepre}forums SET jammer=\'0\''),
array('comment' => '关闭 所有版块 允许匿名发贴', 'sql' => 'UPDATE {tablepre}forums SET allowanonymous=\'0\''),
array('comment' => '关闭 所有版块 支付宝求购按钮', 'sql' => 'UPDATE {tablepre}forums SET allowpaytoauthor=\'0\''),
array('comment' => '会员操作相关', 'sql' => ''),
array('comment' => '清除 所有会员 自定义风格', 'sql' => 'UPDATE {tablepre}members SET styleid=\'0\''),
array('comment' => '清空 所有会员 积分交易记录', 'sql' => 'TRUNCATE {tablepre}creditslog;'),
array('comment' => '清空 所有会员 收藏夹', 'sql' => 'TRUNCATE {tablepre}favorites;'),
);
?> | zyyhong | trunk/jiaju001/bbs/admin/quickqueries.inc.php | PHP | asf20 | 2,634 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: creditwizard.inc.php 10115 2007-08-24 00:58:08Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
$step = in_array($step, array(1, 2, 3)) ? $step : 1;
cpheader();
shownav('menu_tools_creditwizard');
$query = $db->query("SELECT * FROM {$tablepre}settings WHERE variable in
('extcredits', 'initcredits', 'creditspolicy', 'creditsformula', 'creditsformulaexp',
'creditstrans', 'creditstax', 'transfermincredits', 'exchangemincredits', 'maxincperthread', 'maxchargespan')");
while($setting = $db->fetch_array($query)) {
$$setting['variable'] = $setting['value'];
}
$extcredits = unserialize($extcredits);
$initcredits = explode(',', $initcredits);
$creditspolicy = unserialize($creditspolicy);
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td><?=$lang['menu_tools_creditwizard']?></td></tr>
<tr><td><?=$lang['creditwizard_tips']?></td></tr></table><br />
<?
if($step == 1) {
if($resetcredit >= 1 && $resetcredit <= 8) {
$initcredits[$resetcredit] = intval($initcredits[$resetcredit]);
if(!submitcheck('confirmed')) {
cpmsg('creditwizard_resetusercredit_warning', 'admincp.php?action=creditwizard&step=1&resetcredit='.$resetcredit, 'form');
} else {
$db->query("UPDATE {$tablepre}members SET extcredits$resetcredit = $initcredits[$resetcredit]", 'UNBUFFERED');
cpmsg('creditwizard_resetusercredit_ok', 'admincp.php?action=creditwizard&step=1');
}
exit;
}
if(!$credit) {
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder" align="center">
<tr class="header"><td colspan="4"><?=$lang['creditwizard_step_menu_1']?></td></tr>
<tr class="category"><td><?=$lang['credits_id']?></td><td><?=$lang['credits_title']?></td><td><?=$lang['creditwizard_status']?></td><td><?=$lang['edit']?></td></tr>
<?
for($i = 1; $i <= 8; $i++) {
echo '<tr align="center"><td class="altbg1">extcredits'.$i.'</td><td class="altbg2">'.$extcredits[$i]['title'].($i == $creditstrans ? $lang['creditwizard_iscreditstrans'] : '').'</td>'.
'<td class="altbg1">'.($extcredits[$i]['available'] ? $lang['creditwizard_available'] : $lang['creditwizard_unavailable']).'</td>'.
'<td class="altbg2"><a href="admincp.php?action=creditwizard&step=1&credit='.$i.'">['.$lang['creditwizard_detail'].']</a>'.
'<a href="admincp.php?action=creditwizard&step=1&resetcredit='.$i.'">['.$lang['creditwizard_resetusercredit'].']</a></td></tr>';
}
?>
</table>
<?
} else {
if(!submitcheck('settingsubmit')) {
$credit = $credit >=1 && $credit <= 8 ? $credit : 1;
$type = $type >=1 && $type <= 3 ? $type : 1;
$typestr = '<a href="admincp.php?action=creditwizard&step=1&credit='.$credit.'&type=1">'.$lang['creditwizard_settingtype_global'].'</a> ';
$typestr .= '<a href="admincp.php?action=creditwizard&step=1&credit='.$credit.'&type=2">'.$lang['creditwizard_settingtype_forum'].'</a> ';
$typestr .= '<a href="admincp.php?action=creditwizard&step=1&credit='.$credit.'&type=3">'.$lang['creditwizard_settingtype_usergroup'].'</a>';
$creditselect = '<select onchange="location.href=\'admincp.php?action=creditwizard&step=1&type='.$type.'&credit=\' + this.value">';
for($i = 1;$i <= 8;$i++) {
$creditselect .= '<option value="'.$i.'"'.($credit == $i ? ' selected' : '').'>extcredits'.$i.($extcredits[$i]['title'] ? ' ('.$extcredits[$i]['title'].')' : '').'</option>';
}
$creditselect .= '</select> ';
$tips = empty($type) || $type == 1 ? $lang['creditwizard_settingtype_global_tips'] : ($type == 2 ? $lang['creditwizard_settingtype_forum_tips'] : ($type == 3 ? $lang['creditwizard_settingtype_usergroup_tips'] : ''));
?>
<form method="post" action="admincp.php?action=creditwizard&step=1&credit=<?=$credit?>&type=<?=$type?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder" align="center">
<tr class="header"><td colspan="2">
<a href="admincp.php?action=creditwizard&step=1"><?=$lang['creditwizard_step_menu_1']?></a> - extcredits<?=$credit.($extcredits[$credit]['title'] ? '('.$extcredits[$credit]['title'].')' : '')?>
</td></tr>
<tr class="category"><td class="altbg2"><?=$typestr?></td><td class="altbg2" style="text-align: right"><?=$creditselect?></td></tr>
<tr class="category"><td colspan="2" class="altbg2"><?=$tips?></td></tr>
<?
if($type == 1) {
showtype('settings_credits_extended');
showsetting('creditwizard_credit_title', 'settingsnew[title]', $extcredits[$credit]['title'], 'text');
showsetting('creditwizard_credits_unit', 'settingsnew[unit]', $extcredits[$credit]['unit'], 'text');
showsetting('creditwizard_credits_ratio', 'settingsnew[ratio]', $extcredits[$credit]['ratio'], 'text');
showsetting('creditwizard_credits_init', 'settingsnew[init]', intval($initcredits[$credit]), 'text');
showsetting('creditwizard_credits_available', 'settingsnew[available]', intval($extcredits[$credit]['available']), 'radio');
showsetting('creditwizard_credits_show_in_thread', 'settingsnew[showinthread]', intval($extcredits[$credit]['showinthread']), 'radio');
showsetting('settings_creditwizard_outport', 'settingsnew[allowexchangeout]', intval($extcredits[$credit]['allowexchangeout']), 'radio');
showsetting('settings_creditwizard_allow_inport', 'settingsnew[allowexchangein]', intval($extcredits[$credit]['allowexchangein']), 'radio');
showtype('settings_credits_policy');
showsetting('settings_credits_policy_post', 'settingsnew[policy_post]', intval($creditspolicy['post'][$credit]), 'text');
showsetting('settings_credits_policy_reply', 'settingsnew[policy_reply]', intval($creditspolicy['reply'][$credit]), 'text');
showsetting('settings_credits_policy_digest', 'settingsnew[policy_digest]', intval($creditspolicy['digest'][$credit]), 'text');
showsetting('settings_credits_policy_post_attach', 'settingsnew[policy_postattach]', intval($creditspolicy['postattach'][$credit]), 'text');
showsetting('settings_credits_policy_get_attach', 'settingsnew[policy_getattach]', intval($creditspolicy['getattach'][$credit]), 'text');
showsetting('settings_credits_policy_send_pm', 'settingsnew[policy_pm]', intval($creditspolicy['pm'][$credit]), 'text');
showsetting('settings_credits_policy_search', 'settingsnew[policy_search]', intval($creditspolicy['search'][$credit]), 'text');
showsetting('settings_credits_policy_promotion_visit', 'settingsnew[policy_promotion_visit]', intval($creditspolicy['promotion_visit'][$credit]), 'text');
showsetting('settings_credits_policy_promotion_register', 'settingsnew[policy_promotion_register]', intval($creditspolicy['promotion_register'][$credit]), 'text');
showsetting('settings_credits_policy_trade', 'settingsnew[policy_tradefinished]', intval($creditspolicy['tradefinished'][$credit]), 'text');
showsetting('settings_credits_policy_poll', 'settingsnew[policy_votepoll]', intval($creditspolicy['votepoll'][$credit]), 'text');
showsetting('settings_credits_lowerlimit', 'settingsnew[lowerlimit]', intval($extcredits[$credit]['lowerlimit']), 'text');
?>
<tr><td colspan="2" class="altbg1"><?=$lang['settings_credits_policy_comment']?></td></tr>
<?
showtype('', 'bottom');
?>
<br /><center>
<input class="button" type="reset" name="settingsubmit" value="<?=$lang['reset']?>">
<input class="button" type="submit" name="settingsubmit" value="<?=$lang['submit']?>">
</form>
<?
} elseif($type == 2) {
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
$fids = implode(',', array_keys($_DCACHE['forums']));
$query = $db->query("SELECT fid, postcredits, replycredits, getattachcredits, postattachcredits, digestcredits
FROM {$tablepre}forumfields WHERE fid in ($fids)");
while($forumcredit = $db->fetch_array($query)) {
$forumcredit['postcreditsstatus'] = $forumcredit['postcredits'] ? 'checked' : '';
$forumcredit['postcredits'] = $forumcredit['postcredits'] ? unserialize($forumcredit['postcredits']) : array();
$forumcredit['postcredits'] = intval($forumcredit['postcredits'][$credit]);
$forumcredit['replycreditsstatus'] = $forumcredit['replycredits'] ? 'checked' : '';
$forumcredit['replycredits'] = $forumcredit['replycredits'] ? unserialize($forumcredit['replycredits']) : array();
$forumcredit['replycredits'] = intval($forumcredit['replycredits'][$credit]);
$forumcredit['getattachcreditsstatus'] = $forumcredit['getattachcredits'] ? 'checked' : '';
$forumcredit['getattachcredits'] = $forumcredit['getattachcredits'] ? unserialize($forumcredit['getattachcredits']) : array();
$forumcredit['getattachcredits'] = intval($forumcredit['getattachcredits'][$credit]);
$forumcredit['postattachcreditsstatus'] = $forumcredit['postattachcredits'] ? 'checked' : '';
$forumcredit['postattachcredits'] = $forumcredit['postattachcredits'] ? unserialize($forumcredit['postattachcredits']) : array();
$forumcredit['postattachcredits'] = intval($forumcredit['postattachcredits'][$credit]);
$forumcredit['digestcreditsstatus'] = $forumcredit['digestcredits'] ? 'checked' : '';
$forumcredit['digestcredits'] = $forumcredit['digestcredits'] ? unserialize($forumcredit['digestcredits']) : array();
$forumcredit['digestcredits'] = intval($forumcredit['digestcredits'][$credit]);
$forumcredits[$forumcredit['fid']] = $forumcredit;
}
$credittable = '';
foreach($_DCACHE['forums'] as $fid => $forum) {
if($forum['type'] != 'group') {
$credittable .= "<tr><td class=\"altbg1\" width=\"22%\"><input class=\"checkbox\" title=\"$lang[select_all]\" type=\"checkbox\" name=\"chkallv$fid\" onclick=\"checkallvalue(this.form, $fid, 'chkallv$fid')\">";
$credittable .= $forum['type'] == 'forum' ? '' : ' ';
$credittable .= " <a href=\"admincp.php?frames=yes&action=forumdetail&fid=$fid\" target=\"_blank\">$forum[name]</a></td>";
$credittable .= "<td class=\"altbg2\"><input class=\"checkbox\" type=\"checkbox\" name=\"postcreditsstatus[$fid]\" value=\"$fid\" {$forumcredits[$fid][postcreditsstatus]}> <input type=\"text\" name=\"postcredits[$fid]\" size=\"2\" value=\"{$forumcredits[$fid][postcredits]}\"></td>";
$credittable .= "<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"replycreditsstatus[$fid]\" value=\"$fid\" {$forumcredits[$fid][replycreditsstatus]}> <input type=\"text\" name=\"replycredits[$fid]\" size=\"2\" value=\"{$forumcredits[$fid][replycredits]}\"></td>";
$credittable .= "<td class=\"altbg2\"><input class=\"checkbox\" type=\"checkbox\" name=\"digestcreditsstatus[$fid]\" value=\"$fid\" {$forumcredits[$fid][digestcreditsstatus]}> <input type=\"text\" name=\"digestcredits[$fid]\" size=\"2\" value=\"{$forumcredits[$fid][digestcredits]}\"></td>";
$credittable .= "<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"postattachcreditsstatus[$fid]\" value=\"$fid\" {$forumcredits[$fid][postattachcreditsstatus]}> <input type=\"text\" name=\"postattachcredits[$fid]\" size=\"2\" value=\"{$forumcredits[$fid][postattachcredits]}\"></td>";
$credittable .= "<td class=\"altbg2\"><input class=\"checkbox\" type=\"checkbox\" name=\"getattachcreditsstatus[$fid]\" value=\"$fid\" {$forumcredits[$fid][getattachcreditsstatus]}> <input type=\"text\" name=\"getattachcredits[$fid]\" size=\"2\" value=\"{$forumcredits[$fid][getattachcredits]}\"></td>";
$credittable .= '</tr>';
}
}
showtype('creditwizard_forum_creditspolicy', '', '', 7);
?>
<tr class="category"><td><?=$lang['forum']?></td>
<td><input class="checkbox" type="checkbox" name="chkall1" onclick="checkall(this.form, 'postcreditsstatus', 'chkall1')"> <?=$lang['forums_edit_postcredits_add']?></td>
<td><input class="checkbox" type="checkbox" name="chkall2" onclick="checkall(this.form, 'replycreditsstatus', 'chkall2')"> <?=$lang['forums_edit_replycredits_add']?></td>
<td><input class="checkbox" type="checkbox" name="chkall3" onclick="checkall(this.form, 'digestcreditsstatus', 'chkall3')"> <?=$lang['settings_credits_policy_digest']?></td>
<td><input class="checkbox" type="checkbox" name="chkall4" onclick="checkall(this.form, 'postattachcreditsstatus', 'chkall4')"> <?=$lang['settings_credits_policy_post_attach']?></td>
<td><input class="checkbox" type="checkbox" name="chkall5" onclick="checkall(this.form, 'getattachcreditsstatus', 'chkall5')"> <?=$lang['settings_credits_policy_get_attach']?></td></tr>
<?=$credittable?>
</table>
<br /><center>
<input class="button" type="button" value="<?=$lang['creditwizard_return']?>" onclick="location.href='admincp.php?action=creditwizard&step=1'">
<input class="button" type="reset" name="settingsubmit" value="<?=$lang['reset']?>">
<input class="button" type="submit" name="settingsubmit" value="<?=$lang['submit']?>">
</center>
</form>
<?
} else {
$query = $db->query("SELECT groupid, grouptitle, raterange FROM {$tablepre}usergroups ORDER BY type DESC, groupid");
$raterangetable = '';
while($group = $db->fetch_array($query)) {
$ratemin = $ratemax = $ratemrpd = '';
foreach(explode("\n", $group['raterange']) as $range) {
$range = explode("\t", $range);
if($range[0] == $credit) {
$ratemin = $range[1];$ratemax = $range[2];$ratemrpd = $range[3];break;
}
}
$raterangetable .= "<tr><td class=\"altbg1\" width=\"22%\">
<input class=\"checkbox\" type=\"checkbox\" name=\"raterangestatus[$group[groupid]]\" value=\"1\" ".($ratemin && $ratemax && $ratemax ? 'checked' : '')."> <a href=\"admincp.php?frames=yes&action=usergroups&edit=$group[groupid]\" target=\"_blank\">$group[grouptitle]</a></td>";
$raterangetable .= "<td class=\"altbg2\"><input type=\"text\" name=\"ratemin[$group[groupid]]\" size=\"3\" value=\"$ratemin\"></td>";
$raterangetable .= "<td class=\"altbg1\"><input type=\"text\" name=\"ratemax[$group[groupid]]\" size=\"3\" value=\"$ratemax\"></td>";
$raterangetable .= "<td class=\"altbg2\"><input type=\"text\" name=\"ratemrpd[$group[groupid]]\" size=\"3\" value=\"$ratemrpd\"></td></tr>";
}
showtype('creditwizard_forum_groupraterange', '', '', 4);
?>
<tr class="category"><td><?=$lang['forum']?></td>
<td><?=$lang['usergroups_edit_raterange_min']?></td>
<td><?=$lang['usergroups_edit_raterange_max']?></td>
<td><?=$lang['usergroups_edit_raterange_mrpd']?></td>
<?=$raterangetable?>
</table>
<br /><center>
<input class="button" type="reset" name="settingsubmit" value="<?=$lang['reset']?>">
<input class="button" type="submit" name="settingsubmit" value="<?=$lang['submit']?>">
</center>
</form>
<?
}
} else {
if($type == 1) {
if($creditstrans == $credit && empty($settingsnew['available'])) {
cpmsg('settings_creditstrans_invalid');
}
$initcredits[$credit] = $settingsnew['init'];
$initcredits = implode(',', $initcredits);
$extcredits[$credit] = array(
'title' => dhtmlspecialchars(stripslashes($settingsnew['title'])),
'unit' => dhtmlspecialchars(stripslashes($settingsnew['unit'])),
'ratio' => ($settingsnew['ratio'] > 0 ? (float)$settingsnew['ratio'] : 0),
'available' => $settingsnew['available'],
'showinthread' => $settingsnew['showinthread'],
'allowexchangeout' => $settingsnew['allowexchangeout'],
'allowexchangein' => $settingsnew['allowexchangein'],
'lowerlimit' => intval($settingsnew['lowerlimit']));
$extcredits = addslashes(serialize($extcredits));
$creditspolicy['post'][$credit] = intval($settingsnew['policy_post']);
$creditspolicy['reply'][$credit] = intval($settingsnew['policy_reply']);
$creditspolicy['digest'][$credit] = intval($settingsnew['policy_digest']);
$creditspolicy['postattach'][$credit] = intval($settingsnew['policy_postattach']);
$creditspolicy['getattach'][$credit] = intval($settingsnew['policy_getattach']);
$creditspolicy['pm'][$credit] = intval($settingsnew['policy_pm']);
$creditspolicy['search'][$credit] = intval($settingsnew['policy_search']);
$creditspolicy['promotion_visit'][$credit] = intval($settingsnew['policy_promotion_visit']);
$creditspolicy['promotion_register'][$credit] = intval($settingsnew['policy_promotion_register']);
$creditspolicy['tradefinished'][$credit] = intval($settingsnew['policy_tradefinished']);
$creditspolicy['votepoll'][$credit] = intval($settingsnew['policy_votepoll']);
$creditspolicy = serialize($creditspolicy);
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('initcredits', '$initcredits')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('extcredits', '$extcredits')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('creditspolicy', '$creditspolicy')");
updatecache('settings');
cpmsg('creditwizard_edit_succeed', 'admincp.php?action=creditwizard&step=1&credit='.$credit.'&type=1');
} elseif($type == 2) {
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
$fids = implode(',', array_keys($_DCACHE['forums']));
$query = $db->query("SELECT fid, postcredits, replycredits, getattachcredits, postattachcredits, digestcredits
FROM {$tablepre}forumfields WHERE fid in ($fids)");
$sqls = array();
while($forumcredit = $db->fetch_array($query)) {
$forumcredit['postcredits'] = $forumcredit['postcredits'] ? unserialize($forumcredit['postcredits']) : array();
$forumcredit['postcredits'][$credit] = intval($postcredits[$forumcredit['fid']]);
$forumcredit['postcredits'][$credit] = $forumcredit['postcredits'][$credit] < -99 ? -99 : $forumcredit['postcredits'][$credit];
$forumcredit['postcredits'][$credit] = $forumcredit['postcredits'][$credit] > 99 ? 99 : $forumcredit['postcredits'][$credit];
$sql = "postcredits='".($postcreditsstatus[$forumcredit['fid']] ? addslashes(serialize($forumcredit['postcredits'])) : '')."'";
$forumcredit['replycredits'] = $forumcredit['replycredits'] ? unserialize($forumcredit['replycredits']) : array();
$forumcredit['replycredits'][$credit] = intval($replycredits[$forumcredit['fid']]);
$forumcredit['replycredits'][$credit] = $forumcredit['replycredits'][$credit] < -99 ? -99 : $forumcredit['replycredits'][$credit];
$forumcredit['replycredits'][$credit] = $forumcredit['replycredits'][$credit] > 99 ? 99 : $forumcredit['replycredits'][$credit];
$sql .= ",replycredits='".($replycreditsstatus[$forumcredit['fid']] ? addslashes(serialize($forumcredit['replycredits'])) : '')."'";
$forumcredit['getattachcredits'] = $forumcredit['getattachcredits'] ? unserialize($forumcredit['getattachcredits']) : array();
$forumcredit['getattachcredits'][$credit] = intval($getattachcredits[$forumcredit['fid']]);
$forumcredit['getattachcredits'][$credit] = $forumcredit['getattachcredits'][$credit] < -99 ? -99 : $forumcredit['getattachcredits'][$credit];
$forumcredit['getattachcredits'][$credit] = $forumcredit['getattachcredits'][$credit] > 99 ? 99 : $forumcredit['getattachcredits'][$credit];
$sql .= ",getattachcredits='".($getattachcreditsstatus[$forumcredit['fid']] ? addslashes(serialize($forumcredit['getattachcredits'])) : '')."'";
$forumcredit['postattachcredits'] = $forumcredit['postattachcredits'] ? unserialize($forumcredit['postattachcredits']) : array();
$forumcredit['postattachcredits'][$credit] = intval($postattachcredits[$forumcredit['fid']]);
$forumcredit['postattachcredits'][$credit] = $forumcredit['postattachcredits'][$credit] < -99 ? -99 : $forumcredit['postattachcredits'][$credit];
$forumcredit['postattachcredits'][$credit] = $forumcredit['postattachcredits'][$credit] > 99 ? 99 : $forumcredit['postattachcredits'][$credit];
$sql .= ",postattachcredits='".($postattachcreditsstatus[$forumcredit['fid']] ? addslashes(serialize($forumcredit['postattachcredits'])) : '')."'";
$forumcredit['digestcredits'] = $forumcredit['digestcredits'] ? unserialize($forumcredit['digestcredits']) : array();
$forumcredit['digestcredits'][$credit] = intval($digestcredits[$forumcredit['fid']]);
$forumcredit['digestcredits'][$credit] = $forumcredit['digestcredits'][$credit] < -99 ? -99 : $forumcredit['digestcredits'][$credit];
$forumcredit['digestcredits'][$credit] = $forumcredit['digestcredits'][$credit] > 99 ? 99 : $forumcredit['digestcredits'][$credit];
$sql .= ",digestcredits='".($digestcreditsstatus[$forumcredit['fid']] ? addslashes(serialize($forumcredit['digestcredits'])) : '')."'";
$db->query("UPDATE {$tablepre}forumfields SET $sql WHERE fid=$forumcredit[fid]", 'UNBUFFERED');
}
cpmsg('creditwizard_edit_succeed', 'admincp.php?action=creditwizard&step=1&credit='.$credit.'&type=2');
} else {
$query = $db->query("SELECT groupid, grouptitle, raterange FROM {$tablepre}usergroups");
$raterangetable = '';
while($group = $db->fetch_array($query)) {
$raterangenew = '';
$rangearray = array();
foreach(explode("\n", $group['raterange']) as $range) {
$ranges = explode("\t", $range);
$rangearray[$ranges[0]] = $range;
}
$range = array();
if($raterangestatus[$group['groupid']]) {
$range[0] = $credit;
$range[1] = intval($ratemin[$group['groupid']] < -999 ? -999 : $ratemin[$group['groupid']]);
$range[2] = intval($ratemax[$group['groupid']] > 999 ? 999 : $ratemax[$group['groupid']]);
$range[3] = intval($ratemrpd[$group['groupid']] > 99999 ? 99999 : $ratemrpd[$group['groupid']]);
if(!$range[3] || $range[2] <= $range[1] || $range[3]< max(abs($range[1]), abs($range[2]))) {
cpmsg('creditwizard_edit_rate_invalid');
}
$rangearray[$credit] = implode("\t", $range);
} else {
unset($rangearray[$credit]);
}
$raterangenew = $rangearray ? implode("\n", $rangearray) : '';
$db->query("UPDATE {$tablepre}usergroups SET raterange='$raterangenew' WHERE groupid=$group[groupid]", 'UNBUFFERED');
}
updatecache('usergroups');
updatecache('admingroups');
cpmsg('creditwizard_edit_succeed', 'admincp.php?action=creditwizard&step=1&credit='.$credit.'&type=3');
}
}
}
} elseif($step == 2) {
if(!submitcheck('settingsubmit')) {
$formulareplace .= '\'<u>'.$lang['settings_creditsformula_digestposts'].'</u>\',\'<u>'.$lang['settings_creditsformula_posts'].'</u>\',\'<u>'.$lang['settings_creditsformula_oltime'].'</u>\',\'<u>'.$lang['settings_creditsformula_pageviews'].'</u>\'';
?>
<script>
function isUndefined(variable) {
return typeof variable == 'undefined' ? true : false;
}
function insertunit(text, textend) {
$('creditsformulanew').focus();
textend = isUndefined(textend) ? '' : textend;
if(!isUndefined($('creditsformulanew').selectionStart)) {
var opn = $('creditsformulanew').selectionStart + 0;
if(textend != '') {
text = text + $('creditsformulanew').value.substring($('creditsformulanew').selectionStart, $('creditsformulanew').selectionEnd) + textend;
}
$('creditsformulanew').value = $('creditsformulanew').value.substr(0, $('creditsformulanew').selectionStart) + text + $('creditsformulanew').value.substr($('creditsformulanew').selectionEnd);
} else if(document.selection && document.selection.createRange) {
var sel = document.selection.createRange();
if(textend != '') {
text = text + sel.text + textend;
}
sel.text = text.replace(/\r?\n/g, '\r\n');
sel.moveStart('character', -strlen(text));
} else {
$('creditsformulanew').value += text;
}
formulaexp();
}
var formulafind = new Array('digestposts', 'posts', 'oltime', 'pageviews');
var formulareplace = new Array(<?=$formulareplace?>);
function formulaexp() {
var result = $('creditsformulanew').value;
<?
$extcreditsbtn = '';
for($i = 1; $i <= 8; $i++) {
$extcredittitle = $extcredits[$i]['available'] ? $extcredits[$i]['title'] : $lang['settings_creditsformula_extcredits'].$i;
echo 'result = result.replace(/extcredits'.$i.'/g, \'<u>'.$extcredittitle.'</u>\');';
$extcreditsbtn .= '<a href="###" onclick="insertunit(\'extcredits'.$i.'\')">'.$extcredittitle.'</a> ';
}
echo 'result = result.replace(/digestposts/g, \'<u>'.$lang['settings_creditsformula_digestposts'].'</u>\');';
echo 'result = result.replace(/posts/g, \'<u>'.$lang['settings_creditsformula_posts'].'</u>\');';
echo 'result = result.replace(/oltime/g, \'<u>'.$lang['settings_creditsformula_oltime'].'</u>\');';
echo 'result = result.replace(/pageviews/g, \'<u>'.$lang['settings_creditsformula_pageviews'].'</u>\');';
?>
$('creditsformulaexp').innerHTML = '<u><?=$lang['settings_creditsformula_credits']?></u>=' + result;
}
</script>
<form method="post" action="admincp.php?action=creditwizard&step=2">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
showtype('creditwizard_step_menu_2', 'top');
?>
<tr><td colspan="2" class="altbg1">
<b><?=$lang['settings_creditsformula']?></b><br /><span class="smalltxt"><?=$lang['creditwizard_current_formula_comment']?></span>
<br />
<img src="images/admincp/zoomin.gif" onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('creditsformulanew', 1)"> <img src="images/admincp/zoomout.gif" onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('creditsformulanew', 0)">
<div style="width:90%" class="formulaeditor">
<div><?=$extcreditsbtn?><br />
<a href="###" onclick="insertunit('digestposts')"><?=$lang['settings_creditsformula_digestposts']?></a>
<a href="###" onclick="insertunit('posts')"><?=$lang['settings_creditsformula_posts']?></a>
<a href="###" onclick="insertunit('oltime')"><?=$lang['settings_creditsformula_oltime']?></a>
<a href="###" onclick="insertunit('pageviews')"><?=$lang['settings_creditsformula_pageviews']?></a>
<a href="###" onclick="insertunit('+')"> + </a>
<a href="###" onclick="insertunit('-')"> - </a>
<a href="###" onclick="insertunit('*')"> * </a>
<a href="###" onclick="insertunit('/')"> / </a>
<a href="###" onclick="insertunit('(', ')')"> ( ) </a><br />
<span id="creditsformulaexp"><?=$creditsformulaexp?></span>
</div>
<textarea name="creditsformulanew" id="creditsformulanew" style="width:100%" rows="3" onkeyup="formulaexp()"><?=dhtmlspecialchars($creditsformula)?></textarea>
</div>
<br /><?=$lang['creditwizard_current_formula_notice']?>
</td></tr>
<?
showtype('', 'bottom');
?>
<br /><center>
<input class="button" type="submit" name="settingsubmit" value="<?=$lang['submit']?>">
</center>
</form>
<?
} else {
if(!preg_match("/^([\+\-\*\/\.\d\(\)]|((extcredits[1-8]|digestposts|posts|pageviews|oltime)([\+\-\*\/\(\)]|$)+))+$/", $creditsformulanew) || !is_null(@eval(preg_replace("/(digestposts|posts|pageviews|oltime|extcredits[1-8])/", "\$\\1", $creditsformulanew).';'))) {
cpmsg('settings_creditsformula_invalid');
}
$creditsformulaexpnew = $creditsformulanew;
foreach(array('digestposts', 'posts', 'oltime', 'pageviews', 'extcredits1', 'extcredits2', 'extcredits3', 'extcredits4', 'extcredits5', 'extcredits6', 'extcredits7', 'extcredits8') as $var) {
if($extcredits[$creditsid = preg_replace("/^extcredits(\d{1})$/", "\\1", $var)]['available']) {
$replacement = $extcredits[$creditsid]['title'];
} else {
$replacement = $lang['settings_creditsformula_'.$var];
}
$creditsformulaexpnew = str_replace($var, '<u>'.$replacement.'</u>', $creditsformulaexpnew);
}
$creditsformulaexpnew = addslashes('<u>'.$lang['settings_creditsformula_credits'].'</u>='.$creditsformulaexpnew);
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('creditsformula', '".addslashes($creditsformulanew)."')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('creditsformulaexp', '".addslashes($creditsformulaexpnew)."')");
updatecache('settings');
cpmsg('creditwizard_edit_succeed', 'admincp.php?action=creditwizard&step=2');
}
} else {
if(!submitcheck('settingsubmit')) {
?>
<form method="post" action="admincp.php?action=creditwizard&step=3">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
$creditstransselect = '';
for($i = 0; $i <= 8; $i++) {
if($i == 0 || $extcredits[$i]['available']) {
$creditstransselect .= '<option value="'.$i.'" '.($i == intval($creditstrans) ? 'selected' : '').'>'.($i ? 'extcredits'.$i.' ('.$extcredits[$i]['title'].')' : $lang['none']).'</option>';
}
}
showtype('creditwizard_step_menu_3', 'top');
?>
<tr class="category"><td colspan="2">
<b><?=$lang['creditwizard_creditstrans']?></b><br /><?=$lang['creditwizard_creditstrans_comment']?>
</td><tr>
<tr><td class="altbg1" width="45%"><b><?=$lang['settings_creditstrans']?></b></td><td class="altbg2"><select onchange="$('allowcreditstrans').style.display = this.value != 0 ? '' : 'none'" name="creditstransnew"><?=$creditstransselect?></select></tr>
<tr><td class="altbg1" width="45%"><b><?=$lang['settings_creditstax']?></b><br /><?=$lang['settings_creditstax_comment']?></td><td class="altbg2"><input name="creditstaxnew" id="creditstaxnew" type="text" size="8" value="<?=$creditstax?>">
<br /><input name="creditstaxradio" class="radio" type="radio" value="0.01" onclick="$('creditstaxnew').value = this.value"<? echo $creditstax == 0.01 ? ' checked' : ''; ?>> <?=$lang['low']?> (0.01)
<br /><input name="creditstaxradio" class="radio" type="radio" value="0.1" onclick="$('creditstaxnew').value = this.value"<? echo $creditstax == 0.1 ? ' checked' : ''; ?>> <?=$lang['middle']?> (0.1)
<br /><input name="creditstaxradio" class="radio" type="radio" value="0.5" onclick="$('creditstaxnew').value = this.value"<? echo $creditstax == 0.5 ? ' checked' : ''; ?>> <?=$lang['high']?> (0.5)
</td></tr>
<tr class="category"><td colspan="2">
<b><?=$lang['creditwizard_exchange']?></b><br /><?=$lang['creditwizard_exchange_comment']?>
</td><tr>
<tr><td class="altbg1" width="45%"><b><?=$lang['settings_exchangemincredits']?></b></td><td class="altbg2"><input name="exchangemincreditsnew" id="exchangemincreditsnew" type="text" size="8" value="<?=$exchangemincredits?>">
<br /><input name="exchangemincreditsradio" class="radio" type="radio" value="100" onclick="$('exchangemincreditsnew').value = this.value"<? echo $exchangemincredits == 100 ? ' checked' : ''; ?>> <?=$lang['low']?> (100)
<br /><input name="exchangemincreditsradio" class="radio" type="radio" value="1000" onclick="$('exchangemincreditsnew').value = this.value"<? echo $exchangemincredits == 1000 ? ' checked' : ''; ?>> <?=$lang['middle']?> (1000)
<br /><input name="exchangemincreditsradio" class="radio" type="radio" value="5000" onclick="$('exchangemincreditsnew').value = this.value"<? echo $exchangemincredits == 5000 ? ' checked' : ''; ?>> <?=$lang['high']?> (5000)
</td></tr>
</table>
<div id="allowcreditstrans"<? echo !$creditstrans ? ' style="display:none"' : ''; ?>><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2">
<b><?=$lang['creditwizard_allowcreditstrans']?></b>
</td></tr>
<tr class="category"><td colspan="2">
<b><?=$lang['creditwizard_transfer']?></b><br /><?=$lang['creditwizard_transfer_comment']?>
</td><tr>
<tr><td class="altbg1" width="45%"><b><?=$lang['settings_transfermincredits']?></b></td><td class="altbg2"><input name="transfermincreditsnew" id="transfermincreditsnew" type="text" size="8" value="<?=$transfermincredits?>">
<br /><input name="transfermincreditsradio" class="radio" type="radio" value="100" onclick="$('transfermincreditsnew').value = this.value"<? echo $transfermincredits == 100 ? ' checked' : ''; ?>> <?=$lang['low']?> (100)
<br /><input name="transfermincreditsradio" class="radio" type="radio" value="1000" onclick="$('transfermincreditsnew').value = this.value"<? echo $transfermincredits == 1000 ? ' checked' : ''; ?>> <?=$lang['middle']?> (1000)
<br /><input name="transfermincreditsradio" class="radio" type="radio" value="5000" onclick="$('transfermincreditsnew').value = this.value"<? echo $transfermincredits == 5000 ? ' checked' : ''; ?>> <?=$lang['high']?> (5000)
</td></tr>
<tr class="category"><td colspan="2">
<b><?=$lang['creditwizard_sell']?></b><br /><?=$lang['creditwizard_sell_comment']?>
</td><tr>
<tr><td class="altbg1" width="45%"><b><?=$lang['settings_maxincperthread']?></b></td><td class="altbg2"><input name="maxincperthreadnew" id="maxincperthreadnew" type="text" size="8" value="<?=$maxincperthread?>">
<br /><input name="maxincperthreadradio" class="radio" type="radio" value="0" onclick="$('maxincperthreadnew').value = this.value"<? echo $maxincperthread == 0 ? ' checked' : ''; ?>> <?=$lang['nolimit']?> (0)
<br /><input name="maxincperthreadradio" class="radio" type="radio" value="10" onclick="$('maxincperthreadnew').value = this.value"<? echo $maxincperthread == 10 ? ' checked' : ''; ?>> <?=$lang['low']?> (10)
<br /><input name="maxincperthreadradio" class="radio" type="radio" value="50" onclick="$('maxincperthreadnew').value = this.value"<? echo $maxincperthread == 50 ? ' checked' : ''; ?>> <?=$lang['middle']?> (50)
<br /><input name="maxincperthreadradio" class="radio" type="radio" value="100" onclick="$('maxincperthreadnew').value = this.value"<? echo $maxincperthread == 100 ? ' checked' : ''; ?>> <?=$lang['high']?> (100)
</td></tr><tr><td class="altbg1" width="45%"><b><?=$lang['settings_maxchargespan']?></b></td><td class="altbg2"><input name="maxchargespannew" id="maxchargespannew" type="text" size="8" value="<?=$maxchargespan?>">
<br /><input name="maxchargespanradio" class="radio" type="radio" value="0" onclick="$('maxchargespannew').value = this.value"<? echo $maxchargespan == 0 ? ' checked' : ''; ?>> <?=$lang['nolimit']?> (0)
<br /><input name="maxchargespanradio" class="radio" type="radio" value="5" onclick="$('maxchargespannew').value = this.value"<? echo $maxchargespan == 5 ? ' checked' : ''; ?>> <?=$lang['low']?> (5)
<br /><input name="maxchargespanradio" class="radio" type="radio" value="24" onclick="$('maxchargespannew').value = this.value"<? echo $maxchargespan == 24 ? ' checked' : ''; ?>> <?=$lang['middle']?> (24)
<br /><input name="maxchargespanradio" class="radio" type="radio" value="48" onclick="$('maxchargespannew').value = this.value"<? echo $maxchargespan == 48 ? ' checked' : ''; ?>> <?=$lang['high']?> (48)
</td></tr>
<tr class="category"><td colspan="2">
<b><?=$lang['creditwizard_reward']?></b><br /><?=$lang['creditwizard_reward_comment']?>
</td></tr>
<tr class="category"><td colspan="2">
<b><?=$lang['creditwizard_ratio']?></b><br /><?=$lang['creditwizard_ratio_comment']?>
</td></tr>
<tr class="category"><td colspan="2">
<b><?=$lang['creditwizard_trade']?></b><br /><?=$lang['creditwizard_trade_comment']?>
</td></tr>
<?
showtype('', 'bottom');
?>
</div>
<br /><center>
<input class="button" type="submit" name="settingsubmit" value="<?=$lang['submit']?>">
</center>
</form>
<?
} else {
if($creditstaxnew < 0 || $creditstaxnew >= 1) {
$creditstaxnew = 0;
}
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('creditstrans', '".((float)$creditstransnew)."')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('creditstax', '".((float)$creditstaxnew)."')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('transfermincredits', '".((float)$transfermincreditsnew)."')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('exchangemincredits', '".((float)$exchangemincreditsnew)."')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('maxincperthread', '".((float)$maxincperthreadnew)."')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('maxchargespan', '".((float)$maxchargespannew)."')");
updatecache('settings');
cpmsg('creditwizard_edit_succeed', 'admincp.php?action=creditwizard&step=3');
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/creditwizard.inc.php | PHP | asf20 | 36,762 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: qihoo.inc.php 10468 2007-09-03 02:21:46Z liuqiang $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='qihoo'");
$qihoo = ($qihoo = $db->result($query, 0)) ? unserialize($qihoo) : array();
if($action == 'qihoo_config') {
if(!submitcheck('qihoosubmit')) {
$checks = array();
$checkstatus = array($qihoo['status'] => 'checked');
$checklocation = array($qihoo['location'] => 'checked');
$checkrelatedsort = array($qihoo['relatedsort'] => 'checked');
$qihoo['searchbox'] = sprintf('%03b', $qihoo['searchbox']);
for($i = 1; $i <= 3; $i++) {
$checks[$i] = $qihoo['searchbox'][3 - $i] ? 'checked' : '';
}
shownav('qihoo_settings_basic');
showtips('qihoo_tips');
?>
<form method="post" name="settings" action="admincp.php?action=qihoo_config">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
showtype('qihoo','top');
showsetting('qihoo_status', '', '', '<input class="radio" type="radio" name="qihoonew[status]" value="1" '.$checkstatus[1].'> '.$lang['qihoo_status_enable'].'<br /><input class="radio" type="radio" name="qihoonew[status]" value="2" '.$checkstatus[2].'> '.$lang['qihoo_status_enable_default'].'<br /><input class="radio" type="radio" name="qihoonew[status]" value="0" '.$checkstatus[0].'> '.$lang['qihoo_status_disable']);
showsetting('qihoo_searchbox', '', '', '<input class="checkbox" type="checkbox" name="qihoonew[searchbox][1]" value="1" '.$checks[1].'> '.$lang['qihoo_searchbox_index'].'<br /><input class="checkbox" type="checkbox" name="qihoonew[searchbox][2]" value="1" '.$checks[2].'> '.$lang['qihoo_searchbox_forumdisplay'].'<br /><input class="checkbox" type="checkbox" name="qihoonew[searchbox][3]" value="1" '.$checks[3].'> '.$lang['qihoo_searchbox_viewthread']);
showsetting('qihoo_summary', 'qihoonew[summary]', $qihoo['summary'], 'radio');
showsetting('qihoo_jammer_allow', 'qihoonew[jammer]', $qihoo['jammer'], 'radio');
showsetting('qihoo_maxtopics', 'qihoonew[maxtopics]', $qihoo['maxtopics'], 'text');
showsetting('qihoo_keywords', 'qihoonew[keywords]', $qihoo['keywords'], 'textarea');
showsetting('qihoo_adminemail', 'qihoonew[adminemail]', $qihoo['adminemail'], 'text');
showtype('', 'bottom');
echo '<br /><center><input class="button" type="submit" name="qihoosubmit" value="'.$lang['submit'].'"></form>';
} else {
$qihoonew['searchbox'] = bindec(intval($qihoonew['searchbox'][3]).intval($qihoonew['searchbox'][2]).intval($qihoonew['searchbox'][1]));
$qihoonew['validity'] = $qihoonew['validity'] < 1 ? 1 : intval($qihoonew['validity']);
if($qihoonew['status'] && $qihoonew['adminemail']) {
if(!isemail($qihoonew['adminemail'])) {
cpmsg('qihoo_adminemail_invalid');
}
if($qihoonew['adminemail'] != $qihoo['adminemail']) {
dfopen('http://search.qihoo.com/corp/discuz.html?site='.site().'&key='.md5(site().'qihoo_discuz'.gmdate("Ymd", $timestamp)).'&email='.$qihoonew['adminemail']);
}
}
foreach((array)$qihoonew AS $key => $value) {
$qihoo[$key] = in_array($key, array('keywords', 'adminemail')) ? $value : intval($value);
}
$db->query("UPDATE {$tablepre}settings SET value='".addslashes(serialize($qihoo))."' WHERE variable='qihoo'");
updatecache('settings');
cpmsg('qihoo_succeed', 'admincp.php?action=qihoo_config');
}
} elseif($action == 'qihoo_relatedthreads') {
if(!submitcheck('qihoosubmit')) {
$checktype = array();
$settings = is_array($qihoo['relatedthreads']) ? $qihoo['relatedthreads'] : array();
$checkposition = array($settings['position'] => 'checked');
$checkrelatedsort = array($settings['order'] => 'checked');
foreach((array)$settings['type'] AS $type) {
$checktype[$type] = 'checked';
}
shownav('qihoo_settings_basic');
showtips('qihoo_tips');
?>
<form method="post" name="settings" action="admincp.php?action=qihoo_relatedthreads">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
showtype('qihoo_relatedthreads','top');
showsetting('qihoo_relatedthreads', 'settingsnew[bbsnum]', $settings['bbsnum'], 'text');
showsetting('qihoo_relatedthreads_web', 'settingsnew[webnum]', $settings['webnum'], 'radio');
showsetting('qihoo_relatedthreads_type', '', '', '<input class="checkbox" type="checkbox" name="settingsnew[type][blog]" value="blog" '.$checktype['blog'].'> '.$lang['qihoo_relatedthreads_type_blog'].'<br /><input class="checkbox" type="checkbox" name="settingsnew[type][news]" value="news" '.$checktype['news'].'> '.$lang['qihoo_relatedthreads_type_news'].'<br /><input class="checkbox" type="checkbox" name="settingsnew[type][bbs]" value="bbs" '.$checktype['bbs'].'> '.$lang['qihoo_relatedthreads_type_bbs']);
showsetting('qihoo_relatedthreads_banurl', 'settingsnew[banurl]', $settings['banurl'], 'textarea');
showsetting('qihoo_relatedthreads_position', '', '', '<input class="radio" type="radio" name="settingsnew[position]" value="0" '.$checkposition[0].'> '.$lang['qihoo_relatedthreads_position_mode_top'].'<br /><input class="radio" type="radio" name="settingsnew[position]" value="1" '.$checkposition[1].'> '.$lang['qihoo_relatedthreads_position_mode_under']);
//showsetting('qihoo_relatedthreads_validity', 'settingsnew[validity]', $settings['validity'], 'text');
showtype('', 'bottom');
echo '<br /><center><input class="button" type="submit" name="qihoosubmit" value="'.$lang['submit'].'"></form>';
} else {
$qihoo['relatedthreads'] = array();
foreach((array)$settingsnew AS $key => $value) {
$qihoo['relatedthreads'][$key] = in_array($key, array('bbsnum', 'webnum', 'position', 'order', 'validity')) ? intval($value) : $value;
}
$db->query("UPDATE {$tablepre}settings SET value='".addslashes(serialize($qihoo))."' WHERE variable='qihoo'");
updatecache('settings');
cpmsg('qihoo_succeed', 'admincp.php?action=qihoo_relatedthreads');
}
} elseif($action == 'qihoo_topics') {
if(!submitcheck('topicsubmit')) {
$topics = '';
foreach((is_array($qihoo['topics']) ? $qihoo['topics'] : array()) AS $key => $value) {
$checkstype = array($value['stype'] => 'selected="selected"');
$checkrelate = array($value['relate'] => 'selected="selected"');
$topics .= "<tr align=\"center\">\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[$key]\" value=\"".$value['topic']."\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"20\" name=\"qihoo_topics[$key][topic]\" id=\"qihoo_topics[$key][topic]\" value=\"$value[topic]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"30\" name=\"qihoo_topics[$key][keyword]\" id=\"qihoo_topics[$key][keyword]\" value=\"$value[keyword]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"10\" name=\"qihoo_topics[$key][length]\" id=\"qihoo_topics[$key][length]\" value=\"$value[length]\"></td>\n".
"<td class=\"altbg1\"><select name=\"qihoo_topics[$key][stype]\" id=\"qihoo_topics[$key][stype]\"><option value=\"0\" $checkstype[0]>$lang[qihoo_topics_type_fulltext]</option><option value=\"title\" $checkstype[title]>$lang[qihoo_topics_type_title]</option></select></td>\n".
"<td class=\"altbg2\"><select name=\"qihoo_topics[$key][relate]\" id=\"qihoo_topics[$key][relate]\"><option value=\"score\" $checkrelate[score]>$lang[qihoo_topics_orderby_relation]</option><option value=\"pdate\" $checkrelate[pdate]>$lang[qihoo_topics_orderby_dateline]</option><option value=\"rdate\" $checkrelate[rdate]>$lang[qihoo_topics_orderby_lastpost]</option></select></td>\n".
"<td class=\"altbg1\"><a href=\"###\" onClick=\"window.open('topic.php?topic='+$('qihoo_topics[$key][topic]').value+'&keyword='+$('qihoo_topics[$key][keyword]').value+'&stype='+$('qihoo_topics[$key][stype]').value+'&length='+$('qihoo_topics[$key][length]').value+'&relate='+$('qihoo_topics[$key][relate]').value+'');\">[$lang[preview]]</a></tr>\n";
}
shownav('qihoo_settings_special');
showtips('qihoo_topics_tips');
?>
<form method="post" action="admincp.php?action=qihoo_topics">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td><input class="checkbox" type="checkbox" name="chkall" class="header" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['qihoo_topics_name']?></td><td><?=$lang['qihoo_topics_keywords']?></td><td><?=$lang['qihoo_topics_length']?></td><td><?=$lang['qihoo_topics_type']?></td><td><?=$lang['qihoo_topics_orderby']?></td><td><?=$lang['preview']?></td></tr>
<?=$topics?>
<tr class="altbg1" align="center">
<td><?=$lang['add_new']?></td>
<td><input type="text" size="20" name="newtopic" id="newtopic"></td>
<td><input type="text" size="30" name="newkeyword" id="newkeyword"></td>
<td><input type="text" size="10" name="newlength" id="newlength" value="0"></td>
<td><select name="newstype" id="newstype"><option value="0" selected><?=$lang['qihoo_topics_type_fulltext']?></option><option value="1"><?=$lang['qihoo_topics_type_title']?></option></select></td>
<td><select name="newrelate" id="newrelate"><option value="score"><?=$lang['qihoo_topics_orderby_relation']?></option><option value="pdate"><?=$lang['qihoo_topics_orderby_dateline']?></option><option value="rdate"><?=$lang['qihoo_topics_orderby_lastpost']?></option></select></td>
<td><a href="###" onClick="window.open('topic.php?topic='+$('newtopic').value+'&keyword='+$('newkeyword').value+'&stype='+$('newstype').value+'&length='+$('newlength').value+'&relate='+$('newrelate').value+'');">[<?=$lang['preview']?>]</a></td>
</tr></table><br />
<center><input class="button" type="submit" name="topicsubmit" value="<?=$lang['submit']?>"></center></form></td></tr>
<?
} else {
$qihoo['topics'] = array();
foreach((array)$qihoo_topics AS $key => $value) {
if(isset($delete[$key])) {
unset($qihoo['topics'][$key]);
} else {
$qihoo['topics'][$key] = array(
'topic' => dhtmlspecialchars(stripslashes($value['topic'])),
'keyword' => $value['keyword'] = trim($value['keyword']) ? dhtmlspecialchars(stripslashes($value['keyword'])) : $value['topic'],
'length' => intval($value['length']),
'stype' => $value['stype'],
'relate' => $value['relate']
);
}
}
if($newtopic) {
$qihoo['topics'][] = array(
'topic' => dhtmlspecialchars(stripslashes($newtopic)),
'keyword' => $newkeyword = trim($newkeyword) ? dhtmlspecialchars(stripslashes($newkeyword)) : $newtopic,
'length' => intval($newlength),
'stype' => $newstype > 1 ? 1 : intval($newstype),
'relate' => $newrelate
);
}
$db->query("UPDATE {$tablepre}settings SET value='".addslashes(serialize($qihoo))."' WHERE variable='qihoo'");
updatecache('settings');
cpmsg('qihoo_topics_succeed', 'admincp.php?action=qihoo_topics');
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/qihoo.inc.php | PHP | asf20 | 11,175 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: database.inc.php 10115 2007-08-24 00:58:08Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
$tabletype = $db->version() > '4.1' ? 'Engine' : 'Type';;
require_once DISCUZ_ROOT.'./include/attachment.func.php';
cpheader();
if(!isfounder()) cpmsg('noaccess_isfounder');
$excepttables = array_merge(array($tablepre.'adminsessions', $tablepre.'failedlogins', $tablepre.'pmsearchindex', $tablepre.'relatedthreads', $tablepre.'rsscaches', $tablepre.'searchindex', $tablepre.'spacecaches', $tablepre.'sessions'),
($supe['status'] ? array($supe['tablepre'].'cache', $supe['tablepre'].'corpus', $supe['tablepre'].'rss', $supe['tablepre'].'spacecache', $supe['tablepre'].'tagcache') : array()));
if(!$backupdir = $db->result($db->query("SELECT value FROM {$tablepre}settings WHERE variable='backupdir'"), 0)) {
$backupdir = random(6);
@mkdir('./forumdata/backup_'.$backupdir, 0777);
$db->query("REPLACE INTO {$tablepre}settings (variable, value) values ('backupdir', '$backupdir')");
}
$backupdir = 'backup_'.$backupdir;
if(!is_dir('./forumdata/'.$backupdir)) {
mkdir('./forumdata/'.$backupdir, 0777);
}
if($action == 'export') {
if(!submitcheck('exportsubmit', 1)) {
$shelldisabled = function_exists('shell_exec') ? '' : 'disabled';
$sqlcharsets = "<input class=\"radio\" type=\"radio\" name=\"sqlcharset\" value=\"\" checked> $lang[default]".
($dbcharset ? " <input class=\"radio\" type=\"radio\" name=\"sqlcharset\" value=\"$dbcharset\"> ".strtoupper($dbcharset) : '').
($db->version() > '4.1' && $dbcharset != 'utf8' ? " <input class=\"radio\" type=\"radio\" name=\"sqlcharset\" value='utf8'> UTF-8</option>" : '');
$tables = $tablelist = '';
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='custombackup'");
if($tables = $db->fetch_array($query)) {
$tables = unserialize($tables['value']);
$tables = is_array($tables) ? $tables : '';
}
$discuz_tables = fetchtablelist($tablepre);
$query = $db->query("SELECT datatables FROM {$tablepre}plugins WHERE datatables<>''");
while($plugin = $db->fetch_array($query)) {
foreach(explode(',', $plugin['datatables']) as $table) {
if($table = trim($table)) {
$discuz_tables[] = array('Name' => $table);
}
}
}
$rowcount = 0;
foreach($discuz_tables as $table) {
$tablelist .= ($rowcount % 4 ? '' : '</tr><tr>')."<td><input class=\"checkbox\" type=\"checkbox\" name=\"customtables[]\" value=\"$table[Name]\" checked> $table[Name]</td>\n";
$rowcount++;
}
$tablelist .= '</tr>';
if(!empty($supe['tablepre'])) {
$supe_tables = fetchtablelist($supe['tablepre']);
$rowcount =0;
$tablelist .='<tr><td colspan="4"><b>'.$lang['database_export_supe_table'].'</b> <input type="checkbox" name="chkall2" onclick="checkall(this.form, \'supetables\', \'chkall2\')" class="checkbox" checked> <b>'.$lang['database_export_custom_select_all'].'</td></tr>';
foreach($supe_tables as $table) {
$tablelist .= ($rowcount % 4 ? '' : '</tr><tr>')."<td><input class=\"checkbox\" type=\"checkbox\" name=\"supetables[]\" value=\"$table[Name]\" checked> $table[Name]</td>\n";
$rowcount++;
}
} else {
$supe_tables = array();
}
shownav('menu_database_export');
showtips('database_export_tips');
?>
<form name="backup" method="post" action="admincp.php?action=export">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="setup" value="1">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['database_export_type']?></td></tr>
<tr>
<td class="altbg1" width="40%"><input class="radio" type="radio" value="discuz" name="type" onclick="$('showtables').style.display='none'" checked> <?=$lang['database_export_discuz']?></td>
<td class="altbg2" width="45%"><?=$lang['database_export_discuz_comment']?></td></tr>
<?php if($supe['status']) {?>
<tr>
<td class="altbg1"><input class="radio" type="radio" value="discuzsupesite" name="type" onclick="$('showtables').style.display='none'"> <?=$lang['database_export_discuzsupesite']?></td>
<td class="altbg2"></td></tr>
<?php }?>
<tr>
<td class="altbg1"><input class="radio" type="radio" value="custom" name="type" onclick="$('showtables').style.display=''"> <?=$lang['database_export_custom']?></td>
<td class="altbg2"><?=$lang['database_export_custom_comment']?></td></tr>
<tbody id="showtables" style="display:none">
<tr>
<td class="altbg2" colspan="2">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr><td colspan="4"><b><?=$lang['database_export_discuz_table']?></b> <input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form, 'customtables')" checked> <b><?=$lang['database_export_custom_select_all']?></b>
</td>
<?=$tablelist?>
</table>
</td>
</tr>
</tbody>
<tr><td class="altbg1"> </td>
<td align="right" class="altbg2" style="text-align: right;"><input class="checkbox" type="checkbox" value="1" onclick="$('advanceoption').style.display = $('advanceoption').style.display == 'none' ? '' : 'none'; this.value = this.value == 1 ? 0 : 1; this.checked = this.value == 1 ? false : true"><?=$lang['more_options']?> </td></tr>
<tbody id="advanceoption" style="display: none;">
<tr class="header"><td colspan="2"><?=$lang['database_export_method']?></td></tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="method" value="shell" <?=$shelldisabled?> onclick="if(<?=intval($db->version() < '4.1')?>) {if(this.form.sqlcompat[2].checked==true) this.form.sqlcompat[0].checked=true; this.form.sqlcompat[2].disabled=true; this.form.sizelimit.disabled=true;} else {this.form.sqlcharset[0].checked=true; for(var i=1; i<=5; i++) {if(this.form.sqlcharset[i]) this.form.sqlcharset[i].disabled=true;}}"> <?=$lang['database_export_shell']?></td>
<td class="altbg2"> </td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="method" value="multivol" checked onclick="this.form.sqlcompat[2].disabled=false; this.form.sizelimit.disabled=false; for(var i=1; i<=5; i++) {if(this.form.sqlcharset[i]) this.form.sqlcharset[i].disabled=false;}"> <?=$lang['database_export_multivol']?></td>
<td class="altbg2"><input type="text" size="40" name="sizelimit" value="2048"></td>
</tr>
<tr class="header"><td colspan="2"><?=$lang['database_export_options']?></td></tr>
<tr>
<td class="altbg1"> <?=$lang['database_export_options_extended_insert']?></td>
<td class="altbg2"><input class="radio" type="radio" name="extendins" value="1"> <?=$lang['yes']?> <input class="radio" type="radio" name="extendins" value="0" checked> <?=$lang['no']?></td>
</tr>
<tr>
<td class="altbg1"> <?=$lang['database_export_options_sql_compatible']?></td>
<td class="altbg2"><input class="radio" type="radio" name="sqlcompat" value="" checked> <?=$lang['default']?> <input class="radio" type="radio" name="sqlcompat" value="MYSQL40"> MySQL 3.23/4.0.x <input class="radio" type="radio" name="sqlcompat" value="MYSQL41"> MySQL 4.1.x/5.x
</td>
</tr>
<tr>
<td class="altbg1"> <?=$lang['database_export_options_charset']?></td>
<td class="altbg2"><?=$sqlcharsets?>
</td>
</tr>
<tr>
<td class="altbg1"> <?=$lang['database_export_usehex']?></td>
<td class="altbg2"><input class="radio" type="radio" name="usehex" value="1" checked> <?=$lang['yes']?> <input class="radio" type="radio" name="usehex" value="0"> <?=$lang['no']?></td>
</td>
</tr>
<?
if(function_exists('gzcompress')) {
?>
<tr>
<td class="altbg1"> <?=$lang['database_export_usezip']?></td>
<td class="altbg2"><input class="radio" type="radio" name="usezip" value="1"> <?=$lang['database_export_zip_1']?> <input class="radio" type="radio" name="usezip" value="2"> <?=$lang['database_export_zip_2']?> <input class="radio" type="radio" name="usezip" value="0" checked> <?=$lang['database_export_zip_3']?></td>
</td>
</tr>
<?
}
?>
<tr>
<td class="altbg1"> <?=$lang['database_export_filename']?></td>
<td class="altbg2"><input type="text" size="40" name="filename" value="<?=date('ymd').'_'.random(8)?>"> .sql</td>
</tr>
</tbody>
</table><br /><center>
<input class="button" type="submit" name="exportsubmit" value="<?=$lang['submit']?>"></center></form>
<?
} else {
$db->query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT');
if(!$filename || preg_match("/(\.)(exe|jsp|asp|aspx|cgi|fcgi|pl)(\.|$)/i", $filename)) {
cpmsg('database_export_filename_invalid');
}
$time = gmdate("$dateformat $timeformat", $timestamp + $timeoffset * 3600);
if($type == 'discuz') {
$tables = arraykeys2(fetchtablelist($tablepre), 'Name');
} elseif($type == 'discuzsupesite') {
$tables = arraykeys2(array_merge(fetchtablelist($tablepre), ($supe['tablepre'] ? fetchtablelist($supe['tablepre']) : array())), 'Name');
} elseif($type == 'custom') {
$tables = array();
if(empty($setup)) {
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='custombackup'");
if($tables = $db->fetch_array($query)) {
$tables = unserialize($tables['value']);
}
} else {
$customtables= array_merge(empty($customtables) ? array() : $customtables, empty($supetables) ? array() : $supetables);
$customtablesnew = empty($customtables)? '' : addslashes(serialize($customtables));
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('custombackup', '$customtablesnew')");
$tables = & $customtables;
}
if( !is_array($tables) || empty($tables)) {
cpmsg('database_export_custom_invalid');
}
}
$query = $db->query("SELECT datatables FROM {$tablepre}plugins WHERE datatables<>''");
while($plugin = $db->fetch_array($query)) {
foreach(explode(',', $plugin['datatables']) as $table) {
if($table = trim($table)) {
$tables[] = $table;
}
}
}
$volume = intval($volume) + 1;
$idstring = '# Identify: '.base64_encode("$timestamp,$version,$type,$method,$volume")."\n";
$dumpcharset = $sqlcharset ? $sqlcharset : str_replace('-', '', $GLOBALS['charset']);
$setnames = ($sqlcharset && $db->version() > '4.1' && (!$sqlcompat || $sqlcompat == 'MYSQL41')) ? "SET NAMES '$dumpcharset';\n\n" : '';
if($db->version() > '4.1') {
if($sqlcharset) {
$db->query("SET NAMES '".$sqlcharset."';\n\n");
}
if($sqlcompat == 'MYSQL40') {
$db->query("SET SQL_MODE='MYSQL40'");
} elseif($sqlcompat == 'MYSQL41') {
$db->query("SET SQL_MODE=''");
}
}
$backupfilename = './forumdata/'.$backupdir.'/'.str_replace(array('/', '\\', '.'), '', $filename);
if($usezip) {
require_once DISCUZ_ROOT.'admin/zip.func.php';
}
if($method == 'multivol') {
$sqldump = '';
$tableid = intval($tableid);
$startfrom = intval($startfrom);
$complete = TRUE;
for(; $complete && $tableid < count($tables) && strlen($sqldump) + 500 < $sizelimit * 1000; $tableid++) {
$sqldump .= sqldumptable($tables[$tableid], $startfrom, strlen($sqldump));
if($complete) {
$startfrom = 0;
}
}
$dumpfile = $backupfilename."-%s".'.sql';
!$complete && $tableid--;
if(trim($sqldump)) {
$sqldump = "$idstring".
"# <?exit();?>\n".
"# Discuz! Multi-Volume Data Dump Vol.$volume\n".
"# Version: Discuz! $version\n".
"# Time: $time\n".
"# Type: $type\n".
"# Table Prefix: $tablepre\n".
"#\n".
"# Discuz! Home: http://www.discuz.com\n".
"# Please visit our website for newest infomation about Discuz!\n".
"# --------------------------------------------------------\n\n\n".
"$setnames".
$sqldump;
$dumpfilename = sprintf($dumpfile, $volume);
@$fp = fopen($dumpfilename, 'wb');
@flock($fp, 2);
if(@!fwrite($fp, $sqldump)) {
@fclose($fp);
cpmsg('database_export_file_invalid');
} else {
fclose($fp);
if($usezip == 2) {
$fp = fopen($dumpfilename, "r");
$content = @fread($fp, filesize($dumpfilename));
fclose($fp);
$zip = new zipfile();
$zip->addFile($content, basename($dumpfilename));
$fp = fopen(sprintf($backupfilename."-%s".'.zip', $volume), 'w');
if(@fwrite($fp, $zip->file()) !== FALSE) {
@unlink($dumpfilename);
}
fclose($fp);
}
unset($sqldump, $zip, $content);
cpmsg('database_export_multivol_redirect', "admincp.php?action=export&type=".rawurlencode($type)."&saveto=server&filename=".rawurlencode($filename)."&method=multivol&sizelimit=".rawurlencode($sizelimit)."&volume=".rawurlencode($volume)."&tableid=".rawurlencode($tableid)."&startfrom=".rawurlencode($startrow)."&extendins=".rawurlencode($extendins)."&sqlcharset=".rawurlencode($sqlcharset)."&sqlcompat=".rawurlencode($sqlcompat)."&exportsubmit=yes&usehex=$usehex&usezip=$usezip");
}
} else {
$volume--;
$filelist = '<ul>';
cpheader();
if($usezip == 1) {
$zip = new zipfile();
$zipfilename = $backupfilename.'.zip';
$unlinks = '';
for($i = 1; $i <= $volume; $i++) {
$filename = sprintf($dumpfile, $i);
$fp = fopen($filename, "r");
$content = @fread($fp, filesize($filename));
fclose($fp);
$zip->addFile($content, basename($filename));
$unlinks .= "@unlink('$filename');";
$filelist .= "<li><a href=\"$filename\">$filename\n";
}
$fp = fopen($zipfilename, 'w');
if(@fwrite($fp, $zip->file()) !== FALSE) {
eval($unlinks);
} else {
cpmsg('database_export_multivol_succeed');
}
unset($sqldump, $zip, $content);
fclose($fp);
@touch('./forumdata/'.$backupdir.'/index.htm');
$filename = $zipfilename;
cpmsg('database_export_zip_succeed');
} else {
@touch('./forumdata/'.$backupdir.'/index.htm');
for($i = 1; $i <= $volume; $i++) {
$filename = sprintf($usezip == 2 ? $backupfilename."-%s".'.zip' : $dumpfile, $i);
$filelist .= "<li><a href=\"$filename\">$filename\n";
}
cpmsg('database_export_multivol_succeed');
}
}
} else {
$tablesstr = '';
foreach($tables as $table) {
$tablesstr .= '"'.$table.'" ';
}
require './config.inc.php';
list($dbhost, $dbport) = explode(':', $dbhost);
$query = $db->query("SHOW VARIABLES LIKE 'basedir'");
list(, $mysql_base) = $db->fetch_array($query, MYSQL_NUM);
$dumpfile = addslashes(dirname(dirname(__FILE__))).'/'.$backupfilename.'.sql';
@unlink($dumpfile);
$mysqlbin = $mysql_base == '/' ? '' : addslashes($mysql_base).'bin/';
@shell_exec($mysqlbin.'mysqldump --force --quick '.($db->version() > '4.1' ? '--skip-opt --create-options' : '-all').' --add-drop-table'.($extendins == 1 ? ' --extended-insert' : '').''.($db->version() > '4.1' && $sqlcompat == 'MYSQL40' ? ' --compatible=mysql40' : '').' --host="'.$dbhost.($dbport ? (is_numeric($dbport) ? ' --port='.$dbport : ' --socket="'.$dbport.'"') : '').'" --user="'.$dbuser.'" --password="'.$dbpw.'" "'.$dbname.'" '.$tablesstr.' > '.$dumpfile);
if(@file_exists($dumpfile)) {
if($usezip) {
require_once DISCUZ_ROOT.'admin/zip.func.php';
$zip = new zipfile();
$zipfilename = $backupfilename.'.zip';
$fp = fopen($dumpfile, "r");
$content = @fread($fp, filesize($dumpfile));
fclose($fp);
$zip->addFile($idstring."# <?exit();?>\n ".$setnames."\n #".$content, basename($dumpfile));
$fp = fopen($zipfilename, 'w');
@fwrite($fp, $zip->file());
fclose($fp);
@unlink($dumpfile);
@touch('./forumdata/'.$backupdir.'/index.htm');
$filename = $backupfilename.'.zip';
unset($sqldump, $zip, $content);
cpmsg('database_export_zip_succeed');
} else {
if(@is_writeable($dumpfile)) {
$fp = fopen($dumpfile, 'rb+');
@fwrite($fp, $idstring."# <?exit();?>\n ".$setnames."\n #");
fclose($fp);
}
@touch('./forumdata/'.$backupdir.'/index.htm');
$filename = $backupfilename.'.sql';
cpmsg('database_export_succeed');
}
} else {
cpmsg('database_shell_fail');
}
}
}
} elseif($action == 'importzip') {
require_once DISCUZ_ROOT.'admin/zip.func.php';
$unzip = new SimpleUnzip();
$unzip->ReadFile($datafile_server);
if($unzip->Count() == 0 || $unzip->GetError(0) != 0 || !preg_match("/\.sql$/i", $importfile = $unzip->GetName(0))) {
cpmsg('database_import_file_illegal');
}
$identify = explode(',', base64_decode(preg_replace("/^# Identify:\s*(\w+).*/s", "\\1", substr($unzip->GetData(0), 0, 256))));
$confirm = !empty($confirm) ? 1 : 0;
if(!$confirm && $identify[1] != $version) {
cpmsg('database_import_confirm', 'admincp.php?action=importzip&datafile_server=$datafile_server&importsubmit=yes&confirm=yes', 'form');
}
$sqlfilecount = 0;
foreach($unzip->Entries as $entry) {
if(preg_match("/\.sql$/i", $entry->Name)) {
$fp = fopen('./forumdata/'.$backupdir.'/'.$entry->Name, 'w');
fwrite($fp, $entry->Data);
fclose($fp);
$sqlfilecount++;
}
}
if(!$sqlfilecount) {
cpmsg('database_import_file_illegal');
}
$info = basename($datafile_server).'<br />'.$lang['version'].': '.$identify[1].'<br />'.$lang['type'].': '.$lang['database_export_'.$identify[2]].'<br />'.$lang['database_method'].': '.($identify[3] == 'multivol' ? $lang['database_multivol'] : $lang['database_shell']).'<br />';
if(isset($multivol)) {
$multivol++;
$datafile_server = preg_replace("/-(\d+)(\..+)$/", "-$multivol\\2", $datafile_server);
if(file_exists($datafile_server)) {
cpmsg('database_import_multivol_unzip_redirect', 'admincp.php?action=importzip&multivol='.$multivol.'&datafile_vol1='.$datafile_vol1.'&datafile_server='.$datafile_server.'&importsubmit=yes&confirm=yes');
} else {
cpmsg('database_import_multivol_confirm', 'admincp.php?action=import&from=server&datafile_server='.$datafile_vol1.'&importsubmit=yes&delunzip=yes', 'form', '', 'admincp.php?action=import');
}
}
if($identify[3] == 'multivol' && $identify[4] == 1 && preg_match("/-1(\..+)$/", $datafile_server)) {
$datafile_vol1 = $datafile_server;
$datafile_server = preg_replace("/-1(\..+)$/", "-2\\1", $datafile_server);
if(file_exists($datafile_server)) {
cpmsg('database_import_multivol_unzip', 'admincp.php?action=importzip&multivol=1&datafile_vol1=./forumdata/'.$backupdir.'/'.$importfile.'&datafile_server='.$datafile_server.'&importsubmit=yes&confirm=yes', 'form');
}
}
cpmsg('database_import_unzip', 'admincp.php?action=import&from=server&datafile_server=./forumdata/'.$backupdir.'/'.$importfile.'&importsubmit=yes&delunzip=yes', 'form', '', 'admincp.php?action=import');
} elseif($action == 'import') {
checkpermission('dbimport');
if(!submitcheck('importsubmit', 1) && !submitcheck('deletesubmit')) {
$exportlog = array();
if(is_dir(DISCUZ_ROOT.'./forumdata/'.$backupdir)) {
$dir = dir(DISCUZ_ROOT.'./forumdata/'.$backupdir);
while($entry = $dir->read()) {
$entry = './forumdata/'.$backupdir.'/'.$entry;
if(is_file($entry)) {
if(preg_match("/\.sql$/i", $entry)) {
$filesize = filesize($entry);
$fp = fopen($entry, 'rb');
$identify = explode(',', base64_decode(preg_replace("/^# Identify:\s*(\w+).*/s", "\\1", fgets($fp, 256))));
fclose ($fp);
$exportlog[] = array(
'version' => $identify[1],
'type' => $identify[2],
'method' => $identify[3],
'volume' => $identify[4],
'filename' => $entry,
'dateline' => filemtime($entry),
'size' => $filesize
);
} elseif(preg_match("/\.zip$/i", $entry)) {
$filesize = filesize($entry);
$exportlog[] = array(
'type' => 'zip',
'filename' => $entry,
'size' => filesize($entry),
'dateline' => filemtime($entry)
);
}
}
}
$dir->close();
} else {
cpmsg('database_export_dest_invalid');
}
$exportinfo = '';
foreach($exportlog as $info) {
$info['dateline'] = is_int($info['dateline']) ? gmdate("$dateformat $timeformat", $info['dateline'] + $timeoffset * 3600) : $lang['unknown'];
$info['size'] = sizecount($info['size']);
$info['volume'] = $info['method'] == 'multivol' ? $info['volume'] : '';
$info['method'] = $info['type'] != 'zip' ? ($info['method'] == 'multivol' ? $lang['database_multivol'] : $lang['database_shell']) : '';
$exportinfo .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"".basename($info['filename'])."\"></td>\n".
"<td class=\"altbg2\"><a href=\"$info[filename]\">".substr(strrchr($info['filename'], "/"), 1)."</a></td>\n".
"<td class=\"altbg1\">$info[version]</td>\n".
"<td class=\"altbg2\">$info[dateline]</td>\n".
"<td class=\"altbg1\">".$lang['database_export_'.$info['type']]."</td>\n".
"<td class=\"altbg2\">$info[size]</td>\n".
"<td class=\"altbg1\">$info[method]</td>\n".
"<td class=\"altbg2\">$info[volume]</td>\n".
($info['type'] == 'zip' ? "<td class=\"altbg1\"><a href=\"admincp.php?action=importzip&datafile_server=$info[filename]&importsubmit=yes\">[$lang[database_import_unzip]]</a></td>\n" :
"<td class=\"altbg1\"><a href=\"admincp.php?action=import&from=server&datafile_server=$info[filename]&importsubmit=yes\"".
($info['version'] != $version ? " onclick=\"return confirm('$lang[database_import_confirm]');\"" : '').">[$lang[import]]</a></td>\n");
}
shownav('menu_database_import');
showtips('database_import_tips');
?>
<form name="restore" method="post" action="admincp.php?action=import" enctype="multipart/form-data">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="2"><?=$lang['database_import']?></td>
</tr>
<tr>
<td class="altbg1" width="40%"><input class="radio" type="radio" name="from" value="server" checked onclick="this.form.datafile_server.disabled=!this.checked;this.form.datafile.disabled=this.checked"><?=$lang['database_import_from_server']?></td>
<td class="altbg2" width="45%"><input type="text" size="40" name="datafile_server" value="./forumdata/<?=$backupdir?>/"></td></tr>
<tr>
<td class="altbg1" width="40%"><input class="radio" type="radio" name="from" value="local" onclick="this.form.datafile_server.disabled=this.checked;this.form.datafile.disabled=!this.checked"><?=$lang['database_import_from_local']?></td>
<td class="altbg2" width="45%"><input type="file" size="29" name="datafile" disabled></td></tr>
</table><br /><center>
<input class="button" type="submit" name="importsubmit" value="<?=$lang['submit']?>"></center>
</form><br />
<form method="post" action="admincp.php?action=import">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="9"><?=$lang['database_export_file']?></td></tr>
<tr align="center" class="category"><td width="48"><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['filename']?></td><td><?=$lang['version']?></td>
<td><?=$lang['time']?></td><td><?=$lang['type']?></td>
<td><?=$lang['size']?></td><td><?=$lang['database_method']?></td>
<td><?=$lang['database_volume']?></td><td><?=$lang['operation']?></td></tr>
<?=$exportinfo?>
</table><br /><center>
<input class="button" type="submit" name="deletesubmit" value="<?=$lang['submit']?>"></center></form>
<?
} elseif(submitcheck('importsubmit', 1)) {
$readerror = 0;
$datafile = '';
if($from == 'server') {
$datafile = DISCUZ_ROOT.'./'.$datafile_server;
}
/*elseif($from == 'local') {
$datafile = $_FILES['datafile']['tmp_name'];
}*/
if(@$fp = fopen($datafile, 'rb')) {
$sqldump = fgets($fp, 256);
$identify = explode(',', base64_decode(preg_replace("/^# Identify:\s*(\w+).*/s", "\\1", $sqldump)));
$dumpinfo = array('method' => $identify[3], 'volume' => intval($identify[4]));
if($dumpinfo['method'] == 'multivol') {
$sqldump .= fread($fp, filesize($datafile));
}
fclose($fp);
} else {
if($autoimport) {
updatecache();
cpmsg('database_import_multivol_succeed');
} else {
cpmsg('database_import_file_illegal');
}
}
if($dumpinfo['method'] == 'multivol') {
$sqlquery = splitsql($sqldump);
unset($sqldump);
$supetablepredot = strpos($supe['tablepre'], '.');
$supe['dbname'] = $supetablepredot !== FALSE ? substr($supe['tablepre'], 0, $supetablepredot) : '';
foreach($sqlquery as $sql) {
$sql = syntablestruct(trim($sql), $db->version() > '4.1', $dbcharset);
if(substr($sql, 0, 11) == 'INSERT INTO') {
$sqldbname = substr($sql, 12, 20);
$dotpos = strpos($sqldbname, '.');
if($dotpos !== FALSE) {
if(empty($supe['dbmode'])) {
$sql = 'INSERT INTO `'.$supe['dbname'].'`.'.substr($sql, 13 + $dotpos);
} else {
supe_dbconnect();
}
}
}
if($sql != '') {
$db->query($sql, 'SILENT');
if(($sqlerror = $db->error()) && $db->errno() != 1062) {
$db->halt('MySQL Query Error', $sql);
}
}
}
if($delunzip) {
@unlink($datafile_server);
}
$datafile_next = preg_replace("/-($dumpinfo[volume])(\..+)$/", "-".($dumpinfo['volume'] + 1)."\\2", $datafile_server);
if($dumpinfo['volume'] == 1) {
cpmsg('database_import_multivol_prompt',
"admincp.php?action=import&from=server&datafile_server=$datafile_next&autoimport=yes&importsubmit=yes".(!empty($delunzip) ? '&delunzip=yes' : ''),
'form');
} elseif($autoimport) {
cpmsg('database_import_multivol_redirect', "admincp.php?action=import&from=server&datafile_server=$datafile_next&autoimport=yes&importsubmit=yes".(!empty($delunzip) ? '&delunzip=yes' : ''));
} else {
updatecache();
cpmsg('database_import_succeed');
}
} elseif($dumpinfo['method'] == 'shell') {
require './config.inc.php';
list($dbhost, $dbport) = explode(':', $dbhost);
$query = $db->query("SHOW VARIABLES LIKE 'basedir'");
list(, $mysql_base) = $db->fetch_array($query, MYSQL_NUM);
$mysqlbin = $mysql_base == '/' ? '' : addslashes($mysql_base).'bin/';
shell_exec($mysqlbin.'mysql -h"'.$dbhost.($dbport ? (is_numeric($dbport) ? ' -P'.$dbport : ' -S"'.$dbport.'"') : '').
'" -u"'.$dbuser.'" -p"'.$dbpw.'" "'.$dbname.'" < '.$datafile);
updatecache();
cpmsg('database_import_succeed');
} else {
cpmsg('database_import_format_illegal');
}
} elseif(submitcheck('deletesubmit')) {
if(is_array($delete)) {
foreach($delete as $filename) {
@unlink('./forumdata/'.$backupdir.'/'.str_replace(array('/', '\\'), '', $filename));
}
cpmsg('database_file_delete_succeed');
} else {
cpmsg('database_file_delete_invalid');
}
}
} elseif($action == 'runquery') {
$checkperm = checkpermission('runquery', 0);
$runquerys = array();
@include_once(DISCUZ_ROOT.'admin/quickqueries.inc.php');
if(!submitcheck('sqlsubmit')) {
shownav('menu_database_query');
showtips('database_run_query_tips');
$runqueryselect = '';
foreach($simplequeries as $key => $query) {
if(empty($query['sql'])) {
$runqueryselect .= "<optgroup label=\"$query[comment]\">";
} else {
$runqueryselect .= '<option value="'.$key.'">'.$query['comment'].'</option>';
}
}
if($runqueryselect) {
$runqueryselect = '<select name="queryselect" style="width:45%">'.$runqueryselect.'</select>';
}
$queries = $queryselect ? $runquerys[$queryselect] : '';
?>
<form method="post" action="admincp.php?action=runquery">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="option" value="simple">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan=2><?=$lang['database_run_query_simply']?></td></tr>
<tr class="altbg1">
<td align="center"><center><?=$runqueryselect?> <input type="submit" name="sqlsubmit" value="<?=$lang['submit']?>"></center></td></tr>
</table>
</form>
<br />
<?
if($checkperm) {
?>
<form method="post" action="admincp.php?action=runquery">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="option" value="">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan=2><?=$lang['database_run_query']?></td></tr>
<tr class="altbg1">
<td valign="top">
<div align="center">
<br /><textarea cols="85" rows="10" name="queries"><?=$queries?></textarea><br />
<br /><?=$lang['database_run_query_comment']?></div>
</td></tr></table>
<br /><center><input class="button" type="submit" name="sqlsubmit" value="<?=$lang['submit']?>"></center>
</form></td></tr>
<?
}
} else {
if($option == 'simple') {
$queryselect = intval($queryselect);
$queries = isset($simplequeries[$queryselect]) && $simplequeries[$queryselect]['sql'] ? $simplequeries[$queryselect]['sql'] : '';
} elseif(!$checkperm) {
cpmsg('database_run_query_denied');
}
$sqlquery = splitsql(str_replace(array(' cdb_', ' {tablepre}', ' `cdb_'), array(' '.$tablepre, ' '.$tablepre, ' `'.$tablepre), $queries));
$affected_rows = 0;
foreach($sqlquery as $sql) {
if(trim($sql) != '') {
$db->query(stripslashes($sql), 'SILENT');
if($sqlerror = $db->error()) {
break;
} else {
$affected_rows += intval($db->affected_rows());
}
}
}
cpmsg($sqlerror ? 'database_run_query_invalid' : 'database_run_query_succeed');
}
} elseif($action == 'optimize') {
shownav('menu_database_optimize');
showtips('database_optimize_tips');
?>
<form name="optimize" method="post" action="admincp.php?action=optimize">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td><input class="checkbox" type="checkbox" name="chkall" class="header" onclick="checkall(this.form)" checked><?=$lang['database_optimize_opt']?></td><td><?=$lang['database_optimize_table_name']?></td><td><?=$lang['type']?></td><td><?=$lang['database_optimize_rows']?></td>
<td><?=$lang['database_optimize_data']?></td><td><?=$lang['database_optimize_index']?></td><td><?=$lang['database_optimize_frag']?></td></tr>
<?
$optimizetable = '';
$totalsize = 0;
$tablearray = empty($supe['tablepre']) ? array( 0 =>$tablepre) : array( 0 => $tablepre, 1 => $supe['tablepre']);
if(!submitcheck('optimizesubmit')) {
foreach($tablearray as $tp) {
$query = $db->query("SHOW TABLE STATUS LIKE '$tp%'", 'SILENT');
while($table = $db->fetch_array($query)) {
if($table['Data_free'] && $table[$tabletype] == 'MyISAM') {
$checked = $table[$tabletype] == 'MyISAM' ? 'checked' : 'disabled';
echo "<tr><td class=\"altbg1\" align=\"center\"><input class=\"checkbox\" type=\"checkbox\" name=\"optimizetables[]\" value=\"$table[Name]\" $checked></td>\n".
"<td class=\"altbg2\" align=\"center\">$table[Name]</td>\n".
"<td class=\"altbg1\" align=\"center\">".$table[$tabletype]."</td>\n".
"<td class=\"altbg2\" align=\"center\">$table[Rows]</td>\n".
"<td class=\"altbg1\" align=\"center\">$table[Data_length]</td>\n".
"<td class=\"altbg2\" align=\"center\">$table[Index_length]</td>\n".
"<td class=\"altbg1\" align=\"center\">$table[Data_free]</td></tr>\n";
$totalsize += $table['Data_length'] + $table['Index_length'];
}
}
}
if(empty($totalsize)) {
echo "<tr><td colspan=\"7\" align=\"right\">".$lang['database_optimize_done']."</td></tr></table></div>";
} else {
echo "<tr><td colspan=\"7\" align=\"right\">$lang[database_optimize_used] ".sizecount($totalsize)."</td></tr></table></div><br /><center><input class=\"button\" type=\"submit\" name=\"optimizesubmit\" value=\"$lang[submit]\"></center>";
}
} else {
//$db->query("DELETE FROM {$tablepre}subscriptions", 'UNBUFFERED');
//$db->query("UPDATE {$tablepre}memberfields SET authstr=''", 'UNBUFFERED');
foreach($tablearray as $tp) {
$query = $db->query("SHOW TABLE STATUS LIKE '$tp%'", 'SILENT');
while($table = $db->fetch_array($query)) {
if(is_array($optimizetables) && in_array($table['Name'], $optimizetables)) {
$db->query("OPTIMIZE TABLE $table[Name]");
}
echo "<tr>\n".
"<td class=\"altbg1\" align=\"center\">".$lang['yes']."</td>\n".
"<td class=\"altbg2\" align=\"center\">$table[Name]</td>\n".
"<td class=\"altbg1\" align=\"center\">".($db->version() > '4.1' ? $table['Engine'] : $table['Type'])."</td>\n".
"<td class=\"altbg2\" align=\"center\">$table[Rows]</td>\n".
"<td class=\"altbg1\" align=\"center\">$table[Data_length]</td>\n".
"<td class=\"altbg2\" align=\"center\">$table[Index_length]</td>\n".
"<td class=\"altbg1\" align=\"center\">0</td>\n".
"</tr>\n";
$totalsize += $table['Data_length'] + $table['Index_length'];
}
}
echo "<tr><td colspan=\"7\" align=\"right\">$lang[database_optimize_used] ".sizecount($totalsize)."</td></tr></table>";
}
echo '</table></form>';
}
function fetchtablelist($tablepre = '') {
global $db;
$arr = explode('.', $tablepre);
$dbname = $arr[1] ? $arr[0] : '';
$sqladd = $dbname ? " FROM $dbname LIKE '$arr[1]%'" : "LIKE '$tablepre%'";
!$tablepre && $tablepre = '*';
$tables = $table = array();
$query = $db->query("SHOW TABLE STATUS $sqladd");
while($table = $db->fetch_array($query)) {
$table['Name'] = ($dbname ? "$dbname." : '').$table['Name'];
$tables[] = $table;
}
return $tables;
}
function arraykeys2($array, $key2) {
$return = array();
foreach($array as $val) {
$return[] = $val[$key2];
}
return $return;
}
function syntablestruct($sql, $version, $dbcharset) {
if(strpos(trim(substr($sql, 0, 18)), 'CREATE TABLE') === FALSE) {
return $sql;
}
$sqlversion = strpos($sql, 'ENGINE=') === FALSE ? FALSE : TRUE;
if($sqlversion === $version) {
return $sqlversion && $dbcharset ? preg_replace(array('/ character set \w+/i', '/ collate \w+/i', "/DEFAULT CHARSET=\w+/is"), array('', '', "DEFAULT CHARSET=$dbcharset"), $sql) : $sql;
}
if($version) {
return preg_replace(array('/TYPE=HEAP/i', '/TYPE=(\w+)/is'), array("ENGINE=MEMORY DEFAULT CHARSET=$dbcharset", "ENGINE=\\1 DEFAULT CHARSET=$dbcharset"), $sql);
} else {
return preg_replace(array('/character set \w+/i', '/collate \w+/i', '/ENGINE=MEMORY/i', '/\s*DEFAULT CHARSET=\w+/is', '/\s*COLLATE=\w+/is', '/ENGINE=(\w+)(.*)/is'), array('', '', 'ENGINE=HEAP', '', '', 'TYPE=\\1\\2'), $sql);
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/database.inc.php | PHP | asf20 | 35,385 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: runwizard.inc.php 10115 2007-08-24 00:58:08Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
$step = in_array($step, array(1, 2, 3, 4)) ? $step : 1;
$runwizardhistory = array();
$runwizardfile = DISCUZ_ROOT.'./forumdata/logs/runwizardlog.php';
if($fp = @fopen($runwizardfile, 'r')) {
$runwizardhistory = @unserialize(fread($fp, 99999));
fclose($fp);
}
cpheader();
$runwizardwarnning = empty($runwizard) ? '<li>'.$lang['runwizard_cover_old'].'</li>' : '';
$listchecked[$step] = ' style="font-weight: 800"';
shownav('menu_runwizard');
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['tips']?></td></tr>
<tr class="altbg1"><td><ul><li><?=$lang['runwizard_help']?></li></ul><ul>
<li><?=$lang['runwizard_step_guide']?></li>
<ul>
<li<?=$listchecked[1]?>><?=$lang['runwizard_step_1']?></li>
<li<?=$listchecked[2]?>><?=$lang['runwizard_step_2']?></li>
<li<?=$listchecked[3]?>><?=$lang['runwizard_step_3']?></li>
<li<?=$listchecked[4]?>><?=$lang['runwizard_step_4']?></li></ul>
<?=$runwizardwarnning?>
</ul>
</td></tr></table>
<?
if($step == 1) {
$sizecheckedid = isset($runwizardhistory['step1']['size']) ? $runwizardhistory['step1']['size'] : 1;
$sizechecked = array($sizecheckedid => ' checked');
$safecheckedid = isset($runwizardhistory['step1']['safe']) ? $runwizardhistory['step1']['safe'] : 0;
$safechecked = array($safecheckedid => 'checked');
$funccheckedid = isset($runwizardhistory['step1']['func']) ? $runwizardhistory['step1']['func'] : 1;
$funcchecked = array($funccheckedid => 'checked');
?>
<br /><form method="post" action="admincp.php?action=runwizard&step=2">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['menu_runwizard']?> - <?=$lang['runwizard_step_menu_1']?></td></tr>
<tr><td class="altbg1">
<ul>
<br /><b><?=$lang['runwizard_forum_scope']?></b>
<ul>
<input class="radio" type="radio" name="size" value="0"<?=$sizechecked[0]?>> <?=$lang['runwizard_forum_scope_small']?><br />
<input class="radio" type="radio" name="size" value="1"<?=$sizechecked[1]?>> <?=$lang['runwizard_forum_scope_midding']?><br />
<input class="radio" type="radio" name="size" value="2"<?=$sizechecked[2]?>> <?=$lang['runwizard_forum_scope_big']?><br />
</ul><br />
<b><?=$lang['runwizard_security']?></b>
<ul>
<input class="radio" type="radio" name="safe" value="2"<?=$safechecked[2]?>> <?=$lang['runwizard_security_high']?><br />
<input class="radio" type="radio" name="safe" value="1"<?=$safechecked[1]?>> <?=$lang['runwizard_security_midding']?><br />
<input class="radio" type="radio" name="safe" value="0"<?=$safechecked[0]?>> <?=$lang['runwizard_security_low']?><br />
</ul><br />
<b><?=$lang['runwizard_hobby']?></b>
<ul>
<input class="radio" type="radio" name="func" value="0"<?=$funcchecked[0]?>> <?=$lang['runwizard_hobby_concision']?><br />
<input class="radio" type="radio" name="func" value="1"<?=$funcchecked[1]?>> <?=$lang['runwizard_hobby_commonly']?><br />
<input class="radio" type="radio" name="func" value="2"<?=$funcchecked[2]?>> <?=$lang['runwizard_hobby_abundance']?><br />
</ul></ul><br /><br /></td></tr></table><br />
<center><input class="button" type="submit" name="step1submit" value=" <?=$lang['next']?> "></center>
</form>
<?
$db->query("DELETE FROM {$tablepre}settings WHERE variable='runwizard'");
updatecache('settings');
} elseif($step == 2) {
if(submitcheck('step1submit')) {
$runwizardhistory['step1']['size'] = $size;
$runwizardhistory['step1']['safe'] = $safe;
$runwizardhistory['step1']['func'] = $func;
saverunwizardhistory();
}
$settings = &$_DCACHE['settings'];
$settings['bbname'] = empty($runwizard) && $runwizardhistory['step2']['bbname'] ? $runwizardhistory['step2']['bbname'] : $settings['bbname'];
$settings['sitename'] = empty($runwizard) && $runwizardhistory['step2']['sitename'] ? $runwizardhistory['step2']['sitename'] : $settings['sitename'];
$settings['siteurl'] = empty($runwizard) && $runwizardhistory['step2']['siteurl'] ? $runwizardhistory['step2']['siteurl'] : $settings['siteurl'];
?>
<br /><form method="post" action="admincp.php?action=runwizard&step=3">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['menu_runwizard']?> - <?=$lang['runwizard_step_menu_2']?></td></tr>
<?
showsetting('settings_bbname', 'settingsnew[bbname]', $settings['bbname'], 'text');
showsetting('settings_sitename', 'settingsnew[sitename]', $settings['sitename'], 'text');
showsetting('settings_siteurl', 'settingsnew[siteurl]', $settings['siteurl'], 'text');
?>
</table><br />
<center><input class="button" type="button" name="step2submit" value=" <?=$lang['prev']?> " onclick="history.back();"> <input class="button" type="submit" name="step2submit" value=" <?=$lang['next']?> "></center>
</form>
<?
} elseif($step == 3) {
if(submitcheck('step2submit')) {
$runwizardhistory['step2']['bbname'] = $settingsnew['bbname'];
$runwizardhistory['step2']['sitename'] = $settingsnew['sitename'];
$runwizardhistory['step2']['siteurl'] = $settingsnew['siteurl'];
saverunwizardhistory();
}
?>
<br /><form method="post" action="admincp.php?action=runwizard&step=4">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['menu_runwizard']?> - <?=$lang['runwizard_step_menu_3']?></td></tr>
<tr><td class="altbg1" colspan="2"><br />
<style type="text/css">
.ulforum li{
margin:6px;
}
</style>
<ul class="ulforum">
<li><?=$lang['runwizard_cat']?> 1: <input type="text" name="newcat[0]" size="30" value="<?=$runwizardhistory['step3']['cates'][0]?>"></li><ul>
<li><?=$lang['runwizard_forum']?> 1: <input type="text" name="newforum[0][]"" size="30" value="<?=$runwizardhistory['step3']['forums'][0][0]?>"></li>
<li><?=$lang['runwizard_forum']?> 2: <input type="text" name="newforum[0][]"" size="30" value="<?=$runwizardhistory['step3']['forums'][0][1]?>"></li>
<li><?=$lang['runwizard_forum']?> 3: <input type="text" name="newforum[0][]"" size="30" value="<?=$runwizardhistory['step3']['forums'][0][2]?>"></li>
</ul></ul>
<ul class="ulforum">
<li><?=$lang['runwizard_cat']?> 2: <input type="text" name="newcat[1]" size="30" value="<?=$runwizardhistory['step3']['cates'][1]?>"></li><ul>
<li><?=$lang['runwizard_forum']?> 4: <input type="text" name="newforum[1][]"" size="30" value="<?=$runwizardhistory['step3']['forums'][1][0]?>"></li>
<li><?=$lang['runwizard_forum']?> 5: <input type="text" name="newforum[1][]"" size="30" value="<?=$runwizardhistory['step3']['forums'][1][1]?>"></li>
<li><?=$lang['runwizard_forum']?> 6: <input type="text" name="newforum[1][]"" size="30" value="<?=$runwizardhistory['step3']['forums'][1][2]?>"></li>
</ul></ul>
<ul class="ulforum">
<li><?=$lang['runwizard_cat']?> 3: <input type="text" name="newcat[2]" size="30" value="<?=$runwizardhistory['step3']['cates'][2]?>"></li><ul>
<li><?=$lang['runwizard_forum']?> 7: <input type="text" name="newforum[2][]"" size="30" value="<?=$runwizardhistory['step3']['forums'][2][0]?>"></li>
<li><?=$lang['runwizard_forum']?> 8: <input type="text" name="newforum[2][]"" size="30" value="<?=$runwizardhistory['step3']['forums'][2][1]?>"></li>
<li><?=$lang['runwizard_forum']?> 9: <input type="text" name="newforum[2][]"" size="30" value="<?=$runwizardhistory['step3']['forums'][2][2]?>"></li>
</ul></ul><br /><br />
</td></tr></table>
<br /><center><input class="button" type="button" name="step2submit" value=" <?=$lang['prev']?> " onclick="history.back();"> <input class="button" type="submit" name="step3submit" value=" <?=$lang['next']?> "> </center>
</form>
<?
} elseif($step == 4) {
if(submitcheck('step3submit')) {
foreach($newcat as $k=>$catename) {
if(!$catename) {
unset($newcat[$k]);
unset($newforum[$k]);
} else {
foreach($newforum[$k] as $k2=>$forumname) {
if(!$forumname) {
unset($newforum[$k][$k2]);
}
}
}
}
$runwizardhistory['step3']['cates'] = $newcat ? $newcat : array();
$runwizardhistory['step3']['forums'] = $newforum ? $newforum : array();
saverunwizardhistory();
}
?>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['menu_runwizard']?> - <?=$lang['runwizard_step_menu_4']?></td></tr>
<tr><td class="altbg1" colspan="2">
<?
if($confirm != 'yes') {
?>
<br /><ul>
<?=$lang['runwizard_forum_initialization']?><br />
<hr width="80%" align="left" noshade style="height:1px;"><br />
<b><?=$lang['runwizard_forum_scope']?></b> <?=$lang['runwizard_size_'.$runwizardhistory['step1']['size']]?><br /><br />
<b><?=$lang['runwizard_security']?></b> <?=$lang['runwizard_safe_'.$runwizardhistory['step1']['safe']]?><br /><br />
<b><?=$lang['runwizard_hobby']?></b> <?=$lang['runwizard_func_'.$runwizardhistory['step1']['func']]?><br /><br />
<b><?=$lang['settings_bbname']?></b> <?=$runwizardhistory['step2']['bbname']?><br /><br />
<b><?=$lang['settings_sitename']?></b> <?=$runwizardhistory['step2']['sitename']?><br /><br />
<b><?=$lang['settings_siteurl']?></b> <?=$runwizardhistory['step2']['siteurl']?><br /><br />
<b><?=$lang['runwizard_forum_add']?></b>
<?
if($runwizardhistory['step3']['cates']) {
echo '<br /><br />';
foreach($runwizardhistory['step3']['cates'] as $id=>$catename) {
echo '<ul><li>'.$catename.'</li><ul>';
foreach($runwizardhistory['step3']['forums'][$id] as $forumname) {
echo '<li>'.$forumname.'</li>';
}
echo '</ul></ul>';
}
} else {
echo $lang['none'];
}
?>
</ul><br /><br />
</td></tr></table><br />
<form method="POST" action="admincp.php?action=runwizard&step=4&confirm=yes">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<center> <input class="button" type="button" " value=" <?=$lang['prev']?> " onclick="history.back();"> <input class="button" type="submit" name="step4submit" value=" <?=$lang['submit']?> "></center></form>
<?
} else {
$sizesettings = array(
'attachsave' => array('1', '3', '4'),
'delayviewcount' => array('0', '0', '3'),
'fullmytopics' => array('1', '0', '0'),
'maxonlines' => array('500', '5000', '50000'),
'pvfrequence' => array('30', '60', '100'),
'qihoo_status' => array('0', '0', '1'),
//'starthreshold' => array('2', '2', '2'),
'searchctrl' => array('10', '30', '60'),
'hottopic' => array('10', '20', '50'),
'losslessdel' => array('365', '200', '100'),
'maxmodworksmonths' => array('5', '3', '1'),
'maxsearchresults' => array('200', '500', '1000'),
'statscachelife' => array('90', '180', '360'),
'moddisplay' => array('flat', 'flat', 'selectbox'),
'topicperpage' => array('30', '20', '15'),
'postperpage' => array('20', '15', '10'),
'maxpolloptions' => array('10', '10', '15'),
'maxpostsize' => array('10000', '10000', '20000'),
'myrecorddays' => array('100', '60', '30'),
'maxfavorites' => array('500', '200', '100'),
'maxsubscriptions' => array('500', '200', '100'),
);
$safesettings = array(
'attachrefcheck' => array('', '1', '1'),
'bannedmessages' => array('', '1', '1'),
'doublee' => array('1', '0', '0'),
'dupkarmarate' => array('1', '0', '0'),
'hideprivate' => array('0', '1', '1'),
'memliststatus' => array('1', '1', '0'),
'seccodestatus' => array('0', '1', '1'),
'bbrules' => array('0', '1', '1'),
'edittimelimit' => array('0', '20', '10'),
'floodctrl' => array('0', '10', '30'),
'karmaratelimit' => array('0', '1', '4'),
'passport_status' => array('0', '0', '0'),
'newbiespan' => array('', '1', '4'),
'showemail' => array('0', '1', '1'),
'maxchargespan' => array('0', '1', '2'),
'regctrl' => array('0', '12', '48'),
'regfloodctrl' => array('0', '100', '50'),
'regstatus' => array('1', '1', '1'),
'regverify' => array('0', '1', '2'),
);
$funcsettings = array(
'archiverstatus' => array('0', '1', '1'),
//'attachimgpost' => array('0', '1', '1'),
'bdaystatus' => array('0', '0', '1'),
'fastpost' => array('0', '1', '1'),
'editedby' => array('0', '1', '1'),
'forumjump' => array('0', '1', '1'),
//'globalstick' => array('0', '0', '1'),
'gzipcompress' => array('', '', '1'),
//'loadctrl' => array('', '', ''),
'newsletter' => array('', '', '1'),
'modworkstatus' => array('0', '0', '1'),
'reportpost' => array('0', '1', '1'),
'rewritestatus' => array('0', '0', '0'),
'rssstatus' => array('0', '1', '1'),
'wapstatus' => array('0', '1', '1'),
'maxbdays' => array('0', '100', '500'),
'smileyinsert' => array('', '1', '1'),
'smcols' => array('', '3', '3'),
'statstatus' => array('0', '0', '1'),
'stylejump' => array('0', '0', '1'),
'subforumsindex' => array('0', '0', '1'),
'transsidstatus' => array('0', '0', '1'),
'visitedforums' => array('0', '10', '20'),
'vtonlinestatus' => array('0', '1', '1'),
'welcomemsg' => array('0', '0', '1'),
'jsstatus' => array('0', '0', '1'),
'watermarkstatus' => array('0', '0', '1'),
'whosonlinestatus' => array('0', '1', '1'),
'debug' => array('0', '1', '1'),
'regadvance' => array('0', '0', '1'),
'jsmenustatus' => array('0', '1', '15'),
'showsettings' => array('0', '7', '7'),
'editoroptions' => array('0', '1', '1'),
);
$safeforums = array(
'modnewposts' => array('0', '0', '1'),
'recyclebin' => array('0', '1', '1'),
'jammer' => array('0', '0', '1'),
);
$funcforums = array(
'allowsmilies' => array('0', '1', '1'),
'allowbbcode' => array('0', '1', '1'),
'allowimgcode' => array('0', '1', '1'),
'allowanonymous' => array('0', '0', '1'),
'allowpostspecial' => array('', '1', '127'),
'disablewatermark' => array('1', '0', '0'),
'threadcaches' => array('0', '0', '1'),
'allowshare' => array('0', '1', '1'),
);
$sizeforums = array(
'threadcaches' => array('0', '0', '1'),
);
$sqladd = $comma = '';
foreach($sizesettings as $fieldname=>$val) {
$db->query("REPLACE INTO {$tablepre}settings (variable, value)
VALUES ('$fieldname', '{$val[$runwizardhistory[step1][size]]}')");
}
foreach($sizeforums as $fieldname=>$val) {
$sqladd .= $comma."$fieldname='".$val[$runwizardhistory['step1']['size']]."'";
$comma = ',';
}
foreach($safesettings as $fieldname=>$val) {
$db->query("REPLACE INTO {$tablepre}settings (variable, value)
VALUES ('$fieldname', '{$val[$runwizardhistory[step1][safe]]}')");
}
foreach($safeforums as $fieldname=>$val) {
$sqladd .= $comma."$fieldname='".$val[$runwizardhistory['step1']['safe']]."'";
}
foreach($funcsettings as $fieldname=>$val) {
$db->query("REPLACE INTO {$tablepre}settings (variable, value)
VALUES ('$fieldname', '{$val[$runwizardhistory[step1][func]]}')");
}
foreach($funcforums as $fieldname=>$val) {
$sqladd .= $comma."$fieldname='".$val[$runwizardhistory['step1']['func']]."'";
}
$db->query("UPDATE {$tablepre}forums SET $sqladd");
$maxonlines = $sizesettings['maxonlines'][$runwizardhistory['step1']['size']];
$db->query("ALTER TABLE {$tablepre}sessions MAX_ROWS=$maxonlines");
$db->query("REPLACE INTO {$tablepre}settings (variable, value)
VALUES ('bbname', '{$runwizardhistory[step2][bbname]}')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value)
VALUES ('sitename', '{$runwizardhistory[step2][sitename]}')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value)
VALUES ('siteurl', '{$runwizardhistory[step2][siteurl]}')");
updatecache('settings');
foreach($runwizardhistory['step3']['cates'] as $id=>$catename) {
$db->query("INSERT INTO {$tablepre}forums (type, name, status)
VALUES ('group', '$catename', '1')");
$fup = $fid = $db->insert_id();
$db->query("INSERT INTO {$tablepre}forumfields (fid)
VALUES ('$fid')");
foreach($runwizardhistory['step3']['forums'][$id] as $forumname) {
$db->query("INSERT INTO {$tablepre}forums (fup, type, name, status, allowsmilies, allowbbcode, allowimgcode, allowshare, allowpostspecial)
VALUES ('$fup', 'forum', '$forumname', '1', '1', '1', '1', '1', '15')");
$fid = $db->insert_id();
$db->query("INSERT INTO {$tablepre}forumfields (fid)
VALUES ('$fid')");
}
}
updatecache('forums');
$runwizardhistory['step3']['cates'] = array();
$runwizardhistory['step3']['forums'] = array();
saverunwizardhistory();
?>
<br /><center><b><?=$lang['runwizard_succeed']?></b><hr width="80%" noshade style="height:1px;"></center>
<br />
<ul>
<?=$lang['runwizard_modreasons']?><br /><br />
<ul>
<li><a href="admincp.php?action=settings&do=basic" onclick="if(parent.header)parent.header.togglemenu('basic')"><?=$lang['runwizard_particular']?></a></li>
<li><a href="admincp.php?action=forumadd" onclick="if(parent.header)parent.header.togglemenu('forums')"><?=$lang['menu_forums_add']?></a></li>
<li><a href="admincp.php?action=forumsedit" onclick="if(parent.header)parent.header.togglemenu('forums')"><?=$lang['menu_forums_edit']?></a></li>
<li><a href="admincp.php?action=fileperms" onclick="if(parent.header)parent.header.togglemenu('tools')"><?=$lang['menu_tools_fileperms']?></a></li>
</ul>
<br/><?=$lang['runwizard_database_backup']?><br /><br />
<ul>
<li><a href="admincp.php?action=export" onclick="if(parent.header)parent.header.togglemenu('tools')"><?=$lang['menu_database_export']?></a></li>
<li><a href="admincp.php?action=import" onclick="if(parent.header)parent.header.togglemenu('tools')"><?=$lang['menu_database_import']?></a></li>
</ul>
</ul><br /><br />
<?}?>
</td></tr></table></div>
<?
}
function saverunwizardhistory() {
global $runwizardfile, $runwizardhistory;
$fp = fopen($runwizardfile, 'w');
fwrite($fp, serialize($runwizardhistory));
fclose($fp);
}
?> | zyyhong | trunk/jiaju001/bbs/admin/runwizard.inc.php | PHP | asf20 | 18,497 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: threads.inc.php 10115 2007-08-24 00:58:08Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
require_once DISCUZ_ROOT.'./include/post.func.php';
cpheader();
$page = max(1, intval($page));
if(!$operation) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
$forumselect = '<select name="inforum"><option value="all"> > '.$lang['all'].'</option>'.
'<option value=""> </option>'.forumselect().'</select>';
if(isset($inforum)) {
$forumselect = preg_replace("/(\<option value=\"$inforum\")(\>)/", "\\1 selected=\"selected\" \\2", $forumselect);
}
$typeselect = '<select name="intype"><option value="all"> > '.$lang['all'].'</option>'.
'<option value=""> </option><option value="0"> > '.$lang['threads_search_type_none'].'</option>';
$query = $db->query("SELECT * FROM {$tablepre}threadtypes ORDER BY displayorder");
while($type = $db->fetch_array($query)) {
$typeselect .= '<option value="'.$type['typeid'].'"> > '.$type['name'].($type['description'] ? ' ('.$type['description'].')' : '').'</option>';
}
$typeselect .= '</select>';
if(isset($intype)) {
$typeselect = preg_replace("/(\<option value=\"$intype\")(\>)/", "\\1 selected=\"selected\" \\2", $typeselect);
}
$checkcins = empty($cins) ? '' : 'checked';
$checkhspecialthread = array(intval($specialthread) => 'checked');
$checksticky = array(intval($sticky) => 'checked');
$checkdigest = array(intval($digest) => 'checked');
$checkattach = array(intval($attach) => 'checked');
$checkblog = array(intval($blog) => 'checked');
$checkrate = array(intval($rate) => 'checked');
$checkhighlight = array(intval($highlight) => 'checked');
if(!empty($special)) {
foreach($special as $id => $val) {
$checkspecial[$val] = empty($special[$id]) ? '' : 'checked';
}
}
shownav('menu_maint_threads');
?>
<script src="include/javascript/calendar.js"></script>
<script type="text/javascript">
function page(number) {
$('threadforum').page.value=number;
$('threadforum').searchsubmit.click();
}
</script>
<form id="threadforum" method="post" action="admincp.php?action=threads">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="page" value="<?=$page?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="2"><?=$lang['threads_search']?></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_detail']?></td>
<td class="altbg2" align="right"><input class="checkbox" type="checkbox" name="detail" <?=($detail ? 'checked' : '')?> value="1"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_forum']?></td>
<td class="altbg2" align="right"><?=$forumselect?></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_time']?></td>
<td class="altbg2" align="right">
<input type="text" name="starttime" size="10" value="<?=dhtmlspecialchars($starttime)?>" onclick="showcalendar(event, this);"> -
<input type="text" name="endtime" size="10" value="<?=dhtmlspecialchars($endtime)?>" onclick="showcalendar(event, this);">
</td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_user']?></td>
<td class="altbg2" align="right">
<?=$lang['case_insensitive']?> <input class="checkbox" type="checkbox" name="cins" value="1" <?=$checkcins?>>
<br /><input type="text" name="users" size="40" value="<?=$users?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_keyword']?></td>
<td class="altbg2" align="right"><input type="text" name="keywords" size="40" value="<?=dhtmlspecialchars($keywords)?>"></td>
</tr>
<tr><td class="altbg1"> </td>
<td align="right" class="altbg2" style="text-align: right;"><input class="checkbox" type="checkbox" value="1" onclick="$('advanceoption').style.display = $('advanceoption').style.display == 'none' ? '' : 'none'; this.value = this.value == 1 ? 0 : 1; this.checked = this.value == 1 ? false : true"><?=$lang['more_options']?> </td></tr>
<tbody id="advanceoption" style="display: none">
<tr>
<td class="altbg1"><?=$lang['threads_search_type']?></td>
<td class="altbg2" align="right"><?=$typeselect?></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_viewless']?></td>
<td class="altbg2" align="right"><input type="text" name="viewsless" size="40" value="<?=dhtmlspecialchars($viewsless)?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_viewmore']?></td>
<td class="altbg2" align="right"><input type="text" name="viewsmore" size="40" value="<?=dhtmlspecialchars($viewsmore)?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_replyless']?></td>
<td class="altbg2" align="right"><input type="text" name="repliesless" size="40" value="<?=dhtmlspecialchars($repliesless)?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_replymore']?></td>
<td class="altbg2" align="right"><input type="text" name="repliesmore" size="40" value="<?=dhtmlspecialchars($repliesmore)?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_readpermmore']?></td>
<td class="altbg2" align="right"><input type="text" name="readpermmore" size="40" value="<?=dhtmlspecialchars($readpermmore)?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_pricemore']?></td>
<td class="altbg2" align="right"><input type="text" name="pricemore" size="40" value="<?=dhtmlspecialchars($pricemore)?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_noreplyday']?></td>
<td class="altbg2" align="right"><input type="text" name="noreplydays" size="40" value="<?=dhtmlspecialchars($noreplydays)?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_special']?></td>
<td class="altbg2" align="right">
<input class="radio" type="radio" name="specialthread" value="0" onclick="$('showspecial').style.display='none'" <?=$checkhspecialthread[0]?>> <?=$lang['unlimited']?>
<input class="radio" type="radio" name="specialthread" value="1" onclick="$('showspecial').style.display=''" <?=$checkhspecialthread[1]?>> <?=$lang['threads_search_include_yes']?>
<input class="radio" type="radio" name="specialthread" value="2" onclick="$('showspecial').style.display=''" <?=$checkhspecialthread[2]?>> <?=$lang['threads_search_include_no']?>
<div id="showspecial" style="display:<?=($specialthread ? '' : 'none')?>">
<input class="checkbox" type="checkbox" name="special[]" value="1" <?=$checkspecial[1]?>> <?=$lang['threads_special_poll']?>
<input class="checkbox" type="checkbox" name="special[]" value="2" <?=$checkspecial[2]?>> <?=$lang['threads_special_trade']?>
<input class="checkbox" type="checkbox" name="special[]" value="3" <?=$checkspecial[3]?>> <?=$lang['threads_special_reward']?>
<input class="checkbox" type="checkbox" name="special[]" value="4" <?=$checkspecial[4]?>> <?=$lang['threads_special_activity']?>
<input class="checkbox" type="checkbox" name="special[]" value="5" <?=$checkspecial[5]?>> <?=$lang['threads_special_debate']?>
<input class="checkbox" type="checkbox" name="special[]" value="6" <?=$checkspecial[6]?>> <?=$lang['threads_special_videos']?>
</div>
</td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_sticky']?></td>
<td class="altbg2" align="right">
<input class="radio" type="radio" name="sticky" value="0" <?=$checksticky[0]?>> <?=$lang['unlimited']?>
<input class="radio" type="radio" name="sticky" value="1" <?=$checksticky[1]?>> <?=$lang['threads_search_include_yes']?>
<input class="radio" type="radio" name="sticky" value="2" <?=$checksticky[2]?>> <?=$lang['threads_search_include_no']?></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_digest']?></td>
<td class="altbg2" align="right">
<input class="radio" type="radio" name="digest" value="0" <?=$checkdigest[0]?>> <?=$lang['unlimited']?>
<input class="radio" type="radio" name="digest" value="1" <?=$checkdigest[1]?>> <?=$lang['threads_search_include_yes']?>
<input class="radio" type="radio" name="digest" value="2" <?=$checkdigest[2]?>> <?=$lang['threads_search_include_no']?></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_blog']?></td>
<td class="altbg2" align="right">
<input class="radio" type="radio" name="blog" value="0" <?=$checkblog[0]?>> <?=$lang['unlimited']?>
<input class="radio" type="radio" name="blog" value="1" <?=$checkblog[1]?>> <?=$lang['threads_search_include_yes']?>
<input class="radio" type="radio" name="blog" value="2" <?=$checkblog[2]?>> <?=$lang['threads_search_include_no']?></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_search_attach']?></td>
<td class="altbg2" align="right">
<input class="radio" type="radio" name="attach" value="0" <?=$checkattach[0]?>> <?=$lang['unlimited']?>
<input class="radio" type="radio" name="attach" value="1" <?=$checkattach[1]?>> <?=$lang['threads_search_include_yes']?>
<input class="radio" type="radio" name="attach" value="2" <?=$checkattach[2]?>> <?=$lang['threads_search_include_no']?></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_rate']?></td>
<td class="altbg2" align="right">
<input class="radio" type="radio" name="rate" value="0" <?=$checkrate[0]?>> <?=$lang['unlimited']?>
<input class="radio" type="radio" name="rate" value="1" <?=$checkrate[1]?>> <?=$lang['threads_search_include_yes']?>
<input class="radio" type="radio" name="rate" value="2" <?=$checkrate[2]?>> <?=$lang['threads_search_include_no']?></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['threads_highlight']?></td>
<td class="altbg2" align="right">
<input class="radio" type="radio" name="highlight" value="0" <?=$checkhighlight[0]?>> <?=$lang['unlimited']?>
<input class="radio" type="radio" name="highlight" value="1" <?=$checkhighlight[1]?>> <?=$lang['threads_search_include_yes']?>
<input class="radio" type="radio" name="highlight" value="2" <?=$checkhighlight[2]?>> <?=$lang['threads_search_include_no']?></td>
</tr>
</tbody>
</table><br />
<center><input class="button" type="submit" name="searchsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
$tidsadd = isset($tids) ? 'tid IN ('.$tids.')' : 'tid IN ('.implodeids($tidarray).')';
if($operation == 'moveforum') {
$query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type<>'group' AND fid='$toforum'");
if(!$db->result($query, 0)) {
cpmsg('threads_move_invalid');
}
$db->query("UPDATE {$tablepre}threads SET fid='$toforum' WHERE $tidsadd");
$db->query("UPDATE {$tablepre}posts SET fid='$toforum' WHERE $tidsadd");
foreach(explode(',', $fids.','.$toforum) as $fid) {
updateforumcount(intval($fid));
}
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'movetype') {
if($totype != 0) {
$query = $db->query("SELECT typeid FROM {$tablepre}threadtypes WHERE typeid='$totype'");
if(!$db->result($query, 0)) {
cpmsg('threads_move_invalid');
}
}
$db->query("UPDATE {$tablepre}threads SET typeid='$totype' WHERE $tidsadd");
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'delete') {
$query = $db->query("SELECT attachment, thumb, remote FROM {$tablepre}attachments WHERE $tidsadd");
while($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
if(!$donotupdatemember) {
$tuidarray = $ruidarray = array();
$query = $db->query("SELECT first, authorid FROM {$tablepre}posts WHERE $tidsadd");
while($post = $db->fetch_array($query)) {
if($post['first']) {
$tuidarray[] = $post['authorid'];
} else {
$ruidarray[] = $post['authorid'];
}
}
if($tuidarray) {
updatepostcredits('-', $tuidarray, $creditspolicy['post']);
}
if($ruidarray) {
updatepostcredits('-', $ruidarray, $creditspolicy['reply']);
}
}
$db->query("DELETE FROM {$tablepre}attachments WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}posts WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}threads WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}polloptions WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}polls WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}rewardlog WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}trades WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}rewardlog WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}activities WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}activityapplies WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}debates WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}debateposts WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}threadsmod WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}relatedthreads WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}typeoptionvars WHERE $tidsadd", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}videos WHERE $tidsadd", 'UNBUFFERED');
if($globalstick) {
updatecache('globalstick');
}
foreach(explode(',', $fids) as $fid) {
updateforumcount(intval($fid));
}
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'deleteattach') {
$query = $db->query("SELECT attachment, thumb, remote FROM {$tablepre}attachments WHERE $tidsadd");
while($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
$db->query("DELETE FROM {$tablepre}attachments WHERE $tidsadd");
$db->query("UPDATE {$tablepre}threads SET attachment='0' WHERE $tidsadd");
$db->query("UPDATE {$tablepre}posts SET attachment='0' WHERE $tidsadd");
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'stick') {
$db->query("UPDATE {$tablepre}threads SET displayorder='$stick_level' WHERE $tidsadd");
if($globalstick) {
updatecache('globalstick');
}
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'adddigest') {
$query = $db->query("SELECT tid, authorid, digest FROM {$tablepre}threads WHERE $tidsadd");
while($thread = $db->fetch_array($query)) {
updatecredits($thread['authorid'], $creditspolicy['digest'], $digest_level - $thread['digest'], 'digestposts=digestposts-1');
}
$db->query("UPDATE {$tablepre}threads SET digest='$digest_level' WHERE $tidsadd");
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'addstatus') {
$db->query("UPDATE {$tablepre}threads SET closed='$status' WHERE $tidsadd");
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'supe_pushsetting' && $supe['status']) {
$db->query("UPDATE {$tablepre}threads SET supe_pushstatus='$supe_pushstatus' WHERE $tidsadd");
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
}
$tids && deletethreadcaches($tids);
$cpmsg = $cpmsg ? "alert('$cpmsg');" : '';
?>
<script><?=$cpmsg?>parent.$('threadforum').searchsubmit.click();</script>
<?
}
if(submitcheck('searchsubmit')) {
$sql = '';
if($inforum != '' && $inforum != 'all') {
$sql .= " AND fid='$inforum'";
}
if($intype != '' && $intype != 'all') {
$sql .= " AND typeid='$intype'";
}
if($viewsless != '') {
$sql .= " AND views<'$viewsless'";
}
if($viewsmore != '') {
$sql .= " AND views>'$viewsmore'";
}
if($repliesless != '') {
$sql .= " AND replies<'$repliesless'";
}
if($repliesmore != '') {
$sql .= " AND replies>'$repliesmore'";
}
if($readpermmore != '') {
$sql .= " AND readperm>'$readpermmore'";
}
if($pricemore != '') {
$sql .= " AND price>'$pricemore'";
}
if($beforedays != '') {
$sql .= " AND dateline<'$timestamp'-'$beforedays'*86400";
}
if($noreplydays != '') {
$sql .= " AND lastpost<'$timestamp'-'$noreplydays'*86400";
}
if($starttime != '') {
$starttime = strtotime($starttime);
$sql .= " AND dateline>'$starttime'";
}
if($endtime) {
$endtime = strtotime($endtime);
$sql .= " AND dateline<='$endtime'";
}
if(trim($keywords)) {
$sqlkeywords = '';
$or = '';
$keywords = explode(',', str_replace(' ', '', $keywords));
for($i = 0; $i < count($keywords); $i++) {
$sqlkeywords .= " $or subject LIKE '%".$keywords[$i]."%'";
$or = 'OR';
}
$sql .= " AND ($sqlkeywords)";
}
if(trim($users)) {
$sql .= " AND ".(empty($cins) ? 'BINARY' : '')." author IN ('".str_replace(',', '\',\'', str_replace(' ', '', $users))."')";
}
if($sticky == 1) {
$sql .= " AND displayorder>'0'";
} elseif($sticky == 2) {
$sql .= " AND displayorder='0'";
}
if($digest == 1) {
$sql .= " AND digest>'0'";
} elseif($digest == 2) {
$sql .= " AND digest='0'";
}
if($blog == 1) {
$sql .= " AND blog>'0'";
} elseif($blog == 2) {
$sql .= " AND blog='0'";
}
if($attach == 1) {
$sql .= " AND attachment>'0'";
} elseif($attach == 2) {
$sql .= " AND attachment='0'";
}
if($attach == 1) {
$sql .= " AND attachment>'0'";
} elseif($attach == 2) {
$sql .= " AND attachment='0'";
}
if($rate == 1) {
$sql .= " AND rate>'0'";
} elseif($rate == 2) {
$sql .= " AND rate='0'";
}
if($highlight == 1) {
$sql .= " AND highlight>'0'";
} elseif($highlight == 2) {
$sql .= " AND highlight='0'";
}
if(!empty($special)) {
$specials = $comma = '';
foreach($special as $val) {
$specials .= $comma.'\''.$val.'\'';
$comma = ',';
}
if($specialthread == 1) {
$sql .= " AND special IN ($specials)";
} elseif($specialthread == 2) {
$sql .= " AND special NOT IN ($specials)";
}
}
$fids = array();
$tids = $threadcount = '0';
if($sql) {
$sql = "digest>='0' AND displayorder>='0' $sql";
if($detail) {
$pagetmp = $page;
do{
$query = $db->query("SELECT fid, tid, readperm, price, subject, authorid, author, views, replies, lastpost FROM {$tablepre}threads WHERE $sql LIMIT ".(($pagetmp - 1) * $tpp).",$tpp");
$pagetmp--;
} while(!$db->num_rows($query) && $pagetmp);
$threads = '';
while($thread = $db->fetch_array($query)) {
$thread['lastpost'] = gmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600);
$threads .= "<tr><td align=\"center\" class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"tidarray[]\" value=\"$thread[tid]\" checked>\n".
"<td class=\"altbg2\"><a href=\"viewthread.php?tid=$thread[tid]\" target=\"_blank\">$thread[subject]</a>".($thread['readperm'] ? " - [$lang[threads_readperm] $thread[readperm]]" : '').($thread['price'] ? " - [$lang[threads_price] $thread[price]]" : '')."</td>\n".
"<td align=\"center\" class=\"altbg1\"><a href=\"forumdisplay.php?fid=$thread[fid]\" target=\"_blank\">{$_DCACHE[forums][$thread[fid]][name]}</a></td>\n".
"<td align=\"center\" class=\"altbg2\"><a href=\"space.php?action=viewpro&uid=$thread[authorid]\" target=\"_blank\">$thread[author]</a></td>\n".
"<td align=\"center\" class=\"altbg1\">$thread[replies]</td>\n".
"<td align=\"center\" class=\"altbg2\">$thread[views]</td>\n".
"<td align=\"center\" class=\"altbg1\">$thread[lastpost]</td></tr>\n";
}
$threadcount = $db->result($db->query("SELECT count(*) FROM {$tablepre}threads WHERE $sql"), 0);
$multi = multi($threadcount, $tpp, $page, "admincp.php?action=threads");
$multi = preg_replace("/href=\"admincp.php\?action=threads&page=(\d+)\"/", "href=\"javascript:page(\\1)\"", $multi);
$multi = str_replace("window.location='admincp.php?action=threads&page='+this.value", "page(this.value)", $multi);
} else {
$query = $db->query("SELECT fid, tid FROM {$tablepre}threads WHERE $sql");
while($thread = $db->fetch_array($query)) {
$fids[] = $thread['fid'];
$tids .= ','.$thread['tid'];
}
$threadcount = $db->result($db->query("SELECT count(*) FROM {$tablepre}threads WHERE $sql"), 0);
$multi = '';
}
}
$fids = implode(',', array_unique($fids));
?>
<br /><form method="post" action="admincp.php?action=threads" target="threadframe">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="2"><?=$lang['threads_result']?> <?=$threadcount?></td>
</tr>
<?
if(!$threadcount) {
echo '<tr><td class="altbg2" colspan="2">'.$lang['threads_thread_nonexistence'].'</td></tr>';
} else {
$typeselect = '';
$query = $db->query("SELECT * FROM {$tablepre}threadtypes ORDER BY displayorder");
while($type = $db->fetch_array($query)) {
$typeselect .= '<option value="'.$type['typeid'].'"> > '.$type['name'].($type['description'] ? ' ('.$type['description'].')' : '').'</option>';
}
if(!$detail) {
echo '<input type="hidden" name="tids" value="'.$tids.'">';
}
echo '<input type="hidden" name="fids" value="'.$fids.'">';
?>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="moveforum" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_move_forum']?></td>
<td class="altbg2"><select name="toforum"><?=forumselect()?></select></td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="movetype" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_move_type']?></td>
<td class="altbg2"><select name="totype"><option value="0"> > <?=$lang['threads_search_type_none']?></option><?=$typeselect?></select></td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="delete" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_delete']?></td>
<td class="altbg2"><input class="checkbox" type="checkbox" name="donotupdatemember" value="1" checked> <?=$lang['threads_delete_no_update_member']?></td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="stick" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_stick']?></td>
<td class="altbg2">
<input class="radio" type="radio" name="stick_level" value="0" checked> <?=$lang['threads_remove']?>
<input class="radio" type="radio" name="stick_level" value="1"> <?=$lang['forums_stick_one']?>
<input class="radio" type="radio" name="stick_level" value="2"> <?=$lang['forums_stick_two']?>
<input class="radio" type="radio" name="stick_level" value="3"> <?=$lang['forums_stick_three']?></td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="adddigest" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_add_digest']?></td>
<td class="altbg2">
<input class="radio" type="radio" name="digest_level" value="0" checked> <?=$lang['threads_remove']?>
<input class="radio" type="radio" name="digest_level" value="1"> <?=$lang['forums_digest_one']?>
<input class="radio" type="radio" name="digest_level" value="2"> <?=$lang['forums_digest_two']?>
<input class="radio" type="radio" name="digest_level" value="3"> <?=$lang['forums_digest_three']?></td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="addstatus" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_open_close']?></td>
<td class="altbg2">
<input class="radio" type="radio" name="status" value="0" checked> <?=$lang['open']?>
<input class="radio" type="radio" name="status" value="1"> <?=$lang['closed']?>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="deleteattach" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_delete_attach']?></td>
<td class="altbg2"> </td>
</tr>
<tr>
<td class="altbg1"><input class="radio" type="radio" name="operation" value="supe_pushsetting" onclick="this.form.modsubmit.disabled=false;"> <?=$lang['threads_push_supesite']?></td>
<td class="altbg2">
<input class="radio" type="radio" name="supe_pushstatus" value="2" checked> <?=$lang['threads_push']?>
<input class="radio" type="radio" name="supe_pushstatus" value="-2"> <?=$lang['threads_remove_push']?>
</tr>
<?
if($detail) {
?>
</table><br /><br /><?=$multi?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><input name="chkall" type="checkbox" class="checkbox" checked onclick="checkall(this.form, 'tidarray', 'chkall')"></td><td><?=$lang['subject']?></td><td><?=$lang['forum']?></td><td><?=$lang['author']?></td><td nowrap><?=$lang['threads_replies']?></td><td nowrap><?=$lang['threads_views']?></td><td><?=$lang['threads_lastpost']?></td></tr>
<?=$threads?>
<?
}
}
echo '</table>'.$multi.'<br /><center><input class="button" type="submit" name="modsubmit" value="'.$lang['submit'].'" disabled></center></form><iframe name="threadframe" style="display:none"></iframe>';
}
?> | zyyhong | trunk/jiaju001/bbs/admin/threads.inc.php | PHP | asf20 | 25,618 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: checktools.inc.php 10009 2007-08-22 06:33:18Z monkey $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if(!isfounder()) cpmsg('noaccess_isfounder');
if($action == 'filecheck') {
shownav('menu_tools_filecheck');
if(!isset($start)) {
cpmsg('filecheck_checking', 'admincp.php?action=filecheck&start=yes');
} else {
if(!$discuzfiles = @file('admin/discuzfiles.md5')) {
cpmsg('filecheck_nofound_md5file');
}
showtips('filecheck_tips');
$md5data = array();
$cachelist = checkcachefiles('forumdata/cache/');
checkfiles('./', '\.php', 0, 'config.inc.php');
checkfiles('include/', '\.php|\.htm|\.js');
checkfiles('templates/default/', '\.php|\.htm');
checkfiles('wap/', '\.php');
checkfiles('archiver/', '\.php');
checkfiles('api/', '\.php');
checkfiles('plugins/', '\.php');
checkfiles('admin/', '\.php');
foreach($discuzfiles as $line) {
$file = trim(substr($line, 34));
$md5datanew[$file] = substr($line, 0, 32);
if($md5datanew[$file] != $md5data[$file]) {
$modifylist[$file] = $md5data[$file];
}
$md5datanew[$file] = $md5data[$file];
}
$weekbefore = $timestamp - 604800;
$addlist = @array_merge(@array_diff_assoc($md5data, $md5datanew), $cachelist[2]);
$dellist = @array_diff_assoc($md5datanew, $md5data);
$modifylist = @array_merge(@array_diff_assoc($modifylist, $dellist), $cachelist[1]);
$showlist = @array_merge($md5data, $md5datanew, $cachelist[0]);
$dirlist = $dirlog = array();
foreach($showlist as $file => $md5) {
$dir = dirname($file);
$filelist = '<tr><td class="altbg1">'.basename($file).'</td>';
if(file_exists($file)) {
$filemtime = filemtime($file);
$filemtime = $filemtime > $weekbefore ? '<b>'.date("$dateformat $timeformat", $filemtime).'</b>' : date("$dateformat $timeformat", $filemtime);
$filelist .= '<td class="altbg2" style="text-align:right">'.number_format(filesize($file)).' Bytes </td><td class="altbg1">'.$filemtime.'</td>';
} else {
$filelist .= '<td class="altbg2"></td><td class="altbg1"></td>';
}
if(@array_key_exists($file, $modifylist)) {
$filelist .= '<td class="altbg2"><font color="#FF0000">'.$lang['filecheck_modify'].'</font></td></tr>';
$dirlog[$dir]['modify']++;
} elseif(@array_key_exists($file, $dellist)) {
$filelist .= '<td class="altbg2"><font color="#0000FF">'.$lang['filecheck_delete'].'</font></td></tr>';
$dirlog[$dir]['del']++;
} elseif(@array_key_exists($file, $addlist)) {
$filelist .= '<td class="altbg2"><font color="#00FF00">'.$lang['filecheck_unknown'].'</font></td></tr>';
$dirlog[$dir]['add']++;
} else {
$filelist .= '<td class="altbg2">'.$lang['filecheck_check_ok'].'</td></tr>';
}
$dirlist[$dir] .= $filelist;
}
}
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="4"><?=$lang['filecheck_completed']?></td></tr>
<tr><td colspan="4"><?=$lang['filecheck_modify'].': '.count($modifylist).' '.$lang['filecheck_delete'].': '.count($dellist).' '.$lang['filecheck_unknown'].': '.count($addlist)?></td></tr>
<?
foreach($dirlist as $dirname => $filelist) {
echo '<tr class="header"><td>'.$dirname.'/</td><td colspan="3" style="text-align:right">'.
($dirlog[$dirname]['modify'] ? $lang['filecheck_modify'].': '.$dirlog[$dirname]['modify'].' ' : '').
($dirlog[$dirname]['del'] ? $lang['filecheck_delete'].': '.$dirlog[$dirname]['del'].' ' : '').
($dirlog[$dirname]['add'] ? $lang['filecheck_unknown'].': '.$dirlog[$dirname]['add'].' ' : '').
'</td><tr><tr class="category"><td>'.$lang['filename'].'</td><td style="text-align:right">'.$lang['size'].' </td><td>'.$lang['filecheck_filemtime'].'</td><td>'.$lang['filecheck_status'].'</td></tr>'.$filelist;
}
?>
</td></tr></table>
<?
} elseif($action == 'dbcheck') {
shownav('menu_tools_dbcheck');
if(!$db->query("SHOW FIELDS FROM {$tablepre}settings", 'SILENT')) {
cpmsg('dbcheck_permissions_invalid');
}
if(!isset($start)) {
cpmsg('dbcheck_checking', 'admincp.php?action=dbcheck&start=yes');
} else {
if(!file_exists('admin/discuzdb.md5')) {
cpmsg('dbcheck_nofound_md5file');
}
include DISCUZ_ROOT.'./config.inc.php';
$dbcharset = empty($dbcharset) ? $charset : $dbcharset;
unset($dbuser, $dbpw, $dbname);
$fp = fopen(DISCUZ_ROOT.'./admin/discuzdb.md5', "rb");
$discuzdb = fread($fp, filesize(DISCUZ_ROOT.'./admin/discuzdb.md5'));
fclose($fp);
$dbmd5 = substr($discuzdb, 0, 32);
$discuzdb = unserialize(substr($discuzdb, 34));
$settingsdata = $discuzdb[1];
$discuzdb = $discuzdb[0][0];
$repair = !empty($repair) ? $repair : array();
$setting = !empty($setting) ? $setting : array();
$missingtable = !empty($missingtable) ? $missingtable : array();
$repairtable = is_array($repairtable) && !empty($repairtable) ? $repairtable : array();
$except = array('threads' => array('sgid'));
$query = $db->query("SELECT fieldid FROM {$tablepre}profilefields");
while($profilefields = $db->fetch_array($query)) {
$except['memberfields'][] = 'field_'.$profilefields[$fieldid];
}
if(submitcheck('repairsubmit') && (!empty($repair) || !empty($setting) || !empty($repairtable) || !empty($missingtable))) {
$error = '';$errorcount = 0;
$alter = $fielddefault = array();
foreach($missingtable as $value) {
if(!isset($installdata)) {
$fp = fopen(DISCUZ_ROOT.'./install/discuz.sql', "rb");
$installdata = fread($fp, filesize(DISCUZ_ROOT.'./install/discuz.sql'));
fclose($fp);
}
preg_match("/CREATE TABLE ".$tablepre.$value."\s+\(.+?;/is", $installdata, $a);
$db->query(createtable($a[0], $dbcharset));
}
foreach($repair as $value) {
if(!in_array($r_table, $repairtable)) {
list($r_table, $r_field, $option) = explode('|', $value);
if(!isset($repairrtable[$r_table]) && $fieldsquery = $db->query("SHOW FIELDS FROM $tablepre$r_table", 'SILENT')) {
while($fields = $db->fetch_array($fieldsquery)) {
$fielddefault[$r_table][$fields['Field']] = $fields['Default'];
}
}
$field = $discuzdb[$r_table][$r_field];
$altersql = '`'.$field['Field'].'` '.$field['Type'];
$altersql .= $field['Null'] == 'NO' ? ' NOT NULL' : '';
$altersql .= in_array($fielddefault[$r_table][$field['Field']], array('', '0')) && in_array($field['Default'], array('', '0')) ||
$field['Null'] == 'NO' && $field['Default'] == '' ||
preg_match('/text/i', $field['Type']) || preg_match('/auto_increment/i', $field['Extra']) ?
'' : ' default \''.$field['Default'].'\'';
$altersql .= $field['Extra'] != '' ? ' '.$field['Extra'] : '';
$altersql = $option == 'modify' ? "MODIFY COLUMN ".$altersql : "ADD COLUMN ".$altersql;
$alter[$r_table][] = $altersql;
}
}
foreach($alter as $r_table => $sqls) {
$db->query("ALTER TABLE `$tablepre$r_table` ".implode(',', $sqls), 'SILENT');
if($sqlerror = $db->error()) {
$errorcount += count($sqls);
$error .= $sqlerror.'<br /><br />';
}
}
$alter = array();
foreach($repairtable as $value) {
foreach($discuzdb[$value] as $field) {
if(!isset($fielddefault[$value]) && $fieldsquery = $db->query("SHOW FIELDS FROM $tablepre$value", 'SILENT')) {
while($fields = $db->fetch_array($fieldsquery)) {
$fielddefault[$value][$fields['Field']] = $fields['Default'];
}
}
$altersql = '`'.$field['Field'].'` '.$field['Type'];
$altersql .= $field['Null'] == 'NO' ? ' NOT NULL' : '';
$altersql .= in_array($fielddefault[$value][$field['Field']], array('', '0')) && in_array($field['Default'], array('', '0')) ||
$field['Null'] == 'NO' && $field['Default'] == '' ||
preg_match('/text/i', $field['Type']) || preg_match('/auto_increment/i', $field['Extra']) ?
'' : ' default \''.$field['Default'].'\'';
$altersql .= $field['Extra'] != '' ? ' '.$field['Extra'] : '';
$altersql = "MODIFY COLUMN ".$altersql;
$alter[$value][] = $altersql;
}
}
foreach($alter as $r_table => $sqls) {
$db->query("ALTER TABLE `$tablepre$r_table` ".implode(',', $sqls), 'SILENT');
if($sqlerror = $db->error()) {
$errorcount += count($sqls);
$error .= $sqlerror.'<br /><br />';
}
}
if(!empty($setting)) {
$settingsdatanow = array();
$settingsquery = $db->query("SELECT variable FROM {$tablepre}settings WHERE SUBSTRING(variable, 1, 9)<>'jswizard_' ORDER BY variable");
while($settings = $db->fetch_array($settingsquery)) {
$settingsdatanew[] = $settings['variable'];
}
$settingsdellist = @array_diff($settingsdata, $settingsdatanew);
if($setting['del'] && is_array($settingsdellist)) {
foreach($settingsdellist as $variable) {
$db->query("INSERT INTO {$tablepre}settings (variable, value) VALUES ('$variable', '')", 'SILENT');
}
}
updatecache('settings');
}
if($errorcount) {
cpmsg('dbcheck_repair_error');
} else {
cpmsg('dbcheck_repair_completed', 'admincp.php?action=dbcheck');
}
}
$installexists = file_exists(DISCUZ_ROOT.'./install/discuz.sql');
$discuzdbnew = $deltables = $excepttables = $missingtables = $charseterror = array();
foreach($discuzdb as $dbtable => $fields) {
if($fieldsquery = $db->query("SHOW FIELDS FROM $tablepre$dbtable", 'SILENT')) {
while($fields = $db->fetch_array($fieldsquery)) {
$r = '/^'.$tablepre.'/';
$cuttable = preg_replace($r, '', $dbtable);
if($db->version() < '4.1' && $cuttable == 'sessions' && $fields['Field'] == 'sid') {
$fields['Type'] = str_replace(' binary', '', $fields['Type']);
}
if($cuttable == 'memberfields' && preg_match('/^field\_\d+$/', $fields['Field'])) {
unset($discuzdbnew[$cuttable][$fields['Field']]);
continue;
}
$discuzdbnew[$cuttable][$fields['Field']]['Field'] = $fields['Field'];
$discuzdbnew[$cuttable][$fields['Field']]['Type'] = $fields['Type'];
$discuzdbnew[$cuttable][$fields['Field']]['Null'] = $fields['Null'] == '' ? 'NO' : $fields['Null'];
$discuzdbnew[$cuttable][$fields['Field']]['Extra'] = $fields['Extra'];
$discuzdbnew[$cuttable][$fields['Field']]['Default'] = $fields['Default'] == '' || $fields['Default'] == '0' ? '' : $fields['Default'];
}
ksort($discuzdbnew[$cuttable]);
} else {
$missingtables[] = '<span style="float:left;width:33%">'.(($installexists ? '<input name="missingtable[]" type="checkbox" class="checkbox" value="'.$dbtable.'">' : '').$tablepre.$dbtable).'</span>';
$excepttables[] = $dbtable;
}
}
if($db->version() > '4.1') {
$dbcharset = strtoupper($dbcharset) == 'UTF-8' ? 'UTF8' : strtoupper($dbcharset);
$query = $db->query("SHOW TABLE STATUS LIKE '$tablepre%'");
while($tables = $db->fetch_array($query)) {
$r = '/^'.$tablepre.'/';
$cuttable = preg_replace($r, '', $tables['Name']);
$tabledbcharset = substr($tables['Collation'], 0, strpos($tables['Collation'], '_'));
if($dbcharset != strtoupper($tabledbcharset)) {
$charseterror[] = '<span style="float:left;width:33%">'.$tablepre.$cuttable.'('.$tabledbcharset.')</span>';
}
}
}
$dbmd5new = md5(serialize($discuzdbnew));
$settingsdatanow = array();
$settingsquery = $db->query("SELECT variable FROM {$tablepre}settings WHERE SUBSTRING(variable, 1, 9)<>'jswizard_' ORDER BY variable");
while($settings = $db->fetch_array($settingsquery)) {
$settingsdatanew[] = $settings['variable'];
}
$settingsdellist = @array_diff($settingsdata, $settingsdatanew);
if($dbmd5 == $dbmd5new && empty($charseterror) && empty($settingsdellist)) {
cpmsg('dbcheck_ok');
}
$showlist = $addlists = '';
foreach($discuzdb as $dbtable => $fields) {
$addlist = $modifylist = $dellist = array();
if($fields != $discuzdbnew[$dbtable]) {
foreach($discuzdb[$dbtable] as $key => $value) {
if(is_array($missingtables) && in_array($tablepre.$dbtable, $missingtables)) {
} elseif(!isset($discuzdbnew[$dbtable][$key])) {
$dellist[] = $value;
} elseif($value != $discuzdbnew[$dbtable][$key]) {
$modifylist[] = $value;
}
}
if(is_array($discuzdbnew[$dbtable])) {
foreach($discuzdbnew[$dbtable] as $key => $value) {
if(!isset($discuzdb[$dbtable][$key]) && !@in_array($value['Field'], $except[$dbtable])) {
$addlist[] = $value;
}
}
}
}
if(($modifylist || $dellist) && !in_array($dbtable, $excepttables)) {
$showlist .= '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">';
$showlist .= "<tr class=\"header\"><td width=\"40%\"><b>$tablepre$dbtable</b> $lang[dbcheck_field]</td><td width=\"40%\">$lang[dbcheck_org_field]</td><td width=\"20%\">$lang[dbcheck_status]</td></tr>";
foreach($modifylist as $value) {
$showlist .= "<tr class=\"altbg2\"><td><input name=\"repair[]\" class=\"checkbox\" type=\"checkbox\" value=\"$dbtable|$value[Field]|modify\"> <b>".$value['Field']."</b> ".
$discuzdbnew[$dbtable][$value['Field']]['Type'].
($discuzdbnew[$dbtable][$value['Field']]['Null'] == 'NO' ? ' NOT NULL' : '').
(!preg_match('/auto_increment/i', $discuzdbnew[$dbtable][$value['Field']]['Extra']) && !preg_match('/text/i', $discuzdbnew[$dbtable][$value['Field']]['Type']) ? ' default \''.$discuzdbnew[$dbtable][$value['Field']]['Default'].'\'' : '').
' '.$discuzdbnew[$dbtable][$value['Field']]['Extra'].
"</td><td><b>".$value['Field']."</b> ".$value['Type'].
($value['Null'] == 'NO' ? ' NOT NULL' : '').
(!preg_match('/auto_increment/i', $value['Extra']) && !preg_match('/text/i', $value['Type']) ? ' default \''.$value['Default'].'\'' : '').
' '.$value['Extra']."</td><td>".
"<font color=\"#FF0000\">$lang[dbcheck_modify]</font></td></tr>";
}
if($modifylist) {
$showlist .= "<tr class=\"altbg1\"><td colspan=\"3\"><input onclick=\"setrepaircheck(this, this.form, '$dbtable')\" name=\"repairtable[]\" class=\"checkbox\" type=\"checkbox\" value=\"$dbtable\"> <b>$lang[dbcheck_repairtable]</b></td></tr>";
}
foreach($dellist as $value) {
$showlist .= "<tr class=\"altbg2\"><td><input name=\"repair[]\" class=\"checkbox\" type=\"checkbox\" value=\"$dbtable|$value[Field]|add\"> <strike><b>".$value['Field']."</b></strike></td><td> <b>".$value['Field']."</b> ".$value['Type'].($value['Null'] == 'NO' ? ' NOT NULL' : '')."</td><td>".
"<font color=\"#0000FF\">$lang[dbcheck_delete]</font></td></tr>";
}
$showlist .= '</td></tr></table><br />';
}
if($addlist) {
$addlists .= "<tr class=\"category\"><td><b>$tablepre$dbtable</b> $lang[dbcheck_new_field]</td></tr>";
foreach($addlist as $value) {
$addlists .= "<tr><td class=\"altbg1\"> <b>".$value['Field']."</b> ".$discuzdbnew[$dbtable][$value['Field']]['Type'].($discuzdbnew[$dbtable][$value['Field']]['Null'] == 'NO' ? ' NOT NULL' : '')."</td></tr>";
}
}
}
if($showlist) {
$showlist = '<tr class="header"><td colspan="3">'.$lang['dbcheck_errorfields_tables'].'</td></tr><tr><td class="altbg1" colspan="3"><br />'.$showlist.'</td></tr>';
}
if($missingtables) {
$showlist .= "<tr class=\"header\"><td colspan=\"3\">$lang[dbcheck_missing_tables]</td></tr>";
$showlist .= '<tr class="altbg1"><td colspan="3">'.implode('', $missingtables).'</td></tr>';
}
if($settingsdellist) {
$showlist .= "<tr class=\"header\"><td colspan=\"3\">$lang[dbcheck_settings]</td></tr>";
$showlist .= '<tr class="altbg1"><td colspan="3">';
$showlist .= "<input name=\"setting[del]\" class=\"checkbox\" type=\"checkbox\" value=\"1\"> ".implode(', ', $settingsdellist).'<br />';
$showlist .= '</td></tr>';
}
$showlist = $showlist ? '<form method="post" action="admincp.php?action=dbcheck&start=yes"><input type="hidden" name="formhash" value="'.FORMHASH.'">'.
'<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'.$showlist.'</table><br /><center>'.
'<input type="submit" class="button" name="repairsubmit" value="'.$lang['dbcheck_repair'].'"></center></form>' : '';
if($charseterror) {
$showlist .= '<br /><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">';
$showlist .= "<tr class=\"header\"><td colspan=\"3\">$lang[dbcheck_charseterror_tables] ($lang[dbcheck_charseterror_notice] $dbcharset)</td></tr>";
$showlist .= '<tr class="altbg1"><td colspan="3">'.implode('', $charseterror).'</td></tr></table>';
}
if($addlists) {
$showlist .= '<br /><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'.
'<tr class="header"><td colspan="3">'.$lang['dbcheck_userfields'].'</td></tr>'.$addlists.'</table>';
}
}
if(!$showlist) {
cpmsg('dbcheck_ok');
} else {
showtips('dbcheck_tips');
?>
<script type="text/javascript">
function setrepaircheck(obj, form, table) {
eval('var rem = /^' + table + '\\|.+?\\|modify$/;');
eval('var rea = /^' + table + '\\|.+?\\|add$/;');
for(var i = 0; i < form.elements.length; i++) {
var e = form.elements[i];
if(e.type == 'checkbox' && e.name == 'repair[]') {
if(rem.exec(e.value) != null) {
if(obj.checked) {
e.checked = false;
e.disabled = true;
} else {
e.checked = false;
e.disabled = false;
}
}
if(rea.exec(e.value) != null) {
if(obj.checked) {
e.checked = true;
e.disabled = false;
} else {
e.checked = false;
e.disabled = false;
}
}
}
}
}
</script>
<?
echo $showlist;
}
?>
</form>
<?
} elseif($action == 'ftpcheck') {
require_once './include/ftp.func.php';
if(!empty($settingsnew['ftp']['password'])) {
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='ftp'");
$settings['ftp'] = unserialize($db->result($query, 0));
$settings['ftp']['password'] = authcode($settings['ftp']['password'], 'DECODE', md5($authkey));
$pwlen = strlen($settingsnew['ftp']['password']);
if($settingsnew['ftp']['password']{0} == $settings['ftp']['password']{0} && $settingsnew['ftp']['password']{$pwlen - 1} == $settings['ftp']['password']{strlen($settings['ftp']['password']) - 1} && substr($settingsnew['ftp']['password'], 1, $pwlen - 2) == '********') {
$settingsnew['ftp']['password'] = $settings['ftp']['password'];
}
}
$ftp['pasv'] = intval($settingsnew['ftp']['pasv']);
$ftp_conn_id = dftp_connect($settingsnew['ftp']['host'], $settingsnew['ftp']['username'], $settingsnew['ftp']['password'], $settingsnew['ftp']['attachdir'], $settingsnew['ftp']['port'], $settingsnew['ftp']['ssl'], 1);
switch($ftp_conn_id) {
case '-1':
$alertmsg = $lang['settings_remote_conerr'];
break;
case '-2':
$alertmsg = $lang['settings_remote_logerr'];
break;
case '-3':
$alertmsg = $lang['settings_remote_pwderr'];
break;
case '-4':
$alertmsg = $lang['settings_remote_ftpoff'];
break;
default:
$alertmsg = '';
}
if(!$alertmsg) {
$tmpdir = md5('Discuz!' + $timestamp);
if(!dftp_mkdir($ftp_conn_id, $tmpdir)) {
$alertmsg = $lang['settings_remote_mderr'];
} else {
if(!(function_exists('ftp_chmod') && dftp_chmod($ftp_conn_id, 0777, $tmpdir)) && !dftp_site($ftp_conn_id, "'CHMOD 0777 $tmpdir'") && !@ftp_exec($ftp_conn_id, "SITE CHMOD 0777 $tmpdir")) {
$alertmsg = $lang['settings_remote_chmoderr'].'\n';
}
$tmpfile = $tmpdir.'/test.txt';
if(!dftp_put($ftp_conn_id, $tmpfile, DISCUZ_ROOT.'./robots.txt', FTP_BINARY)) {
$alertmsg .= $lang['settings_remote_uperr'];
dftp_delete($ftp_conn_id, $tmpfile);
dftp_delete($ftp_conn_id, $tmpfile.'.uploading');
dftp_delete($ftp_conn_id, $tmpfile.'.abort');
dftp_rmdir($ftp_conn_id, $tmpdir);
} else {
if(!@readfile($settingsnew['ftp']['attachurl'].'/'.$tmpfile)) {
$alertmsg .= $lang['settings_remote_geterr'];
dftp_delete($ftp_conn_id, $tmpfile);
dftp_rmdir($ftp_conn_id, $tmpdir);
} else {
if(!dftp_delete($ftp_conn_id, $tmpfile)) {
$alertmsg .= $lang['settings_remote_delerr'];
} else {
dftp_rmdir($ftp_conn_id, $tmpdir);
$alertmsg = $lang['settings_remote_ok'];
}
}
}
}
}
echo '<script language="javascript">alert(\''.str_replace('\'', '\\\'', $alertmsg).'\');parent.$(\'settings\').action=\'admincp.php?action=settings&edit=yes\';parent.$(\'settings\').target=\'_self\'</script>';
} elseif($action == 'mailcheck') {
$mail = serialize($settingsnew['mail']);
$test_tos = explode(',', $test_to);
$date = date('Y-m-d H:i:s');
$alertmsg = '';
$title = $lang['settings_mailcheck_title_'.$settingsnew['mail']['mailsend']];
$message = $lang['settings_mailcheck_message_'.$settingsnew['mail']['mailsend']].' '.$test_from.$lang['settings_mailcheck_date'].' '.$date;
$bbname = $lang['settings_mailcheck_method_1'];
sendmail($test_tos[0], $title.' @ '.$date, "$bbname\n\n\n$message", $test_from);
$bbname = $lang['settings_mailcheck_method_2'];
sendmail($test_to, $title.' @ '.$date, "$bbname\n\n\n$message", $test_from);
if(!$alertmsg) {
$alertmsg = $lang['settings_mailcheck_success_1']."$title @ $date".$lang['settings_mailcheck_success_2'];
} else {
$alertmsg = $lang['settings_mailcheck_error'].$alertmsg;
}
echo '<script language="javascript">alert(\''.str_replace(array('\'', "\n", "\r"), array('\\\'', '\n', ''), $alertmsg).'\');parent.$(\'settings\').action=\'admincp.php?action=settings&edit=yes\';parent.$(\'settings\').target=\'_self\'</script>';
} elseif($action == 'imagepreview') {
if(!empty($previewthumb)) {
$thumbstatus = $settingsnew['thumbstatus'];
if(!$thumbstatus) {
cpmsg('thumbpreview_error');
}
$imagelib = $settingsnew['imagelib'];
$imageimpath = $settingsnew['imageimpath'];
$thumbwidth = $settingsnew['thumbwidth'];
$thumbheight = $settingsnew['thumbheight'];
require_once DISCUZ_ROOT.'./include/image.class.php';
@unlink(DISCUZ_ROOT.'./forumdata/watermark_temp.jpg');
$image = new Image('images/admincp/watermarkpreview.jpg', 'images/admincp/watermarkpreview.jpg');
$image->Thumb($thumbwidth, $thumbheight, 1);
if(file_exists(DISCUZ_ROOT.'./forumdata/watermark_temp.jpg')) {
shownav('imagepreview_thumb');
echo '<center><img src="forumdata/watermark_temp.jpg?'.random(5).'"></center>';
} else {
cpmsg('thumbpreview_createerror');
}
} else {
$watermarkstatus = $settingsnew['watermarkstatus'];
if(!$watermarkstatus) {
cpmsg('watermarkpreview_error');
}
$imagelib = $settingsnew['imagelib'];
$imageimpath = $settingsnew['imageimpath'];
$watermarktype = $settingsnew['watermarktype'];
$watermarktrans = $settingsnew['watermarktrans'];
$watermarkquality = $settingsnew['watermarkquality'];
$watermarkminwidth = $settingsnew['watermarkminwidth'];
$watermarkminheight = $settingsnew['watermarkminheight'];
$settingsnew['watermarktext']['size'] = intval($settingsnew['watermarktext']['size']);
$settingsnew['watermarktext']['angle'] = intval($settingsnew['watermarktext']['angle']);
$settingsnew['watermarktext']['shadowx'] = intval($settingsnew['watermarktext']['shadowx']);
$settingsnew['watermarktext']['shadowy'] = intval($settingsnew['watermarktext']['shadowy']);
$settingsnew['watermarktext']['translatex'] = intval($settingsnew['watermarktext']['translatex']);
$settingsnew['watermarktext']['translatey'] = intval($settingsnew['watermarktext']['translatey']);
$settingsnew['watermarktext']['skewx'] = intval($settingsnew['watermarktext']['skewx']);
$settingsnew['watermarktext']['skewy'] = intval($settingsnew['watermarktext']['skewy']);
$settingsnew['watermarktext']['fontpath'] = str_replace(array('\\', '/'), '', $settingsnew['watermarktext']['fontpath']);
$settingsnew['watermarktext']['color'] = preg_replace('/#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/e', "hexdec('\\1').','.hexdec('\\2').','.hexdec('\\3')", $settingsnew['watermarktext']['color']);
$settingsnew['watermarktext']['shadowcolor'] = preg_replace('/#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/e', "hexdec('\\1').','.hexdec('\\2').','.hexdec('\\3')", $settingsnew['watermarktext']['shadowcolor']);
if($watermarktype == 2) {
if($settingsnew['watermarktext']['fontpath']) {
$fontpath = $settingsnew['watermarktext']['fontpath'];
$fontpathnew = 'ch/'.$fontpath;
$settingsnew['watermarktext']['fontpath'] = file_exists('images/fonts/'.$fontpathnew) ? $fontpathnew : '';
if(!$settingsnew['watermarktext']['fontpath']) {
$fontpathnew = 'en/'.$fontpath;
$settingsnew['watermarktext']['fontpath'] = file_exists('images/fonts/'.$fontpathnew) ? $fontpathnew : '';
}
if(!$settingsnew['watermarktext']['fontpath']) {
cpmsg('watermarkpreview_fontpath_error');
}
$settingsnew['watermarktext']['fontpath'] = 'images/fonts/'.$settingsnew['watermarktext']['fontpath'];
}
if($settingsnew['watermarktext']['text'] && strtoupper($charset) != 'UTF-8') {
include DISCUZ_ROOT.'include/chinese.class.php';
$c = new Chinese($charset, 'utf8');
$settingsnew['watermarktext']['text'] = $c->Convert($settingsnew['watermarktext']['text']);
}
$settingsnew['watermarktext']['text'] = bin2hex($settingsnew['watermarktext']['text']);
$watermarktext = $settingsnew['watermarktext'];
}
require_once DISCUZ_ROOT.'./include/image.class.php';
@unlink(DISCUZ_ROOT.'./forumdata/watermark_temp.jpg');
$image = new Image('images/admincp/watermarkpreview.jpg', 'images/admincp/watermarkpreview.jpg');
$image->Watermark(1);
if(file_exists(DISCUZ_ROOT.'./forumdata/watermark_temp.jpg')) {
shownav('imagepreview_watermark');
echo '<center><br /><img src="forumdata/watermark_temp.jpg?'.random(5).'"></center>';
} else {
cpmsg('watermarkpreview_createerror');
}
}
}
function createtable($sql, $dbcharset) {
$type = strtoupper(preg_replace("/^\s*CREATE TABLE\s+.+\s+\(.+?\).*(ENGINE|TYPE)\s*=\s*([a-z]+?).*$/isU", "\\2", $sql));
$type = in_array($type, array('MYISAM', 'HEAP')) ? $type : 'MYISAM';
return preg_replace("/^\s*(CREATE TABLE\s+.+\s+\(.+?\)).*$/isU", "\\1", $sql).
(mysql_get_server_info() > '4.1' ? " ENGINE=$type default CHARSET=$dbcharset" : " TYPE=$type");
}
function checkfiles($currentdir, $ext = '', $sub = 1, $skip = '') {
global $md5data;
$dir = @opendir(DISCUZ_ROOT.$currentdir);
$exts = '/('.$ext.')$/i';
$skips = explode(',', $skip);
while($entry = @readdir($dir)) {
$file = $currentdir.$entry;
if($entry != '.' && $entry != '..' && (preg_match($exts, $entry) || $sub && is_dir($file)) && !in_array($entry, $skips)) {
if($sub && is_dir($file)) {
checkfiles($file.'/', $ext, $sub, $skip);
} else {
$md5data[$file] = md5_file($file);
}
}
}
}
function checkcachefiles($currentdir) {
global $authkey;
$dir = opendir($currentdir);
$exts = '/\.php$/i';
$showlist = $modifylist = $addlist = array();
while($entry = readdir($dir)) {
$file = $currentdir.$entry;
if($entry != '.' && $entry != '..' && preg_match($exts, $entry)) {
$fp = fopen($file, "rb");
$cachedata = fread($fp, filesize($file));
fclose($fp);
if(preg_match("/^<\?php\n\/\/Discuz! cache file, DO NOT modify me!\n\/\/Created: [\w\s,:]+\n\/\/Identify: (\w{32})\n\n(.+?)\?>$/s", $cachedata, $match)) {
$showlist[$file] = $md5 = $match[1];
$cachedata = $match[2];
if(md5($entry.$cachedata.$authkey) != $md5) {
$modifylist[$file] = $md5;
}
} else {
$showlist[$file] = $addlist[$file] = '';
}
}
}
return array($showlist, $modifylist, $addlist);
}
function checkmailerror($type, $error) {
global $alertmsg;
$alertmsg .= !$alertmsg ? $error : '';
}
?> | zyyhong | trunk/jiaju001/bbs/admin/checktools.inc.php | PHP | asf20 | 28,401 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: counter.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if(!submitcheck('forumsubmit', 1) && !submitcheck('digestsubmit', 1) && !submitcheck('membersubmit', 1) && !submitcheck('threadsubmit', 1) && !submitcheck('movedthreadsubmit', 1) && !submitcheck('cleanupsubmit', 1)) {
shownav('menu_tools_updatecounters');
?>
<form method="post" action="admincp.php?action=counter">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['counter_forum']?></td></tr>
<tr class="altbg2">
<td width="15%"><?=$lang['counter_amount']?></td><td><input type="text" name="pertask" value="15"></td>
</tr></table><br /><center>
<input class="button" type="submit" name="forumsubmit" value="<?=$lang['submit']?>">
<input class="button" type="reset" value="<?=$lang['reset']?>"></center></form><br />
<form method="post" action="admincp.php?action=counter">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['counter_digest']?></td></tr>
<tr class="altbg2">
<td width="15%"><?=$lang['counter_amount']?></td><td><input type="text" name="pertask" value="1000"></td>
</tr></table><br /><center>
<input class="button" type="submit" name="digestsubmit" value="<?=$lang['submit']?>">
<input class="button" type="reset" value="<?=$lang['reset']?>"></center></form><br />
<form method="post" action="admincp.php?action=counter">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['counter_member']?></td></tr>
<tr class="altbg2">
<td width="15%"><?=$lang['counter_amount']?></td><td><input type="text" name="pertask" value="1000"></td>
</tr></table><br /><center>
<input class="button" type="submit" name="membersubmit" value="<?=$lang['submit']?>">
<input class="button" type="reset" value="<?=$lang['reset']?>"></center></form><br />
<form method="post" action="admincp.php?action=counter">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['counter_thread']?></td></tr>
<tr class="altbg2">
<td width="15%"><?=$lang['counter_amount']?></td><td><input type="text" name="pertask" value="500"></td></tr>
</table><br /><center>
<input class="button" type="submit" name="threadsubmit" value="<?=$lang['submit']?>">
<input class="button" type="reset" value="<?=$lang['reset']?>"></center></form><br />
<form method="post" action="admincp.php?action=counter">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['counter_moved_thread']?></td></tr>
<tr class="altbg2">
<td width="15%"><?=$lang['counter_amount']?></td><td><input type="text" name="pertask" value="100"></td></tr>
</table><br /><center>
<input class="button" type="submit" name="movedthreadsubmit" value="<?=$lang['submit']?>">
<input class="button" type="reset" value="<?=$lang['reset']?>"></center></form><br />
<form method="post" action="admincp.php?action=counter">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['counter_moved_favorites_logs']?></td></tr>
<tr class="altbg2">
<td width="15%"><?=$lang['counter_amount']?></td><td><input type="text" name="pertask" value="100"></td></tr>
</table><br /><center>
<input class="button" type="submit" name="cleanupsubmit" value="<?=$lang['submit']?>">
<input class="button" type="reset" value="<?=$lang['reset']?>"></center></form>
<?
} elseif(submitcheck('forumsubmit', 1)) {
if(!$current) {
$current = 0;
}
$pertask = intval($pertask);
$current = intval($current);
$next = $current + $pertask;
$nextlink = "admincp.php?action=counter¤t=$next&pertask=$pertask&forumsubmit=yes";
$processed = 0;
$queryf = $db->query("SELECT fid FROM {$tablepre}forums WHERE type<>'group' LIMIT $current, $pertask");
while($forum = $db->fetch_array($queryf)) {
$processed = 1;
$query = $db->query("SELECT COUNT(*) AS threads, SUM(replies)+COUNT(*) AS posts FROM {$tablepre}threads WHERE fid='$forum[fid]' AND displayorder>='0'");
extract($db->fetch_array($query));
$query = $db->query("SELECT tid, subject, lastpost, lastposter FROM {$tablepre}threads WHERE fid='$forum[fid]' AND displayorder>='0' ORDER BY lastpost DESC LIMIT 1");
$thread = $db->fetch_array($query);
$lastpost = addslashes("$thread[tid]\t$thread[subject]\t$thread[lastpost]\t$thread[lastposter]");
$db->query("UPDATE {$tablepre}forums SET threads='$threads', posts='$posts', lastpost='$lastpost' WHERE fid='$forum[fid]'");
}
if($processed) {
cpmsg("$lang[counter_forum]: $lang[counter_processing]", $nextlink);
} else {
$db->query("UPDATE {$tablepre}forums SET threads='0', posts='0' WHERE type='group'");
cpmsg('counter_forum_succeed');
}
} elseif(submitcheck('digestsubmit', 1)) {
if(!$current) {
$db->query("UPDATE {$tablepre}members SET digestposts=0", 'UNBUFFERED');
$current = 0;
}
$pertask = intval($pertask);
$current = intval($current);
$next = $current + $pertask;
$nextlink = "admincp.php?action=counter¤t=$next&pertask=$pertask&digestsubmit=yes";
$processed = 0;
$membersarray = $postsarray = array();
$query = $db->query("SELECT authorid FROM {$tablepre}threads WHERE digest<>'0' AND displayorder>='0' LIMIT $current, $pertask");
while($thread = $db->fetch_array($query)) {
$processed = 1;
$membersarray[$thread['authorid']]++;
}
foreach($membersarray as $uid => $posts) {
$postsarray[$posts] .= ','.$uid;
}
unset($membersarray);
foreach($postsarray as $posts => $uids) {
$db->query("UPDATE {$tablepre}members SET digestposts=digestposts+'$posts' WHERE uid IN (0$uids)", 'UNBUFFERED');
}
if($processed) {
cpmsg("$lang[counter_digest]: $lang[counter_processing]", $nextlink);
} else {
cpmsg('counter_digest_succeed');
}
} elseif(submitcheck('membersubmit', 1)) {
if(!$current) {
$current = 0;
}
$pertask = intval($pertask);
$current = intval($current);
$next = $current + $pertask;
$nextlink = "admincp.php?action=counter¤t=$next&pertask=$pertask&membersubmit=yes";
$processed = 0;
$queryt = $db->query("SELECT uid FROM {$tablepre}members LIMIT $current, $pertask");
while($mem = $db->fetch_array($queryt)) {
$processed = 1;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE authorid='$mem[uid]' AND invisible='0'");
$db->query("UPDATE {$tablepre}members SET posts='".$db->result($query, 0)."' WHERE uid='$mem[uid]'");
}
if($processed) {
cpmsg("$lang[counter_member]: $lang[counter_processing]", $nextlink);
} else {
cpmsg('counter_member_succeed');
}
} elseif(submitcheck('threadsubmit', 1)) {
if(!$current) {
$current = 0;
}
$pertask = intval($pertask);
$current = intval($current);
$next = $current + $pertask;
$nextlink = "admincp.php?action=counter¤t=$next&pertask=$pertask&threadsubmit=yes";
$processed = 0;
$queryt = $db->query("SELECT tid FROM {$tablepre}threads WHERE displayorder>='0' LIMIT $current, $pertask");
while($threads = $db->fetch_array($queryt)) {
$processed = 1;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='$threads[tid]' AND invisible='0'");
$replynum = $db->result($query, 0);
$replynum--;
$db->query("UPDATE {$tablepre}threads SET replies='$replynum' WHERE tid='$threads[tid]'");
}
if($processed) {
cpmsg("$lang[counter_thread]: $lang[counter_processing]", $nextlink);
} else {
cpmsg('counter_thread_succeed');
}
} elseif(submitcheck('movedthreadsubmit', 1)) {
if(!$current) {
$current = 0;
}
$pertask = intval($pertask);
$current = intval($current);
$next = $current + $pertask;
$nextlink = "admincp.php?action=counter¤t=$next&pertask=$pertask&movedthreadsubmit=yes";
$processed = 0;
$tids = 0;
$query = $db->query("SELECT t1.tid, t2.tid AS threadexists FROM {$tablepre}threads t1
LEFT JOIN {$tablepre}threads t2 ON t2.tid=t1.closed AND t2.displayorder>='0'
WHERE t1.closed>'1' LIMIT $current, $pertask");
while($thread = $db->fetch_array($query)) {
$processed = 1;
if($thread['threadexists']) {
$tids .= ','.$thread['tid'];
}
}
if($tids) {
$db->query("DELETE FROM {$tablepre}threads WHERE tid IN ($tids)", 'UNBUFFERED');
}
if($processed) {
cpmsg("$lang[counter_moved_thread]: $lang[counter_processing]", $nextlink);
} else {
cpmsg('counter_moved_thread_succeed');
}
} elseif(submitcheck('cleanupsubmit', 1)) {
if(!$current) {
$current = 0;
}
$pertask = intval($pertask);
$current = intval($current);
$next = $current + $pertask;
$nextlink = "admincp.php?action=counter¤t=$next&pertask=$pertask&cleanupsubmit=yes";
$processed = 0;
$queryt = $db->query("SELECT tid,fid FROM {$tablepre}favorites LIMIT $current, $pertask");
while($fav = $db->fetch_array($queryt)) {
$processed = 1;
if($fav['tid']) {
$favtid[]= $fav['tid'];
} elseif($fav['fid']) {
$favfid[]= $fav['fid'];
}
}
if(!empty($favtid)) {
foreach($favtid as $tid) {
$query = $db->query("SELECT tid FROM {$tablepre}threads WHERE tid='$tid'");
if(!$db->result($query, 0)) {
$db->query("DELETE FROM {$tablepre}favorites WHERE tid='$tid'");
$db->query("DELETE FROM {$tablepre}rewardlog WHERE tid='$tid'");
}
}
}
if(!empty($favfid)) {
foreach($favfid as $fid) {
$query = $db->query("SELECT fid FROM {$tablepre}forums WHERE fid='$fid'");
if(!$db->result($query, 0)) {
$db->query("DELETE FROM {$tablepre}favorites WHERE fid='$fid'");
}
}
}
if($processed) {
cpmsg("$lang[counter_moved_favorites_logs]: $lang[counter_processing]", $nextlink);
} else {
cpmsg('counter_moved_favorites_logs_succeed');
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/counter.inc.php | PHP | asf20 | 10,630 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: home.inc.php 10314 2007-08-25 10:28:50Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
if(@file_exists(DISCUZ_ROOT.'./install.php')) {
@unlink(DISCUZ_ROOT.'./install.php');
if(@file_exists(DISCUZ_ROOT.'./install.php')) {
dexit('Please delete install.php via FTP!');
}
}
@include_once DISCUZ_ROOT.'./discuz_version.php';
require_once DISCUZ_ROOT.'./include/attachment.func.php';
$siteuniqueid = $db->result($db->query("SELECT value FROM {$tablepre}settings WHERE variable='siteuniqueid'"), 0);
if(empty($siteuniqueid) || strlen($siteuniqueid) < 16) {
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
$siteuniqueid = $chars[date('y')%60].$chars[date('n')].$chars[date('j')].$chars[date('G')].$chars[date('i')].$chars[date('s')].substr(md5($onlineip.$discuz_user.$timestamp), 0, 4).random(6);
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('siteuniqueid', '$siteuniqueid')");
}
if(empty($_DCACHE['settings']['authkey']) || strlen($_DCACHE['settings']['authkey']) < 16) {
$authkey = $_DCACHE['settings']['authkey'] = substr(md5($siteuniqueid.$bbname.$timestamp), 8, 8).random(8);
$db->query("REPLACE INTO {$tablepre}settings SET variable='authkey', value='$authkey'");
updatesettings();
}
$onlines = array();
$query = $db->query("SELECT a.*, m.username, m.adminid, m.regip
FROM {$tablepre}adminsessions a
LEFT JOIN {$tablepre}members m USING(uid) ORDER BY a.errorcount");
while($member = $db->fetch_array($query)) {
$memlink = '<a href="space.php?action=viewpro&uid='.$member['uid'].'" target="_blank" alt="'.
"$lang[time]: ".gmdate("$dateformat $timeformat", $member['dateline'] + $timeoffset * 3600)."\n".
($member['errorcount'] == -1 ? '' : "$lang[home_onlines_errors]: $member[errorcount]\n").
($allowviewip && ($adminid <= $member['adminid'] || $member['adminid'] <= 0) ? "$lang[home_online_regip]: ".
"$member[regip]\n$lang[home_onlines_ip]: $member[ip]" : '').'">'.
$member['username'].'</a>';
$onlines[] = $member['errorcount'] == -1 ? $memlink : "<i>$memlink</i>";
}
if(submitcheck('notesubmit')) {
if(is_array($delete)) {
$db->query("DELETE FROM {$tablepre}adminnotes WHERE id IN ('".implode('\',\'', $delete)."') AND (admin='$discuz_user' OR adminid>='$adminid')");
}
if($newmessage) {
$newaccess[$adminid] = 1;
$newaccess = bindec(intval($newaccess[1]).intval($newaccess[2]).intval($newaccess[3]));
$newexpiration = strtotime($newexpiration) - $timeoffset * 3600 + date('Z');
$newmessage = nl2br(dhtmlspecialchars($newmessage));
$db->query("INSERT INTO {$tablepre}adminnotes (admin, access, adminid, dateline, expiration, message)
VALUES ('$discuz_user', '$newaccess', '$adminid', '$timestamp', '$newexpiration', '$newmessage')");
}
}
switch($adminid) {
case 1: $access = '4,5,6,7'; break;
case 2: $access = '2,3,6,7'; break;
default: $access = '1,3,5,7'; break;
}
$notes = '';
$query = $db->query("SELECT * FROM {$tablepre}adminnotes WHERE access IN ($access) ORDER BY dateline DESC");
while($note = $db->fetch_array($query)) {
if($note['expiration'] < $timestamp) {
$db->query("DELETE FROM {$tablepre}adminnotes WHERE id='$note[id]'");
} else {
$note['adminenc'] = rawurlencode($note['admin']);
$note['dateline'] = gmdate("$dateformat $timeformat", $note['dateline'] + $timeoffset * 3600);
$note['expiration'] = gmdate($dateformat, $note['expiration'] + $timeoffset * 3600);
$note['access'] = sprintf('%03b', $note['access']);
$notes .= "<tr class=\"smalltxt\"><td class=\"altbg1\" align=\"center\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" ".($note['admin'] == $discuz_userss || $note['adminid'] >= $adminid ? "value=\"$note[id]\"" : 'disabled')."></td>\n".
"<td class=\"altbg2\" align=\"center\"><a href=\"space.php?action=viewpro&username=$note[adminenc]\" target=\"_blank\">$note[admin]</a></td>\n".
"<td class=\"altbg1\" align=\"center\">$note[dateline]</td>\n".
"<td class=\"altbg2\"><b>$note[message]</b></td>\n".
"<td class=\"altbg1\" align=\"center\">".($note['access'][0] ? $lang['yes'] : '')."</td>\n".
"<td class=\"altbg2\" align=\"center\">".($note['access'][1] ? $lang['yes'] : '')."</td>\n".
"<td class=\"altbg1\" align=\"center\">".($note['access'][2] ? $lang['yes'] : '')."</td>\n".
"<td class=\"altbg2\" align=\"center\">$note[expiration]</td></tr>\n";
}
}
if($adminid == 1) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
$serverinfo = PHP_OS.' / PHP v'.PHP_VERSION;
$serverinfo .= @ini_get('safe_mode') ? ' Safe Mode' : NULL;
$dbversion = $db->result($db->query("SELECT VERSION()"), 0);
if(@ini_get('file_uploads')) {
$fileupload = ini_get('upload_max_filesize');
} else {
$fileupload = '<font color="red">'.$lang['no'].'</font>';
}
$groupselect = '';
$query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups ORDER BY creditslower, groupid");
while($group = $db->fetch_array($query)) {
$groupselect .= '<option value="'.$group['groupid'].'">'.$group['grouptitle'].'</option>';
}
$dbsize = 0;
$query = $db->query("SHOW TABLE STATUS LIKE '$tablepre%'", 'SILENT');
while($table = $db->fetch_array($query)) {
$dbsize += $table['Data_length'] + $table['Index_length'];
}
$dbsize = $dbsize ? sizecount($dbsize) : $lang['unknown'];
if(isset($attachsize)) {
$attachsize = $db->result($db->query("SELECT SUM(filesize) FROM {$tablepre}attachments"), 0);
$attachsize = is_numeric($attachsize) ? sizecount($attachsize) : $lang['unknown'];
} else {
$attachsize = '<a href="admincp.php?action=home&attachsize">[ '.$lang['detail'].' ]</a>';
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE first='0' AND invisible='-2'");
$postsmod = $db->result($query, 0);
$threadsdel = $threadsmod = 0;
$query = $db->query("SELECT displayorder FROM {$tablepre}threads WHERE displayorder<'0'");
while($thread = $db->fetch_array($query)) {
if($thread['displayorder'] == -1) {
$threadsdel++;
} elseif($thread['displayorder'] == -2) {
$threadsmod++;
}
}
} elseif($allowmodpost) {
if($adminid == 3) {
$fids = '0';
$query = $db->query("SELECT fid FROM {$tablepre}moderators WHERE uid='$discuz_uid'");
while($forum = $db->fetch_array($query)) {
$fids .= ','.$forum['fid'];
}
if($fids) {
$fidadd = "fid IN ($fids) AND";
} else {
$fidadd = '';
$allowmodpost = 0;
}
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}threads WHERE $fidadd displayorder='-2'");
$threadsmod = $db->result($query, 0);
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE $fidadd first='0' AND invisible='-2'");
$postsmod = $db->result($query, 0);
}
cpheader();
shownav('header_admin');
$save_mastermobile = $db->result($db->query("SELECT value FROM {$tablepre}settings WHERE variable='mastermobile'"), 0);
$save_mastermobile = !empty($save_mastermobile) ? authcode($save_mastermobile, 'DECODE', $authkey) : '';
$securityadvise = '';
$securityadvise .= !$discuz_secques ? $lang['home_secques_invalid'] : '';
$securityadvise .= ($adminid == 1 && $groupid == 1 && empty($forumfounders)) ? $lang['home_security_nofounder'] : '';
$securityadvise .= ($adminid == 1 && $groupid == 1 && $admincp['tpledit']) ? $lang['home_security_tpledit'] : '';
$securityadvise .= ($adminid == 1 && $groupid == 1 && $admincp['runquery']) ? $lang['home_security_runquery'] : '';
$userformhash = FORMHASH;
if(isfounder() && submitcheck('securyservice')) {
$new_mastermobile = trim($new_mastermobile);
if(empty($new_mastermobile)) {
$save_mastermobile = $new_mastermobile;
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('mastermobile', '$new_mastermobile')");
} elseif($save_mastermobile != $new_mastermobile && strlen($new_mastermobile) == 11 && is_numeric($new_mastermobile) && (substr($new_mastermobile, 0, 2) == '13' || substr($new_mastermobile, 0, 2) == '15')) {
$save_mastermobile = $new_mastermobile;
$new_mastermobile = authcode($new_mastermobile, 'ENCODE', $authkey);
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('mastermobile', '$new_mastermobile')");
}
}
$view_mastermobile = !empty($save_mastermobile) ? substr($save_mastermobile, 0 , 3).'*****'.substr($save_mastermobile, -3) : '';
echo <<<EOT
<form method="post" action="admincp.php?action=home">
<input type="hidden" name="formhash" value="$userformhash">
<input type="hidden" name="securyservice" value="yes">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="3">$lang[home_security_tips]</td></tr>
EOT;
if(isfounder()) {
$hidemobile = '<input type="text" class="altbg1" value="'.(!empty($view_mastermobile) ? $lang['home_security_service_mobile_save'] : $lang['home_security_service_mobile_none']).'" disabled="true" style="border:0" size="50">';
echo <<<EOT
<tr class="altbg1">
<td>$lang[home_security_service]</td>
<td colspan=2>$lang[home_security_service_info]</td>
</tr>
<tr class="altbg2">
<td width="20%">$lang[home_security_service_mobile]</td>
<td><input type="text" size="30" class="input" name='new_mastermobile' value='$view_mastermobile'> $hidemobile</td>
<td width="20%"><input type="submit" class="button" name="securyservice" value="$lang[submit]"></td>
</tr>
EOT;
}
if($securityadvise) {
echo '<tr class="altbg1"><td width="20%">'.$lang['home_security_advise'].'</td><td colspan=2>'.$securityadvise.'</td></tr>';
}
?>
</table></form><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['home_onlines']?></td></tr>
<tr><td><?=implode(', ', $onlines)?></td></tr>
</table><br />
<? if($isfounder) {
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='insenz'");
$insenz = ($insenz = $db->result($query, 0)) ? unserialize($insenz) : array();
if(empty($insenz['authkey']) && $onlineip != '127.0.0.1') {
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td>'.$lang['insenz_note'].'</td></tr>
<tr><td><b>'.$lang['insenz_note_join_insenz'].'</b><a href="admincp.php?action=insenz"><font color="red"><u>'.$lang['insenz_note_register'].'</u></font></a></td></tr>
</table><br />';
} elseif($insenz['status']) {
require_once DISCUZ_ROOT.'./include/insenz.func.php';
?>
<div id="insenznews"></div>
<? }} ?>
<div id="boardnews"></div>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="3"><?=$lang['home_stuff']?></td></tr>
<? if(($adminid == 2 || $adminid == 3) && ($allowedituser || $allowbanuser)) { ?>
<form method="post" action="admincp.php?action=editmember&searchsubmit=yes">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg1"><td><?=$lang['home_edit_member']?></td>
<td><input type="text" size="30" name="username"></td><td><input class="button" type="submit" name="searchsubmit" value="<?=$lang['submit']?>"></td></tr></form>
<? } ?>
<? if($adminid == 1) { ?>
<form method="post" action="admincp.php?action=members&searchsubmit=yes">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg1"><td><?=$lang['home_edit_member']?></td>
<td><input type="text" size="30" name="username"></td><td><input class="button" type="submit" name="searchsubmit" value="<?=$lang['submit']?>"></td></tr></form>
<form method="post" action="admincp.php?action=forumdetail">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg2"><td><?=$lang['home_edit_forum']?></td>
<td><select name="fid"><option value=""> > <?=$lang['select']?></option><option value=""> </option>
<?=forumselect(1)?></select></td><td><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr></form>
<form method="post" action="admincp.php?action=usergroups">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg1"><td><?=$lang['home_edit_group']?></td>
<td><select name="edit"><?=$groupselect?></td><td><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr></form>
<? } ?>
</table>
<br />
<form method="post" action="admincp.php?action=home">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td width="5%"><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form, 'delete');"><?=$lang['del']?></td>
<td width="12%"><?=$lang['username']?></td>
<td width="12%"><?=$lang['time']?></td>
<td width="30%"><?=$lang['announce_home_options']?></td>
<td width="8%" nowrap><?=$lang['usergroups_system_1']?></td>
<td width="8%" nowrap><?=$lang['usergroups_system_2']?></td>
<td width="8%" nowrap><?=$lang['usergroups_system_3']?></td>
<td width="15%"><?=$lang['validity']?></td></tr>
<?=$notes?>
<tr align="center"><td class="altbg1"><?=$lang['add_new']?></td>
<td class="altbg2" colspan="3"><textarea name="newmessage" rows="2" style="width: 95%; word-break: break-all"></textarea></td>
<td class="altbg1"><input class="checkbox" type="checkbox" name="newaccess[1]" value="1" checked <?=($adminid == 1 ? 'disabled' : '')?>></td>
<td class="altbg2"><input class="checkbox" type="checkbox" name="newaccess[2]" value="1" checked <?=($adminid == 2 ? 'disabled' : '')?>></td>
<td class="altbg1"><input class="checkbox" type="checkbox" name="newaccess[3]" value="1" checked <?=($adminid == 3 ? 'disabled' : '')?>></td>
<td class="altbg2"><input type="text" name="newexpiration" size="8" value="<?=gmdate('Y-n-j', $timestamp + $timeoffset * 3600 + 86400 * 30)?>">
<input class="button" type="submit" name="notesubmit" value="<?=$lang['submit']?>"></td></tr>
</table>
<br />
<? if((($threadsmod || $postsmod) && $allowmodpost) || ($threadsdel && $adminid == 1)) { ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['home_threads_posts']?></td></tr>
<?
$thisbg = 'altbg1';
if($allowmodpost) {
if($threadsmod) {
$thisbg = $thisbg == 'altbg2' ? 'altbg1' : 'altbg2';
echo "<tr class=\"$thisbg\" style=\"font-weight: bold\"><td width=\"25%\"><a href=\"admincp.php?action=modthreads\">$lang[home_mod_threads]</a></td><td>$threadsmod</td></tr>\n";
}
if($postsmod) {
$thisbg = $thisbg == 'altbg2' ? 'altbg1' : 'altbg2';
echo "<tr class=\"$thisbg\" style=\"font-weight: bold\"><td width=\"25%\"><a href=\"admincp.php?action=modreplies\">$lang[home_mod_posts]</a></td><td>$postsmod</td></tr>\n";
}
}
if($threadsdel && $adminid == 1) {
$thisbg = $thisbg == 'altbg2' ? 'altbg1' : 'altbg2';
echo "<tr class=\"$thisbg\" style=\"font-weight: bold\"><td width=\"25%\"><a href=\"admincp.php?action=recyclebin\">$lang[home_delete_threads]</td><td>$threadsdel</td></tr>\n";
}
?>
</table>
<br />
<? } if($adminid == 1) { ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['home_sys_info']?></td></tr>
<tr class="altbg2"><td width="25%"><?=$lang['home_discuz_version']?></td><td>Discuz! <?=DISCUZ_VERSION?> Release <?=DISCUZ_RELEASE?> [ <a href="http://www.discuz.net/forumdisplay.php?fid=10" target="_blank"><?=$lang['home_check_newversion']?></a> ]</td></tr>
<tr class="altbg1"><td width="25%"><?=$lang['home_environment']?></td><td><?=$serverinfo?></td></tr>
<tr class="altbg2"><td><?=$lang['home_database']?></td><td><?=$dbversion?></td></tr>
<tr class="altbg1"><td><?=$lang['home_upload_perm']?></td><td><?=$fileupload?></td></tr>
<tr class="altbg2"><td><?=$lang['home_database_size']?></td><td><?=$dbsize?></td></tr>
<tr class="altbg1"><td><?=$lang['home_attach_size']?></td><td><?=$attachsize?></td></tr>
<tr class="altbg2"><td><?=$lang['menu_tools_fileperms']?></td><td><a href='admincp.php?action=fileperms'>[ <?=$lang['check']?> ]</a></td></tr>
</table>
<br />
<? } ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['home_dev']?></td></tr>
<tr class="altbg2"><td width="25%"><?=$lang['home_dev_copyright']?></td><td class="smalltxt"><a href="http://www.comsenz.com" target="_blank">康盛创想(北京)科技有限公司 (Comsenz Inc.)</a></td></tr>
<tr class="altbg1"><td><?=$lang['home_dev_manager']?></td><td class="smalltxt"><a href="http://www.discuz.net/space.php?uid=1" target="_blank">戴志康 (Kevin 'Crossday' Day)</a></td></tr>
<tr class="altbg2"><td><?=$lang['home_dev_team']?></td><td class="smalltxt"><a href="http://www.discuz.net/space.php?uid=2691" target="_blank">Liang 'Readme' Chen</a>, <a href="http://www.discuz.net/space.php?uid=1519" target="_blank">Yang 'Summer' Xia</a>, <a href="http://www.discuz.net/space.php?uid=859" target="_blank">Haibo 'cnteacher' Wang</a>, <a href="http://www.discuz.net/space.php?uid=16678" target="_blank">Yang 'Tiger' Song</a>, <a href="http://www.discuz.net/space.php?uid=10407" target="_blank">Qiang Liu</a>, <a href="http://www.discuz.net/space.php?uid=80629" target="_blank">Ning 'Monkey' Hou</a>, <a href="http://www.discuz.net/space.php?uid=122246" target="_blank">Min 'Heyond' Huang</a>, <a href="http://www.discuz.net/space.php?uid=22195" target="_blank">Chao 'Langwan' Luo</a>, <a href="http://www.discuz.net/space.php?uid=210272" target="_blank">XiaoDun 'Kenshine' Fang</a>, <a href="http://www.discuz.net/space.php?uid=492114" target="_blank">Liang 'Metthew' Xu</a></td></tr>
<tr class="altbg1"><td><?=$lang['home_dev_addons']?></td><td class="smalltxt"><a href="http://www.discuz.net/space.php?uid=9600" target="_blank">theoldmemory</a>, <a href="http://www.discuz.net/space.php?uid=2629" target="_blank">rain5017</a>, <a href="http://www.discuz.net/space.php?uid=26926" target="_blank">Snow Wolf</a>, <a href="http://www.discuz.net/space.php?uid=17149" target="_blank">hehechuan</a>, <a href="http://www.discuz.net/space.php?uid=9132" target="_blank">pk0909</a>, <a href="http://www.discuz.net/space.php?uid=248" target="_blank">feixin</a>, <a href="http://www.discuz.net/space.php?uid=675" target="_blank">Laobing Jiuba</a>, <a href="http://www.discuz.net/space.php?uid=7155" target="_blank">Gregry</a></td></tr>
<tr class="altbg2"><td><?=$lang['home_dev_skins']?></td><td class="smalltxt"><a href="http://www.discuz.net/space.php?uid=13877" target="_blank">Artery</a>, <a href="http://www.discuz.net/space.php?uid=233" target="_blank">Huli Hutu</a>, <a href="http://www.discuz.net/space.php?uid=122" target="_blank">Lao Gui</a>, <a href="http://www.discuz.net/space.php?uid=159" target="_blank">Tyc</a>, <a href="http://www.discuz.net/space.php?uid=177" target="_blank">stoneage</a>, <a href="http://www.discuz.net/space.php?uid=294092" target="_blank">Fangming 'Lushnis' Li</a>, <a href="http://www.discuz.net/space.php?uid=362790" target="_blank">Defeng 'Dfox' Xu</a></td></tr>
<tr class="altbg1"><td><?=$lang['home_dev_enterprise_site']?></td><td class="smalltxt"><a href="http://www.comsenz.com" target="_blank">http://www.Comsenz.com</a></td></tr>
<tr class="altbg2"><td><?=$lang['home_dev_project_site']?></td><td class="smalltxt"><a href="http://www.discuz.com" target="_blank">http://www.Discuz.com</a></td></tr>
<tr class="altbg1"><td><?=$lang['home_dev_community']?></td><td class="smalltxt"><a href="http://www.discuz.net" target="_blank">http://www.Discuz.net</a></td></tr>
</table>
<br />
| zyyhong | trunk/jiaju001/bbs/admin/home.inc.php | PHP | asf20 | 20,056 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: global.func.php 10296 2007-08-25 07:58:34Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
@set_time_limit(0);
function cpmsg($message, $url_forward = '', $msgtype = 'message', $extra = '', $cancelurl = '') {
extract($GLOBALS, EXTR_SKIP);
eval("\$message = \"".(isset($msglang[$message]) ? $msglang[$message] : $message)."\";");
if($msgtype == 'form') {
$message = "<form method=\"post\" action=\"$url_forward\"><input type=\"hidden\" name=\"formhash\" value=\"".FORMHASH."\">".
"<br /><br /><br />$message$extra<br /><br /><br /><br />\n".
"<input class=\"button\" type=\"submit\" name=\"confirmed\" value=\"$lang[ok]\"> \n".
"<input class=\"button\" type=\"button\" value=\"$lang[cancel]\" onClick=\"".
($cancelurl == '' ? 'history.go(-1)' : 'location.href=\''.$cancelurl.'\'').
";\"></form><br />";
} else {
if($url_forward) {
$message .= "<br /><br /><br /><a href=\"$url_forward\">$lang[message_redirect]</a>";
$url_forward = transsid($url_forward);
$message .= "<script>setTimeout(\"redirect('$url_forward');\", 2000);</script>";
} elseif(strpos($message, $lang['return'])) {
$message .= "<br /><br /><br /><a href=\"javascript:history.go(-1);\" class=\"mediumtxt\">$lang[message_return]</a>";
}
$message = "<br /><br /><br />$message$extra<br /><br />";
}
?>
<br /><br /><br /><br /><br /><br />
<table width="500" border="0" cellpadding="0" cellspacing="0" align="center" class="tableborder">
<tr class="header"><td><?=$lang['discuz_message']?></td></tr><tr><td class="altbg2"><div align="center">
<?=$message?></div><br /><br />
</td></tr></table>
<br /><br /><br />
<?
cpfooter();
dexit();
}
function istpldir($dir) {
return is_dir(DISCUZ_ROOT.'./'.$dir) && !in_array(substr($dir, -1, 1), array('/', '\\')) &&
strpos(realpath(DISCUZ_ROOT.'./'.$dir), realpath(DISCUZ_ROOT.'./templates')) === 0;
}
function isplugindir($dir) {
return !$dir || (!preg_match("/(\.\.|[\\\\]+$)/", $dir) && substr($dir, -1) =='/');
}
function ispluginkey($key) {
return preg_match("/^[a-z]+[a-z0-9_]*$/i", $key);
}
function dir_writeable($dir) {
if(!is_dir($dir)) {
@mkdir($dir, 0777);
}
if(is_dir($dir)) {
if($fp = @fopen("$dir/test.txt", 'w')) {
@fclose($fp);
@unlink("$dir/test.txt");
$writeable = 1;
} else {
$writeable = 0;
}
}
return $writeable;
}
function checkpermission($action, $break = 1) {
if(!isset($GLOBALS['admincp'])) {
cpmsg('action_access_noexists');
} elseif($break && !$GLOBALS['admincp'][$action]) {
cpmsg('action_noaccess_config');
} else {
return $GLOBALS['admincp'][$action];
}
}
function showforum($key, $type = '') {
global $forums, $showedforums, $lang, $indexname;
$forum = $forums[$key];
$showedforums[] = $key;
return '<li><a href="'.($type == 'group' ? './'.$indexname.'?gid='.$forum['fid'] : './forumdisplay.php?fid='.$forum['fid']).'" target="_blank"><b>'.$forum['name'].'</b><span class="smalltxt">'.
($forum['status'] ? '' : ' ('.$lang['forums_hidden'].')').'</span></a> - '.
$lang['display_order'].': <input type="text" name="order['.$forum['fid'].']" value="'.$forum['displayorder'].'" size="1"> - '.
$lang['text_area'].':'.' <input type="text" name="area['.$forum['fid'].']" value="'.$forum['areaid'].'" size="3">'.
($type != 'sub' ? '<a href="admincp.php?action=forumadd&fupid='.$forum['fid'].'" title="'.$lang['forums_add_comment'].'">['.$lang['forums_add'].']</a> ' : '').
'<a href="admincp.php?action=forumdetail&fid='.$forum['fid'].'" title="'.$lang['forums_edit_comment'].'">['.$lang['edit'].']</a>'.
($type != 'group' ? ' <a href="admincp.php?action=forumcopy&source='.$forum['fid'].'" title="'.$lang['forums_copy_comment'].'">['.$lang['forums_copy'].']</a> ' : ' ').
'<a href="admincp.php?action=forumdelete&fid='.$forum['fid'].'" title="'.$lang['forums_delete_comment'].'">['.$lang['delete'].']</a> - '.
'<a href="admincp.php?action=moderators&fid='.$forum['fid'].'" title="'.$lang['forums_moderators_comment'].'">['.$lang['forums_moderators'].($forum['moderators'] ? ': '.str_replace("\t", ', ', $forum['inheritedmod'] ? '<b>'.$forum['moderators'].'</b>' : $forum['moderators']) : '').']</a>'.
'<br /></li>';
}
function showtype($name, $type = '', $submit = '', $colspan = 2) {
$name = isset($GLOBALS['lang'][$name]) ? $GLOBALS['lang'][$name] : $name;
$id = substr(md5($name), 16);
$submithtml = $submit ? '<center><input class="button" type="submit" name="'.$submit.'" value="'.$GLOBALS['lang']['submit'].'"></center>' : '';
if($type != 'bottom') {
if(!$type) {
echo '</table><br />';
}
if(!$type || $type == 'top') {
?>
<a name="<?=$id?>"></a>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="<?=$colspan?>"><?=$name?>
<a href="###" onclick="collapse_change('<?=$id?>')"><img id="menuimg_<?=$id?>" src="./images/admincp/menu_reduce.gif" border="0" style="float: right; margin-top: -12px; margin-right: 8px;" /></a>
</td>
</tr>
<tbody id="menu_<?=$id?>" style="display: yes">
<?
}
} else {
echo '</tbody></table>'.$submithtml;
}
}
function showsetting($setname, $varname, $value, $type = 'radio', $width = '45%', $disabled = '', $hidden = 0) {
global $lang;
$check = array();
$comment = isset($lang[$setname.'_comment']) ? $lang[$setname.'_comment'] : '';
$check['disabled'] = $disabled ? ' disabled' : '';
$width = !$width ? '45%' : $width;
$aligntop = $type == "textarea" || $width != "45%" ? "valign=\"top\"" : NULL;
echo "<tr><td width=\"$width\" class=\"altbg1\" $aligntop>".
'<b>'.(isset($lang[$setname]) ? $lang[$setname] : $setname).'</b>'.($comment ? '<br /><span class="smalltxt">'.$comment.'</span>' : NULL).
($disabled ? '<br /><span class="smalltxt" style="color:#FF0000">'.$lang[$setname.'_disabled'].'</span>' : NULL).'</td>'.
'<td class="altbg2">';
if($type == 'radio') {
$value ? $check['true'] = "checked" : $check['false'] = "checked";
$value ? $check['false'] = '' : $check['true'] = '';
$check['hidden1'] = $hidden ? 'onclick="$(\'hidden_'.$setname.'\').style.display = \'\';"' : '';
$check['hidden0'] = $hidden ? 'onclick="$(\'hidden_'.$setname.'\').style.display = \'none\';"' : '';
echo "<input class=\"radio\" type=\"radio\" name=\"$varname\" value=\"1\" $check[true] $check[hidden1] $check[disabled]> {$lang['yes']} \n".
"<input class=\"radio\" type=\"radio\" name=\"$varname\" value=\"0\" $check[false] $check[hidden0] $check[disabled]> {$lang['no']}\n";
} elseif($type == 'radioplus') {
$value == -1 ? $check['default'] = 'checked' : ($value ? $check['true'] = 'checked' : $check['false'] = 'checked');
echo "<input class=\"radio\" type=\"radio\" name=\"$varname\" value=\"-1\" $check[default]> ".$lang['default']." \n".
"<input class=\"radio\" type=\"radio\" name=\"$varname\" value=\"1\" $check[true]> {$lang['yes']} \n".
"<input class=\"radio\" type=\"radio\" name=\"$varname\" value=\"0\" $check[false]> {$lang['no']}\n";
} elseif($type{0} == 'm') {
if(substr($type, 1) == 'radio') {
$radiocheck = array($value => ' checked');
$split = count($varname[1]) > 2 ? '<br />' : ' ';
foreach($varname[1] as $varary) {
$onclick = '';
if(!empty($varary[2])) {
foreach($varary[2] as $ctrlid => $display) {
$onclick .= '$(\''.$ctrlid.'\').style.display = \''.$display.'\';';
}
}
$onclick && $onclick = ' onclick="'.$onclick.'"';
echo '<input class="radio" type="radio" name="'.$varname[0].'" value="'.$varary[0].'"'.$radiocheck[$varary[0]].$check['disabled'].$onclick.'> '.$varary[1].$split;
}
} else {
$checkboxs = count($varname[1]);
$value = sprintf('%0'.$checkboxs.'b', $value);$i = 1;
foreach($varname[1] AS $key => $var) {
echo '<input class="checkbox" type="checkbox" name="'.$varname[0].'['.$i.']" value="1"'.($value{$checkboxs - $i} ? ' checked' : '').' '.(!empty($varname[2][$key]) ? $varname[2][$key] : '').'> '.$var.'<br />';
$i++;
}
}
} elseif($type == 'color') {
global $stylestuff;
$preview_varname = str_replace('[', '_', str_replace(']', '', $varname));
$code = explode(' ', $value);
$css = '';
for($i = 0; $i <= 1; $i++) {
if($code[$i] != '') {
if($code[$i]{0} == '#') {
$css .= strtoupper($code[$i]).' ';
} elseif(preg_match('/^http:\/\//i', $code[$i])) {
$css .= 'url(\''.$code[$i].'\') ';
} else {
$css .= 'url(\''.$stylestuff['imgdir']['subst'].'/'.$code[$i].'\') ';
}
}
}
$background = trim($css);
if(!$GLOBALS['coloridcount']) {
echo "<script>
function updatecolorpreview(obj) {
var sp = $(obj + '_v').value.indexOf(' ');
if(sp == -1) {
var code = [$(obj + '_v').value];var codel = 1;
} else {
var code = [$(obj + '_v').value.substr(0, sp), $(obj + '_v').value.substr(sp + 1)];var codel = 2;
}
var css = '';
for(i = 0;i < codel;i++) {
if(code[i] != '') {
if(code[i].substr(0, 1) == '#') {
css += code[i] + ' ';
} else {
css += 'url(\"{$stylestuff['imgdir']['subst']}/' + code[i] + '\") ';
}
}
}
$(obj).style.background = css;
}
</script>";
}
$colorid = ++$GLOBALS['coloridcount'];
echo "<input id=\"c{$colorid}_v\" type=\"text\" size=\"50\" value=\"$value\" name=\"$varname\" onchange=\"updatecolorpreview('c{$colorid}')\">\n".
"<input id=\"c$colorid\" onclick=\"c{$colorid}_frame.location='images/admincp/getcolor.htm?c{$colorid}';showMenu('c$colorid')\" type=\"button\" value=\"\" style=\"width: 20px;background: $background\"><span id=\"c{$colorid}_menu\" style=\"display: none\" class=\"tableborder\"><iframe name=\"c{$colorid}_frame\" src=\"\" frameborder=\"0\" width=\"164\" height=\"184\" scrolling=\"no\"></iframe></span>\n";
} elseif($type == 'text' || $type == 'password') {
echo "<input type=\"$type\" size=\"50\" name=\"$varname\" value=\"".dhtmlspecialchars($value)."\" $check[disabled]>\n";
} elseif($type == 'calendar') {
echo "<input type=\"$type\" size=\"50\" name=\"$varname\" value=\"".dhtmlspecialchars($value)."\" onclick=\"showcalendar(event, this)\">\n";
} elseif($type == 'textarea') {
$readonly = $disabled ? 'readonly' : '';
echo "<img src=\"images/admincp/zoomin.gif\" onmouseover=\"this.style.cursor='pointer'\" onclick=\"zoomtextarea('$varname', 1)\"> <img src=\"images/admincp/zoomout.gif\" onmouseover=\"this.style.cursor='pointer'\" onclick=\"zoomtextarea('$varname', 0)\"><br /><textarea $readonly rows=\"6\" name=\"$varname\" id=\"$varname\" cols=\"50\">".dhtmlspecialchars($value)."</textarea>";
} elseif($type == 'select') {
echo '<select name="'.$varname[0].'" style="width: 55%">';
foreach($varname[1] as $option) {
$selected = $option[0] == $value ? 'selected' : '';
echo "<option value=\"$option[0]\" $selected>".$option[1]."</option>\n";
}
echo '</select>';
} else {
echo $type;
}
echo '</td></tr>';
if($hidden) {
echo '</tbody><tbody class="sub" id="hidden_'.$setname.'" style="display: '.($value ? '' : 'none').'">';
}
}
function showmenu($title, $menus = array()) {
global $menucount, $collapse;
echo '<table width="146" border="0" cellspacing="0" align="center" cellpadding="0" class="leftmenulist" style="margin-bottom: 5px;">';
if(is_array($menus)) {
$menucount++;
$collapsed = preg_match("/\[$menucount\]/", $collapse);
echo '<tr class="leftmenutext"><td><a href="###" onclick="collapse_change('.$menucount.')"><img id="menuimg_'.$menucount.'" src="./images/admincp/menu_'.($collapsed ? 'add' : 'reduce').'.gif" border="0"/></a> '.
'<a href="###" onclick="collapse_change('.$menucount.')">'.$title.'</a></td></tr>'.
'<tbody id="menu_'.$menucount.'" style="display:'.($collapsed ? 'none' : '').'">'.
'<tr class="leftmenutd"><td><table border="0" cellspacing="0" cellpadding="0" class="leftmenuinfo">';
foreach($menus as $menudata) {
echo $menudata['name'] ? '<tr><td><a href="'.$menudata['url'].'" target="'.($menudata['target'] ? $menudata['target'] : 'main').'">'.$menudata['name'].'</a></td></tr>' : '';
}
echo '</table></td></tr></tbody>';
} else {
echo "<tr class=\"leftmenutext\"><td><img src=\"./images/admincp/menu_reduce.gif\" /> <a href=\"$menus\" target=\"main\">$title</a></td></tr>\n";
}
echo "</table>\n";
}
function showtips($tips) {
extract($GLOBALS, EXTR_SKIP);
global $_DCOOKIE;
if(isset($lang[$tips])) {
eval('$tips = "'.str_replace('"', '\\"', $lang[$tips]).'";');
}
$collapsed = preg_match("/\[tip\]/", isset($_DCOOKIE['collapse']) ? $_DCOOKIE['collapse'] : '');
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'.
'<tr class="header"><td><div style="float:left; margin-left:0px; padding-top:8px"><a href="###" onclick="collapse_change(\'tip\')">'.$lang['tips'].'</a></div><div style="float:right; margin-right:4px; padding-bottom:9px">'.
'<a href="###" onclick="collapse_change(\'tip\')"><img id="menuimg_tip" src="./images/admincp/menu_'.($collapsed ? 'add' : 'reduce').'.gif" border="0"/></a></div>'.
'</td></tr><tbody id="menu_tip" style="display:'.($collapsed ? 'none' : '').'"><tr><td>'.$tips.'</td></tr></tbody></table><br />';
}
function shownav($navs) {
$navs = isset($GLOBALS['lang'][$navs]) ? $GLOBALS['lang'][$navs] : $navs;
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="guide">'.
'<tr><td><a href="#" onClick="parent.menu.location=\'admincp.php?action=menu\'; parent.main.location=\'admincp.php?action=home\';return false;">'.$GLOBALS['lang']['header_system'].'</a> » '.$navs.'</td></tr></table><br />';
}
function sqldumptable($table, $startfrom = 0, $currsize = 0) {
global $db, $sizelimit, $startrow, $extendins, $sqlcompat, $sqlcharset, $dumpcharset, $usehex, $complete, $excepttables;
$offset = 300;
$tabledump = '';
$tablefields = array();
$query = $db->query("SHOW FULL COLUMNS FROM $table", 'SILENT');
if(strexists($table, 'adminsessions')) {
return ;
} elseif(!$query && $db->errno() == 1146) {
return;
} elseif(!$query) {
$usehex = FALSE;
} else {
while($fieldrow = $db->fetch_array($query)) {
$tablefields[] = $fieldrow;
}
}
if(!$startfrom) {
$createtable = $db->query("SHOW CREATE TABLE $table", 'SILENT');
if(!$db->error()) {
$tabledump = "DROP TABLE IF EXISTS $table;\n";
} else {
return '';
}
$create = $db->fetch_row($createtable);
if(strpos($table, '.') !== FALSE) {
$tablename = substr($table, strpos($table, '.') + 1);
$create[1] = str_replace("CREATE TABLE $tablename", 'CREATE TABLE '.$table, $create[1]);
}
$tabledump .= $create[1];
if($sqlcompat == 'MYSQL41' && $db->version() < '4.1') {
$tabledump = preg_replace("/TYPE\=(.+)/", "ENGINE=\\1 DEFAULT CHARSET=".$dumpcharset, $tabledump);
}
if($db->version() > '4.1' && $sqlcharset) {
$tabledump = preg_replace("/(DEFAULT)*\s*CHARSET=.+/", "DEFAULT CHARSET=".$sqlcharset, $tabledump);
}
$query = $db->query("SHOW TABLE STATUS LIKE '$table'");
$tablestatus = $db->fetch_array($query);
$tabledump .= ($tablestatus['Auto_increment'] ? " AUTO_INCREMENT=$tablestatus[Auto_increment]" : '').";\n\n";
if($sqlcompat == 'MYSQL40' && $db->version() >= '4.1' && $db->version() < '5.1') {
if($tablestatus['Auto_increment'] <> '') {
$temppos = strpos($tabledump, ',');
$tabledump = substr($tabledump, 0, $temppos).' auto_increment'.substr($tabledump, $temppos);
}
if($tablestatus['Engine'] == 'MEMORY') {
$tabledump = str_replace('TYPE=MEMORY', 'TYPE=HEAP', $tabledump);
}
}
}
if(!in_array($table, $excepttables)) {
$tabledumped = 0;
$numrows = $offset;
$firstfield = $tablefields[0];
if($extendins == '0') {
while($currsize + strlen($tabledump) + 500 < $sizelimit * 1000 && $numrows == $offset) {
if($firstfield['Extra'] == 'auto_increment') {
$selectsql = "SELECT * FROM $table WHERE $firstfield[Field] > $startfrom LIMIT $offset";
} else {
$selectsql = "SELECT * FROM $table LIMIT $startfrom, $offset";
}
$tabledumped = 1;
$rows = $db->query($selectsql);
$numfields = $db->num_fields($rows);
$numrows = $db->num_rows($rows);
while($row = $db->fetch_row($rows)) {
$comma = $t = '';
for($i = 0; $i < $numfields; $i++) {
$t .= $comma.($usehex && !empty($row[$i]) && (strexists($tablefields[$i]['Type'], 'char') || strexists($tablefields[$i]['Type'], 'text')) ? '0x'.bin2hex($row[$i]) : '\''.mysql_escape_string($row[$i]).'\'');
$comma = ',';
}
if(strlen($t) + $currsize + strlen($tabledump) + 500 < $sizelimit * 1000) {
if($firstfield['Extra'] == 'auto_increment') {
$startfrom = $row[0];
} else {
$startfrom++;
}
$tabledump .= "INSERT INTO $table VALUES ($t);\n";
} else {
$complete = FALSE;
break 2;
}
}
}
} else {
while($currsize + strlen($tabledump) + 500 < $sizelimit * 1000 && $numrows == $offset) {
if($firstfield['Extra'] == 'auto_increment') {
$selectsql = "SELECT * FROM $table WHERE $firstfield[Field] > $startfrom LIMIT $offset";
} else {
$selectsql = "SELECT * FROM $table LIMIT $startfrom, $offset";
}
$tabledumped = 1;
$rows = $db->query($selectsql);
$numfields = $db->num_fields($rows);
if($numrows = $db->num_rows($rows)) {
$t1 = $comma1 = '';
while($row = $db->fetch_row($rows)) {
$t2 = $comma2 = '';
for($i = 0; $i < $numfields; $i++) {
$t2 .= $comma2.($usehex && !empty($row[$i]) && (strexists($tablefields[$i]['Type'], 'char') || strexists($tablefields[$i]['Type'], 'text'))? '0x'.bin2hex($row[$i]) : '\''.mysql_escape_string($row[$i]).'\'');
$comma2 = ',';
}
if(strlen($t1) + $currsize + strlen($tabledump) + 500 < $sizelimit * 1000) {
if($firstfield['Extra'] == 'auto_increment') {
$startfrom = $row[0];
} else {
$startfrom++;
}
$t1 .= "$comma1 ($t2)";
$comma1 = ',';
} else {
$tabledump .= "INSERT INTO $table VALUES $t1;\n";
$complete = FALSE;
break 2;
}
}
$tabledump .= "INSERT INTO $table VALUES $t1;\n";
}
}
}
$startrow = $startfrom;
$tabledump .= "\n";
}
return $tabledump;
}
function splitsql($sql) {
$sql = str_replace("\r", "\n", $sql);
$ret = array();
$num = 0;
$queriesarray = explode(";\n", trim($sql));
unset($sql);
foreach($queriesarray as $query) {
$queries = explode("\n", trim($query));
foreach($queries as $query) {
$ret[$num] .= $query[0] == "#" ? NULL : $query;
}
$num++;
}
return($ret);
}
function bbsinformation() {
global $db, $timestamp, $tablepre, $charset, $bbname, $_SERVER, $siteuniqueid, $save_mastermobile;
$update = array('uniqueid' => $siteuniqueid, 'version' => DISCUZ_VERSION, 'release' => DISCUZ_RELEASE, 'php' => PHP_VERSION, 'mysql' => $db->version(), 'charset' => $charset, 'bbname' => $bbname, 'mastermobile' => $save_mastermobile);
$updatetime = @filemtime(DISCUZ_ROOT.'./forumdata/updatetime.lock');
if(empty($updatetime) || ($timestamp - $updatetime > 3600 * 4)) {
@touch(DISCUZ_ROOT.'./forumdata/updatetime.lock');
$update['members'] = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}members"), 0);
$update['threads'] = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}threads"), 0);
$update['posts'] = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}posts"), 0);
$query = $db->query("SELECT special, count(*) as spcount FROM {$tablepre}threads GROUP BY special");
while($thread = $db->fetch_array($query)) {
$thread['special'] = intval($thread['special']);
$update['spt_'.$thread['special']] = $thread['spcount'];
}
}
$data = '';
foreach($update as $key => $value) {
$data .= $key.'='.rawurlencode($value).'&';
}
return 'update='.rawurlencode(base64_encode($data)).'&md5hash='.substr(md5($_SERVER['HTTP_USER_AGENT'].implode('', $update).$timestamp), 8, 8).'×tamp='.$timestamp;
}
function cpheader() {
global $charset, $cookiepre, $attackevasive;
$IMGDIR = IMGDIR;
print <<< EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$charset">
<link href="./images/admincp/admincp.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">var IMGDIR = '$IMGDIR';var attackevasive = '$attackevasive';</script>
<script src="include/javascript/common.js" type="text/javascript"></script>
<script src="include/javascript/menu.js" type="text/javascript"></script>
<script src="include/javascript/ajax.js" type="text/javascript"></script>
<script type="text/javascript">
function checkalloption(form, value) {
for(var i = 0; i < form.elements.length; i++) {
var e = form.elements[i];
if(e.value == value && e.type == 'radio' && e.disabled != true) {
e.checked = true;
}
}
}
function checkallvalue(form, value, checkall) {
var checkall = checkall ? checkall : 'chkall';
for(var i = 0; i < form.elements.length; i++) {
var e = form.elements[i];
if(e.type == 'checkbox' && e.value == value) {
e.checked = form.elements[checkall].checked;
}
}
}
function zoomtextarea(objname, zoom) {
zoomsize = zoom ? 10 : -10;
obj = \$(objname);
if(obj.rows + zoomsize > 0 && obj.cols + zoomsize * 3 > 0) {
obj.rows += zoomsize;
obj.cols += zoomsize * 3;
}
}
function redirect(url) {
window.location.replace(url);
}
var collapsed = getcookie('{$cookiepre}collapse');
function collapse_change(menucount) {
if(\$('menu_' + menucount).style.display == 'none') {
\$('menu_' + menucount).style.display = '';collapsed = collapsed.replace('[' + menucount + ']' , '');
\$('menuimg_' + menucount).src = './images/admincp/menu_reduce.gif';
} else {
\$('menu_' + menucount).style.display = 'none';collapsed += '[' + menucount + ']';
\$('menuimg_' + menucount).src = './images/admincp/menu_add.gif';
}
setcookie('{$cookiepre}collapse', collapsed, 2592000);
}
</script>
</head>
<body leftmargin="10" topmargin="10">
<div id="append_parent"></div>
<table width="100%" border="0" cellpadding="2" cellspacing="6"><tr><td>
EOT;
}
function cpfooter() {
global $version, $adminid, $db, $tablepre, $action, $bbname, $charset, $timestamp, $isfounder, $insenz;
global $_COOKIE, $_SESSION, $_DCOOKIE, $_DCACHE, $_DSESSION, $_DCACHE, $_DPLUGIN, $sqldebug, $debuginfo;
$infmessage = '';
?>
</td></tr></table>
<br /><br /><div class="footer"><hr size="0" noshade color="<?=BORDERCOLOR?>" width="80%">
Powered by <a href="http://www.discuz.net" target="_blank" style="color: <?=TEXT?>"><b>Discuz!</b> <?=$version?></a> © 2001-2007, <b>
<a href="http://www.comsenz.com" target="_blank" style="color: <?=TEXT?>">Comsenz Inc.</a></b><span class="smalltxt"><?=$infmessage?></span></div>
</body>
</html>
<?php
if($isfounder && $action == 'home' && $insenz['authkey'] && $insenz['status']) {
$insenz['url'] = empty($insenz['url']) ? 'api.insenz.com' : $insenz['url'];
?>
<script src="http://<?=$insenz[url]?>/news.php?id=<?=$insenz[siteid]?>&t=<?=$timestamp?>&k=<?=md5($insenz[authkey].$insenz[siteid].$timestamp.'Discuz!')?>&insenz_version=<?=INSENZ_VERSION?>&discuz_version=<?=DISCUZ_VERSION.' - '.DISCUZ_RELEASE?>&random=<?=random(4)?>" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript">
if(typeof error_msg != 'undefined') {
if(error_msg != '') {
alert(error_msg);
}
if(title.length || message != '') {
$('insenznews').innerHTML = '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'
+ '<tr class="header"><td><?=$lang['insenz_note']?></td></tr><tr><td>'
+ (message ? message : '')
+ (title.length ? '<br /><b><?=$lang['insenz_note_new_campaign']?></b><a href="admincp.php?action=insenz&c_status=2"><font color="red"><u><?=$lang['insenz_note_link_to_go']?></u></font></a>' : '')
+ '</td></tr></table><br />';
}
}
</script>
<?
}
if($adminid == 1 && $action == 'home') {
echo '<sc'.'ript language="Jav'.'aScript" src="ht'.'tp:/'.'/cus'.'tome'.'r.disc'.'uz.n'.'et/n'.'ews'.'.p'.'hp?'.bbsinformation().'"></s'.'cri'.'pt>';
}
updatesession();
}
function isfounder($user = '') {
$user = empty($user) ? array('uid' => $GLOBALS['discuz_uid'], 'adminid' => $GLOBALS['adminid'], 'username' => $GLOBALS['discuz_userss']) : $user;
$founders = str_replace(' ', '', $GLOBALS['forumfounders']);
if($user['adminid'] <> 1) {
return FALSE;
} elseif(empty($founders)) {
return TRUE;
} elseif(strexists(",$founders,", ",$user[uid],")) {
return TRUE;
} elseif(!is_numeric($user['username']) && strexists(",$founders,", ",$user[username],")) {
return TRUE;
} else {
return FALSE;
}
}
function fetch_table_struct($tablename, $result = 'FIELD') {
global $db, $tablepre;
$datas = array();
$query = $db->query("DESCRIBE $tablepre$tablename");
while($data = $db->fetch_array($query)) {
$datas[$data['Field']] = $result == 'FIELD' ? $data['Field'] : $data;
}
return $datas;
}
if(!function_exists('ajaxshowheader')) {
function ajaxshowheader() {
global $charset, $inajax;
ob_end_clean();
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
header("Content-type: application/xml");
echo "<?xml version=\"1.0\" encoding=\"$charset\"?>\n<root><![CDATA[";
}
}
if(!function_exists('ajaxshowfooter')) {
function ajaxshowfooter() {
echo ']]></root>';
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/global.func.php | PHP | asf20 | 26,354 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: moderate.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
cpheader();
if($action == 'modmembers') {
//Table validating status: 0=Awaiting for moderation; 1=Invalidated; 2=Validated;
if(!submitcheck('modsubmit') && !submitcheck('prunesubmit', 1)) {
$query = $db->query("SELECT status, COUNT(*) AS count FROM {$tablepre}validating GROUP BY status");
while($num = $db->fetch_array($query)) {
$count[$num['status']] = $num['count'];
}
$sendemail = isset($sendemail) ? $sendemail : 1;
$checksendemail = $sendemail ? 'checked' : '';
$page = max(1, intval($page));
$start_limit = ($page - 1) * $memberperpage;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}validating WHERE status='0'");
$multipage = multi($db->result($query, 0), $memberperpage, $page, 'admincp.php?action=modmembers&sendemail=$sendemail');
$vuids = '0';
$members = '';
$query = $db->query("SELECT m.uid, m.username, m.groupid, m.email, m.regdate, m.regip, v.message, v.submittimes, v.submitdate, v.moddate, v.admin, v.remark
FROM {$tablepre}validating v, {$tablepre}members m
WHERE v.status='0' AND m.uid=v.uid ORDER BY v.submitdate DESC LIMIT $start_limit, $memberperpage");
while($member = $db->fetch_array($query)) {
if($member['groupid'] != 8) {
$vuids .= ','.$member['uid'];
continue;
}
$member['regdate'] = gmdate("$dateformat $timeformat", $member['regdate'] + $timeoffset * 3600);
$member['submitdate'] = gmdate("$dateformat $timeformat", $member['submitdate'] + $timeoffset * 3600);
$member['moddate'] = $member['moddate'] ? gmdate("$dateformat $timeformat", $member['moddate'] + $timeoffset * 3600) : $lang['none'];
$member['admin'] = $member['admin'] ? "<a href=\"space.php?action=viewpro&username=".rawurlencode($member['admin'])."\" target=\"_blank\">$member[admin]</a>" : $lang['none'];
$members .= "<tr class=\"smalltxt\"><td class=\"altbg2\"><input class=\"radio\" type=\"radio\" name=\"mod[$member[uid]]\" value=\"invalidate\"> $lang[invalidate]<br /><input class=\"radio\" type=\"radio\" name=\"mod[$member[uid]]\" value=\"validate\" checked> $lang[validate]<br />\n".
"<input class=\"radio\" type=\"radio\" name=\"mod[$member[uid]]\" value=\"delete\"> $lang[delete]<br /><input class=\"radio\" type=\"radio\" name=\"mod[$member[uid]]\" value=\"ignore\"> $lang[ignore]</td><td class=\"altbg1\"><b><a href=\"space.php?action=viewpro&uid=$member[uid]\" target=\"_blank\">$member[username]</a></b>\n".
"<br />$lang[members_edit_regdate] $member[regdate]<br />$lang[members_edit_regip] $member[regip]<br />Email: $member[email]</td>\n".
"<td class=\"altbg2\" align=\"center\"><textarea rows=\"4\" name=\"remark[$member[uid]]\" style=\"width: 95%; word-break: break-all\">$member[message]</textarea></td>\n".
"<td class=\"altbg1\">$lang[moderate_members_submit_times]: $member[submittimes]<br />$lang[moderate_members_submit_time]: $member[submitdate]<br />$lang[moderate_members_admin]: $member[admin]<br />\n".
"$lang[moderate_members_mod_time]: $member[moddate]</td><td class=\"altbg1\"><textarea rows=\"4\" name=\"remark[$member[uid]]\" style=\"width: 95%; word-break: break-all\">$member[remark]</textarea></td></tr>\n";
}
if($vuids) {
$db->query("DELETE FROM {$tablepre}validating WHERE uid IN ($vuids)", 'UNBUFFERED');
}
shownav('menu_moderate_modmembers');
showtips('moderate_members_tips');
?>
<form method="post" action="admincp.php?action=modmembers">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['moderate_members_prune']?></td></tr>
<tr><td class="altbg1"><?=$lang['moderate_members_prune_submitmore']?></td>
<td align="right" class="altbg2"><input type="text" name="submitmore" size="40" value="5"></td></tr>
<tr><td class="altbg1"><?=$lang['moderate_members_prune_regbefore']?></td>
<td align="right" class="altbg2"><input type="text" name="regbefore" size="40" value="30"></td></tr>
<tr><td class="altbg1"><?=$lang['moderate_members_prune_modbefore']?></td>
<td align="right" class="altbg2"><input type="text" name="modbefore" size="40" value="15"></td></tr>
<tr><td class="altbg1"><?=$lang['moderate_members_prune_regip']?></td>
<td align="right" class="altbg2"><input type="text" name="regip" size="40"></td></tr>
</table><br />
<center><input class="button" type="submit" name="prunesubmit" value="<?=$lang['submit']?>"></center>
</form><br />
<form method="post" action="admincp.php?action=modmembers">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?=$multipage?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="5"><?=$lang['moderate_members']?></td></tr>
<tr class="category"><td colspan="5">
<table cellspacing="0" cellpadding="0" width="100%"><tr><td style="border:none"><input class="button" type="button" value="<?=$lang['moderate_all_invalidate']?>" onclick="checkalloption(this.form, 'invalidate')">
<input class="button" type="button" value="<?=$lang['moderate_all_validate']?>" onclick="checkalloption(this.form, 'validate')">
<input class="button" type="button" value="<?=$lang['moderate_all_delete']?>" onclick="checkalloption(this.form, 'delete')">
<input class="button" type="button" value="<?=$lang['moderate_all_ignore']?>" onclick="checkalloption(this.form, 'ignore')">
</td><td align="right" style="border:none"><input class="checkbox" type="checkbox" name="sendemail" value="1" <?=$checksendemail?>> <?=$lang['moderate_members_email']?></td></tr></table>
</td></tr>
<tr align="center" class="header"><td width="10%"><?=$lang['operation']?></td><td width="25%"><?=$lang['members_edit_info']?></td><td width="20%"><?=$lang['moderate_members_message']?></td><td width="25%"><?=$lang['moderate_members_info']?></td><td width="20%"><?=$lang['moderate_members_remark']?></td></tr>
<?=$members?>
</table>
<?=$multipage?>
<br /><center>
<input class="button" type="submit" name="modsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} elseif(submitcheck('modsubmit')) {
$moderation = array('invalidate' => array(), 'validate' => array(), 'delete' => array(), 'ignore' => array());
$uids = 0;
if(is_array($mod)) {
foreach($mod as $uid => $action) {
$uid = intval($uid);
$uids .= ','.$uid;
$moderation[$action][] = $uid;
}
}
$members = array();
$uidarray = array(0);
$query = $db->query("SELECT v.*, m.uid, m.username, m.email, m.regdate FROM {$tablepre}validating v, {$tablepre}members m
WHERE v.uid IN ($uids) AND m.uid=v.uid AND m.groupid='8'");
while($member = $db->fetch_array($query)) {
$members[$member['uid']] = $member;
$uidarray[] = $member['uid'];
}
$uids = implode(',', $uidarray);
$numdeleted = $numinvalidated = $numvalidated = 0;
if(!empty($moderation['delete']) && is_array($moderation['delete'])) {
$deleteuids = '\''.implode('\',\'', $moderation['delete']).'\'';
$db->query("DELETE FROM {$tablepre}members WHERE uid IN ($deleteuids) AND uid IN ($uids)");
$numdeleted = $db->affected_rows();
$db->query("DELETE FROM {$tablepre}memberfields WHERE uid IN ($deleteuids) AND uid IN ($uids)");
$db->query("DELETE FROM {$tablepre}validating WHERE uid IN ($deleteuids) AND uid IN ($uids)");
} else {
$moderation['delete'] = array();
}
if(!empty($moderation['validate']) && is_array($moderation['validate'])) {
$query = $db->query("SELECT groupid FROM {$tablepre}usergroups WHERE creditshigher<=0 AND 0<creditslower LIMIT 1");
$newgroupid = $db->result($query, 0);
$validateuids = '\''.implode('\',\'', $moderation['validate']).'\'';
$db->query("UPDATE {$tablepre}members SET adminid='0', groupid='$newgroupid' WHERE uid IN ($validateuids) AND uid IN ($uids)");
$numvalidated = $db->affected_rows();
$db->query("DELETE FROM {$tablepre}validating WHERE uid IN ($validateuids) AND uid IN ($uids)");
} else {
$moderation['validate'] = array();
}
if(!empty($moderation['invalidate']) && is_array($moderation['invalidate'])) {
foreach($moderation['invalidate'] as $uid) {
$numinvalidated++;
$db->query("UPDATE {$tablepre}validating SET moddate='$timestamp', admin='$discuz_user', status='1', remark='".dhtmlspecialchars($remark[$uid])."' WHERE uid='$uid' AND uid IN ($uids)");
}
} else {
$moderation['invalidate'] = array();
}
if($sendemail) {
foreach(array('delete', 'validate', 'invalidate') as $operation) {
foreach($moderation[$operation] as $uid) {
if(isset($members[$uid])) {
$member = $members[$uid];
$member['regdate'] = gmdate($_DCACHE['settings']['dateformat'].' '.$_DCACHE['settings']['timeformat'], $member['regdate'] + $_DCACHE['settings']['timeoffset'] * 3600);
$member['submitdate'] = gmdate($_DCACHE['settings']['dateformat'].' '.$_DCACHE['settings']['timeformat'], $member['submitdate'] + $_DCACHE['settings']['timeoffset'] * 3600);
$member['moddate'] = gmdate($_DCACHE['settings']['dateformat'].' '.$_DCACHE['settings']['timeformat'], $timestamp + $_DCACHE['settings']['timeoffset'] * 3600);
$member['operation'] = $lang[$operation];
$member['remark'] = $remark[$uid] ? dhtmlspecialchars($remark[$uid]) : $lang['none'];
sendmail("$member[username] <$member[email]>", 'moderate_member_subject', 'moderate_member_message');
}
}
}
}
cpmsg('moderate_members_succeed', "admincp.php?action=modmembers&page=$page");
} elseif(submitcheck('prunesubmit', 1)) {
$sql = '1';
$sql .= $submitmore ? " AND v.submittimes>'$submitmore'" : '';
$sql .= $regbefore ? " AND m.regdate<'".($timestamp - $regbefore * 86400)."'" : '';
$sql .= $modbefore ? " AND v.moddate<'".($timestamp - $modbefore * 86400)."'" : '';
$sql .= $regip ? " AND m.regip LIKE '$regip%'" : '';
$query = $db->query("SELECT v.uid FROM {$tablepre}validating v, {$tablepre}members m
WHERE $sql AND m.uid=v.uid AND m.groupid='8'");
$membernum = $db->num_rows($query);
if(!$confirmed) {
cpmsg('members_delete_confirm', "admincp.php?action=modmembers&submitmore=".rawurlencode($submitmore)."®before=".rawurlencode($regbefore)."®ip=".rawurlencode($regip)."&prunesubmit=yes", 'form');
} else {
$uids = 0;
while($member = $db->fetch_array($query)) {
$uids .= ','.$member['uid'];
}
$db->query("DELETE FROM {$tablepre}members WHERE uid IN ($uids)");
$numdeleted = $db->affected_rows();
$db->query("DELETE FROM {$tablepre}memberfields WHERE uid IN ($uids)");
$db->query("DELETE FROM {$tablepre}validating WHERE uid IN ($uids)");
cpmsg('members_delete_succeed');
}
}
} else {
require_once DISCUZ_ROOT.'./include/forum.func.php';
require_once DISCUZ_ROOT.'./include/post.func.php';
$modfid = !empty($modfid) ? intval($modfid) : 0;
$fids = 0;
$recyclebins = $forumlist = array();
if($adminid == 3) {
$query = $db->query("SELECT m.fid, f.name, f.recyclebin FROM {$tablepre}moderators m LEFT JOIN {$tablepre}forums f ON f.fid=m.fid WHERE m.uid='$discuz_uid'");
while($forum = $db->fetch_array($query)) {
$fids .= ','.$forum['fid'];
$recyclebins[$forum['fid']] = $forum['recyclebin'];
$forumlist[$forum['fid']] = strip_tags($forum['name']);
}
if(empty($forumlist)) {
cpmsg('moderate_posts_no_access_all');
} elseif($modfid && empty($forumlist[$modfid])) {
cpmsg('moderate_posts_no_access_this');
}
} else {
$query = $db->query("SELECT fid, name, recyclebin FROM {$tablepre}forums WHERE status>0 AND type<>'group'");
while($forum = $db->fetch_array($query)) {
$recyclebins[$forum['fid']] = $forum['recyclebin'];
$forumlist[$forum['fid']] = $forum['name'];
}
}
if($modfid) {
$fidadd = array('fids' => "fid='$modfid'", 'and' => ' AND ', 't' => 't.', 'p' => 'p.');
} else {
$fidadd = $fids ? array('fids' => "fid IN ($fids)", 'and' => ' AND ', 't' => 't.', 'p' => 'p.') : array();
}
if(isset($filter) && $filter == 'ignore') {
$displayorder = -3;
$filteroptions = '<option value="normal">'.$lang['moderate_none'].'</option><option value="ignore" selected>'.$lang['moderate_ignore'].'</option>';
} else {
$displayorder = -2;
$filter = 'normal';
$filteroptions = '<option value="normal" selected>'.$lang['moderate_none'].'</option><option value="ignore">'.$lang['moderate_ignore'].'</option>';
}
$forumoptions = '<option value="all"'.(empty($modfid) ? ' selected' : '').'>'.$lang['moderate_all_fields'].'</option>';
foreach($forumlist as $fid => $forumname) {
$selected = $modfid == $fid ? ' selected' : '';
$forumoptions .= '<option value="'.$fid.'" '.$selected.'>'.$forumname.'</option>'."\n";
}
require_once DISCUZ_ROOT.'./include/misc.func.php';
$modreasonoptions = '<option value="">'.$lang['none'].'</option><option value="">--------</option>'.modreasonselect();
}
if($action == 'modthreads') {
shownav('menu_moderate_modthreads');
$validatedthreads = array();
if(submitcheck('modsubmit')) {
$moderation = array('validate' => array(), 'delete' => array(), 'ignore' => array());
if(is_array($mod)) {
foreach($mod as $tid => $action) {
$moderation[$action][] = intval($tid);
}
}
if($moderation['ignore']) {
$ignoretids = '\''.implode('\',\'', $moderation['ignore']).'\'';
$db->query("UPDATE {$tablepre}threads SET displayorder='-3' WHERE tid IN ($ignoretids) AND displayorder='-2'");
}
$threadsmod = 0;
$pmlist = array();
if($moderation['delete']) {
$deletetids = '0';
$recyclebintids = '0';
$query = $db->query("SELECT tid, fid, authorid, subject FROM {$tablepre}threads WHERE tid IN ('".implode('\',\'', $moderation['delete'])."') AND displayorder='$displayorder' $fidadd[and]$fidadd[fids]");
while($thread = $db->fetch_array($query)) {
if($recyclebins[$thread['fid']]) {
$recyclebintids .= ','.$thread['tid'];
} else {
$deletetids .= ','.$thread['tid'];
}
$pm = 'pm_'.$thread['tid'];
if(isset($$pm) && $$pm <> '' && $thread['authorid']) {
$pmlist[] = array(
'act' => 'modthreads_delete_',
'authorid' => $thread['authorid'],
'thread' => $thread['subject'],
'reason' => dhtmlspecialchars($$pm)
);
}
}
if($recyclebintids) {
$db->query("UPDATE {$tablepre}threads SET displayorder='-1', moderated='1' WHERE tid IN ($recyclebintids)");
updatemodworks('MOD', $db->affected_rows());
$db->query("UPDATE {$tablepre}posts SET invisible='-1' WHERE tid IN ($recyclebintids)");
updatemodlog($recyclebintids, 'DEL');
}
$query = $db->query("SELECT attachment, thumb, remote FROM {$tablepre}attachments WHERE tid IN ($deletetids)");
while($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
$db->query("DELETE FROM {$tablepre}threads WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}posts WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}polloptions WHERE tid IN ($deletetids)");
$db->query("DELETE FROM {$tablepre}polls WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}trades WHERE tid IN ($deletetids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}attachments WHERE tid IN ($deletetids)", 'UNBUFFERED');
}
if($moderation['validate']) {
$forums = array();
$validatetids = '\''.implode('\',\'', $moderation['validate']).'\'';
$tids = $supe_pushtids = $comma = $comma2 = '';
$authoridarray = $moderatedthread = array();
$query = $db->query("SELECT t.fid, t.tid, t.authorid, t.subject, t.author, t.dateline, t.supe_pushstatus, ff.postcredits, ff.supe_pushsetting FROM {$tablepre}threads t
LEFT JOIN {$tablepre}forumfields ff USING(fid)
WHERE t.tid IN ($validatetids) AND t.displayorder='$displayorder' $fidadd[and]$fidadd[t]$fidadd[fids]");
while($thread = $db->fetch_array($query)) {
$supe_pushsetting = unserialize($thread['supe_pushsetting']);
if($supe['status'] && $thread['supe_pushstatus'] == 0 && $supe_allowpushthread && $supe_pushsetting['status'] == '1') {
$supe_pushtids .= $comma2.$thread['tid'];
$comma2 = ',';
}
$tids .= $comma.$thread['tid'];
$comma = ',';
if($thread['postcredits']) {
updatepostcredits('+', $thread['authorid'], unserialize($thread['postcredits']));
} else {
$authoridarray[] = $thread['authorid'];
}
$forums[] = $thread['fid'];
$validatedthreads[] = $thread;
$pm = 'pm_'.$thread['tid'];
if(isset($$pm) && $$pm <> '' && $thread['authorid']) {
$pmlist[] = array(
'act' => 'modthreads_validate_',
'authorid' => $thread['authorid'],
'tid' => $thread['tid'],
'thread' => $thread['subject'],
'reason' => dhtmlspecialchars($$pm)
);
}
}
if($supe_pushtids) {
$db->query("UPDATE {$tablepre}threads SET supe_pushstatus='1' WHERE tid IN ($supe_pushtids)");
}
if($tids) {
if($authoridarray) {
updatepostcredits('+', $authoridarray, $creditspolicy['post']);
}
$db->query("UPDATE {$tablepre}posts SET invisible='0' WHERE tid IN ($tids)");
$db->query("UPDATE {$tablepre}threads SET displayorder='0', moderated='1' WHERE tid IN ($tids)");
$threadsmod = $db->affected_rows();
foreach(array_unique($forums) as $fid) {
updateforumcount($fid);
}
updatemodworks('MOD', $threadsmod);
updatemodlog($tids, 'MOD');
}
}
if($pmlist) {
foreach($pmlist as $pm) {
$reason = $pm['reason'];
$threadsubject = $pm['thread'];
$tid = intval($pm['tid']);
sendpm($pm['authorid'], $pm['act'].'subject', $pm['act'].'message', $fromid = '', $from = '');
}
}
}
if(!empty($validatedthreads)) {
?>
<form id="topicadmin" name="topicadmin" method="POST" action="topicadmin.php" target="_blank">
<input type="hidden" name="tid" value="">
<input type="hidden" name="fid" value="">
<input type="hidden" name="action" value="">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="5"><?=$lang['moderate_validate_list']?></td></tr>
<tr class="category" align="center"><td>Tid</td><td><?=$lang['subject']?></td><td><?=$lang['author']?></td><td><?=$lang['dateline']?></td><td><?=$lang['front_moderation']?></td></tr>
<?
foreach($validatedthreads as $thread) {
echo '<tr><td width="8%" class="altbg1">'.$thread['tid'].'</td>'.
'<td width="45%" class="altbg2"><a href="viewthread.php?tid='.$thread['tid'].'" target="_blank">'.$thread['subject'].'</a></td>'.
'<td width="12%" class="altbg1"><a href="space.php?action=viewpro&uid='.$thread['authorid'].'" target="_blank">'.$thread['author'].'</a></td>'.
'<td width="20%" class="altbg2">'.gmdate("$dateformat $timeformat", $thread['dateline'] + 3600 * $timeoffset).'</td>'.
'<td width="15%" class="altbg1"><select name="action2" id="action2" onchange="if(this.options[this.selectedIndex].value != \'\') {$(\'topicadmin\').action.value= this.options[this.selectedIndex].value; $(\'topicadmin\').tid.value='.$thread['tid'].'; $(\'topicadmin\').fid.value='.$thread['fid'].'; $(\'topicadmin\').submit();}">
<option value="" selected>'.$lang['admin_modoptions'].'</option>
<option value="delete">'.$lang['admin_delthread'].'</option>
<option value="close">'.$lang['admin_close'].'</option>
<option value="move">'.$lang['admin_move'].'</option>
<option value="copy">'.$lang['admin_copy'].'</option>
<option value="highlight">'.$lang['admin_highlight'].'</option>
<option value="digest">'.$lang['admin_digest'].'</option>
<option value="stick">'.$lang['admin_stick'].'</option>
<option value="merge">'.$lang['admin_merge'].'</option>
<option value="bump">'.$lang['admin_bump'].'</option>
<option value="repair">'.$lang['admin_repair'].'</option>
</select></td></tr>';
}
echo '</table></form><br />';
}
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
$tpp = 10;
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}threads WHERE $fidadd[fids]$fidadd[and] displayorder='$displayorder'");
$modcount = $db->result($query, 0);
$multipage = multi($modcount, $tpp, $page, "admincp.php?action=modthreads&filter=$filter&modfid=$modfid");
$threads = '';
$query = $db->query("SELECT f.name AS forumname, f.allowsmilies, f.allowhtml, f.allowbbcode, f.allowimgcode,
t.tid, t.fid, t.author, t.authorid, t.subject, t.dateline, t.attachment,
p.pid, p.message, p.useip, p.attachment, p.htmlon, p.smileyoff, p.bbcodeoff
FROM {$tablepre}threads t
LEFT JOIN {$tablepre}posts p ON p.tid=t.tid
LEFT JOIN {$tablepre}forums f ON f.fid=t.fid
WHERE $fidadd[t]$fidadd[fids]$fidadd[and] t.displayorder='$displayorder'
ORDER BY t.dateline DESC LIMIT $start_limit, $tpp");
while($thread = $db->fetch_array($query)) {
if($thread['authorid'] && $thread['author']) {
$thread['author'] = "<a href=\"space.php?action=viewpro&uid=$thread[authorid]\" target=\"_blank\">$thread[author]</a>";
} elseif($thread['authorid'] && !$thread['author']) {
$thread['author'] = "<a href=\"space.php?action=viewpro&uid=$thread[authorid]\" target=\"_blank\">$lang[anonymous]</a>";
} else {
$thread['author'] = $lang['guest'];
}
$thread['dateline'] = gmdate("$dateformat $timeformat", $thread['dateline'] + $timeoffset * 3600);
$thread['message'] = discuzcode($thread['message'], $thread['smileyoff'], $thread['bbcodeoff'], sprintf('%00b', $thread['htmlon']), $thread['allowsmilies'], $thread['allowbbcode'], $thread['allowimgcode'], $thread['allowhtml']);
$thisbg = $thisbg == 'altbg2' ? 'altbg1' : 'altbg2';
$threads .= "<tr><td colspan=2 style=\"height: 2px\"></td></tr><tr class=\"altbg1\" id=\"mod_$thread[tid]_row1\"><td width=\"15%\" height=\"100%\">\n".
"<b>$thread[author]</b> ({$thread[useip]})</td>\n".
"<td><a href=\"forumdisplay.php?fid=$thread[fid]\" target=\"_blank\">$thread[forumname]</a> <b>»</b> <b>$thread[subject]</b></td></tr>\n".
"<tr class=\"altbg2\" id=\"mod_$thread[tid]_row2\"><td valign=\"middle\" >".
"<input class=\"radio\" type=\"radio\" name=\"mod[$thread[tid]]\" id=\"mod_$thread[tid]_1\" value=\"validate\" checked onclick=\"mod_setbg($thread[tid], 'validate');\">$lang[validate]<br />\n".
"<input class=\"radio\" type=\"radio\" name=\"mod[$thread[tid]]\" id=\"mod_$thread[tid]_2\" value=\"delete\" onclick=\"mod_setbg($thread[tid], 'delete');\">$lang[delete]<br />\n".
"<input class=\"radio\" type=\"radio\" name=\"mod[$thread[tid]]\" id=\"mod_$thread[tid]_3\" value=\"ignore\" onclick=\"mod_setbg($thread[tid], 'ignore');\">$lang[ignore]\n".
"</td>\n".
"<td style=\"border-left: 1px #BBDCF1 solid; padding: 4px;\"><div style=\"overflow: auto; overflow-x: hidden; height:120px; word-break: break-all\">$thread[message]";
if($thread['attachment']) {
require_once DISCUZ_ROOT.'./include/attachment.func.php';
$queryattach = $db->query("SELECT aid, filename, filetype, filesize, attachment, isimage FROM {$tablepre}attachments WHERE tid='$thread[tid]'");
while($attach = $db->fetch_array($queryattach)) {
$attach['url'] = $attach['isimage']
? " $attach[filename] (".sizecount($attach['filesize']).")<br /><br /><img src=\"$attachurl/$attach[attachment]\" onload=\"if(this.width > 400) {this.resized=true; this.width=400;}\">"
: "<a href=\"$attachurl/$attach[attachment]\" target=\"_blank\">$attach[filename]</a> (".sizecount($attach['filesize']).")";
$threads .= "<br /><br />$lang[attachment]: ".attachtype(fileext($thread['filename'])."\t".$attach['filetype']).$attach['url'];
}
}
$threads .= "</div></td></tr><tr class=altbg2 id=\"mod_$thread[tid]_row3\"><td style=\"text-align: center; padding: 0px;\">$thread[dateline]</td><td style=\"border-left: 1px #BBDCF1 solid; padding: 2px 10px 2px 10px;\">\n".
"<a href=\"post.php?action=edit&fid=$thread[fid]&tid=$thread[tid]&pid=$thread[pid]&page=1&mod=edit\" target=\"_blank\">".$lang['moderate_edit_thread']."</a> ".
" | ".$lang['moderate_reasonpm']." <input type=text size=30 name=pm_$thread[tid] id=pm_$thread[tid] style=\"margin: 0px;\"> <select style=\"margin: 0px;\" onchange=\"$('pm_$thread[tid]').value=this.value\">$modreasonoptions</select>".
"</td></tr>\n";
}
$threads = $threads ? $threads : '<tr><td colspan="2" class="altbg1"><a href="admincp.php?action=modreplies">'.$lang['moderate_threads_none'].'</a></td></tr>';
?>
<style type="text/css">
.mod_validate td{ background: #FFFFFF; }
.mod_delete td{ background: #FFEBE7; }
.mod_ignore td{ background: #EEEEEE; }
</style>
<script type="text/javascript">
function mod_setbg(tid, value) {
if(value == 'validate') {
$('mod_' + tid + '_row1').className = 'altbg1';
$('mod_' + tid + '_row2').className = 'altbg2';
$('mod_' + tid + '_row3').className = 'altbg2';
}else {
$('mod_' + tid + '_row1').className = 'mod_' + value;
$('mod_' + tid + '_row2').className = 'mod_' + value;
$('mod_' + tid + '_row3').className = 'mod_' + value;
}
}
</script>
<form method="post" action="admincp.php?action=modthreads&page=<?=$page?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="ignore" value="<?=$ignore?>">
<input type="hidden" name="filter" value="<?=$filter?>">
<input type="hidden" name="modfid" value="<?=$modfid?>">
<?=$multipage?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['moderate_threads']?> - <?=$lang['moderate_bound']?> -
<select style="margin: 0px;" onchange="if(this.options[this.selectedIndex].value != '') {window.location=('admincp.php?action=modthreads&modfid=<?=$modfid?>&filter='+this.options[this.selectedIndex].value+'&sid=5ScwCd');
}"><?=$filteroptions?></select>
- <?=$lang['moderate_forum']?> - <select style="margin: 0px;" onchange="if(this.options[this.selectedIndex].value != '') {window.location=('admincp.php?action=modthreads&filter=<?=$filter?>&modfid='+this.options[this.selectedIndex].value+'&sid=5ScwCd');
}"><?=$forumoptions?></select></td></tr>
<tr><td colspan="2" class="category">
<input class="button" type="button" value="<?=$lang['moderate_all_validate']?>" onclick="checkalloption(this.form, 'validate')">
<input class="button" type="button" value="<?=$lang['moderate_all_delete']?>" onclick="checkalloption(this.form, 'delete')">
<input class="button" type="button" value="<?=$lang['moderate_all_ignore']?>" onclick="checkalloption(this.form, 'ignore')">
<?=$threads?>
</table>
<?=$multipage?>
<br /><center><input class="button" type="submit" name="modsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} elseif($action == 'modreplies') {
if(!submitcheck('modsubmit')) {
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
$ppp = 10;
$page = max(1, intval($page));
$start_limit = ($page - 1) * $ppp;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE invisible='$displayorder' AND first='0' $fidadd[and]$fidadd[fids]");
$modcount = $db->result($query, 0);
$multipage = multi($modcount, $ppp, $page, "admincp.php?action=modreplies&filter=$filter&modfid=$modfid");
$posts = '';
$query = $db->query("SELECT f.name AS forumname, f.allowsmilies, f.allowhtml, f.allowbbcode, f.allowimgcode,
p.pid, p.fid, p.tid, p.author, p.authorid, p.subject, p.dateline, p.message, p.useip, p.attachment,
p.htmlon, p.smileyoff, p.bbcodeoff, t.subject AS tsubject
FROM {$tablepre}posts p
LEFT JOIN {$tablepre}threads t ON t.tid=p.tid
LEFT JOIN {$tablepre}forums f ON f.fid=p.fid
WHERE p.invisible='$displayorder' AND p.first='0' $fidadd[and]$fidadd[p]$fidadd[fids]
ORDER BY p.dateline DESC LIMIT $start_limit, $ppp");
while($post = $db->fetch_array($query)) {
$post['dateline'] = gmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600);
$post['subject'] = $post['subject'] ? '<b>'.$post['subject'].'</b>' : '<i>'.$lang['nosubject'].'</i>';
$post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], sprintf('%00b', $post['htmlon']), $post['allowsmilies'], $post['allowbbcode'], $post['allowimgcode'], $post['allowhtml']);
$thisbg = $thisbg == 'altbg2' ? 'altbg1' : 'altbg2';
$posts .= "<tr><td colspan=2 style=\"height: 2px\"></td></tr><tr class=\"altbg1\" id=\"mod_$post[pid]_row1\"><td width=\"15%\" height=\"100%\">\n".
"<b>$post[author]</b>($post[useip])</td>\n".
"<td><a href=\"forumdisplay.php?fid=$post[fid]\" target=\"_blank\">$post[forumname]</a> <b>»</b> ".
"<a href=\"viewthread.php?tid=$post[tid]\" target=\"_blank\">$post[tsubject]</a> <b>»</b> $post[subject]</a></td></tr>\n".
"<tr class=\"altbg2\" id=\"mod_$post[pid]_row2\"><td valign=\"middle\" >".
"<input class=\"radio\" type=\"radio\" name=\"mod[$post[pid]]\" value=\"validate\" id=\"mod_$post[pid]_1\" checked onclick=\"mod_setbg($post[pid], 'validate');\">$lang[validate]<br />\n".
"<input class=\"radio\" type=\"radio\" name=\"mod[$post[pid]]\" value=\"delete\" id=\"mod_$post[pid]_2\" onclick=\"mod_setbg($post[pid], 'delete');\">$lang[delete]<br />\n".
"<input class=\"radio\" type=\"radio\" name=\"mod[$post[pid]]\" value=\"ignore\" id=\"mod_$post[pid]_3\" onclick=\"mod_setbg($post[pid], 'ignore');\">$lang[ignore]<br />\n".
"</td>".
"<td style=\"border-left: 1px #BBDCF1 solid; padding: 4px;\"><div style=\"overflow: auto; overflow-x: hidden; height:120px; word-break: break-all\">$post[message]";
if($post['attachment']) {
require_once DISCUZ_ROOT.'./include/attachment.func.php';
$queryattach = $db->query("SELECT aid, filename, filetype, filesize, attachment, isimage FROM {$tablepre}attachments WHERE pid='$post[pid]'");
while($attach = $db->fetch_array($queryattach)) {
$attach['url'] = $attach['isimage']
? " $attach[filename] (".sizecount($attach['filesize']).")<br /><br /><img src=\"$attachurl/$attach[attachment]\" onload=\"if(this.width > 400) {this.resized=true; this.width=400;}\">"
: "<a href=\"$attachurl/$attach[attachment]\" target=\"_blank\">$attach[filename]</a> (".sizecount($attach['filesize']).")";
$posts .= "<br /><br />$lang[attachment]: ".attachtype(fileext($attach['filename'])."\t".$attach['filetype']).$attach['url'];
}
}
$posts .= "</div></td></tr><tr class=altbg2 id=\"mod_$post[pid]_row3\"><td style=\"text-align: center; padding: 0px;\">$post[dateline]</td><td style=\"border-left: 1px #BBDCF1 solid; padding: 2px 10px 2px 10px;\">\n".
"<a href=\"post.php?action=edit&fid=$thread[fid]&tid=$post[tid]&pid=$post[pid]&page=1&mod=edit\" target=\"_blank\">".$lang['moderate_edit_post']."</a> ".
" | ".$lang['moderate_reasonpm']." <input type=text size=30 name=pm_$post[pid] id=pm_$post[pid] style=\"margin: 0px;\"> <select style=\"margin: 0px;\" onchange=\"$('pm_$post[pid]').value=this.value\">$modreasonoptions</select>".
"</td></tr>\n";
}
$posts = $posts ? $posts : '<tr><td colspan="2" class="altbg1"><a href="admincp.php?action=modthreads">'.$lang['moderate_posts_none'].'</a></td></tr>';
shownav('menu_moderate_modreplies');
?>
<style type="text/css">
.mod_validate td{ background: #FFFFFF; }
.mod_delete td{ background: #FFEBE7; }
.mod_ignore td{ background: #EEEEEE; }
</style>
<script type="text/javascript">
function mod_setbg(tid, value) {
if(value == 'validate') {
$('mod_' + tid + '_row1').className = 'altbg1';
$('mod_' + tid + '_row2').className = 'altbg2';
$('mod_' + tid + '_row3').className = 'altbg2';
}else {
$('mod_' + tid + '_row1').className = 'mod_' + value;
$('mod_' + tid + '_row2').className = 'mod_' + value;
$('mod_' + tid + '_row3').className = 'mod_' + value;
}
}
</script>
<form method="post" action="admincp.php?action=modreplies&page=<?=$page?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="filter" value="<?=$filter?>">
<input type="hidden" name="modfid" value="<?=$modfid?>">
<?=$multipage?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['moderate_posts']?> - <?=$lang['moderate_bound']?> -
<select style="margin: 0px;" onchange="if(this.options[this.selectedIndex].value != '') {window.location=('admincp.php?action=modreplies&modfid=<?=$modfid?>&filter='+this.options[this.selectedIndex].value+'&sid=5ScwCd');
}"><?=$filteroptions?></select>
- <?=$lang['moderate_forum']?> - <select style="margin: 0px;" onchange="if(this.options[this.selectedIndex].value != '') {window.location=('admincp.php?action=modreplies&filter=<?=$filter?>&modfid='+this.options[this.selectedIndex].value+'&sid=5ScwCd');
}"><?=$forumoptions?></select></td></tr>
<tr><td colspan="2" style="line-height:32px;" class="p_header">
<input class="button" type="button" value="<?=$lang['moderate_all_validate']?>" onclick="checkalloption(this.form, 'validate')">
<input class="button" type="button" value="<?=$lang['moderate_all_delete']?>" onclick="checkalloption(this.form, 'delete')">
<input class="button" type="button" value="<?=$lang['moderate_all_ignore']?>" onclick="checkalloption(this.form, 'ignore')"></td></tr>
<?=$posts?>
</table>
<?=$multipage?>
<br /><center><input class="button" type="submit" name="modsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
$moderation = array('validate' => array(), 'delete' => array(), 'ignore' => array());
$pmlist = array();
if(is_array($mod)) {
foreach($mod as $pid => $action) {
$moderation[$action][] = intval($pid);
}
}
if($ignorepids = implodeids($moderation['ignore'])) {
$db->query("UPDATE {$tablepre}posts SET invisible='-3' WHERE pid IN ($ignorepids) AND invisible='-2' AND first='0' $fidadd[and]$fidadd[fids]");
}
if($deletepids = implodeids($moderation['delete'])) {
$query = $db->query("SELECT pid, authorid, tid, message FROM {$tablepre}posts WHERE pid IN ($deletepids) AND invisible='$displayorder' AND first='0' $fidadd[and]$fidadd[fids]", 'UNBUFFERED');
$pids = '0';
while($post = $db->fetch_array($query)) {
$pids .= ','.$post['pid'];
$pm = 'pm_'.$post['pid'];
if(isset($$pm) && $$pm <> '' && $post['authorid']) {
$pmlist[] = array(
'act' => 'modreplies_delete_',
'authorid' => $post['authorid'],
'tid' => $post['tid'],
'post' => dhtmlspecialchars(cutstr($post['message'], 30)),
'reason' => dhtmlspecialchars($$pm)
);
}
}
if($pids) {
$query = $db->query("SELECT attachment, thumb, remote FROM {$tablepre}attachments WHERE pid IN ($deletepids)");
while($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
$db->query("DELETE FROM {$tablepre}attachments WHERE pid IN ($pids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}posts WHERE pid IN ($pids)", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}trades WHERE pid IN ($pids)", 'UNBUFFERED');
}
updatemodworks('DLP', count($moderation['delete']));
}
$repliesmod = 0;
if($validatepids = implodeids($moderation['validate'])) {
$forums = $threads = $lastpost = $attachments = $pidarray = $authoridarray = array();
$query = $db->query("SELECT t.lastpost, p.pid, p.fid, p.tid, p.authorid, p.author, p.dateline, p.attachment, p.message, p.anonymous, ff.replycredits
FROM {$tablepre}posts p
LEFT JOIN {$tablepre}forumfields ff ON ff.fid=p.fid
LEFT JOIN {$tablepre}threads t ON t.tid=p.tid
WHERE p.pid IN ($validatepids) AND p.invisible='$displayorder' AND first='0' $fidadd[and]$fidadd[p]$fidadd[fids]");
while($post = $db->fetch_array($query)) {
$repliesmod ++;
$pidarray[] = $post['pid'];
if($post['replycredits']) {
updatepostcredits('+', $post['authorid'], unserialize($post['replycredits']));
} else {
$authoridarray[] = $post['authorid'];
}
$forums[] = $post['fid'];
$threads[$post['tid']]['posts']++;
$threads[$post['tid']]['lastpostadd'] = $post['dateline'] > $post['lastpost'] && $post['dateline'] > $lastpost[$post['tid']] ?
", lastpost='$post[dateline]', lastposter='".($post['anonymous'] && $post['dateline'] != $post['lastpost'] ? '' : addslashes($post[author]))."'" : '';
$threads[$post['tid']]['attachadd'] = $threads[$post['tid']]['attachadd'] || $post['attachment'] ? ', attachment=\'1\'' : '';
$pm = 'pm_'.$post['pid'];
if(isset($$pm) && $$pm <> '' && $post['authorid']) {
$pmlist[] = array(
'act' => 'modreplies_validate_',
'authorid' => $post['authorid'],
'tid' => $post['tid'],
'post' => dhtmlspecialchars(cutstr($post['message'], 30)),
'reason' => dhtmlspecialchars($$pm)
);
}
}
if($authoridarray) {
updatepostcredits('+', $authoridarray, $creditspolicy['reply']);
}
foreach($threads as $tid => $thread) {
$db->query("UPDATE {$tablepre}threads SET replies=replies+$thread[posts] $thread[lastpostadd] $thread[attachadd] WHERE tid='$tid'", 'UNBUFFERED');
}
foreach(array_unique($forums) as $fid) {
updateforumcount($fid);
}
if(!empty($pidarray)) {
$db->query("UPDATE {$tablepre}posts SET invisible='0' WHERE pid IN (0,".implode(',', $pidarray).")");
$repliesmod = $db->affected_rows();
updatemodworks('MOD', $repliesmod);
} else {
updatemodworks('MOD', 1);
}
}
if($pmlist) {
foreach($pmlist as $pm) {
$reason = $pm['reason'];
$post = $pm['post'];
$tid = intval($pm['tid']);
sendpm($pm['authorid'], $pm['act'].'subject', $pm['act'].'message', $fromid = '', $from = '');
}
}
cpmsg('moderate_replies_succeed', "admincp.php?action=modreplies&page=$page&filter=$filter&modfid=$modfid");
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/moderate.inc.php | PHP | asf20 | 38,848 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: plugins.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
if($action == 'pluginsconfig' && $export) {
$query = $db->query("SELECT * FROM {$tablepre}plugins WHERE pluginid='$export'");
if(!$plugin = $db->fetch_array($query)) {
cpheader();
cpmsg('undefined_action');
}
unset($plugin['pluginid']);
$pluginarray = array();
$pluginarray['plugin'] = $plugin;
$pluginarray['version'] = strip_tags($version);
$time = gmdate("$dateformat $timeformat", $timestamp + $timeoffset * 3600);
$query = $db->query("SELECT * FROM {$tablepre}pluginhooks WHERE pluginid='$export'");
while($hook = $db->fetch_array($query)) {
unset($hook['pluginhookid'], $hook['pluginid']);
$pluginarray['hooks'][] = $hook;
}
$query = $db->query("SELECT * FROM {$tablepre}pluginvars WHERE pluginid='$export'");
while($var = $db->fetch_array($query)) {
unset($var['pluginvarid'], $var['pluginid']);
$pluginarray['vars'][] = $var;
}
$plugin_export = "# Discuz! Plugin Dump\n".
"# Version: Discuz! $version\n".
"# Time: $time \n".
"# From: $bbname ($boardurl) \n".
"#\n".
"# Discuz! Community: http://www.Discuz.net\n".
"# Please visit our website for latest news about Discuz!\n".
"# --------------------------------------------------------\n\n\n".
wordwrap(base64_encode(serialize($pluginarray)), 60, "\n", 1);
ob_end_clean();
dheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
dheader('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
dheader('Cache-Control: no-cache, must-revalidate');
dheader('Pragma: no-cache');
dheader('Content-Encoding: none');
dheader('Content-Length: '.strlen($plugin_export));
dheader('Content-Disposition: attachment; filename=discuz_plugin_'.$plugin['identifier'].'.txt');
dheader('Content-Type: '.(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? 'application/octetstream' : 'application/octet-stream'));
echo $plugin_export;
dexit();
}
cpheader();
if($action == 'plugins') {
if(!$edit && !$identifier) {
shownav('menu_plugins_edit');
showtips('plugins_tips');
$plugins = '';
$query = $db->query("SELECT p.*, pv.pluginvarid FROM {$tablepre}plugins p
LEFT JOIN {$tablepre}pluginvars pv USING(pluginid)
GROUP BY p.pluginid
ORDER BY p.available DESC, p.pluginid");
while($plugin = $db->fetch_array($query)) {
if(!$plugin['adminid'] || $plugin['adminid'] >= $adminid) {
$plugin['disabled'] = '';
$plugin['edit'] = $plugin['pluginvarid'] ? "<a href=\"admincp.php?action=plugins&edit=$plugin[pluginid]\">[$lang[plugins_settings]]</a> " : '';
if(is_array($plugin['modules'] = unserialize($plugin['modules']))) {
foreach($plugin['modules'] as $module) {
if($module['type'] == 3 && (!$module['adminid'] || $module['adminid'] >= $adminid)) {
$plugin['edit'] .= "<a href=\"admincp.php?action=plugins&identifier=$plugin[identifier]&mod=$module[name]\">[$lang[plugins_settings_module]: $module[menu]]</a> ";
}
}
}
} else {
$plugin['disabled'] = 'disabled';
$plugin['edit'] = "[$lang[detail]]";
}
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tableborder\" $plugin[disabled]>\n".
"<tr class=\"header\"><td colspan=\"2\">$plugin[name]".(!$plugin['available'] ? ' ('.$lang['plugins_unavailable'].')' : '')."</td></tr>\n".
"<tr><td width=\"20%\" class=\"altbg1\">$lang[description]:</td><td class=\"altbg2\">$plugin[description]</td></tr>\n".
"<tr><td width=\"20%\" class=\"altbg1\">$lang[copyright]:</td><td class=\"altbg2\">$plugin[copyright]</td></tr>\n".
"<tr><td width=\"20%\" class=\"altbg1\">$lang[edit]:</td><td class=\"altbg2\">$plugin[edit]</td></tr>\n".
"</table><br />";
}
} else {
$query = $db->query("SELECT * FROM {$tablepre}plugins WHERE ".($identifier ? "identifier='$identifier'" : "pluginid='$edit'"));
if(!$plugin = $db->fetch_array($query)) {
cpmsg('undefined_action');
} else {
$edit = $plugin['pluginid'];
}
$pluginvars = array();
$query = $db->query("SELECT * FROM {$tablepre}pluginvars WHERE pluginid='$edit' ORDER BY displayorder");
while($var = $db->fetch_array($query)) {
$pluginvars[$var['variable']] = $var;
}
if(empty($mod)) {
if(($plugin['adminid'] && $adminid > $plugin['adminid']) || !$pluginvars) {
cpmsg('noaccess');
}
if(!submitcheck('editsubmit')) {
shownav('menu_plugins_edit');
echo "<form method=\"post\" action=\"admincp.php?action=plugins&edit=$pluginid&edit=$edit&formhash=".FORMHASH."\">\n";
showtype($lang['plugins_settings'].' - '.$plugin['name'], 'top');
foreach($pluginvars as $var) {
$var['variable'] = 'varsnew['.$var['variable'].']';
if($var['type'] == 'number') {
$var['type'] = 'text';
} elseif($var['type'] == 'select') {
$var['type'] = "<select name=\"$var[variable]\">\n";
foreach(explode("\n", $var['extra']) as $key => $option) {
$option = trim($option);
if(strpos($option, '=') === FALSE) {
$key = $option;
} else {
$item = explode('=', $option);
$key = trim($item[0]);
$option = trim($item[1]);
}
$var['type'] .= "<option value=\"".dhtmlspecialchars($key)."\" ".($var['value'] == $key ? 'selected' : '').">$option</option>\n";
}
$var['type'] .= "</select>\n";
$var['variable'] = $var['value'] = '';
}
$var['title'] = '</b><b>'.(isset($lang[$var['title']]) ? $lang[$var['title']] : $var['title']).'</b><br />'.
(isset($lang[$var['description']]) ? $lang[$var['description']] : $var['description']);
showsetting($var['title'], $var['variable'], $var['value'], $var['type']);
}
showtype('', 'bottom');
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"editsubmit\" value=\"$lang[submit]\"></center></form>";
} else {
if(is_array($varsnew)) {
foreach($varsnew as $variable => $value) {
if(isset($pluginvars[$variable])) {
if($pluginvars[$variable]['type'] == 'number') {
$value = (float)$value;
}
$db->query("UPDATE {$tablepre}pluginvars SET value='$value' WHERE pluginid='$edit' AND variable='$variable'");
}
}
}
updatecache('plugins');
cpmsg('plugins_settings_succeed', 'admincp.php?action=plugins');
}
} else {
$modfile = '';
if(is_array($plugin['modules'] = unserialize($plugin['modules']))) {
foreach($plugin['modules'] as $module) {
if($module['type'] == 3 && $module['name'] == $mod && (!$module['adminid'] || $module['adminid'] >= $adminid)) {
$plugin['directory'] .= (!empty($plugin['directory']) && substr($plugin['directory'], -1) != '/') ? '/' : '';
$modfile = './plugins/'.$plugin['directory'].$module['name'].'.inc.php';
break;
}
}
}
if($modfile) {
if(!@include DISCUZ_ROOT.$modfile) {
cpmsg('plugins_settings_module_nonexistence');
} else {
dexit();
}
} else {
cpmsg('undefined_action');
}
}
}
} elseif($action == 'pluginsconfig') {
if(!submitcheck('configsubmit') && !submitcheck('importsubmit')) {
$plugins = '';
$query = $db->query("SELECT * FROM {$tablepre}plugins");
while($plugin = $db->fetch_array($query)) {
$plugins .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$plugin[pluginid]\"></td>\n".
"<td class=\"altbg2\"><b>$plugin[name]</b></td>\n".
"<td class=\"altbg1\">$plugin[identifier]</td>\n".
"<td class=\"altbg2\">$plugin[description]</td>\n".
"<td class=\"altbg1\">$plugin[directory]</td>\n".
"<td class=\"altbg2\"><input class=\"checkbox\" type=\"checkbox\" name=\"availablenew[$plugin[pluginid]]\" value=\"1\" ".(!$plugin['name'] || !$plugin['identifier'] ? 'disabled' : ($plugin['available'] ? 'checked' : ''))."></td>\n".
"<td class=\"altbg1\"><a href=\"admincp.php?action=pluginsconfig&export=$plugin[pluginid]\">[$lang[download]]</a></td>\n".
"<td class=\"altbg2\"><a href=\"admincp.php?action=pluginsedit&pluginid=$plugin[pluginid]\">[$lang[detail]]</a></td></tr>\n";
}
shownav('menu_plugins_config');
showtips('plugins_config_tips');
?>
<form method="post" action="admincp.php?action=pluginsconfig&">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td width="5%"><input class="checkbox" type="checkbox" name="chkall" class="header" onclick="checkall(this.form, 'delete')"><?=$lang['del']?></td>
<td width="15%"><?=$lang['plugins_name']?></td>
<td width="15%"><?=$lang['plugins_identifier']?></td>
<td width="26%"><?=$lang['description']?></td>
<td width="15%"><?=$lang['plugins_directory']?></td>
<td width="8%"><?=$lang['available']?></td>
<td width="8%"><?=$lang['export']?></td>
<td width="10%"><?=$lang['edit']?></td></tr>
<?=$plugins?>
<tr align="center" class="altbg1"><td><?=$lang['add_new']?></td>
<td><input type='text' name="newname" size="12"></td>
<td><input type='text' name="newidentifier" size="8"></td>
<td colspan="6"> </td>
</tr></table><br />
<center><input class="button" type="submit" name="configsubmit" value="<?=$lang['submit']?>"></center></form><br />
<form method="post" action="admincp.php?action=pluginsconfig&">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['plugins_import']?></td></tr>
<tr><td class="altbg1"><div align="center"><textarea name="plugindata" cols="80" rows="8"></textarea><br />
<input class="checkbox" type="checkbox" name="ignoreversion" value="1"> <?=$lang['plugins_import_ignore_version']?></div></td></tr>
</table><br /><center><input class="button" type="submit" name="importsubmit" value="<?=$lang['submit']?>"></center></form>
<?
} elseif(submitcheck('configsubmit')) {
$db->query("UPDATE {$tablepre}plugins SET available='0'");
if(is_array($availablenew)) {
foreach($availablenew as $id => $available) {
$db->query("UPDATE {$tablepre}plugins SET available='$available' WHERE pluginid='$id'");
}
}
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}plugins WHERE pluginid IN ($ids)");
$db->query("DELETE FROM {$tablepre}pluginvars WHERE pluginid IN ($ids)");
}
if(($newname = trim($newname)) || ($newidentifier = trim($newidentifier))) {
if(!$newname) {
cpmsg('plugins_edit_name_invalid');
}
$query = $db->query("SELECT pluginid FROM {$tablepre}plugins WHERE identifier='$newidentifier' LIMIT 1");
if($db->num_rows($query) || !$newidentifier || !ispluginkey($newidentifier)) {
cpmsg('plugins_edit_identifier_invalid');
}
$db->query("INSERT INTO {$tablepre}plugins (name, identifier, available) VALUES ('".dhtmlspecialchars(trim($newname))."', '$newidentifier', '0')");
}
updatecache('plugins');
updatecache('settings');
cpmsg('plugins_edit_succeed', 'admincp.php?action=pluginsconfig');
} elseif(submitcheck('importsubmit')) {
$plugindata = preg_replace("/(#.*\s+)*/", '', $plugindata);
$pluginarray = daddslashes(unserialize(base64_decode($plugindata)), 1);
if(!is_array($pluginarray) || !is_array($pluginarray['plugin'])) {
cpmsg('plugins_import_data_invalid');
} elseif(empty($ignoreversion) && strip_tags($pluginarray['version']) != strip_tags($version)) {
cpmsg('plugins_import_version_invalid');
}
$query = $db->query("SELECT pluginid FROM {$tablepre}plugins WHERE identifier='{$pluginarray[plugin][identifier]}' LIMIT 1");
if($db->num_rows($query)) {
cpmsg('plugins_import_identifier_duplicated');
}
$sql1 = $sql2 = $comma = '';
foreach($pluginarray['plugin'] as $key => $val) {
if($key == 'directory') {
//compatible for old versions
$val .= (!empty($val) && substr($val, -1) != '/') ? '/' : '';
}
$sql1 .= $comma.$key;
$sql2 .= $comma.'\''.$val.'\'';
$comma = ',';
}
$db->query("INSERT INTO {$tablepre}plugins ($sql1) VALUES ($sql2)");
$pluginid = $db->insert_id();
foreach(array('hooks', 'vars') as $pluginconfig) {
if(is_array($pluginarray[$pluginconfig])) {
foreach($pluginarray[$pluginconfig] as $config) {
$sql1 = 'pluginid';
$sql2 = '\''.$pluginid.'\'';
foreach($config as $key => $val) {
$sql1 .= ','.$key;
$sql2 .= ',\''.$val.'\'';
}
$db->query("INSERT INTO {$tablepre}plugin$pluginconfig ($sql1) VALUES ($sql2)");
}
}
}
updatecache('plugins');
updatecache('settings');
cpmsg('plugins_import_succeed', 'admincp.php?action=pluginsconfig');
}
} elseif($action == 'pluginsedit' && $pluginid) {
$query = $db->query("SELECT * FROM {$tablepre}plugins WHERE pluginid='$pluginid'");
if(!$plugin = $db->fetch_array($query)) {
cpmsg('undefined_action');
}
$plugin['modules'] = unserialize($plugin['modules']);
if(!submitcheck('editsubmit')) {
$modules = '';
if(is_array($plugin['modules'])) {
foreach($plugin['modules'] as $moduleid => $module) {
$adminidselect = array($module['adminid'] => 'selected');
$includecheck = empty($val['include']) ? $lang['no'] : $lang['yes'];
$modules .= "<tr class=\"altbg1\" align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[$moduleid]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"15\" name=\"namenew[$moduleid]\" value=\"$module[name]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"15\" name=\"menunew[$moduleid]\" value=\"$module[menu]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"15\" name=\"urlnew[$moduleid]\" value=\"".dhtmlspecialchars($module['url'])."\"></td>\n".
"<td class=\"altbg1\"><select name=\"typenew[$moduleid]\">";
for($i = 1; $i <= 6; $i++) {
$modules .= "<option value=\"$i\" ".($module['type'] == $i ? 'selected' : '').">".$lang['plugins_edit_modules_type_'.$i]."</option>";
}
$modules .= "</select></td>\n".
"<td class=\"altbg2\"><select name=\"adminidnew[$moduleid]\">\n".
"<option value=\"0\" $adminidselect[0]>$lang[usergroups_system_0]</option>\n".
"<option value=\"1\" $adminidselect[1]>$lang[usergroups_system_1]</option>\n".
"<option value=\"2\" $adminidselect[2]>$lang[usergroups_system_2]</option>\n".
"<option value=\"3\" $adminidselect[3]>$lang[usergroups_system_3]</option>\n".
"</select></td><td class=\"altbg1\"><input type=\"text\" size=\"2\" name=\"ordernew[$moduleid]\" value=\"$module[displayorder]\"></td></tr>\n";
}
}
$hooks = '';
$query = $db->query("SELECT pluginhookid, title, description, available FROM {$tablepre}pluginhooks WHERE pluginid='$plugin[pluginid]'");
while($hook = $db->fetch_array($query)) {
$hook['description'] = nl2br(cutstr($hook['description'], 50));
$hook['evalcode'] = 'eval($hooks[\''.$plugin['identifier'].'_'.$hook['title'].'\']);';
$hooks .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[$hook[pluginhookid]]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" name=\"titlenew[$hook[pluginhookid]]\" size=\"15\" value=\"$hook[title]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" name=\"hookevalcode{$hook[pluginhookid]}\" id=\"hookevalcode{$hook[pluginhookid]}\" size=\"30\" value=\"".($hook['available'] ? $hook[evalcode] : 'N/A')."\" readonly></td>\n".
"<td class=\"altbg2\">$hook[description]</td>\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"availablenew[$hook[pluginhookid]]\" value=\"1\" ".($hook['available'] ? 'checked' : '')." onclick=\"if(this.checked) {\$('hookevalcode{$hook[pluginhookid]}').value='".addslashes($hook[evalcode])."';}else{\$('hookevalcode{$hook[pluginhookid]}').value='N/A';}\"></td>\n".
"<td class=\"altbg2\"><a href=\"admincp.php?action=pluginhooks&pluginid=$plugin[pluginid]&pluginhookid=$hook[pluginhookid]\">[$lang[edit]]</a></td></tr>";
}
$vars = '';
$query = $db->query("SELECT * FROM {$tablepre}pluginvars WHERE pluginid='$plugin[pluginid]' ORDER BY displayorder");
while($var = $db->fetch_array($query)) {
$var['type'] = $lang['plugins_edit_vars_type_'. $var['type']];
$var['title'] .= isset($lang[$var['title']]) ? '<br />'.$lang[$var['title']] : '';
$vars .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$var[pluginvarid]\"></td>\n".
"<td class=\"altbg2\">$var[title]</td>\n".
"<td class=\"altbg1\">$var[variable]</td>\n".
"<td class=\"altbg2\">$var[type]</td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"2\" name=\"displayordernew[$var[pluginvarid]]\" value=\"$var[displayorder]\"></td>\n".
"<td class=\"altbg2\"><a href=\"admincp.php?action=pluginvars&pluginid=$plugin[pluginid]&pluginvarid=$var[pluginvarid]\">[$lang[detail]]</a></td></tr>\n";
}
shownav('menu_plugins_config');
showtips('plugins_edit_tips');
?>
<a name="common"></a>
<form method="post" action="admincp.php?action=pluginsedit&type=common&pluginid=<?=$pluginid?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
$adminidselect = array($plugin['adminid'] => 'selected');
showtype($lang['plugins_edit'].' - '.$plugin['name'], 'top');
showsetting('plugins_edit_name', 'namenew', $plugin['name'], 'text');
if(!$plugin['copyright']) {
showsetting('plugins_edit_copyright', 'copyrightnew', $plugin['copyright'], 'text');
}
showsetting('plugins_edit_identifier', 'identifiernew', $plugin['identifier'], 'text');
showsetting('plugins_edit_adminid', '', '', '<select name="adminidnew"><option value="1" '.$adminidselect[1].'>'.$lang['usergroups_system_1'].'</option><option value="2" '.$adminidselect[2].'>'.$lang['usergroups_system_2'].'</option><option value="3" '.$adminidselect[3].'>'.$lang['usergroups_system_3'].'</option></select>');
showsetting('plugins_edit_directory', 'directorynew', $plugin['directory'], 'text');
showsetting('plugins_edit_datatables', 'datatablesnew', $plugin['datatables'], 'text');
showsetting('plugins_edit_description', 'descriptionnew', $plugin['description'], 'textarea');
showtype('', 'bottom');
?>
<br /><center><input class="button" type="submit" name="editsubmit" value="<?=$lang['submit']?>"></center>
</form><br />
<a name="modules"></a>
<form method="post" action="admincp.php?action=pluginsedit&type=modules&pluginid=<?=$pluginid?>&">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="7"><?=$lang['plugins_edit_modules']?></td></tr>
<tr class="category" align="center"><td width="45"><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form,'delete')"><?=$lang['del']?></td>
<td><?=$lang['plugins_edit_modules_name']?></td><td><?=$lang['plugins_edit_modules_menu']?></td><td><?=$lang['plugins_edit_modules_menu_url']?></td>
<td><?=$lang['plugins_edit_modules_type']?></td><td><?=$lang['plugins_edit_modules_adminid']?></td><td><?=$lang['display_order']?></td></tr>
<?=$modules?>
<tr class="altbg1" align="center"><td><?=$lang['add_new']?></td><td><input type="text" size="15" name="newname"></td>
<td><input type="text" size="15" name="newmenu"></td>
<td><input type="text" size="15" name="newurl"></td>
<td><select name="newtype">
<option value="1"><?=$lang['plugins_edit_modules_type_1']?></option>
<option value="2"><?=$lang['plugins_edit_modules_type_2']?></option>
<option value="3"><?=$lang['plugins_edit_modules_type_3']?></option>
<option value="4"><?=$lang['plugins_edit_modules_type_4']?></option>
<option value="5"><?=$lang['plugins_edit_modules_type_5']?></option>
<option value="5"><?=$lang['plugins_edit_modules_type_6']?></option>
</select></td><td><select name="newadminid">
<option value="0"><?=$lang['usergroups_system_0']?></option>
<option value="1" selected><?=$lang['usergroups_system_1']?></option>
<option value="2"><?=$lang['usergroups_system_2']?></option>
<option value="3"><?=$lang['usergroups_system_3']?></option>
</select></td><td><input type="text" size="2" name="neworder"></td></tr>
</table><br /><center><input class="button" type="submit" name="editsubmit" value="<?=$lang['submit']?>"></center>
</form><br />
<a name="hooks"></a>
<form method="post" action="admincp.php?action=pluginsedit&type=hooks&pluginid=<?=$pluginid?>&">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="6"><?=$lang['plugins_edit_hooks']?></td></tr>
<tr class="category" align="center"><td width="45"><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form,'delete')"><?=$lang['del']?></td>
<td width="20%"><?=$lang['plugins_hooks_title']?></td><td width="25%"><?=$lang['plugins_hooks_callback']?></td><td width="25%"><?=$lang['plugins_hooks_description']?></td>
<td width="45"><?=$lang['available']?></td><td><?=$lang['edit']?></td></tr>
<?=$hooks?>
<tr class="altbg1" align="center"><td><?=$lang['add_new']?></td><td><input type="text" name="newtitle" size="15"></td>
<td colspan="4"> </td></tr>
</table><br /><center><input class="button" type="submit" name="editsubmit" value="<?=$lang['submit']?>"></center>
</form><br />
<a name="vars"></a>
<form method="post" action="admincp.php?action=pluginsedit&type=vars&pluginid=<?=$pluginid?>&">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="6"><?=$lang['plugins_edit_vars']?></td></tr>
<tr class="category" align="center"><td width="45"><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form,'delete')"><?=$lang['del']?></td>
<td><?=$lang['plugins_vars_title']?></td><td><?=$lang['plugins_vars_variable']?></td><td><?=$lang['plugins_vars_type']?></td><td><?=$lang['display_order']?></td><td><?=$lang['edit']?></td></tr>
<?=$vars?>
<tr align="center" class="altbg1"><td><?=$lang['add_new']?></td>
<td><input type="text" size="15" name="newtitle"></td>
<td><input type="text" size="15" name="newvariable"></td>
<td><select name="newtype">
<option value="number"><?=$lang['plugins_edit_vars_type_number']?></option>
<option value="text" selected><?=$lang['plugins_edit_vars_type_text']?></option>
<option value="textarea"><?=$lang['plugins_edit_vars_type_textarea']?></option>
<option value="radio"><?=$lang['plugins_edit_vars_type_radio']?></option>
<option value="select"><?=$lang['plugins_edit_vars_type_select']?></option>
<option value="color"><?=$lang['plugins_edit_vars_type_color']?></option>
</seletc></td><td><input type="text" size="2" name="newdisplayorder" value="0"></td>
<td> </td></tr>
</table><br /><center><input class="button" type="submit" name="editsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
if($type == 'common') {
$namenew = dhtmlspecialchars(trim($namenew));
$directorynew = dhtmlspecialchars($directorynew);
$identifiernew = trim($identifiernew);
$datatablesnew = dhtmlspecialchars(trim($datatablesnew));
$descriptionnew = dhtmlspecialchars($descriptionnew);
$copyrightnew = $plugin['copyright'] ? addslashes($plugin['copyright']) : dhtmlspecialchars($copyrightnew);
$adminidnew = ($adminidnew > 0 && $adminidnew <= 3) ? $adminidnew : 1;
if(!$namenew) {
cpmsg('plugins_edit_name_invalid');
} elseif(!isplugindir($directorynew)) {
cpmsg('plugins_edit_directory_invalid');
} elseif($identifiernew != $plugin['identifier']) {
$query = $db->query("SELECT pluginid FROM {$tablepre}plugins WHERE identifier='$identifiernew' LIMIT 1");
if($db->num_rows($query) || !ispluginkey($identifiernew)) {
cpmsg('plugins_edit_identifier_invalid');
}
}
$db->query("UPDATE {$tablepre}plugins SET adminid='$adminidnew', name='$namenew', identifier='$identifiernew', description='$descriptionnew', datatables='$datatablesnew', directory='$directorynew', copyright='$copyrightnew' WHERE pluginid='$pluginid'");
} elseif($type == 'modules') {
$modulesnew = array();
$newname = trim($newname);
if(is_array($plugin['modules'])) {
foreach($plugin['modules'] as $moduleid => $module) {
if(!isset($delete[$moduleid])) {
$modulesnew[] = array
(
'name' => $namenew[$moduleid],
'menu' => $menunew[$moduleid],
'url' => $urlnew[$moduleid],
'type' => $typenew[$moduleid],
'adminid' => ($adminidnew[$moduleid] >= 0 && $adminidnew[$moduleid] <= 3) ? $adminidnew[$moduleid] : $module['adminid'],
'displayorder' => intval($ordernew[$moduleid]),
);
}
}
}
$newmodule = array();
if(!empty($newname)) {
$modulesnew[] = array
(
'name' => $newname,
'menu' => $newmenu,
'url' => $newurl,
'type' => $newtype,
'adminid' => $newadminid,
'displayorder' => intval($neworder),
);
}
usort($modulesnew, 'modulecmp');
$namesarray = array();
foreach($modulesnew as $key => $module) {
if(!ispluginkey($module['name'])) {
cpmsg('plugins_edit_modules_name_invalid');
} elseif(in_array($module['name'], $namesarray)) {
cpmsg('plugins_edit_modules_duplicated');
}
$namesarray[] = $module['name'];
$module['menu'] = trim($module['menu']);
$module['url'] = trim($module['url']);
$module['adminid'] = $module['adminid'] >= 0 && $module['adminid'] <= 3 ? $module['adminid'] : 1 ;
switch($module['type']) {
case 5:
case 1:
if(empty($module['url'])) {
cpmsg('plugins_edit_modules_url_invalid');
}
break;
case 6:
case 2:
case 3:
if(empty($module['menu'])) {
cpmsg('plugins_edit_modules_menu_invalid');
}
unset($module['url']);
break;
case 4:
unset($module['menu'], $module['url']);
break;
default:
cpmsg('undefined_action');
}
$modulesnew[$key] = $module;
}
$db->query("UPDATE {$tablepre}plugins SET modules='".addslashes(serialize($modulesnew))."' WHERE pluginid='$pluginid'");
} elseif($type == 'hooks') {
if(is_array($delete)) {
$ids = $comma = '';
foreach($delete as $id => $val) {
$ids .= "$comma'$id'";
$comma = ',';
}
$db->query("DELETE FROM {$tablepre}pluginhooks WHERE pluginid='$pluginid' AND pluginhookid IN ($ids)");
}
if(is_array($titlenew)) {
$titlearray = array();
foreach($titlenew as $id => $val) {
if(!ispluginkey($val) || in_array($val, $titlearray)) {
cpmsg('plugins_edit_hooks_title_invalid');
}
$titlearray[] = $val;
$db->query("UPDATE {$tablepre}pluginhooks SET title='".dhtmlspecialchars($titlenew[$id])."', available='".intval($availablenew[$id])."' WHERE pluginid='$pluginid' AND pluginhookid='$id'");
}
}
if($newtitle) {
if(!ispluginkey($newtitle) || (is_array($titlenew) && in_array($newtitle, $titlenew))) {
cpmsg('plugins_edit_hooks_title_invalid');
}
$db->query("INSERT INTO {$tablepre}pluginhooks (pluginid, title, description, code, available)
VALUES ('$pluginid', '".dhtmlspecialchars($newtitle)."', '', '', 0)");
}
} elseif($type == 'vars') {
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}pluginvars WHERE pluginid='$pluginid' AND pluginvarid IN ($ids)");
}
if(is_array($displayordernew)) {
foreach($displayordernew as $id => $displayorder) {
$db->query("UPDATE {$tablepre}pluginvars SET displayorder='$displayorder' WHERE pluginid='$pluginid' AND pluginvarid='$id'");
}
}
$newtitle = dhtmlspecialchars(trim($newtitle));
$newvariable = trim($newvariable);
if($newtitle && $newvariable) {
$query = $db->query("SELECT pluginvarid FROM {$tablepre}pluginvars WHERE pluginid='$pluginid' AND variable='$newvariable' LIMIT 1");
if($db->num_rows($query) || strlen($newvariable) > 40 || !ispluginkey($newvariable)) {
cpmsg('plugins_edit_var_invalid');
}
$db->query("INSERT INTO {$tablepre}pluginvars (pluginid, displayorder, title, variable, type)
VALUES ('$pluginid', '$newdisplayorder', '$newtitle', '$newvariable', '$newtype')");
}
}
updatecache('plugins');
updatecache('settings');
cpmsg('plugins_edit_succeed', "admincp.php?action=pluginsedit&pluginid=$pluginid#$type");
}
} elseif($action == 'pluginhooks' && $pluginid && $pluginhookid) {
$query = $db->query("SELECT * FROM {$tablepre}plugins p, {$tablepre}pluginhooks ph WHERE p.pluginid='$pluginid' AND ph.pluginid=p.pluginid AND ph.pluginhookid='$pluginhookid'");
if(!$pluginhook = $db->fetch_array($query)) {
cpmsg('undefined_action');
}
if(!submitcheck('hooksubmit')) {
shownav('menu_plugins_edit');
showtips('plugins_edit_hooks_tips');
?>
<form method="post" action="admincp.php?action=pluginhooks&pluginid=<?=$pluginid?>&pluginhookid=<?=$pluginhookid?>&formhash=<?=FORMHASH?>">
<?
showtype($lang['plugins_edit_hooks'].' - '.$pluginhook['title'], 'top');
showsetting('plugins_edit_hooks_description', 'descriptionnew', $pluginhook['description'], 'textarea');
showsetting('plugins_edit_hooks_code', 'codenew', $pluginhook['code'], 'textarea');
showtype('', 'bottom');
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"hooksubmit\" value=\"$lang[submit]\"></center></form>\n<br />";
} else {
$descriptionnew = dhtmlspecialchars(trim($descriptionnew));
$codenew = trim($codenew);
$db->query("UPDATE {$tablepre}pluginhooks SET description='$descriptionnew', code='$codenew' WHERE pluginid='$pluginid' AND pluginhookid='$pluginhookid'");
updatecache('settings');
cpmsg('plugins_edit_hooks_succeed', "admincp.php?action=pluginsedit&pluginid=$pluginid");
}
} elseif($action == 'pluginvars' && $pluginid && $pluginvarid) {
$query = $db->query("SELECT * FROM {$tablepre}plugins p, {$tablepre}pluginvars pv WHERE p.pluginid='$pluginid' AND pv.pluginid=p.pluginid AND pv.pluginvarid='$pluginvarid'");
if(!$pluginvar = $db->fetch_array($query)) {
cpmsg('undefined_action');
}
if(!submitcheck('varsubmit')) {
shownav('menu_plugins_edit');
$typeselect = '<select name="typenew">';
foreach(array('number', 'text', 'radio', 'textarea', 'select', 'color') as $type) {
$typeselect .= '<option value="'.$type.'" '.($pluginvar['type'] == $type ? 'selected' : '').'>'.$lang['plugins_edit_vars_type_'.$type].'</option>';
}
$typeselect .= '</select>';
echo "<form method=\"post\" action=\"admincp.php?action=pluginvars&pluginid=$pluginid&pluginvarid=$pluginvarid&formhash=".FORMHASH."\">\n";
showtype($lang['plugins_edit_vars'].' - '.$pluginvar['title'], 'top');
showsetting('plugins_edit_vars_title', 'titlenew', $pluginvar['title'], 'text');
showsetting('plugins_edit_vars_description', 'descriptionnew', $pluginvar['description'], 'textarea');
showsetting('plugins_edit_vars_type', '', '', $typeselect);
showsetting('plugins_edit_vars_variable', 'variablenew', $pluginvar['variable'], 'text');
showsetting('plugins_edit_vars_extra', 'extranew', $pluginvar['extra'], 'textarea');
showtype('', 'bottom');
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"varsubmit\" value=\"$lang[submit]\"></center></form>\n<br />";
} else {
$titlenew = cutstr(dhtmlspecialchars(trim($titlenew)), 25);
$descriptionnew = cutstr(dhtmlspecialchars(trim($descriptionnew)), 255);
$variablenew = trim($variablenew);
$extranew = dhtmlspecialchars(trim($extranew));
if(!$titlenew) {
cpmsg('plugins_edit_vars_title_invalid');
} elseif($variablenew != $pluginvar['variable']) {
$query = $db->query("SELECT pluginvarid FROM {$tablepre}pluginvars WHERE variable='$variablenew'");
if($db->num_rows($query) || !$variablenew || strlen($variablenew) > 40 || !ispluginkey($variablenew)) {
cpmsg('plugins_edit_vars_invalid');
}
}
$db->query("UPDATE {$tablepre}pluginvars SET title='$titlenew', description='$descriptionnew', type='$typenew', variable='$variablenew', extra='$extranew' WHERE pluginid='$pluginid' AND pluginvarid='$pluginvarid'");
updatecache('plugins');
cpmsg('plugins_edit_vars_succeed', "admincp.php?action=pluginsedit&pluginid=$pluginid");
}
}
function modulecmp($a, $b) {
return $a['displayorder'] > $b['displayorder'] ? 1 : -1;
}
?> | zyyhong | trunk/jiaju001/bbs/admin/plugins.inc.php | PHP | asf20 | 33,338 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: threadtypes.inc.php 10347 2007-08-27 03:16:06Z tiger $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if($action == 'threadtypes') {
if($special) {
$special = 1;
$navlang = 'threadtype_infotypes';
} else {
$special = 0;
$navlang = 'forums_threadtypes';
}
if(!submitcheck('typesubmit')) {
$forumsarray = $fidsarray = array();
$query = $db->query("SELECT f.fid, f.name, ff.threadtypes FROM {$tablepre}forums f , {$tablepre}forumfields ff WHERE ff.threadtypes<>'' AND f.fid=ff.fid");
while($forum = $db->fetch_array($query)) {
$forum['threadtypes'] = unserialize($forum['threadtypes']);
if(is_array($forum['threadtypes']['types'])) {
foreach($forum['threadtypes']['types'] as $typeid => $name) {
$forumsarray[$typeid][] = '<a href="forumdisplay.php?fid='.$forum['fid'].'" target="_blank">'.$forum['name'].'</a> [<a href="admincp.php?action=forumdetail&fid='.$forum['fid'].'">'.$lang['edit'].'</a>]';
$fidsarray[$typeid][] = $forum['fid'];
}
}
}
if($special) {
$typemodelopt = '';
$query = $db->query("SELECT id, name FROM {$tablepre}typemodels ORDER BY displayorder");
while($typemodel = $db->fetch_array($query)) {
$typemodelopt .= "<option value=\"$typemodel[id]\" ".($typemodel['id'] == $threadtype['special'] ? 'selected="selected"' : '').">$typemodel[name]</option>";
}
}
$threadtypes = '';
$query = $db->query("SELECT * FROM {$tablepre}threadtypes WHERE ".($special ? "special!='0'" : "special='0'")." ORDER BY displayorder");
while($type = $db->fetch_array($query)) {
$threadtypes .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$type[typeid]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"15\" name=\"namenew[$type[typeid]]\" value=\"".dhtmlspecialchars($type['name'])."\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"2\" name=\"displayordernew[$type[typeid]]\" value=\"$type[displayorder]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"30\" name=\"descriptionnew[$type[typeid]]\" value=\"$type[description]\"></td>\n".
"<td class=\"altbg1\">".(is_array($forumsarray[$type['typeid']]) ? implode(', ', $forumsarray[$type['typeid']])."<input type=\"hidden\" name=\"fids[$type[typeid]]\" value=\"".implode(', ', $fidsarray[$type['typeid']])."\">" : '')."</td>\n".
($special ? "<td class=\"altbg2\"><a href=\"admincp.php?action=typedetail&typeid=$type[typeid]\">[$lang[detail]]</a></td></tr>\n" : '');
}
shownav($navlang);
!$special ? showtips('forums_threadtypes_tips') : '';
?>
<form method="post" action="admincp.php?action=threadtypes">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="special" value="<?=$special?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="6"><?=$lang[$navlang]?></td></tr>
<tr align="center" class="category">
<td><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['name']?></td>
<td><?=$lang['display_order']?></td>
<td><?=$lang['description']?></td>
<td><?=$lang['forums_threadtypes_forums']?></td>
<?
echo $special ? "<td>$lang[detail]</td>" : '';
?>
</tr>
<?=$threadtypes?>
<tr align="center" class="altbg1">
<td><?=$lang['add_new']?></td>
<td><input type='text' name="newname" size="15"></td>
<td><input type="text" name="newdisplayorder" size="2" value="0"></td>
<td><input type="text" name="newdescription" size="30" value=""></td>
<td> </td>
<?
echo $special ? '<td> </td>' : '';
?>
</tr>
</table><br />
<center><input class="button" type="submit" name="typesubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
$updatefids = $modifiedtypes = array();
if(is_array($delete)) {
$deleteids = implodeids($delete);
$db->query("DELETE FROM {$tablepre}typeoptionvars WHERE typeid IN ($deleteids)");
$db->query("DELETE FROM {$tablepre}tradeoptionvars WHERE typeid IN ($deleteids)");
$db->query("DELETE FROM {$tablepre}typevars WHERE typeid IN ($deleteids)");
$db->query("DELETE FROM {$tablepre}threadtypes WHERE typeid IN ($deleteids) AND special='$special'");
if($db->affected_rows()) {
$db->query("UPDATE {$tablepre}threads SET typeid='0' WHERE typeid IN ($deleteids)");
foreach($delete AS $id) {
if(is_array($namenew) && isset($namenew[$id])) {
unset($namenew[$id]);
}
if(!empty($fids[$id])) {
foreach(explode(',', $fids[$id]) AS $fid) {
if($fid = intval($fid)) {
$updatefids[$fid]['deletedids'][] = intval($id);
}
}
}
}
}
}
if(is_array($namenew) && $namenew) {
foreach($namenew as $typeid => $val) {
$db->query("UPDATE {$tablepre}threadtypes SET name='".trim($namenew[$typeid])."', description='".dhtmlspecialchars(trim($descriptionnew[$typeid]))."', displayorder='$displayordernew[$typeid]', special='$special' WHERE typeid='$typeid'");
if($db->affected_rows()) {
$modifiedtypes[] = $typeid;
}
}
if($modifiedtypes = array_unique($modifiedtypes)) {
foreach($modifiedtypes AS $id) {
if(!empty($fids[$id])) {
foreach(explode(',', $fids[$id]) AS $fid) {
if($fid = intval($fid)) {
$updatefids[$fid]['modifiedids'][] = $id;
}
}
}
}
}
}
if($updatefids) {
$query = $db->query("SELECT fid, threadtypes FROM {$tablepre}forumfields WHERE fid IN (".implodeids(array_keys($updatefids)).") AND threadtypes<>''");
while($forum = $db->fetch_array($query)) {
$fid = $forum['fid'];
$forum['threadtypes'] = unserialize($forum['threadtypes']);
if($updatefids[$fid]['deletedids']) {
foreach($updatefids[$fid]['deletedids'] AS $id) {
unset($forum['threadtypes']['types'][$id], $forum['threadtypes']['flat'][$id], $forum['threadtypes']['selectbox'][$id]);
}
}
if($updatefids[$fid]['modifiedids']) {
foreach($updatefids[$fid]['modifiedids'] AS $id) {
if(isset($forum['threadtypes']['types'][$id])) {
$namenew[$id] = trim($namenew[$id]);
$forum['threadtypes']['types'][$id] = $namenew[$id];
if(isset($forum['threadtypes']['selectbox'][$id])) {
$forum['threadtypes']['selectbox'][$id] = $namenew[$id];
} else {
$forum['threadtypes']['flat'][$id] = $namenew[$id];
}
}
}
}
$db->query("UPDATE {$tablepre}forumfields SET threadtypes='".addslashes(serialize($forum['threadtypes']))."' WHERE fid='$fid'");
}
}
if($newname != '') {
$newname = trim($newname);
$query = $db->query("SELECT typeid FROM {$tablepre}threadtypes WHERE name='$newname'");
if($db->num_rows($query)) {
cpmsg('forums_threadtypes_duplicate');
}
$db->query("INSERT INTO {$tablepre}threadtypes (name, description, displayorder, special) VALUES
('$newname', '".dhtmlspecialchars(trim($newdescription))."', '$newdisplayorder', '$special')");
$typeid = $db->insert_id();
}
$forwardurl = !$newname || ($newname && !$special) ? 'admincp.php?action=threadtypes&special='.$special : 'admincp.php?action=typedetail&typeid='.$typeid;
cpmsg('forums_threadtypes_succeed', $forwardurl);
}
} elseif($action == 'typeoption') {
if(!submitcheck('typeoptionsubmit')) {
$typeoptions = '';
$query = $db->query("SELECT * FROM {$tablepre}typeoptions WHERE classid='0' ORDER BY displayorder");
while($option = $db->fetch_array($query)) {
$classoptions .= "<input class=\"button\" type=\"button\" value=\"$option[title]\" onclick=\"window.location='admincp.php?action=typeoption&classid=$option[optionid]';\"> ";
}
$classid = $classid ? intval($classid) : $db->result($db->query("SELECT * FROM {$tablepre}typeoptions WHERE classid='0' ORDER BY displayorder LIMIT 1"), 0);
if($classid) {
$query = $db->query("SELECT title FROM {$tablepre}typeoptions WHERE optionid='$classid'");
if(!$typetitle = $db->result($query, 0)) {
cpmsg('threadtype_infotypes_noexist', 'admincp.php?action=threadtypes');
}
$typeoptions = '';
$query = $db->query("SELECT * FROM {$tablepre}typeoptions WHERE classid='$classid' ORDER BY displayorder");
while($option = $db->fetch_array($query)) {
$option['type'] = $lang['threadtype_edit_vars_type_'. $option['type']];
$typeoptions .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$option[optionid]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"15\" name=\"title[$option[optionid]]\" value=\"".dhtmlspecialchars($option['title'])."\"></td>\n".
"<td class=\"altbg1\">$option[identifier]<input type=\"hidden\" name=\"identifier[$option[optionid]]\" value=\"$option[identifier]\"></td>\n".
"<td class=\"altbg2\">$option[type]</td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"2\" name=\"displayorder[$option[optionid]]\" value=\"$option[displayorder]\"></td>\n".
"<td class=\"altbg2\"><a href=\"admincp.php?action=optiondetail&optionid=$option[optionid]\">[$lang[detail]]</a></td></tr>\n";
}
}
shownav('threadtype_infotypes_option');
?>
<form method="post" action="admincp.php?action=typeoption&typeid=<?=$typeid?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="classid" value="<?=$classid?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="6"><?=$lang['threadtype_cat_manage']?></td></tr>
<tr class="category" align="center">
<td><?=$classoptions?></td>
</tr>
</table><br />
<?if($classid) {?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="6"><?=$lang['threadtype_manage']?> - <?=$typetitle?></td></tr>
<tr class="category" align="center">
<td width="45"><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form,'delete')"><?=$lang['del']?></td>
<td><?=$lang['name']?></td>
<td><?=$lang['threadtype_variable']?></td>
<td><?=$lang['threadtype_type']?></td>
<td><?=$lang['display_order']?></td>
<td><?=$lang['edit']?></td></tr>
<?=$typeoptions?>
<tr align="center" class="altbg1"><td><?=$lang['add_new']?></td>
<td><input type="text" size="15" name="newtitle"></td>
<td><input type="text" size="15" name="newidentifier"></td>
<td><select name="newtype">
<option value="number"><?=$lang['threadtype_edit_vars_type_number']?></option>
<option value="text" selected><?=$lang['threadtype_edit_vars_type_text']?></option>
<option value="textarea"><?=$lang['threadtype_edit_vars_type_textarea']?></option>
<option value="radio"><?=$lang['threadtype_edit_vars_type_radio']?></option>
<option value="checkbox"><?=$lang['threadtype_edit_vars_type_checkbox']?></option>
<option value="select"><?=$lang['threadtype_edit_vars_type_select']?></option>
<option value="calendar"><?=$lang['threadtype_edit_vars_type_calendar']?></option>
<option value="email"><?=$lang['threadtype_edit_vars_type_email']?></option>
<option value="image"><?=$lang['threadtype_edit_vars_type_image']?></option>
<option value="url"><?=$lang['threadtype_edit_vars_type_url']?></option>
</seletc></td><td><input type="text" size="2" name="newdisplayorder" value="0"></td>
<td> </td></tr>
</table><br />
<?}?>
<center><input class="button" type="submit" name="typeoptionsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}typeoptions WHERE optionid IN ($ids)");
}
if(is_array($title)) {
foreach($title as $id => $val) {
$db->query("UPDATE {$tablepre}typeoptions SET displayorder='$displayorder[$id]', title='$title[$id]', identifier='$identifier[$id]' WHERE optionid='$id'");
}
}
$newtitle = dhtmlspecialchars(trim($newtitle));
$newidentifier = trim($newidentifier);
if($newtitle && $newidentifier) {
$query = $db->query("SELECT optionid FROM {$tablepre}typeoptions WHERE identifier='$newidentifier' LIMIT 1");
if($db->num_rows($query) || strlen($newidentifier) > 40 || !ispluginkey($newidentifier)) {
cpmsg('threadtype_infotypes_optionvariable_invalid');
}
$db->query("INSERT INTO {$tablepre}typeoptions (classid, displayorder, title, identifier, type)
VALUES ('$classid', '$newdisplayorder', '$newtitle', '$newidentifier', '$newtype')");
} elseif($newtitle && !$newidentifier) {
cpmsg('threadtype_infotypes_option_invalid', 'admincp.php?action=typeoption&classid='.$classid);
}
updatecache('threadtypes');
cpmsg('threadtype_infotypes_succeed', 'admincp.php?action=typeoption&classid='.$classid);
}
} elseif($action == 'optiondetail') {
$query = $db->query("SELECT * FROM {$tablepre}typeoptions WHERE optionid='$optionid'");
if(!$option = $db->fetch_array($query)) {
cpmsg('undefined_action');
}
if(!submitcheck('editsubmit')) {
shownav('threadtype_infotypes_option');
$typeselect = '<select name="typenew" onchange="var styles, key;styles=new Array(\'number\',\'text\',\'radio\', \'checkbox\', \'textarea\', \'select\', \'image\'); for(key in styles) {var obj=$(\'style_\'+styles[key]); obj.style.display=styles[key]==this.options[this.selectedIndex].value?\'\':\'none\';}">';
foreach(array('number', 'text', 'radio', 'checkbox', 'textarea', 'select', 'calendar', 'email', 'url', 'image') as $type) {
$typeselect .= '<option value="'.$type.'" '.($option['type'] == $type ? 'selected' : '').'>'.$lang['threadtype_edit_vars_type_'.$type].'</option>';
}
$typeselect .= '</select>';
$option['rules'] = unserialize($option['rules']);
echo "<form method=\"post\" action=\"admincp.php?action=optiondetail&optionid=$optionid&formhash=".FORMHASH."\">\n";
showtype('threadtype_infotypes_option_config', 'top');
showsetting($lang['name'], 'titlenew', $option['title'], 'text');
showsetting($lang['threadtype_variable'], 'identifiernew', $option['identifier'], 'text');
showsetting($lang['type'], '', '', $typeselect);
showsetting('fields_edit_desc', 'descriptionnew', $option['description'], 'textarea');
showoptiontype('number', $option['type']);
showsetting('fields_edit_maxnum', 'rules[number][maxnum]', $option['rules']['maxnum'], 'text');
showsetting('fields_edit_minnum', 'rules[number][minnum]', $option['rules']['minnum'], 'text');
showoptiontype('text', $option['type']);
showsetting('fields_edit_textmax', 'rules[text][maxlength]', $option['rules']['maxlength'], 'text');
showoptiontype('textarea', $option['type']);
showsetting('fields_edit_textmax', 'rules[textarea][maxlength]', $option['rules']['maxlength'], 'text');
showoptiontype('select', $option['type']);
showsetting('fields_edit_choices', 'rules[select][choices]', $option['rules']['choices'], 'textarea');
showoptiontype('radio', $option['type']);
showsetting('fields_edit_choices', 'rules[radio][choices]', $option['rules']['choices'], 'textarea');
showoptiontype('checkbox', $option['type']);
showsetting('fields_edit_choices', 'rules[checkbox][choices]', $option['rules']['choices'], 'textarea');
showoptiontype('image', $option['type']);
showsetting('fields_edit_images_weight', 'rules[image][maxwidth]', $option['rules']['maxwidth'], 'text');
showsetting('fields_edit_images_height', 'rules[image][maxheight]', $option['rules']['maxheight'], 'text');
showtype('', 'bottom');
echo "</div><center><input class=\"button\" type=\"submit\" name=\"editsubmit\" value=\"$lang[submit]\"></center></form>";
} else {
$titlenew = trim($titlenew);
if(!$titlenew || !$identifiernew) {
cpmsg('threadtype_infotypes_option_invalid');
}
$query = $db->query("SELECT optionid FROM {$tablepre}typeoptions WHERE identifier='$identifiernew' AND optionid!='$optionid' LIMIT 1");
if($db->num_rows($query) || strlen($identifiernew) > 40 || !ispluginkey($identifiernew)) {
cpmsg('threadtype_infotypes_optionvariable_invalid');
}
$db->query("UPDATE {$tablepre}typeoptions SET title='$titlenew', description='$descriptionnew', identifier='$identifiernew', type='$typenew', rules='".addslashes(serialize($rules[$typenew]))."' WHERE optionid='$optionid'");
updatecache('threadtypes');
cpmsg('threadtype_infotypes_option_succeed', 'admincp.php?action=optiondetail&optionid='.$optionid);
}
} elseif($action == 'typedetail') {
if($operation == 'classlist') {
$classoptions = '';
$classidarray = array();
!$classid && $classid = 0;
$query = $db->query("SELECT optionid, title FROM {$tablepre}typeoptions WHERE classid='$classid' ORDER BY displayorder");
while($option = $db->fetch_array($query)) {
$classidarray[] = $option['optionid'];
$classoptions .= "<input class=\"button\" type=\"button\" value=\"$option[title]\" onclick=\"ajaxget('admincp.php?action=typedetail&operation=optionlist&typeid=$typeid&classid=$option[optionid]', 'optionlist', 'optionlist', 'Loading...', '', checkedbox)\"> ";
}
include template('header');
echo $classoptions;
include template('footer');
exit;
} elseif($operation == 'optionlist') {
if(!$classid) {
$query = $db->query("SELECT optionid FROM {$tablepre}typeoptions WHERE classid='0' ORDER BY displayorder LIMIT 1");
$classid = $db->result($query, 0);
}
$query = $db->query("SELECT optionid FROM {$tablepre}typevars WHERE typeid='$typeid'");
$option = $options = array();
while($option = $db->fetch_array($query)) {
$options[] = $option['optionid'];
}
$optionlist = '';
$query = $db->query("SELECT * FROM {$tablepre}typeoptions WHERE classid='$classid' ORDER BY displayorder");
while($option = $db->fetch_array($query)) {
$optionlist .= "<input ".(in_array($option['optionid'], $options) ? ' checked ' : '')."class=\"checkbox\" type=\"checkbox\" name=\"typeselect[]\" value=\"$option[optionid]\" onclick=\"insertoption(this.value);\">".dhtmlspecialchars($option['title'])." ";
}
include template('header');
echo $optionlist;
include template('footer');
exit;
} elseif($operation == 'typelist') {
$query = $db->query("SELECT * FROM {$tablepre}typeoptions WHERE optionid='$optionid' LIMIT 1");
$option = $db->fetch_array($query);
include template('header');
$option['type'] = $lang['threadtype_edit_vars_type_'. $option['type']];
$option['available'] = 1;
echo typeoptionproc($option);
include template('footer');
exit;
}
if(!submitcheck('typedetailsubmit') && !submitcheck('typepreviewsubmit')) {
$query = $db->query("SELECT name, template, modelid, expiration FROM {$tablepre}threadtypes WHERE typeid='$typeid'");
$threadtype = $db->fetch_array($query);
$threadtype['modelid'] = isset($modelid) ? intval($modelid) : $threadtype['modelid'];
$threadtype['expiration'] ? $check['true'] = "checked" : $check['false'] = "checked";
$typemodelopt = '';
$existoption = $showoption = array();
$query = $db->query("SELECT id, name, options, customoptions FROM {$tablepre}typemodels ORDER BY displayorder");
while($typemodel = $db->fetch_array($query)) {
if($typemodel['id'] == $threadtype['modelid']) {
foreach(explode("\t", $typemodel['customoptions']) as $id) {
$existoption[$id] = 0;
}
foreach(explode("\t", $typemodel['options']) as $id) {
$existoption[$id] = 1;
}
}
$typemodelopt .= "<option value=\"$typemodel[id]\" ".($typemodel['id'] == $threadtype['modelid'] ? 'selected="selected"' : '').">$typemodel[name]</option>";
}
$typeoptions = $jsoptionids = '';
$query = $db->query("SELECT t.optionid, t.displayorder, t.available, t.required, t.unchangeable, t.search, tt.title, tt.type, tt.identifier
FROM {$tablepre}typevars t, {$tablepre}typeoptions tt
WHERE t.typeid='$typeid' AND t.optionid=tt.optionid ORDER BY t.displayorder");
while($option = $db->fetch_array($query)) {
$jsoptionids .= "optionids.push($option[optionid]);\r\n";
$optiontitle[$option['identifier']] = $option['title'];
$showoption[$option['optionid']]['optionid'] = $option['optionid'];
$showoption[$option['optionid']]['title'] = $option['title'];
$showoption[$option['optionid']]['type'] = $lang['threadtype_edit_vars_type_'. $option['type']];
$showoption[$option['optionid']]['identifier'] = $option['identifier'];
$showoption[$option['optionid']]['displayorder'] = $option['displayorder'];
$showoption[$option['optionid']]['available'] = $option['available'];
$showoption[$option['optionid']]['required'] = $option['required'];
$showoption[$option['optionid']]['unchangeable'] = $option['unchangeable'];
$showoption[$option['optionid']]['search'] = $option['search'];
}
if($existoption && is_array($existoption)) {
$optionids = $comma = '';
foreach($existoption as $optionid => $val) {
$optionids .= $comma.$optionid;
$comma = '\',\'';
}
$query = $db->query("SELECT * FROM {$tablepre}typeoptions WHERE optionid IN ('$optionids')");
while($option = $db->fetch_array($query)) {
$showoption[$option['optionid']]['optionid'] = $option['optionid'];
$showoption[$option['optionid']]['title'] = $option['title'];
$showoption[$option['optionid']]['type'] = $lang['threadtype_edit_vars_type_'. $option['type']];
$showoption[$option['optionid']]['identifier'] = $option['identifier'];
$showoption[$option['optionid']]['required'] = $existoption[$option['optionid']];
$showoption[$option['optionid']]['available'] = 1;
$showoption[$option['optionid']]['unchangeable'] = 0;
$showoption[$option['optionid']]['model'] = 1;
}
}
foreach($showoption as $optionid => $option) {
$typeoptions .= '<tr><td colspan="10" style="border: 0px; padding: 0px;" id="optionid'.$optionid.'"><TABLE width="100%" cellspacing="0" cellpadding="0" style="margin:0px;">'.typeoptionproc($option).'</TABLE></td></tr>';
}
if($threadtype['template']) {
$previewtemplate = preg_replace("/{(.+?)}/ies", "showoption('\\1', 'title')", $threadtype['template']);
$previewtemplate = preg_replace("/\[(.+?)value\]/ies", "showoption('\\1', 'value')", $previewtemplate);
}
shownav('menu_forums_threadtypes');
?>
<form method="post" action="admincp.php?action=typedetail&typeid=<?=$typeid?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="2"><?=$lang['threadtype_models']?></td>
</tr>
<tr>
<td width="45%" class="altbg1"><b><?=$lang['threadtype_models_select']?></b><br /><span class="smalltxt"><?=$lang['threadtype_models_select_comment']?></span></td>
<td class="altbg2">
<select name="modelid" onchange="window.location=('admincp.php?action=typedetail&typeid=<?=$typeid?>&modelid='+this.options[this.selectedIndex].value+'')"><option value="0"><?=$lang['none']?></option><?=$typemodelopt?></select>
</td>
</tr>
<tr>
<td width="45%" class="altbg1"><b><?=$lang['threadtype_infotypes_validity']?></b><br /><span class="smalltxt"><?=$lang['threadtype_infotypes_validity_comment']?></span></td>
<td class="altbg2">
<input type="radio" class="radio" name="typeexpiration" value="1" <?=$check['true']?>><?=$lang['yes']?> <input type="radio" class="radio" name="typeexpiration" value="0" <?=$check['false']?>><?=$lang['no']?>
</td>
</tr>
</table><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$threadtype['name']?> - <?=$lang['threadtype_infotypes_add_option']?></td></tr>
<tr class="altbg1" align="center"><td id="classlist">
<?=$classoptions?>
</td></tr>
<tr class="altbg1"><td id="optionlist"><?=$optionlist?></td></tr>
<tr><td width="100%">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder" id="typelist">
<tr class="header"><td colspan="10"><?=$threadtype['name']?> - <?=$lang['threadtype_infotypes_exist_option']?></td></tr>
<tr class="category" align="center">
<td width="10%">
<input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form,'delete')"><?=$lang['del']?></td>
<td width="10%"><?=$lang['name']?></td>
<td width="15%"><?=$lang['type']?></td>
<td width="8%"><?=$lang['available']?></td>
<td width="8%"><?=$lang['required']?></td>
<td width="8%"><?=$lang['unchangeable']?></td>
<td width="8%"><?=$lang['threadtype_infotypes_search']?></td>
<td width="10%"><?=$lang['display_order']?></td>
<td width="10%"><?=$lang['threadtype_infotypes_add_template']?></td>
<td width="10%"><?=$lang['edit']?></td>
</tr>
<?=$typeoptions?>
</table>
</td>
</tr>
</table>
<center>
<input class="button" type="submit" name="typedetailsubmit" value="<?=$lang['submit']?>">
</center>
<a name="template"><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$threadtype['name']?> - <?=$lang['threadtype_infotypes_template']?></td></tr>
<tr class="altbg1"><td>
<img src="images/admincp/zoomin.gif" onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('typetemplate', 1)">
<img src="images/admincp/zoomout.gif" onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('typetemplate', 0)"><br />
<textarea cols="100" rows="5" id="typetemplate" name="typetemplate" style="width: 95%;"><?=$threadtype['template']?></textarea>
<br />
<b><?=$lang['threadtype_infotypes_template']?>:</b>
<br />
<?=$lang['threadtype_infotypes_template_tips']?>
<?php
if($previewtemplate) {
echo '<br /><fieldset style="padding: 1em; margin: 1em;"><legend><b>'.$lang['threadtype_infotypes_template_preview'].':</b></legend>';
echo $previewtemplate;
echo '</fieldset>';
}
?>
</td></tr>
</table><br />
</a>
<center>
<input class="button" type="submit" name="typedetailsubmit" value="<?=$lang['submit']?>">
<input class="button" type="submit" name="typepreviewsubmit" value="<?=$lang['template_preview']?>">
</center>
</form>
<script type="text/javascript">
var optionids = new Array();
<?=$jsoptionids?>
function insertvar(text) {
$('typetemplate').focus();
selection = document.selection;
if(selection && selection.createRange) {
var sel = selection.createRange();
sel.text = '<li><b>{' + text + '}</b>: [' + text + "value]</li>\r\n";
sel.moveStart('character', -strlen(text));
} else {
$('typetemplate').value += '<li><b>{' + text + '}<b>: [' + text + "value]</li>\r\n";
}
}
function checkedbox() {
var tags = $('optionlist').getElementsByTagName('input');
for(var i=0; i<tags.length; i++) {
if(in_array(tags[i].value, optionids)) {
tags[i].checked = true;
}
}
}
function insertoption(optionid) {
var x = new Ajax();
x.optionid = optionid;
x.get('admincp.php?action=typedetail&operation=typelist&inajax=1&optionid=' + optionid, function(s, x) {
if(!in_array(x.optionid, optionids)) {
var otr = $('typelist').insertRow(-1);
var otd = otr.insertCell(-1);
otd.colSpan = 10;
otd.id = 'optionid' + optionid;
otd.style.border = '0px';
otd.style.padding = '0px';
otd.style.margin = '0px';
otd.style.width="100%";
otd.innerHTML = '<TABLE width="100%" cellspacing="0" cellpadding="0" style="margin: 0px;">' + s + '</TABLE>';
optionids.push(x.optionid);
} else {
if(is_ie){
$('optionid' + x.optionid).parentNode.removeNode(true);
} else {
$('optionid' + x.optionid).parentNode.removeChild($('optionid' + x.optionid));
}
for(var i=0; i<optionids.length; i++) {
if(optionids[i] == x.optionid) {
optionids[i] = 0;
}
}
}
});
}
</script>
<script type="text/javascript">ajaxget('admincp.php?action=typedetail&operation=classlist', 'classlist');</script>
<script type="text/javascript">ajaxget('admincp.php?action=typedetail&operation=optionlist&typeid=<?=$typeid?>', 'optionlist', '', '', '', checkedbox);</script>
<?
} else {
$db->query("UPDATE {$tablepre}threadtypes SET special='1', modelid='".intval($modelid)."', template='$typetemplate', expiration='$typeexpiration' WHERE typeid='$typeid'");
if(submitcheck('typedetailsubmit')) {
$orgoption = $orgoptions = $addoption = array();
$query = $db->query("SELECT optionid FROM {$tablepre}typevars WHERE typeid='$typeid'");
while($orgoption = $db->fetch_array($query)) {
$orgoptions[] = $orgoption['optionid'];
}
if(intval($modelid)) {
$query = $db->query("SELECT options, customoptions FROM {$tablepre}typemodels WHERE id='$modelid'");
$modelopt = $db->fetch_array($query);
if($modelopt['customoptions']) {
foreach(explode("\t", $modelopt['customoptions']) as $id) {
$addoption[$id] = $required[$id] = 0;
$available[$id] = 1;
}
}
if($modelopt['options']) {
foreach(explode("\t", $modelopt['options']) as $id) {
$addoption[$id] = $available[$id] = $required[$id] = 1;
}
}
}
$addoption = $addoption ? (array)$addoption + (array)$displayorder : (array)$displayorder;
@$newoptions = array_keys($addoption);
if(empty($addoption)) {
cpmsg('threadtype_infotypes_invalid');
}
@$delete = array_merge((array)$delete, array_diff($orgoptions, $newoptions));
if($delete) {
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}typevars WHERE typeid='$typeid' AND optionid IN ($ids)");
}
foreach($delete as $id) {
unset($addoption[$id]);
}
}
if(is_array($addoption)) {
foreach($addoption as $id => $val) {
$db->query("INSERT INTO {$tablepre}typevars (typeid, optionid, available, required) VALUES ('$typeid', '$id', '1', '".intval($val)."')", 'SILENT');
$db->query("UPDATE {$tablepre}typevars SET displayorder='$displayorder[$id]', available='$available[$id]', required='$required[$id]', unchangeable='$unchangeable[$id]', search='$search[$id]' WHERE typeid='$typeid' AND optionid='$id'");
}
}
updatecache('threadtypes');
cpmsg('threadtype_infotypes_succeed', 'admincp.php?action=typedetail&typeid='.$typeid);
} elseif(submitcheck('typepreviewsubmit')) {
header("Location: {$boardurl}admincp.php?action=typedetail&typeid=$typeid#template");
}
}
} elseif($action == 'typemodel') {
if(!submitcheck('modelsubmit')) {
$typemodels = '';
$query = $db->query("SELECT * FROM {$tablepre}typemodels ORDER BY displayorder");
while($model = $db->fetch_array($query)) {
$typemodels .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$model[id]\" ".($model['type'] ? 'disabled' : '')."></td>\n".
"<td class=\"altbg1\"><input type=\"text\" name=\"name[$model[id]]\" value=\"$model[name]\">\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"10\" name=\"displayorder[$model[id]]\" value=\"$model[displayorder]\"></td>\n".
"<td class=\"altbg1\"><a href=\"admincp.php?action=modeldetail&modelid=$model[id]\">[$lang[detail]]</a></td></tr>\n";
}
?>
<form method="post" action="admincp.php?action=typemodel">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder" id="typelist">
<tr class="header"><td colspan="7"><?=$lang['threadtype_models']?></td></tr>
<tr class="category" align="center">
<td width="15%">
<input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form,'delete')"><?=$lang['del']?></td>
<td><?=$lang['name']?></td>
<td><?=$lang['display_order']?></td>
<td><?=$lang['edit']?></td>
</tr>
<?=$typemodels?>
<tr align="center" class="altbg1"><td><?=$lang['add_new']?></td>
<td><input type="text" name="newtitle"></td>
<td><input type="text" size="10" name="newdisplayorder"></td>
<td> </td></tr>
</table>
<center>
<input class="button" type="submit" name="modelsubmit" value="<?=$lang['submit']?>">
</center>
<?
} else {
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}typemodels WHERE id IN ($ids)");
}
if(is_array($name)) {
foreach($name as $id => $val) {
$db->query("UPDATE {$tablepre}typemodels SET displayorder='$displayorder[$id]', name='$name[$id]' WHERE id='$id'");
}
}
if($newtitle) {
$db->query("INSERT INTO {$tablepre}typemodels (name, displayorder, type)
VALUES ('$newtitle', '$newdisplayorder', '0')");
}
cpmsg('threadtype_infotypes_model_succeed', 'admincp.php?action=typemodel');
}
} elseif($action == 'modeldetail') {
if(!submitcheck('modeldetailsubmit')) {
$classoptions = $modeloption = $sysoption = $sysoptselect = '';
$query = $db->query("SELECT * FROM {$tablepre}typeoptions WHERE classid!='0' ORDER BY displayorder");
while($option = $db->fetch_array($query)) {
$classoptions .= "<option value=\"$option[optionid]\">$option[title]</option>";
}
$query = $db->query("SELECT * FROM {$tablepre}typemodels WHERE id='".intval($modelid)."'");
if(!$model = $db->fetch_array($query)) {
cpmsg('undefined_action');
}
$query = $db->query("SELECT * FROM {$tablepre}typeoptions WHERE optionid IN (".implodeids(explode("\t", $model['customoptions'])).")");
while($modelopt = $db->fetch_array($query)){
$modeloption .= "<option value=\"$modelopt[optionid]\">$modelopt[title]</option>";
}
if($model['type']) {
$query = $db->query("SELECT * FROM {$tablepre}typeoptions WHERE optionid IN (".implodeids(explode("\t", $model['options'])).")");
while($modelopt = $db->fetch_array($query)){
$sysoption .= "<option value=\"$modelopt[optionid]\">$modelopt[title]</option>";
}
$sysoptselect = '<select name="" size="8" multiple="multiple" style="width: 50%">'.$sysoption.'</select>';
}
$optselect = '<select name="" size="8" multiple="multiple" style="width: 50%" id="coptselect">'.$classoptions.'</select>';
$hoptselect = '<select name="customoptions[]" size="8" multiple="multiple" style="width: 50%" id="moptselect">'.$modeloption.'</select>';
?>
<script type="text/javascript">
function copyoption(s1, s2) {
var s1 = $(s1);
var s2 = $(s2);
var len = s1.options.length;
for(var i=0; i<len; i++) {
op = s1.options[i];
if(op.selected == true && !optionexists(s2, op.value)) {
o = op.cloneNode(true);
s2.appendChild(o);
}
}
}
function optionexists(s1, value) {
var len = s1.options.length;
for(var i=0; i<len; i++) {
if(s1.options[i].value == value) {
return true;
}
}
return false;
}
function removeoption(s1) {
var s1 = $(s1);
var len = s1.options.length;
for(var i=s1.options.length - 1; i>-1; i--) {
op = s1.options[i];
if(op.selected && op.selected == true) {
s1.removeChild(op);
}
}
return false;
}
function selectalloption(s1) {
var s1 = $(s1);
var len = s1.options.length;
for(var i=s1.options.length - 1; i>-1; i--) {
op = s1.options[i];
op.selected = true;
}
}
</script>
<form method="post" action="admincp.php?action=modeldetail&modelid=<?=$modelid?>&formhash=<?=FORMHASH?>" onsubmit="selectalloption('moptselect');">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="2"><?=$lang['threadtype_models_basic_setting']?></td>
</tr>
<tr>
<td width="45%" class="altbg1" ><b><?=$lang['name']?></b></td>
<td class="altbg2"><input type="text" size="50" name="namenew" value="<?=$model['name']?>"></td>
</tr>
</table><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="2"><?=$lang['threadtype_models_option_setting']?></td>
</tr>
<?if($model['type']) {?>
<tr>
<td width="45%" class="altbg1" ><b><?=$lang['threadtype_models_option_model']?></b></td>
<td class="altbg2"><?=$sysoptselect?><br />
</td></tr>
<?}?>
<tr>
<td width="45%" class="altbg1" ><b><?=$lang['threadtype_models_option_user']?></b></td>
<td class="altbg2"><?=$hoptselect?><br /><a href="###" onclick="removeoption('moptselect')">[<?=$lang['del']?>]</a>
</td></tr>
<tr>
<td width="45%" class="altbg1" ><b><?=$lang['threadtype_models_option_system']?></b></td>
<td class="altbg2"><?=$optselect?><br /><a href="###" onclick="copyoption('coptselect', 'moptselect')">[<?=$lang['threadtype_models_option_copy']?>]</a>
</td></tr>
</table><br />
<center>
<input class="button" type="submit" name="modeldetailsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
$customoptionsnew = $customoptions && is_array($customoptions) ? implode("\t", $customoptions) : '';
$db->query("UPDATE {$tablepre}typemodels SET name='$namenew', customoptions='$customoptionsnew' WHERE id='$modelid'");
cpmsg('threadtype_infotypes_model_succeed', 'admincp.php?action=modeldetail&modelid='.$modelid);
}
}
function showoptiontype($type, $curtype) {
echo '</table><br /></div><div id="style_'.$type.'" style="'.($type != $curtype ? 'display: none' : '').'" class="maintablediv">'.
'<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'.
'<tr class="header"><td colspan="2">'.$GLOBALS['lang']['threadtype_edit_vars_type_'.$type].'</td></tr>';
}
function showoption($var, $type) {
global $optiontitle, $lang;
if($optiontitle[$var]) {
$optiontitle[$var] = $type == 'title' ? $optiontitle[$var] : $optiontitle[$var].$lang['value'];
return $optiontitle[$var];
} else {
return "!$var!";
}
}
function typeoptionproc($option) {
global $lang;
return "<tr align=\"center\">
<td class=\"altbg1\" width=\"10%\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$option[optionid]\" ".($option['model'] ? 'disabled' : '')."></td>\n".
"<td class=\"altbg2\" width=\"10%\">".dhtmlspecialchars($option['title'])." </td>\n".
"<td class=\"altbg1\" width=\"15%\">$option[type]</td>\n".
"<td class=\"altbg2\" width=\"8%\"><input class=\"checkbox\" type=\"checkbox\" name=\"available[$option[optionid]]\" value=\"1\" ".($option['available'] ? 'checked' : '')." ".($option['model'] ? 'disabled' : '')."></td>\n".
"<td class=\"altbg1\" width=\"8%\"><input class=\"checkbox\" type=\"checkbox\" name=\"required[$option[optionid]]\" value=\"1\" ".($option['required'] ? 'checked' : '')." ".($option['model'] ? 'disabled' : '')."></td>\n".
"<td class=\"altbg2\" width=\"8%\"><input class=\"checkbox\" type=\"checkbox\" name=\"unchangeable[$option[optionid]]\" value=\"1\" ".($option['unchangeable'] ? 'checked' : '')."></td>\n".
"<td class=\"altbg1\" width=\"8%\"><input class=\"checkbox\" type=\"checkbox\" name=\"search[$option[optionid]]\" value=\"1\" ".($option['search'] ? 'checked' : '')."></td>\n".
"<td class=\"altbg2\" width=\"10%\"><input type=\"text\" size=\"2\" name=\"displayorder[$option[optionid]]\" value=\"$option[displayorder]\"></td>\n".
"<td class=\"altbg1\" width=\"10%\"><a href=\"###\" onclick=\"insertvar('$option[identifier]');doane(event);return false;\">[".$lang['threadtype_infotypes_add_template']."]</a></td>\n".
"<td class=\"altbg2\" width=\"10%\"><a href=\"admincp.php?action=optiondetail&optionid=$option[optionid]\">[".$lang['edit']."]</a></td></tr>\n";
}
?> | zyyhong | trunk/jiaju001/bbs/admin/threadtypes.inc.php | PHP | asf20 | 39,896 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: project.inc.php 10548 2007-09-05 05:03:35Z monkey $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
if(!isfounder()) {
cpheader();
cpmsg('noaccess');
}
$query = $db->query("SELECT disabledactions FROM {$tablepre}adminactions WHERE admingid='$groupid'");
$dactionarray = ($dactionarray = unserialize($db->result($query, 0))) ? $dactionarray : array();
$allowforumsedit = !in_array('forumsedit', $dactionarray) ? 1 : 0;
$allowusergroups = !in_array('usergroups', $dactionarray) ? 1 : 0;
$allowcreditwizard = !in_array('creditwizard', $dactionarray) ? 1 : 0;
if(empty($allowforumsedit) && empty($allowusergroups) && empty($allowcreditwizard)) {
cpheader();
cpmsg('action_noaccess');
}
if($action == 'project' && $export) {
$query = $db->query("SELECT * FROM {$tablepre}projects WHERE id='$export'");
if(!$projectarray = $db->fetch_array($query)) {
cpheader();
cpmsg('undefined_action');
}
if(($projectarray['type'] == 'forum' && empty($allowforumsedit)) || ($projectarray['type'] == 'group' && empty($allowusergroups)) || ($projectarray['type'] == 'extcredit' && empty($allowcreditwizard))) {
cpheader();
cpmsg('action_noaccess');
}
$projectarray['version'] = strip_tags($version);
$time = gmdate("$dateformat $timeformat", $timestamp + $timeoffset * 3600);
$project_export = "# Discuz! Project Dump ($projectarray[type])\n".
"# Version: Discuz! $version\n".
"# Time: $time \n".
"# From: $bbname ($boardurl) \n".
"#\n".
"# Discuz! Community: http://www.Discuz.net\n".
"# Please visit our website for latest news about Discuz!\n".
"# --------------------------------------------------------\n\n\n".
wordwrap(base64_encode(serialize($projectarray)), 60, "\n", 1);
ob_end_clean();
dheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
dheader('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
dheader('Cache-Control: no-cache, must-revalidate');
dheader('Pragma: no-cache');
dheader('Content-Encoding: none');
dheader('Content-Length: '.strlen($project_export));
dheader('Content-Disposition: attachment; filename=discuz_project_'.$projectarray['type'].'_'.$projectarray['name'].'.txt');
dheader('Content-Type: '.(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? 'application/octetstream' : 'application/octet-stream'));
echo $project_export;
dexit();
}
cpheader();
if($action == 'project') {
if(!submitcheck('projectsubmit') && !submitcheck('importsubmit')) {
$listarray = array();
$projectlist = $typeadd = $selecttype = '';
$page = max(1, intval($page));
$start_limit = ($page - 1) * 10;
$allowaction = array(
'forum' => $allowforumsedit,
'group' => $allowusergroups,
'extcredit' => $allowcreditwizard,
);
if(!empty($type) && in_array($type, array('forum', 'group', 'extcredit'))) {
foreach($allowaction as $key => $val) {
if($type == $key && empty($val)) {
cpmsg('action_noaccess');
}
}
$typeadd = "WHERE type='$type'";
$selecttype = '&type='.$type;
} else {
$typeadd = $comma = '';
foreach($allowaction as $key => $val) {
if(!empty($val)) {
$typeadd .= $comma."'$key'";
$comma = ', ';
}
}
$typeadd = 'WHERE type IN ('.$typeadd.')';
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}projects $typeadd");
$projectnum = $db->result($query, 0);
$query = $db->query("SELECT id, name, type, description FROM {$tablepre}projects $typeadd LIMIT $start_limit, 10");
while($list = $db->fetch_array($query)) {
$list['name'] = dhtmlspecialchars($list['name']);
$list['description'] = dhtmlspecialchars($list['description']);
$type = 'project_'.$list['type'].'_scheme';
$projectlist .= "<tr align=\"center\">\n".
"<td class=\"altbg2\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$list[id]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"15\" name=\"name[$list[id]]\" value=\"$list[name]\"></td>\n".
"<td class=\"altbg2\">$lang[$type]</td>\n".
"<td class=\"altbg2\"><input type=\"textarea\" size=\"40\" name=\"description[$list[id]]\" value=\"$list[description]\"></td>\n".
"<td class=\"altbg2\">[<a href=\"admincp.php?action=project&export=$list[id]\">".$lang['download']."</a>]</td>\n".
"<td class=\"altbg2\">[<a href=\"admincp.php?action=projectapply&projectid=$list[id]&type=$list[type]\">".$lang['apply']."</a>]</td></tr>\n";
}
$multipage = multi($projectnum, 10, $page, "admincp.php?action=project$selecttype");
shownav('project_scheme');
?>
<form method="post" action="admincp.php?action=project">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td><?=$lang['project_forum_scheme_sort']?></td></tr>
<tr><td>
<?
if($allowforumsedit) {
echo '<input class="button" type="button" value="'.$lang['project_forum_scheme'].'" onclick="window.location=\'admincp.php?action=project&type=forum\';"> ';
}
if($allowusergroups) {
echo '<input class="button" type="button" value="'.$lang['project_group_scheme'].'" onclick="window.location=\'admincp.php?action=project&type=group\';"> ';
}
if($allowcreditwizard) {
echo '<input class="button" type="button" value="'.$lang['project_extcredit_scheme'].'" onclick="window.location=\'admincp.php?action=project&type=extcredit\';"> ';
}
?>
</td></tr>
</table><br />
<?=$multipage?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td width="5%"><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td width="20%"><?=$lang['name']?></td><td width="15%"><?=$lang['type']?></td><td width="40%"><?=$lang['description']?></td><td width="10%"><?=$lang['export']?></td><td width="10%"><?=$lang['detail']?></td></tr>
<?=$projectlist?></table>
<?=$multipage?><br />
<center><input class="button" type="submit" name="projectsubmit" value="<?=$lang['submit']?>"></center><br />
<form method="post" action="admincp.php?action=project">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['project_import_stick']?></td></tr>
<tr><td class="altbg1"> <div align="center"><textarea name="projectdata" cols="80" rows="8"></textarea><br /></td></tr>
</table><br />
<center><input class="button" type="submit" name="importsubmit" value="<?=$lang['submit']?>"></center></form></td></tr>
<?
} elseif(submitcheck('projectsubmit')) {
if(is_array($delete)) {
$ids = $comma = '';
foreach($delete as $id) {
$ids .= "$comma'$id'";
$comma = ',';
}
$db->query("DELETE FROM {$tablepre}projects WHERE id IN ($ids)");
}
if(is_array($name)) {
foreach($name as $id => $val) {
$db->query("UPDATE {$tablepre}projects SET name='$name[$id]', description='$description[$id]' WHERE id='$id'");
}
}
cpmsg('project_update_forum', 'admincp.php?action=project');
} elseif(submitcheck('importsubmit')) {
$projectdata = preg_replace("/(#.*\s+)*/", '', $projectdata);
$projectarray = daddslashes(unserialize(base64_decode($projectdata)), 1);
if(!is_array($projectarray)) {
cpmsg('project_import_data_invalid');
} elseif(strip_tags($projectarray['version']) != strip_tags($version)) {
cpmsg('project_export_version');
} else {
$db->query("INSERT INTO {$tablepre}projects (name, type, description, value) VALUES ('$projectarray[name]', '$projectarray[type]', '$projectarray[description]', '$projectarray[value]')");
cpmsg('project_import_succeed', 'admincp.php?action=project');
}
}
} elseif($action == 'projectadd') {
$delfields = array
(
'forum' => array('fid', 'fup', 'type', 'name', 'status', 'displayorder', 'threads', 'posts', 'todayposts', 'lastpost', 'description', 'password', 'icon', 'redirect', 'moderators', 'rules', 'threadtypes'),
'group' => array('groupid', 'radminid', 'type', 'system', 'grouptitle', 'creditshigher', 'creditslower', 'stars', 'color', 'groupavatar')
);
if(!submitcheck('addsubmit')) {
shownav('project_scheme_add');
if(!empty($projectid)) {
$query = $db->query("SELECT name, description, value FROM {$tablepre}projects WHERE id='$projectid'");
$project = $db->fetch_array($query);
}
if(($type == 'forum' && empty($allowforumsedit)) || ($type == 'group' && empty($allowusergroups)) || ($type == 'extcredit' && empty($allowcreditwizard))) {
cpmsg('action_noaccess');
}
$allselected = 'selected';
if($type == 'forum' || $type == 'group') {
$listoption = '';
$fieldarray = $type == 'forum' ? array_merge(fetch_table_struct('forums'), fetch_table_struct('forumfields')) : fetch_table_struct('usergroups');
$listfields = array_diff($fieldarray, $delfields[$type]);
foreach($listfields as $field) {
$listoption .= '<option value="'.$field.'">'.$lang['project_option_'.$type.'_'.$field].'</option>';
}
} elseif($type == 'extcredit') {
$value = unserialize($project['value']);
$savemethod = $value['savemethod'];
$allselected = '';
$listoption = '<option value="1"'.(@in_array(1, $savemethod) ? ' selected': '').'>'.$lang['project_credits_item_config'].'</option>';
$listoption .= '<option value="2"'.(@in_array(2, $savemethod) ? ' selected': '').'>'.$lang['project_credits_rule_config'].'</option>';
$listoption .= '<option value="3"'.(@in_array(3, $savemethod) ? ' selected': '').'>'.$lang['project_credits_use_config'].'</option>';
}
?>
<form method="post" action="admincp.php?action=projectadd&id=<?=$id?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="projectid" value="<?=$projectid?>">
<input type="hidden" name="type" value="<?=$type?>">
<input type="hidden" name="detailsubmit" value="submit">
<?
showtype("project_scheme_save", 'top');
if(!empty($projectid)) {
showsetting('project_scheme_cover', 'coverwith', '', 'radio');
}
showsetting('project_scheme_option', '', '', '<select name="fieldoption[]" size="10" multiple="multiple" style="width: 80%"><option value="all" '.$allselected.'>'.$lang['all'].'</option>'.$listoption.'</select>');
showsetting('project_scheme_title', 'name', $project['name'], 'text');
showsetting('project_scheme_description', 'description', $project['description'], 'textarea');
showtype('', 'bottom');
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"addsubmit\" value=\"$lang[submit]\">";
} else {
$type = !empty($type) && in_array($type, array('forum', 'group', 'extcredit')) ? $type : '';
if(empty($name)) {
cpmsg('project_no_title');
}
if($type == 'forum') {
$query = $db->query("SELECT f.*, ff.* FROM {$tablepre}forums f
LEFT JOIN {$tablepre}forumfields ff USING (fid)
WHERE f.fid='$id'");
if(!$value = $db->fetch_array($query)) {
cpmsg('forums_nonexistence');
}
} elseif($type == 'group') {
$query = $db->query("SELECT * FROM {$tablepre}usergroups WHERE groupid='$id'");
if(!$value = $db->fetch_array($query)) {
cpmsg('project_no_usergroup');
}
} elseif($type == 'extcredit') {
if(empty($fieldoption)) {
cpmsg('project_no_item');
}
$delfields = array();
$fieldoption = in_array('all', $fieldoption) ? array(1, 2, 3) : $fieldoption;
$variables = in_array(1, $fieldoption) ? ", 'extcredits', 'creditspolicy'" : '';
$variables .= in_array(2, $fieldoption) ? ", 'creditsformula'" : '';
$variables .= in_array(3, $fieldoption) ? ", 'creditstrans', 'creditstax', 'transfermincredits', 'exchangemincredits', 'maxincperthread', 'maxchargespan'" : '';
$query = $db->query("SELECT * FROM {$tablepre}settings WHERE variable IN (''$variables)");
$value['savemethod'] = $fieldoption;
while($data = $db->fetch_array($query)) {
$value[$data['variable']] = $data['value'];
}
}
if($type == 'forum' || $type == 'group') {
if(in_array('all', $fieldoption)) {
foreach($delfields[$type] as $field) {
unset($value[$field]);
}
} else {
$selectlist = '';
foreach($value as $key => $val) {
if(in_array($key, $fieldoption)) {
$selectlist[$key] .= $val;
}
}
$value = $selectlist;
}
}
$value = !empty($value) ? addslashes(serialize($value)) : '';
if(!empty($projectid) && !empty($coverwith)) {
$db->query("UPDATE {$tablepre}projects SET name='$name', description='$description', value='$value' WHERE id='$projectid'");
} else {
$db->query("INSERT INTO {$tablepre}projects (name, type, description, value) VALUES ('$name', '$type', '$description', '$value')");
}
if($type == 'forum') {
cpmsg('project_sava_succeed', 'admincp.php?action=forumdetail&fid='.$id);
} elseif($type == 'group') {
cpmsg('project_sava_succeed', 'admincp.php?action=usergroups&edit='.$id);
} elseif($type == 'extcredit') {
cpmsg('project_sava_succeed', 'admincp.php?action=settings&do=credits');
}
}
} elseif($action == 'projectapply') {
$type = !empty($type) && in_array($type, array('forum', 'group', 'extcredit')) ? $type : 'forum';
if(($type == 'forum' && empty($allowforumsedit)) || ($type == 'group' && empty($allowusergroups)) || ($type == 'extcredit' && empty($allowcreditwizard))) {
cpmsg('action_noaccess');
}
$projectselect = "<select name=\"projectid\"><option value=\"0\" selected=\"selected\">".$lang['none']."</option>";
$query = $db->query("SELECT id, name, type FROM {$tablepre}projects WHERE type='$type'");
while($project = $db->fetch_array($query)) {
$projectselect .= "<option value=\"$project[id]\" ".($project['id'] == $projectid ? 'selected="selected"' : NULL).">$project[name]</option>\n";
}
$projectselect .= '</select>';
if(!submitcheck('applysubmit')) {
if($type == 'forum') {
require_once DISCUZ_ROOT.'./include/forum.func.php';
$forumselect = '<select name="target[]" size="10" multiple="multiple" style="width: 80%">'.forumselect().'</select>';
} elseif($type == 'group') {
$groupselect = '<select name="target[]" size="10" multiple="multiple" style="width: 80%">';
$query = $db->query("SELECT groupid, type, grouptitle, creditshigher, creditslower, stars, color, groupavatar FROM {$tablepre}usergroups ORDER BY creditshigher");
while($group = $db->fetch_array($query)) {
$groupselect .= '<option value="'.$group['groupid'].'">'.$group['grouptitle'].'</option>';
}
$groupselect .= '</select>';
} elseif($type == 'extcredit') {
dheader('location:admincp.php?action=settings&do=credits&projectid='.$projectid);
}
shownav('project_global_forum');
?>
<form method="post" action="admincp.php?action=projectapply">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="projectid" value="<?=$projectid?>">
<?
showtype('project_scheme_forum', 'top');
showsetting('project_scheme_title', '', '', $projectselect);
if($type == 'forum') {
showsetting('forums_copy_target', '', '', $forumselect);
} elseif($type == 'group') {
showsetting('project_target_usergroup', '', '', $groupselect);
}
showtype('', 'bottom');
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"applysubmit\" value=\"$lang[submit]\"></form>";
} else {
if(empty($target)) {
cpmsg('project_target_item');
}
$applyids = implodeids($target);
$query = $db->query("SELECT type, value FROM {$tablepre}projects WHERE id='$projectid'");
if(!$project = $db->fetch_array($query)) {
cpmsg('project_no_scheme');
}
if(!$value = unserialize($project['value'])) {
cpmsg('project_invalid');
}
if($project['type'] == 'forum') {
$table_forum_columns = array('styleid', 'allowsmilies', 'allowhtml', 'allowbbcode', 'allowimgcode', 'allowanonymous', 'allowshare', 'allowpostspecial', 'alloweditrules', 'allowpaytoauthor', 'alloweditpost', 'allowspecialonly', 'modnewposts', 'recyclebin', 'jammer', 'forumcolumns', 'threadcaches', 'disablewatermark', 'autoclose', 'simple');
$table_forumfield_columns = array('attachextensions', 'postcredits', 'replycredits', 'digestcredits', 'postattachcredits', 'getattachcredits', 'viewperm', 'postperm', 'replyperm', 'getattachperm', 'postattachperm', 'modrecommend', 'formulaperm');
$updatesql = $comma = '';
foreach($table_forum_columns as $field) {
if(isset($value[$field])) {
$updatesql .= "$comma$field='".addslashes($value[$field])."'";
$comma = ', ';
}
}
if($updatesql) {
$db->query("UPDATE {$tablepre}forums SET $updatesql WHERE fid IN ($applyids)");
}
$updatesql = $comma = '';
foreach($table_forumfield_columns as $field) {
if(isset($value[$field])) {
$updatesql .= "$comma$field='".addslashes($value[$field])."'";
$comma = ', ';
}
}
if($updatesql) {
$db->query("UPDATE {$tablepre}forumfields SET $updatesql WHERE fid IN ($applyids)");
}
} elseif($project['type'] == 'group') {
$usergroup_columns = array('readaccess', 'allowvisit', 'allowpost', 'allowreply', 'allowpostpoll', 'allowpostreward', 'allowposttrade', 'allowpostactivity', 'allowpostvideo', 'allowdirectpost', 'allowgetattach', 'allowpostattach', 'allowvote', 'allowmultigroups', 'allowsearch', 'allowavatar', 'allowcstatus', 'allowuseblog', 'allowinvisible', 'allowtransfer', 'allowsetreadperm', 'allowsetattachperm', 'allowhidecode', 'allowhtml', 'allowcusbbcode', 'allowanonymous', 'allownickname', 'allowsigbbcode', 'allowsigimgcode', 'allowviewpro', 'allowviewstats', 'disableperiodctrl', 'reasonpm', 'maxprice', 'maxpmnum', 'maxsigsize', 'maxattachsize', 'maxsizeperday', 'maxpostsperhour', 'attachextensions', 'raterange', 'mintradeprice', 'maxtradeprice', 'minrewardprice', 'maxrewardprice', 'magicsdiscount', 'allowmagics', 'maxmagicsweight', 'allowbiobbcode', 'allowbioimgcode', 'maxbiosize', 'maxbiotradesize', 'allowinvite', 'allowmailinvite', 'inviteprice', 'maxinvitenum', 'maxinviteday');
$updatesql = $comma = '';
foreach($usergroup_columns as $field) {
if(isset($value[$field])) {
$updatesql .= "$comma$field='".addslashes($value[$field])."'";
$comma = ', ';
}
}
if($updatesql) {
$db->query("UPDATE {$tablepre}usergroups SET $updatesql WHERE groupid IN ($applyids)");
}
}
cpmsg('project_scheme_succeed');
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/project.inc.php | PHP | asf20 | 18,919 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: google.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='google'");
$google = ($google = $db->result($query, 0)) ? unserialize($google) : array();
if($action == 'google_config') {
if(!submitcheck('googlesubmit')) {
$checks = array();
$checkstatus = array($google['status'] => 'checked');
$checklocation = array($google['location'] => 'checked');
$checkrelatedsort = array($google['relatedsort'] => 'checked');
$google['searchbox'] = sprintf('%03b', $google['searchbox']);
for($i = 1; $i <= 3; $i++) {
$checks[$i] = $google['searchbox'][3 - $i] ? 'checked' : '';
}
shownav('google_settings_basic');
?>
<form method="post" name="settings" action="admincp.php?action=google_config">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
showtype('google','top');
showsetting('google_status', 'googlenew[status]', $google['status'], 'radio');
showsetting('google_searchbox', '', '', '<input class="checkbox" type="checkbox" name="googlenew[searchbox][1]" value="1" '.$checks[1].'> '.$lang['google_searchbox_index'].'<br /><input class="checkbox" type="checkbox" name="googlenew[searchbox][2]" value="1" '.$checks[2].'> '.$lang['google_searchbox_forumdisplay'].'<br /><input class="checkbox" type="checkbox" name="googlenew[searchbox][3]" value="1" '.$checks[3].'> '.$lang['google_searchbox_viewthread']);
showsetting('google_lang', array('googlenew[lang]', array(
array('', $lang['google_lang_any']),
array('en', $lang['google_lang_en']),
array('zh-CN', $lang['google_lang_zh-CN']),
array('zh-TW', $lang['google_lang_zh-TW']))), $google['lang'], 'mradio');
showtype('', 'bottom');
echo '<br /><center><input class="button" type="submit" name="googlesubmit" value="'.$lang['submit'].'"></form>';
} else {
$googlenew['searchbox'] = bindec(intval($googlenew['searchbox'][3]).intval($googlenew['searchbox'][2]).intval($googlenew['searchbox'][1]));
$db->query("UPDATE {$tablepre}settings SET value='".addslashes(serialize($googlenew))."' WHERE variable='google'");
updatecache('settings');
updatecache('google');
cpmsg('google_succeed');
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/google.inc.php | PHP | asf20 | 2,463 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: ecommerce.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if($action == 'alipay') {
$settings = array();
$query = $db->query("SELECT variable, value FROM {$tablepre}settings WHERE variable='ec_account'");
while($setting = $db->fetch_array($query)) {
$settings[$setting['variable']] = $setting['value'];
}
if(!submitcheck('alipaysubmit')) {
shownav('menu_ecommerce_alipay');
if($from == 'creditwizard') {
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td><?=$lang['menu_tools_creditwizard']?></td></tr>
<tr><td><?=$lang['creditwizard_tips']?></td></tr></table><br />
<?
}
showtips('alipay_tips');
?>
<form method="post" name="settings" action="admincp.php?action=alipay">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
showtype('alipay', 'top');
showsetting('alipay_account', 'settingsnew[ec_account]', $settings['ec_account'], 'text');
showtype('', 'bottom');
echo '<br /><center>';
echo '<input class="button" type="submit" name="alipaysubmit" value="'.$lang['submit'].'"></form>';
} else {
$db->query("UPDATE {$tablepre}settings SET value='$settingsnew[ec_account]' WHERE variable='ec_account'");
updatecache('settings');
cpmsg('alipay_succeed');
}
} elseif($action == 'orders') {
if(!$creditstrans || !$ec_ratio) {
cpmsg('orders_disabled');
}
if(!submitcheck('ordersubmit')) {
$statusselect = array(($orderstatus = intval($orderstatus)) => 'selected');
$orderid = dhtmlspecialchars($orderid);
$users = dhtmlspecialchars($users);
$buyer = dhtmlspecialchars($buyer);
$admin = dhtmlspecialchars($admin);
$sstarttime = dhtmlspecialchars($sstarttime);
$sendtime = dhtmlspecialchars($sendtime);
$cstarttime = dhtmlspecialchars($cstarttime);
$cendtime = dhtmlspecialchars($cendtime);
shownav('menu_ecommerce_credit_orders');
showtips('orders_tips');
?>
<form method="post" action="admincp.php?action=orders">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="2"><?=$lang['orders_search']?></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['orders_search_status']?></td>
<td class="altbg2" align="right">
<select name="orderstatus">
<option value="0" <?=$statusselect[0]?>> <?=$lang['orders_search_status_all']?></option>
<option value="1" <?=$statusselect[1]?>> <?=$lang['orders_search_status_pending']?></option>
<option value="2" <?=$statusselect[2]?>> <?=$lang['orders_search_status_auto_finished']?></option>
<option value="3" <?=$statusselect[3]?>> <?=$lang['orders_search_status_manual_finished']?></option>
</select>
</td>
</tr>
<tr>
<td class="altbg1" width="45%"><?=$lang['orders_search_id']?></td>
<td class="altbg2" align="right"><input type="text" name="orderid" size="40" value="<?=$orderid?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['orders_search_users']?></td>
<td class="altbg2" align="right"><input type="text" name="users" size="40" value="<?=$users?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['orders_search_buyer']?></td>
<td class="altbg2" align="right"><input type="text" name="buyer" size="40" value="<?=$buyer?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['orders_search_admin']?></td>
<td class="altbg2" align="right"><input type="text" name="admin" size="40" value="<?=$admin?>"></td>
</tr>
<tr>
<td class="altbg1"><?=$lang['orders_search_submit_date']?></td>
<td class="altbg2" align="right">
<input type="text" name="sstarttime" size="10" value="<?=$sstarttime?>"> -
<input type="text" name="sendtime" size="10" value="<?=$sendtime?>"
</td>
</tr>
<tr>
<td class="altbg1"><?=$lang['orders_search_confirm_date']?></td>
<td class="altbg2" align="right">
<input type="text" name="cstarttime" size="10" value="<?=$cstarttime?>"> -
<input type="text" name="cendtime" size="10" value="<?=$cendtime?>"
</td>
</tr>
</table><br />
<center><input class="button" type="submit" name="searchsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
$numvalidate = 0;
if($validate) {
$orderids = $comma = '';
$confirmdate = gmdate($_DCACHE['settings']['dateformat'].' '.$_DCACHE['settings']['timeformat'], $timestamp + $_DCACHE['settings']['timeoffset'] * 3600);
$query = $db->query("SELECT * FROM {$tablepre}orders WHERE orderid IN ('".implode('\',\'', $validate)."') AND status='1'");
while($order = $db->fetch_array($query)) {
$db->query("UPDATE {$tablepre}members SET extcredits$creditstrans=extcredits$creditstrans+'$order[amount]' WHERE uid='$order[uid]'");
$orderids .= "$comma'$order[orderid]'";
$comma = ',';
$submitdate = gmdate($_DCACHE['settings']['dateformat'].' '.$_DCACHE['settings']['timeformat'], $order['submitdate'] + $_DCACHE['settings']['timeoffset'] * 3600);
sendpm($order['uid'], 'addfunds_subject', 'addfunds_message', $fromid = '0', $from = 'System Message');
}
if($numvalidate = $db->num_rows($query)) {
$db->query("UPDATE {$tablepre}orders SET status='3', admin='$discuz_user', confirmdate='$timestamp' WHERE orderid IN ($orderids)");
}
}
cpmsg('orders_validate_succeed', "admincp.php?action=orders&searchsubmit=yes&orderstatus=$orderstatus&orderid=$orderid&users=$users&buyer=$buyer&admin=$admin&sstarttime=$sstarttime&sendtime=$sendtime&cstarttime=$cstarttime&cendtime=$cendtime");
}
if(submitcheck('searchsubmit', 1)) {
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
$sql = '';
$sql .= $orderstatus != '' ? " AND o.status='$orderstatus'" : '';
$sql .= $orderid != '' ? " AND o.orderid='$orderid'" : '';
$sql .= $users != '' ? " AND m.username IN ('".str_replace(',', '\',\'', str_replace(' ', '', $users))."')" : '';
$sql .= $buyer != '' ? " AND o.buyer='$buyer'" : '';
$sql .= $admin != '' ? " AND o.admin='$admin'" : '';
$sql .= $sstarttime != '' ? " AND o.submitdate>='".(strtotime($sstarttime) - $timeoffset * 3600)."'" : '';
$sql .= $sendtime != '' ? " AND o.submitdate<'".(strtotime($sendtime) - $timeoffset * 3600)."'" : '';
$sql .= $cstarttime != '' ? " AND o.confirmdate>='".(strtotime($cstarttime) - $timeoffset * 3600)."'" : '';
$sql .= $cendtime != '' ? " AND o.confirmdate<'".(strtotime($cendtime) - $timeoffset * 3600)."'" : '';
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}orders o, {$tablepre}members m WHERE m.uid=o.uid $sql");
$ordercount = $db->result($query, 0);
$multipage = multi($ordercount, $tpp, $page, "admincp.php?action=orders&searchsubmit=yes&orderstatus=$orderstatus&orderid=$orderid&users=$users&buyer=$buyer&admin=$admin&sstarttime=$sstarttime&sendtime=$sendtime&cstarttime=$cstarttime&cendtime=$cendtime");
$orders = '';
$query = $db->query("SELECT o.*, m.username
FROM {$tablepre}orders o, {$tablepre}members m
WHERE m.uid=o.uid $sql ORDER BY o.submitdate DESC
LIMIT $start_limit, $tpp");
while($order = $db->fetch_array($query)) {
switch($order['status']) {
case 1: $order['orderstatus'] = $lang['orders_search_status_pending']; break;
case 2: $order['orderstatus'] = '<b>'.$lang['orders_search_status_auto_finished'].'</b>'; break;
case 3: $order['orderstatus'] = '<b>'.$lang['orders_search_status_manual_finished'].'</b><br />(<a href="space.php?action=viewpro&username='.rawurlencode($order['admin']).'" target="_blank">'.$order['admin'].'</a>)'; break;
}
$order['submitdate'] = gmdate("$dateformat $timeformat", $order['submitdate'] + $timeoffset * 3600);
$order['confirmdate'] = $order['confirmdate'] ? gmdate("$dateformat $timeformat", $order['confirmdate'] + $timeoffset * 3600) : 'N/A';
$orders .= "<tr align=\"center\" class=\"smalltxt\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"validate[]\" value=\"$order[orderid]\" ".($order['status'] != 1 ? 'disabled' : '')."></td>\n".
"<td class=\"altbg2\">$order[orderid]</td>\n".
"<td class=\"altbg1\">$order[orderstatus]</td>\n".
"<td class=\"altbg2\"><a href=\"space.php?action=viewpro&uid=$order[uid]\" target=\"_blank\">$order[username]</a></td>\n".
"<td class=\"altbg1\"><a href=\"mailto:$order[buyer]\">$order[buyer]</a></td>\n".
"<td class=\"altbg2\">{$extcredits[$creditstrans]['title']} $order[amount] {$extcredits[$creditstrans]['unit']}</td>\n".
"<td class=\"altbg1\">$lang[rmb] $order[price] $lang[rmb_yuan]</td>\n".
"<td class=\"altbg2\">$order[submitdate]</td>\n".
"<td class=\"altbg1\">$order[confirmdate]</td></tr>\n";
}
?>
<form method="post" action="admincp.php?action=orders">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?=$multipage?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form)"><?=$lang['orders_validate']?></td>
<td><?=$lang['orders_id']?></td><td><?=$lang['orders_status']?></td><td><?=$lang['orders_username']?></td><td><?=$lang['orders_buyer']?></td>
<td><?=$lang['orders_amount']?></td><td><?=$lang['orders_price']?></td><td><?=$lang['orders_submitdate']?></td><td><?=$lang['orders_confirmdate']?></td></tr>
<?=$orders?>
</table>
<?=$multipage?><br />
<center><input class="button" type="submit" name="ordersubmit" value="<?=$lang['submit']?>">
</center>
</form>
<?
}
} elseif($action == 'ec_credit') {
$defaultrank = array(
1 => 4,
2 => 11,
3 => 41,
4 => 91,
5 => 151,
6 => 251,
7 => 501,
8 => 1001,
9 => 2001,
10 => 5001,
11 => 10001,
12 => 20001,
13 => 50001,
14 => 100001,
15 => 200001
);
if(!submitcheck('creditsubmit')) {
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='ec_credit'");
$ec_credit = $db->result($query, 0);
$ec_credit = $ec_credit ? unserialize($ec_credit) : array(
'maxcreditspermonth' => '6',
'rank' => $defaultrank
);
shownav('menu_ecommerce_credit');
showtips('ec_credit_tips');
?>
<form method="post" name="settings" action="admincp.php?action=ec_credit">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
showtype('ec_credit', 'top');
showsetting('ec_credit_maxcreditspermonth', 'ec_creditnew[maxcreditspermonth]', $ec_credit['maxcreditspermonth'], 'text');
showtype('', 'bottom');
?>
<br /><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="5"><?=$lang['ec_credit_rank']?></td></tr>
<tr class="category" align="center"><td><?=$lang['ec_credit_rank']?></td><td><?=$lang['ec_credit_mincredits']?></td><td><?=$lang['ec_credit_maxcredits']?></td><td><?=$lang['ec_credit_sellericon']?></td><td><?=$lang['ec_credit_buyericon']?></td></tr>
<?
foreach($ec_credit['rank'] AS $rank => $mincredits) {
echo "<tr align=\"center\"><td class=\"altbg1\">$rank</td><td class=\"altbg2\"><input type=\"text\" size=\"12\" name=\"ec_creditnew[rank][$rank]\" value=\"$mincredits\"></td><td class=\"altbg1\">{$ec_credit[rank][$rank + 1]}</td><td class=\"altbg2\"><img src=\"images/rank/seller/$rank.gif\" border=\"0\"></td><td class=\"altbg1\"><img src=\"images/rank/buyer/$rank.gif\" border=\"0\"></td>\n";
}
showtype('', 'bottom');
echo '<br /><center><input class="button" type="submit" name="creditsubmit" value="'.$lang['submit'].'"></center></form>';
} else {
$ec_creditnew['maxcreditspermonth'] = intval($ec_creditnew['maxcreditspermonth']);
if(is_array($ec_creditnew['rank'])) {
foreach($ec_creditnew['rank'] AS $rank => $mincredits) {
$mincredits = intval($mincredits);
if($rank == 1 && $mincredits <= 0) {
cpmsg('ecommerce_invalidcredit');
} elseif($rank > 1 && $mincredits <= $ec_creditnew['rank'][$rank - 1]) {
cpmsg('ecommerce_must_larger');
}
$ec_creditnew['rank'][$rank] = $mincredits;
}
} else {
$ec_creditnew['rank'] = $defaultrank;
}
$db->query("UPDATE {$tablepre}settings SET value='".serialize($ec_creditnew)."' WHERE variable='ec_credit'");
updatecache('settings');
cpmsg('alipay_succeed');
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/ecommerce.inc.php | PHP | asf20 | 12,557 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: forums.inc.php 10463 2007-09-03 01:23:37Z tiger $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if($action == 'forumadd') {
if((!submitcheck('catsubmit') && !submitcheck('forumsubmit'))) {
$addforumtype = '';
$groupselect = $forumselect = "<select name=\"fup\">\n";
$query = $db->query("SELECT fid, name, type, fup FROM {$tablepre}forums WHERE type<>'sub' ORDER BY displayorder");
while($fup = $db->fetch_array($query)) {
$fups[] = $fup;
}
if(is_array($fups)) {
foreach($fups as $forum1) {
if($forum1['type'] == 'group') {
if(isset($fupid) && $fupid == $forum1['fid']) {
$fupselected = 'selected';
$addforumtype = 'group';
} else {
$fupselected = '';
}
$groupselect .= "<option value=\"$forum1[fid]\" $fupselected>$forum1[name]</option>\n";
$forumselect .= "<optgroup label=\"$forum1[name]\">\n";
foreach($fups as $forum2) {
if($forum2['type'] == 'forum' && $forum2['fup'] == $forum1['fid']) {
if(isset($fupid) && $fupid == $forum2['fid']) {
$fupselected = 'selected';
$addforumtype = 'forum';
} else {
$fupselected = '';
}
$forumselect .= "<option value=\"$forum2[fid]\" $fupselected> > $forum2[name]</option>\n";
}
}
}
}
foreach($fups as $forum0) {
if($forum0['type'] == 'forum' && $forum0['fup'] == 0) {
if(isset($fupid) && $fupid == $forum0['fid']) {
$fupselected = 'selected';
$addforumtype = $forum0['type'];
} else {
$fupselected = '';
}
if($forum0['type'] == 'group') {
$groupselect .= "<option value=\"$forum0[fid]\" $fupselected>$forum0[name]</option>\n";
} else {
$forumselect .= "<option value=\"$forum0[fid]\" $fupselected>$forum0[name]</option>\n";
}
}
}
}
$groupselect .= '</select>';
$forumselect .= '</select>';
$projectselect = "<select name=\"projectid\"><option value=\"0\" selected=\"selected\">".$lang['none']."</option>";
$query = $db->query("SELECT id, name FROM {$tablepre}projects WHERE type='forum'");
while($project = $db->fetch_array($query)) {
$projectselect .= "<option value=\"$project[id]\">$project[name]</option>\n";
}
$projectselect .= '</select>';
shownav('menu_forums_add');
showtips('forums_add_tips');
if(empty($addforumtype)) {
?>
<br /><form method="post" action="admincp.php?action=forumadd&add=category">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="3"><?=$lang['forums_add_category']?></td></tr>
<tr align="center"><td class="altbg1" width="15%"><?=$lang['name']?>:</td>
<td class="altbg2" width="85%"><input type="text" name="newcat" value="<?=$lang['forums_add_category_name']?>" size="20"></td>
</table><br /><center>
<input class="button" type="submit" name="catsubmit" value="<?=$lang['submit']?>"></center></form>
<?
}
if(empty($addforumtype) || $addforumtype == 'group') {
?>
<br /><form method="post" action="admincp.php?action=forumadd&add=forum">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['forums_add_forum']?></td></tr>
<tr align="center"><td class="altbg1" width="15%"><?=$lang['name']?>:</td>
<td class="altbg2" width="85%"><input type="text" name="newforum" value="<?=$lang['forums_add_forum_name']?>" size="20"></td></tr>
<tr align="center"><td class="altbg1" width="15%"><?=$lang['forums_add_parent_category']?>:</td>
<td class="altbg2" width="85%"><?=$groupselect?></td></tr>
<tr align="center"><td class="altbg1" width="15%"><?=$lang['forums_scheme']?></td>
<td class="altbg2" width="85%"><?=$projectselect?></td></tr></table><br />
<center><input class="button" type="submit" name="forumsubmit" value="<?=$lang['submit']?>"></center></form>
<?
}
if(empty($addforumtype) || $addforumtype == 'forum') {
?>
<br /><form method="post" action="admincp.php?action=forumadd&add=forum">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="3"><?=$lang['forums_add_sub']?></td></tr>
<tr align="center"><td class="altbg1" width="15%"><?=$lang['name']?>:</td>
<td class="altbg2" width="28%"><input type="text" name="newforum" value="<?=$lang['forums_add_sub_name']?>" size="20"></td></tr>
<tr align="center"><td class="altbg1" width="15%"><?=$lang['forums_add_parent_forum']?>:</td>
<td class="altbg2" width="27%"><?=$forumselect?></td></tr>
<tr align="center"><td class="altbg1" width="15%"><?=$lang['forums_scheme']?></td>
<td class="altbg2" width="85%"><?=$projectselect?></td></tr></table><br />
<center><input class="button" type="submit" name="forumsubmit" value="<?=$lang['submit']?>"></center>
</form><br />
<?
}
} elseif(submitcheck('catsubmit')) {
if(strlen($newcat) > 50) {
cpmsg('forums_name_toolong');
}
$db->query("INSERT INTO {$tablepre}forums (type, name, status)
VALUES ('group', '$newcat', '1')");
$fid = $db->insert_id();
$db->query("INSERT INTO {$tablepre}forumfields (fid)
VALUES ('$fid')");
updatecache('forums');
cpmsg('forums_add_category_succeed', 'admincp.php?action=forumsedit');
} elseif(submitcheck('forumsubmit')) {
if(strlen($newforum) > 50) {
cpmsg('forums_name_toolong');
}
if(!$fup) {
cpmsg('forums_noparent');
}
$modarray = $forumfields = array();
$table_forum_columns = array('fup', 'type', 'name', 'status', 'styleid', 'allowsmilies', 'allowhtml', 'allowbbcode', 'allowimgcode', 'allowanonymous', 'allowshare', 'allowpostspecial', 'alloweditrules', 'allowpaytoauthor', 'alloweditpost', 'modnewposts', 'recyclebin', 'jammer', 'forumcolumns', 'threadcaches', 'disablewatermark', 'autoclose', 'simple');
$table_forumfield_columns = array('fid', 'attachextensions', 'threadtypes', 'postcredits', 'replycredits', 'digestcredits', 'postattachcredits', 'getattachcredits', 'viewperm', 'postperm', 'replyperm', 'getattachperm', 'postattachperm');
$query = $db->query("SELECT * FROM {$tablepre}forums WHERE fid='$fup'");
$forum = $db->fetch_array($query);
if(!empty($projectid)) {
$query = $db->query("SELECT value FROM {$tablepre}projects WHERE id='$projectid'");
$project = unserialize($db->result($query, 0));
foreach($table_forum_columns as $field) {
$forumfields[$field] = $project[$field];
}
foreach($table_forumfield_columns as $field) {
$forumfields[$field] = $project[$field];
}
} else {
$forumfields['allowsmilies'] = $forumfields['allowbbcode'] = $forumfields['allowimgcode'] = $forumfields['allowshare'] = 1;
$forumfields['allowpostspecial'] = 127;
}
$forumfields['fup'] = $forum ? $fup : 0;
$forumfields['type'] = $forum['type'] == 'forum' ? 'sub' : 'forum';
$forumfields['name'] = $newforum;
$forumfields['status'] = 1;
$sql1 = $sql2 = $comma = '';
foreach($table_forum_columns as $field) {
if(isset($forumfields[$field])) {
$sql1 .= "$comma$field";
$sql2 .= "$comma'{$forumfields[$field]}'";
$comma = ', ';
}
}
$db->query("INSERT INTO {$tablepre}forums ($sql1) VALUES ($sql2)");
$forumfields['fid'] = $fid = $db->insert_id();
$sql1 = $sql2 = $comma = '';
foreach($table_forumfield_columns as $field) {
if(isset($forumfields[$field])) {
$sql1 .= "$comma$field";
$sql2 .= "$comma'{$forumfields[$field]}'";
$comma = ', ';
}
}
$db->query("INSERT INTO {$tablepre}forumfields ($sql1) VALUES ($sql2)");
$query = $db->query("SELECT uid, inherited FROM {$tablepre}moderators WHERE fid='$fup'");
while($mod = $db->fetch_array($query)) {
if($mod['inherited'] || $forum['inheritedmod']) {
$db->query("REPLACE INTO {$tablepre}moderators (uid, fid, inherited)
VALUES ('$mod[uid]', '$fid', '1')");
}
}
updatecache('forums');
cpmsg('forums_add_forum_succeed', 'admincp.php?action=forumsedit');
}
} elseif($action == 'forumsedit') {
if(!submitcheck('editsubmit')) {
shownav('menu_forums_edit');
showtips('forums_tips');
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['forums_edit']?></td></tr>
<tr><td class="altbg1"><br />
<form method="post" action="admincp.php?action=forumsedit">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
$forums = $showedforums = array();
$query = $db->query("SELECT f.fid, f.type, f.status, f.name, f.fup, f.displayorder, f.inheritedmod, f.areaid, ff.moderators
FROM {$tablepre}forums f LEFT JOIN {$tablepre}forumfields ff USING(fid)
ORDER BY f.type<>'group', f.displayorder");
while($forum = $db->fetch_array($query)) {
$forums[] = $forum;
}
for($i = 0; $i < count($forums); $i++) {
if($forums[$i]['type'] == 'group') {
echo '<ul>'.showforum($i, 'group');
for($j = 0; $j < count($forums); $j++) {
if($forums[$j]['fup'] == $forums[$i]['fid'] && $forums[$j]['type'] == 'forum') {
echo '<ul>'.showforum($j);
for($k = 0; $k < count($forums); $k++) {
if($forums[$k]['fup'] == $forums[$j]['fid'] && $forums[$k]['type'] == 'sub') {
echo '<ul>'.showforum($k, 'sub').'</ul>';
}
}
echo '</ul>';
}
}
echo '</ul>';
} elseif(!$forums[$i]['fup'] && $forums[$i]['type'] == 'forum') {
echo '<ul>'.showforum($i);
for($j = 0; $j < count($forums); $j++) {
if($forums[$j]['fup'] == $forums[$i]['fid'] && $forums[$j]['type'] == 'sub') {
echo '<ul>'.showforum($j, 'sub').'</ul>';
}
}
echo '</ul>';
}
}
foreach($forums as $key => $forum) {
if(!in_array($key, $showedforums)) {
$db->query("UPDATE {$tablepre}forums SET fup='0', type='forum' WHERE fid='$forum[fid]'");
echo '<ul>'.showforum($key).'</ul>';
}
}
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"editsubmit\" value=\"$lang[submit]\"></center><br /></form></td></tr></table>\n";
} else {
// read from groups
$usergroups = array();
$query = $db->query("SELECT groupid, type, creditshigher, creditslower FROM {$tablepre}usergroups");
while($group = $db->fetch_array($query)) {
$usergroups[$group['groupid']] = $group;
}
if(is_array($order)) {
foreach($order as $fid => $value) {
$db->query("UPDATE {$tablepre}forums SET displayorder='$order[$fid]' WHERE fid='$fid'");
$db->query("UPDATE {$tablepre}forums SET areaid='$area[$fid]' WHERE fid='$fid'");
}
}
updatecache('forums');
cpmsg('forums_update_succeed', 'admincp.php?action=forumsedit');
}
} elseif($action == 'moderators' && $fid) {
if(!submitcheck('modsubmit')) {
$moderators = '';
$query = $db->query("SELECT m.username, mo.* FROM {$tablepre}members m, {$tablepre}moderators mo WHERE mo.fid='$fid' AND m.uid=mo.uid ORDER BY mo.inherited, mo.displayorder");
while($mod = $db->fetch_array($query)) {
$moderators .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$mod[uid]\" ".($mod['inherited'] ? 'disabled' : '').">\n".
"<td class=\"altbg2\"><a href=\"space.php?action=viewpro&uid=$mod[uid]\" target=\"_blank\">$mod[username]</a></td>\n".
"<td class=\"altbg1\"><input type=\"text\" name=\"displayordernew[$mod[uid]]\" value=\"$mod[displayorder]\" size=\"2\"></td>\n".
"<td class=\"altbg2\">".($mod['inherited'] ? '<b>'.$lang['yes'].'</b>' : $lang['no'])."</td></tr>\n";
}
if($forum['type'] == 'group' || $forum['type'] == 'sub') {
$checked = $forum['type'] == 'group' ? 'checked' : '';
$disabled = 'disabled';
} else {
$checked = $forum['inheritedmod'] ? 'checked' : '';
$disabled = '';
}
shownav('forums_moderators_edit');
showtips('forums_moderators_tips');
?>
<form method="post" action="admincp.php?action=moderators&fid=<?=$fid?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="4"><?=$lang['forums_moderators_edit']?> - <?=$forum['name']?></td></tr>
<tr align="center" class="category"><td><?=$lang['del']?></td><td><?=$lang['username']?></td><td><?=$lang['display_order']?></td><td><?=$lang['forums_moderators_inherited']?></td></tr>
<?=$moderators?>
<tr align="center"><td class="altbg1"><?=$lang['add_new']?></td><td class="altbg2"><input type='text' name="newmoderator" size="20"></td><td class="altbg1"><input type="text" name="newdisplayorder" size="2" value="0"></td><td class="altbg2"> </td></tr>
<tr><td colspan="4" class="altbg2"><input class="checkbox" type="checkbox" name="inheritedmodnew" value="1" <?=$checked?> <?=$disabled?>> <?=$lang['forums_moderators_inherit']?></td></tr>
</table><br />
<center><input class="button" type="submit" name="modsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
if($forum['type'] == 'group') {
$inheritedmodnew = 1;
} elseif($forum['type'] == 'sub') {
$inheritedmodnew = 0;
}
if(!empty($delete) || $newmoderator || (bool)$forum['inheritedmod'] != (bool)$inheritedmodnew) {
$fidarray = $newmodarray = $origmodarray = array();
if($forum['type'] == 'group') {
$query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='forum' AND fup='$fid'");
while($sub = $db->fetch_array($query)) {
$fidarray[] = $sub['fid'];
}
$query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='sub' AND fup IN ('".implode('\',\'', $fidarray)."')");
while($sub = $db->fetch_array($query)) {
$fidarray[] = $sub['fid'];
}
} elseif($forum['type'] == 'forum') {
$query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='sub' AND fup='$fid'");
while($sub = $db->fetch_array($query)) {
$fidarray[] = $sub['fid'];
}
}
if(is_array($delete)) {
foreach($delete as $uid) {
$db->query("DELETE FROM {$tablepre}moderators WHERE uid='$uid' AND ((fid='$fid' AND inherited='0') OR (fid IN ('".implode('\',\'', $fidarray)."') AND inherited='1'))");
}
$excludeuids = 0;
$deleteuids = '\''.implode('\',\'', $delete).'\'';
$query = $db->query("SELECT uid FROM {$tablepre}moderators WHERE uid IN ($deleteuids)");
while($mod = $db->fetch_array($query)) {
$excludeuids .= ','.$mod['uid'];
}
$usergroups = array();
$query = $db->query("SELECT groupid, type, radminid, creditshigher, creditslower FROM {$tablepre}usergroups");
while($group = $db->fetch_array($query)) {
$usergroups[$group['groupid']] = $group;
}
$query = $db->query("SELECT uid, groupid, credits FROM {$tablepre}members WHERE uid IN ($deleteuids) AND uid NOT IN ($excludeuids) AND adminid NOT IN (1,2)");
while($member = $db->fetch_array($query)) {
if($usergroups[$member['groupid']]['type'] == 'special' && $usergroups[$member['groupid']]['radminid'] != 3) {
$adminidnew = -1;
$groupidnew = $member['groupid'];
} else {
$adminidnew = 0;
foreach($usergroups as $group) {
if($group['type'] == 'member' && $member['credits'] >= $group['creditshigher'] && $member['credits'] < $group['creditslower']) {
$groupidnew = $group['groupid'];
break;
}
}
}
$db->query("UPDATE {$tablepre}members SET adminid='$adminidnew', groupid='$groupidnew' WHERE uid='$member[uid]'");
}
}
if((bool)$forum['inheritedmod'] != (bool)$inheritedmodnew) {
$query = $db->query("SELECT uid FROM {$tablepre}moderators WHERE fid='$fid' AND inherited='0'");
while($mod = $db->fetch_array($query)) {
$origmodarray[] = $mod['uid'];
if(!$forum['inheritedmod'] && $inheritedmodnew) {
$newmodarray[] = $mod['uid'];
}
}
if($forum['inheritedmod'] && !$inheritedmodnew) {
$db->query("DELETE FROM {$tablepre}moderators WHERE uid IN ('".implode('\',\'', $origmodarray)."') AND fid IN ('".implode('\',\'', $fidarray)."') AND inherited='1'");
}
}
if($newmoderator) {
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE username='$newmoderator'");
if(!$member = $db->fetch_array($query)) {
cpmsg('members_edit_nonexistence');
} else {
$newmodarray[] = $member['uid'];
$db->query("UPDATE {$tablepre}members SET groupid='3' WHERE uid='$member[uid]' AND adminid NOT IN (1,2,3,4,5,6,7,8,-1)");
$db->query("UPDATE {$tablepre}members SET adminid='3' WHERE uid='$member[uid]' AND adminid NOT IN (1,2)");
$db->query("REPLACE INTO {$tablepre}moderators (uid, fid, displayorder, inherited)
VALUES ('$member[uid]', '$fid', '$newdisplayorder', '0')");
}
}
foreach($newmodarray as $uid) {
$db->query("REPLACE INTO {$tablepre}moderators (uid, fid, displayorder, inherited)
VALUES ('$uid', '$fid', '$newdisplayorder', '0')");
if($inheritedmodnew) {
foreach($fidarray as $ifid) {
$db->query("REPLACE INTO {$tablepre}moderators (uid, fid, inherited)
VALUES ('$uid', '$ifid', '1')");
}
}
}
if($forum['type'] == 'group') {
$inheritedmodnew = 1;
} elseif($forum['type'] == 'sub') {
$inheritedmodnew = 0;
}
$db->query("UPDATE {$tablepre}forums SET inheritedmod='$inheritedmodnew' WHERE fid='$fid'");
}
if(is_array($displayordernew)) {
foreach($displayordernew as $uid => $order) {
$db->query("UPDATE {$tablepre}moderators SET displayorder='$order' WHERE fid='$fid' AND uid='$uid'");
}
}
$moderators = $tab = '';
$query = $db->query("SELECT m.username FROM {$tablepre}members m, {$tablepre}moderators mo WHERE mo.fid='$fid' AND mo.inherited='0' AND m.uid=mo.uid ORDER BY mo.displayorder");
while($mod = $db->fetch_array($query)) {
$moderators .= $tab.addslashes($mod['username']);
$tab = "\t";
}
$db->query("UPDATE {$tablepre}forumfields SET moderators='$moderators' WHERE fid='$fid'");
cpmsg('forums_moderators_update_succeed', "admincp.php?action=moderators&fid=$fid");
}
} elseif($action == 'forumsmerge') {
if(!submitcheck('mergesubmit') || $source == $target) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
$forumselect = "<select name=\"%s\">\n<option value=\"\"> > $lang[select]</option><option value=\"\"> </option>".str_replace('%', '%%', forumselect()).'</select>';
shownav('menu_forums_merge');
?>
<form method="post" action="admincp.php?action=forumsmerge">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="3"><?=$lang['forums_merge']?></td></tr>
<tr align="center"><td class="altbg1" width="40%"><?=$lang['forums_merge_source']?>:</td>
<td class="altbg2" width="45%"><?=sprintf($forumselect, "source")?></td></tr>
<tr align="center"><td class="altbg1" width="40%"><?=$lang['forums_merge_target']?>:</td>
<td class="altbg2" width="45%"><?=sprintf($forumselect, "target")?></td></tr>
</table><br /><center><input class="button" type="submit" name="mergesubmit" value="<?=$lang['submit']?>"></center></form>
<?
} else {
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}forums WHERE fid IN ('$source', '$target') AND type<>'group'");
if(($db->result($query, 0)) != 2) {
cpmsg('forums_nonexistence');
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}forums WHERE fup='$source'");
if($db->result($query, 0)) {
cpmsg('forums_merge_source_sub_notnull');
}
$db->query("UPDATE {$tablepre}threads SET fid='$target' WHERE fid='$source'");
$db->query("UPDATE {$tablepre}posts SET fid='$target' WHERE fid='$source'");
$query = $db->query("SELECT threads, posts FROM {$tablepre}forums WHERE fid='$source'");
$sourceforum = $db->fetch_array($query);
$db->query("UPDATE {$tablepre}forums SET threads=threads+$sourceforum[threads], posts=posts+$sourceforum[posts] WHERE fid='$target'");
$db->query("DELETE FROM {$tablepre}forums WHERE fid='$source'");
$db->query("DELETE FROM {$tablepre}forumfields WHERE fid='$source'");
$db->query("DELETE FROM {$tablepre}moderators WHERE fid='$source'");
$query = $db->query("SELECT * FROM {$tablepre}access WHERE fid='$source'");
while($access = $db->fetch_array($query)) {
$db->query("INSERT INTO {$tablepre}access (uid, fid, allowview, allowpost, allowreply, allowgetattach)
VALUES ('$access[uid]', '$target', '$access[allowview]', '$access[allowpost]', '$access[allowreply]', '$access[allowgetattach]')", 'SILENT');
}
$db->query("DELETE FROM {$tablepre}access WHERE fid='$source'");
updatecache('forums');
cpmsg('forums_merge_succeed', 'admincp.php?action=forumsedit');
}
} elseif($action == 'forumdetail') {
$perms = array('viewperm', 'postperm', 'replyperm', 'getattachperm', 'postattachperm');
$query = $db->query("SELECT *, f.fid AS fid FROM {$tablepre}forums f
LEFT JOIN {$tablepre}forumfields ff USING (fid)
WHERE f.fid='$fid'");
if(!$forum = $db->fetch_array($query)) {
cpmsg('forums_nonexistence');
}
$query = $db->query("SELECT disabledactions FROM {$tablepre}adminactions WHERE admingid='$groupid'");
$dactionarray = ($dactionarray = unserialize($db->result($query, 0))) ? $dactionarray : array();
$allowthreadtypes = !in_array('threadtypes', $dactionarray);
if(!empty($projectid)) {
$query = $db->query("SELECT value FROM {$tablepre}projects WHERE id='$projectid'");
$forum = @array_merge($forum, unserialize($db->result($query, 0)));
}
if(!submitcheck('detailsubmit') && !submitcheck('saveconfigsubmit')) {
shownav('menu_forums_detail');
?>
<script language="JavaScript">
var typenum = 1;
function addtype() {
if(typenum > 9) return;
$('type_' + typenum).style.display = '';
typenum++;
}
</script>
<form method="post" action="admincp.php?action=forumdetail&fid=<?=$fid?>&">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="type" value="<?=$forum['type']?>">
<input type="hidden" name="detailsubmit" value="submit">
<?
if($forum['type'] == 'group') {
showtype("$lang[forums_cat_detail] - $forum[name]", 'top');
showsetting('forums_cat_name', 'namenew', $forum['name'], 'text');
showsetting('forums_sub_horizontal', 'forumcolumnsnew', $forum['forumcolumns'], 'text');
showtype('', 'bottom');
} else {
showtips('forums_edit_tips');
$projectselect = "<select name=\"projectid\" onchange=\"window.location='admincp.php?action=forumdetail&fid=$fid&projectid='+this.options[this.options.selectedIndex].value\"><option value=\"0\" selected=\"selected\">".$lang['none']."</option>";
$query = $db->query("SELECT id, name FROM {$tablepre}projects WHERE type='forum'");
while($project = $db->fetch_array($query)) {
$projectselect .= "<option value=\"$project[id]\" ".($project['id'] == $projectid ? 'selected="selected"' : NULL).">$project[name]</option>\n";
}
$projectselect .= '</select>';
$fupselect = "<select name=\"fupnew\">\n";
$query = $db->query("SELECT fid, type, name, fup FROM {$tablepre}forums WHERE fid<>'$fid' AND type<>'sub' ORDER BY displayorder");
while($fup = $db->fetch_array($query)) {
$fups[] = $fup;
}
if(is_array($fups)) {
foreach($fups as $forum1) {
if($forum1['type'] == 'group') {
$selected = $forum1['fid'] == $forum['fup'] ? "selected=\"selected\"" : NULL;
$fupselect .= "<option value=\"$forum1[fid]\" $selected>$forum1[name]</option>\n";
foreach($fups as $forum2) {
if($forum2['type'] == 'forum' && $forum2['fup'] == $forum1['fid']) {
$selected = $forum2['fid'] == $forum['fup'] ? "selected=\"selected\"" : NULL;
$fupselect .= "<option value=\"$forum2[fid]\" $selected> > $forum2[name]</option>\n";
}
}
}
}
foreach($fups as $forum0) {
if($forum0['type'] == 'forum' && $forum0['fup'] == 0) {
$selected = $forum0['fid'] == $forum['fup'] ? "selected=\"selected\"" : NULL;
$fupselect .= "<option value=\"$forum0[fid]\" $selected>$forum0[name]</option>\n";
}
}
}
$fupselect .= '</select>';
$groups = array();
$query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups");
while($group = $db->fetch_array($query)) {
$groups[] = $group;
}
$styleselect = "<select name=\"styleidnew\"><option value=\"0\">$lang[use_default]</option>";
$query = $db->query("SELECT styleid, name FROM {$tablepre}styles");
while($style = $db->fetch_array($query)) {
$styleselect .= "<option value=\"$style[styleid]\" ".
($style['styleid'] == $forum['styleid'] ? 'selected="selected"' : NULL).
">$style[name]</option>\n";
}
$styleselect .= '</select>';
if($forum['autoclose']) {
$acoption = $forum['autoclose'] / abs($forum['autoclose']);
$forum['autoclose'] = abs($forum['autoclose']);
} else {
$acoption = 0;
}
$checkac = array($acoption => 'checked');
$viewaccess = $postaccess = $replyaccess = $getattachaccess = $postattachaccess = '';
$query = $db->query("SELECT m.username, a.* FROM {$tablepre}access a LEFT JOIN {$tablepre}members m USING (uid) WHERE fid='$fid'");
while($access = $db->fetch_array($query)) {
$member = ", <a href=\"admincp.php?action=access&uid=$access[uid]\" target=\"_blank\">$access[username]</a>";
$viewaccess .= $access['allowview'] ? $member : NULL;
$postaccess .= $access['allowpost'] ? $member : NULL;
$replyaccess .= $access['allowreply'] ? $member : NULL;
$getattachaccess .= $access['allowgetattach'] ? $member : NULL;
$postattachaccess .= $access['allowpostattach'] ? $member : NULL;
}
unset($member);
if($forum['status'] != 2) {
if($forum['threadtypes']) {
$forum['threadtypes'] = unserialize($forum['threadtypes']);
$forum['typemodels'] = unserialize($forum['typemodels']);
$forum['threadtypes']['status'] = 1;
} else {
$forum['threadtypes'] = array('status' => 0, 'required' => 0, 'listable' => 0, 'prefix' => 0, 'options' => array());
}
$typeselect = '';
$query = $db->query("SELECT * FROM {$tablepre}threadtypes ORDER BY displayorder");
while($type = $db->fetch_array($query)) {
$typeselected = array();
if(isset($forum['threadtypes']['flat'][$type['typeid']])) {
$typeselected[1] = 'checked';
} elseif(isset($forum['threadtypes']['selectbox'][$type['typeid']])) {
$typeselected[2] = 'checked';
} else {
$typeselected[0] = 'checked';
}
$typeselected[3] = $forum['threadtypes']['show'][$type['typeid']] ? 'checked' : '';
$showtype = TRUE;
if($type['special'] && !@include_once DISCUZ_ROOT.'./forumdata/cache/threadtype_'.$type['typeid'].'.php') {
$showtype = FALSE;
}
$typeselect .= $showtype ? "<tr align=\"center\"><td class=\"altbg1\">$type[name]</td>".
"<td class=\"altbg2\">$type[description]".($type['special'] ? ' '.$lang['menu_forums_types'] : '')."</td>".
"<td class=\"altbg1\"><input class=\"radio\" type=\"radio\" name=\"threadtypesnew[options][{$type[typeid]}]\" value=\"0\" $typeselected[0]></td>".
"<td class=\"altbg2\"><input class=\"radio\" type=\"radio\" name=\"threadtypesnew[options][{$type[typeid]}]\" value=\"1\" $typeselected[1]></td>".
"<td class=\"altbg1\"><input class=\"radio\" type=\"radio\" name=\"threadtypesnew[options][{$type[typeid]}]\" value=\"2\" $typeselected[2]></td>".
"<td class=\"altbg2\"><input class=\"checkbox\" type=\"checkbox\" name=\"threadtypesnew[options][show][{$type[typeid]}]\" value=\"3\" $typeselected[3] ".(!$type['special'] ? 'disabled' : '')."></td>".
"</tr>" : '';
}
$typeselect = $typeselect ? $typeselect : '<tr><td class="altbg1" colspan="6">'.$lang['forums_edit_threadtypes_options_null'].'</td></tr>';
$num = 0;
$query = $db->query("SELECT * FROM {$tablepre}typemodels ORDER BY displayorder");
while($model = $db->fetch_array($query)) {
$num++;
$typemodelselect .= $num && $num % 6 == 0 ? '<br />' : '';
$modelchecked = $forum['typemodels'][$model['id']] ? 'checked' : '';
$typemodelselect .= "<input class=\"checkbox\" type=\"checkbox\" name=\"typemodel[]\" value=\"$model[id]\" $modelchecked>$model[name] ";
}
}
$forum['postcredits'] = $forum['postcredits'] ? unserialize($forum['postcredits']) : array();
$forum['replycredits'] = $forum['replycredits'] ? unserialize($forum['replycredits']) : array();
$forum['digestcredits'] = $forum['digestcredits'] ? unserialize($forum['digestcredits']) : array();
$forum['postattachcredits'] = $forum['postattachcredits'] ? unserialize($forum['postattachcredits']) : array();
$forum['getattachcredits'] = $forum['getattachcredits'] ? unserialize($forum['getattachcredits']) : array();
$forum['circle'] = $forum['status'] == 2 ? 1 : 0;
$simplebin = sprintf('%08b', $forum['simple']);
$forum['defaultorderfield'] = bindec(substr($simplebin, 0, 2));
$forum['defaultorder'] = ($forum['simple'] & 32) ? 1 : 0;
$forum['subforumsindex'] = bindec(substr($simplebin, 3, 2));
$forum['subforumsindex'] = $forum['subforumsindex'] == 0 ? -1 : ($forum['subforumsindex'] == 2 ? 0 : 1);
$forum['simple'] = $forum['simple'] & 1;
$forum['modrecommend'] = $forum['modrecommend'] ? unserialize($forum['modrecommend']) : '';
$forum['formulaperm'] = unserialize($forum['formulaperm']);$forum['formulaperm'] = $forum['formulaperm'][0];
showtype('menu_forums_detail', 'top');
showsetting('forums_scheme', '', '', $projectselect);
showtype("forums_basic_settings");
showsetting('forums_edit_name', 'namenew', $forum['name'], 'text');
showsetting('forums_edit_display', 'statusnew', $forum['status'], 'radio');
showsetting('forums_edit_perm_passwd', 'passwordnew', $forum['password'], 'text');
showsetting('forums_edit_up', '', '', $fupselect);
showsetting('forums_edit_redirect', 'redirectnew', $forum['redirect'], 'text');
showsetting('forums_edit_icon', 'iconnew', $forum['icon'], 'text');
showsetting('forums_edit_description', 'descriptionnew', $forum['description'], 'textarea');
showsetting('forums_edit_rules', 'rulesnew', $forum['rules'], 'textarea');
showsetting('forums_edit_keyword', 'keywordsnew', $forum['keywords'], 'text');
showtype('forums_extend_conf');
showsetting('forums_edit_style', '', '', $styleselect);
showsetting('forums_sub_horizontal', 'forumcolumnsnew', $forum['forumcolumns'], 'text');
showsetting('forums_edit_subforumsindex', 'subforumsindexnew', $forum['subforumsindex'], 'radioplus');
showsetting('forums_edit_simple', 'simplenew', $forum['simple'], 'radio');
showsetting('forums_edit_defaultorderfield', array('defaultorderfieldnew', array(
array(0, $lang['forums_edit_order_lastpost']),
array(1, $lang['forums_edit_order_starttime']),
array(2, $lang['forums_edit_order_replies']),
array(3, $lang['forums_edit_order_views']))), $forum['defaultorderfield'], 'mradio');
showsetting('forums_edit_defaultorder', array('defaultordernew', array(
array(0, $lang['forums_edit_order_desc']),
array(1, $lang['forums_edit_order_asc']))), $forum['defaultorder'], 'mradio');
showsetting('forums_threadcache', 'threadcachesnew', $forum['threadcaches'], 'text');
showsetting('forums_edit_edit_rules', array('alloweditrulesnew', array(
array(0, $lang['forums_edit_edit_rules_html_none']),
array(1, $lang['forums_edit_edit_rules_html_no']),
array(2, $lang['forums_edit_edit_rules_html_yes']))), $forum['alloweditrules'], 'mradio');
showsetting('forums_edit_recommend', 'modrecommendnew[open]', $forum['modrecommend']['open'], 'radio', '', '', 1);
showsetting('forums_edit_recommend_sort', array('modrecommendnew[sort]', array(
array(0, $lang['forums_edit_recommend_sort_manual']),
array(1, $lang['forums_edit_recommend_sort_auto']),
array(2, $lang['forums_edit_recommend_sort_mix']))), $forum['modrecommend']['sort'], 'mradio');
showsetting('forums_edit_recommend_orderby', array('modrecommendnew[orderby]', array(
array(0, $lang['forums_edit_recommend_orderby_dateline']),
array(1, $lang['forums_edit_recommend_orderby_lastpost']),
array(2, $lang['forums_edit_recommend_orderby_views']),
array(3, $lang['forums_edit_recommend_orderby_replies']),
array(4, $lang['forums_edit_recommend_orderby_digest']))), $forum['modrecommend']['orderby'], 'mradio');
showsetting('forums_edit_recommend_num', 'modrecommendnew[num]', $forum['modrecommend']['num'], 'text');
showsetting('forums_edit_recommend_maxlength', 'modrecommendnew[maxlength]', $forum['modrecommend']['maxlength'], 'text');
showsetting('forums_edit_recommend_cachelife', 'modrecommendnew[cachelife]', $forum['modrecommend']['cachelife'], 'text');
showsetting('forums_edit_recommend_dateline', 'modrecommendnew[dateline]', $forum['modrecommend']['dateline'], 'text');
echo '</tbody><tbody>';
if($supe['status']) {
if($supe['circlestatus']) {
showsetting('circle_forum', 'circlenew', $forum['circle'], 'radio');
}
$forum['supe_pushsetting'] = unserialize($forum['supe_pushsetting']);
$forum['supe_pushsetting']['status'] = intval($forum['supe_pushsetting']['status']);
$forum['supe_pushsetting']['filter']['digest'] = intval($forum['supe_pushsetting']['filter']['digest']);
$forum['supe_pushsetting']['filter']['displayorder'] = intval($forum['supe_pushsetting']['filter']['displayorder']);
$supe_pushsetchecked = array($forum['supe_pushsetting']['status'] => ' checked');
$supe_pushsetdigestselected = array($forum['supe_pushsetting']['filter']['digest'] => ' selected');
$supe_pushsetdisplayorderselected = array($forum['supe_pushsetting']['filter']['displayorder'] => ' selected');
echo '<tr><td class="altbg1"><b>'.$lang['supe_collection_mode'].'</b><br />'.$lang['supe_collection_mode_comment'].'</td>';
echo '<td class="altbg2"><input class="radio" type="radio" name="supe_pushsetting[status]" value="0" '.$supe_pushsetchecked[0].' onclick="$(\'supe_pushsetting_filter_div\').style.display=\'none\'">'.$lang['supe_pushsetting_status_0'].'<br /><input class="radio" type="radio" name="supe_pushsetting[status]" value="1" '.$supe_pushsetchecked[1].' onclick="$(\'supe_pushsetting_filter_div\').style.display=\'none\'">'.$lang['supe_pushsetting_status_1'].'<br /><input class="radio" type="radio" name="supe_pushsetting[status]" value="2" '.$supe_pushsetchecked[2].' onclick="$(\'supe_pushsetting_filter_div\').style.display=\'none\'">'.$lang['supe_pushsetting_status_2'].'<br /><input class="radio" type="radio" name="supe_pushsetting[status]" value="3" '.$supe_pushsetchecked[3].' onclick="$(\'supe_pushsetting_filter_div\').style.display=\'block\'">'.$lang['supe_pushsetting_status_3'];
echo '<div id="supe_pushsetting_filter_div" style="display:'.($forum['supe_pushsetting']['status'] == 3 ? 'block' : 'none').'">';
echo '<br />'.$lang['supe_pushsetting_views'].' >= <input type="input" name="supe_pushsetting[filter][views]" value="'.$forum['supe_pushsetting']['filter']['views'].'" size="8">';
echo '<br />'.$lang['supe_pushsetting_replys'].' >= <input type="input" name="supe_pushsetting[filter][replies]" value="'.$forum['supe_pushsetting']['filter']['replies'].'" size="8">';
echo '<br />'.$lang['supe_pushsetting_digest'].' >= <select name="supe_pushsetting[filter][digest]"><option value="0"'.$supe_pushsetdigestselected[0].'></option><option value="1"'.$supe_pushsetdigestselected[1].'>'.$lang['forums_digest_one'].'</option><option value="2"'.$supe_pushsetdigestselected[2].'>'.$lang['forums_digest_two'].'</option><option value="3"'.$supe_pushsetdigestselected[3].'>'.$lang['forums_digest_three'].'</option></select>';
echo '<br />'.$lang['supe_pushsetting_stick'].' >= <select name="supe_pushsetting[filter][displayorder]"><option value="0"'.$supe_pushsetdisplayorderselected[0].'></option><option value="1"'.$supe_pushsetdisplayorderselected[1].'>'.$lang['forums_stick_one'].'</option><option value="2"'.$supe_pushsetdisplayorderselected[2].'>'.$lang['forums_stick_two'].'</option><option value="3"'.$supe_pushsetdisplayorderselected[3].'>'.$lang['forums_stick_three'].'</option></select>';
echo '</div></td></tr>';
unset($supe_pushsetchecked, $supe_pushsetdigestselected, $supe_pushsetdisplayorderselected);
}
showtype('forums_edit_options');
showsetting('forums_edit_modposts', array('modnewpostsnew', array(
array(0, $lang['none']),
array(1, $lang['forums_edit_modposts_threads']),
array(2, $lang['forums_edit_modposts_posts']))), $forum['modnewposts'], 'mradio');
showsetting('forums_edit_alloweditpost', 'alloweditpostnew', $forum['alloweditpost'], 'radio');
showsetting('forums_edit_recyclebin', 'recyclebinnew', $forum['recyclebin'], 'radio');
showsetting('forums_edit_share', 'allowsharenew', $forum['allowshare'], 'radio');
showsetting('forums_edit_html', 'allowhtmlnew', $forum['allowhtml'], 'radio');
showsetting('forums_edit_bbcode', 'allowbbcodenew', $forum['allowbbcode'], 'radio');
showsetting('forums_edit_imgcode', 'allowimgcodenew', $forum['allowimgcode'], 'radio');
showsetting('forums_edit_mediacode', 'allowmediacodenew', $forum['allowmediacode'], 'radio');
showsetting('forums_edit_smilies', 'allowsmiliesnew', $forum['allowsmilies'], 'radio');
showsetting('forums_edit_jammer', 'jammernew', $forum['jammer'], 'radio');
showsetting('forums_edit_anonymous', 'allowanonymousnew', $forum['allowanonymous'], 'radio');
showsetting('forums_edit_disablewatermark', 'disablewatermarknew', $forum['disablewatermark'], 'radio');
showsetting('forums_edit_allowpostspecial', array('allowpostspecialnew', array(
$lang['forums_thread_poll'],
$lang['forums_thread_trade'],
$lang['forums_thread_reward'],
$lang['forums_thread_activity'],
$lang['forums_thread_debate'],
$lang['forums_thread_video'])), $forum['allowpostspecial'], 'mcheckbox');
showsetting('forums_edit_allowspecialonly', 'allowspecialonlynew', $forum['allowspecialonly'], 'radio');
if(!empty($tradetypes) && is_array($tradetypes)) {
$forum['tradetypes'] = $forum['tradetypes'] == '' ? -1 : unserialize($forum['tradetypes']);
$tradetypeselect = '';
foreach($tradetypes as $typeid => $typename) {
$tradetypeselect .= '<input class="checkbox" type="checkbox" name="tradetypesnew[]" value="'.$typeid.'" '.($forum['tradetypes'] == -1 || @in_array($typeid, $forum['tradetypes']) ? 'checked' : '').'> '.$typename.'<br />';
}
showsetting('forums_edit_trade_type', '', '', $tradetypeselect);
}
showsetting('forums_edit_trade_payto', 'allowpaytoauthornew', $forum['allowpaytoauthor'], 'radio');
showsetting('forums_edit_autoclose', '', '', '<input class="radio" type="radio" name="autoclosenew" value="0" '.$checkac[0].' onclick="this.form.autoclosetimenew.disabled=true;"> '.$lang['forums_edit_autoclose_none'].'<br /><input class="radio" type="radio" name="autoclosenew" value="1" '.$checkac[1].' onclick="this.form.autoclosetimenew.disabled=false;"> '.$lang['forums_edit_autoclose_dateline'].'<br /><input class="radio" type="radio" name="autoclosenew" value="-1" '.$checkac[-1].' onclick="this.form.autoclosetimenew.disabled=false;"> '.$lang['forums_edit_autoclose_lastpost']);
showsetting('forums_edit_autoclose_time', '', '', '<input type="text" size="30" value="'.$forum['autoclose'].'" name="autoclosetimenew" '.($acoption ? '' : 'disabled').'>');
showsetting('forums_edit_attach_ext', 'attachextensionsnew', $forum['attachextensions'], 'text');
showtype('forums_edit_credits', '', '', 7);
echo '<tr class="category"><td>'.$lang['credits_id'].'</td><td>'.$lang['credits_title'].'</td><td>'.$lang['forums_edit_postcredits_add'].'</td><td>'.$lang['forums_edit_replycredits_add'].'</td><td>'.$lang['settings_credits_policy_digest'].'</td><td>'.$lang['settings_credits_policy_post_attach'].'</td><td>'.$lang['settings_credits_policy_get_attach'].'</td></tr>';
$customcreditspolicy = '';
if(is_array($extcredits)) {
foreach($extcredits AS $i => $extcredit) {
$customcreditspolicy .= "<tr align=\"center\"><td class=\"altbg1\" width=\"10%\">extcredits$i</td>".
"<td class=\"altbg2\" width=\"10%\">{$extcredit['title']}</td>".
"<td class=\"altbg1\" width=\"12%\"><input type=\"text\" size=\"2\" name=\"postcreditsnew[$i]\" value=\"".$forum['postcredits'][$i]."\"></td>".
"<td class=\"altbg2\" width=\"12%\"><input type=\"text\" size=\"2\" name=\"replycreditsnew[$i]\" value=\"".$forum['replycredits'][$i]."\"></td>".
"<td class=\"altbg1\" width=\"12%\"><input type=\"text\" size=\"2\" name=\"digestcreditsnew[$i]\" value=\"".$forum['digestcredits'][$i]."\"></td>".
"<td class=\"altbg2\" width=\"12%\"><input type=\"text\" size=\"2\" name=\"postattachcreditsnew[$i]\" value=\"".$forum['postattachcredits'][$i]."\"></td>".
"<td class=\"altbg1\" width=\"12%\"><input type=\"text\" size=\"2\" name=\"getattachcreditsnew[$i]\" value=\"".$forum['getattachcredits'][$i]."\"></td></tr>";
}
}
$customcreditspolicy .= '<tr><td colspan="7">'.$lang['forums_edit_credits_comment'].'<br /><a href="member.php?action=credits&view=forum_post&fid='.$fid.'" target="_blank">'.$lang['forums_edit_credits_preview'].'</a></td></tr>';
echo $customcreditspolicy;
if($allowthreadtypes) {
showtype('forums_edit_threadtypes');
if($forum['status'] != 2) {
showsetting('forums_edit_threadtypes_status', 'threadtypesnew[status]', $forum['threadtypes']['status'], 'radio');
showsetting('forums_edit_threadtypes_required', 'threadtypesnew[required]', $forum['threadtypes']['required'], 'radio');
showsetting('forums_edit_threadtypes_listable', 'threadtypesnew[listable]', $forum['threadtypes']['listable'], 'radio');
showsetting('forums_edit_threadtypes_prefix', 'threadtypesnew[prefix]', $forum['threadtypes']['prefix'], 'radio');
showsetting('forums_edit_threadtypes_typemodel', '', '', $typemodelselect);
echo '</table><br /><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'.
'<tr class="header"><td width="10%">'.$lang['forums_edit_cat_name'].'</td><td width="25%">'.$lang['forums_sort_note'].'</td><td width="10%">'.$lang['not_use'].'</td><td width="15%">'.$lang['forums_threadtypes_use_cols'].'</td><td width="15%">'.$lang['forums_threadtypes_use_choice'].'</td><td width="20%">'.$lang['forums_threadtypes_show'].'</td></tr>'.
$typeselect.'<tr><td colspan=6>'.$lang['add_new'].'<a href="###" onclick="addtype()">[+]</a></td></tr><tbody id="type_0"><tr align="center"><td class="altbg1"><input type="text" name="newname[0]" size="15"></td><td class="altbg2"><input type="text" name="newdescription[0]" size="15"></td><td class="altbg1"><input class="radio" type="radio" name="newoptions[0]" value="0"></td><td class="altbg2"><input class="radio" type="radio" name="newoptions[0]" value="1" checked></td><td class="altbg1"><input class="radio" type="radio" name="newoptions[0]" value="2"></td><td class="altbg1"><input class="checkbox" type="checkbox" name="newoptions[0]" value="2"></td></tr></tbody>';
for($i = 1; $i < 10; $i++) {
echo '<tbody id="type_'.$i.'" style="display: none"><tr align="center"><td class="altbg1"><input type="text" name="newname['.$i.']" size="15"></td><td class="altbg2"><input type="text" name="newdescription['.$i.']" size="15"></td><td class="altbg1"><input class="radio" type="radio" name="newoptions['.$i.']" value="0"></td><td class="altbg2"><input class="radio" type="radio" name="newoptions['.$i.']" value="1" checked></td><td class="altbg1"><input class="radio" type="radio" name="newoptions['.$i.']" value="2"></td><td class="altbg1"><input class="checkbox" type="checkbox" name="newoptions['.$i.']" value="2"></td></tr></tbody>';
}
echo '<tr><td colspan="6">'.$lang['settings_threadtypes_comment'].'</td></tr>';
} else {
echo '<tr><td>'.$lang['forums_edit_threadtypes_close'].'</td></tr>';
}
}
echo '</table><br /><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'.
'<tr class="header"><td>'.$lang['forums_edit_perm'].'</td>'.
'<td><input class="checkbox" type="checkbox" name="chkall1" onclick="checkall(this.form, \'viewperm\', \'chkall1\')"> '.$lang['forums_edit_perm_view'].'</td>'.
'<td><input class="checkbox" type="checkbox" name="chkall2" onclick="checkall(this.form, \'postperm\', \'chkall2\')"> '.$lang['forums_edit_perm_post'].'</td>'.
'<td><input class="checkbox" type="checkbox" name="chkall3" onclick="checkall(this.form, \'replyperm\', \'chkall3\')"> '.$lang['forums_edit_perm_reply'].'</td>'.
'<td><input class="checkbox" type="checkbox" name="chkall4" onclick="checkall(this.form, \'getattachperm\', \'chkall4\')"> '.$lang['forums_edit_perm_get_attach'].'</td>'.
'<td><input class="checkbox" type="checkbox" name="chkall5" onclick="checkall(this.form, \'postattachperm\', \'chkall5\')"> '.$lang['forums_edit_perm_post_attach'].'</td></tr>';
foreach($groups as $group) {
echo '<tr><td class="altbg1"><input class="checkbox" title="'.$lang['select_all'].'" type="checkbox" name="chkallv'.$group['groupid'].'" onclick="checkallvalue(this.form, '.$group['groupid'].', \'chkallv'.$group['groupid'].'\')"> '.$group[grouptitle].'</td>';
$altbgthis = 'altbg1';
foreach($perms as $perm) {
$checked = strstr($forum[$perm], "\t$group[groupid]\t") ? 'checked' : NULL;
$altbgthis = $altbgthis == 'altbg2' ? 'altbg1' : 'altbg2';
echo '<td class="'.$altbgthis.'"><input class="checkbox" type="checkbox" name="'.$perm.'[]" value="'.$group['groupid'].'" '.$checked.'></td>';
}
echo '</tr>';
}
echo '</td></tr><tr><td colspan="6">'.$lang['forums_edit_perm_comment'].'</td></tr>';
echo '<tr class="header"><td colspan="6"><b>'.$lang['forums_edit_access_mask'].'</b></td></tr>';
echo '<tr><td class="altbg1">'.$lang['forums_edit_perm_view'].':</td><td class="altbg2" colspan="5">'.substr($viewaccess, 2).'</td></tr>';
echo '<tr><td class="altbg1">'.$lang['forums_edit_perm_post'].':</td><td class="altbg2" colspan="5">'.substr($postaccess, 2).'</td></tr>';
echo '<tr><td class="altbg1">'.$lang['forums_edit_perm_reply'].':</td><td class="altbg2" colspan="5">'.substr($replyaccess, 2).'</td></tr>';
echo '<tr><td class="altbg1">'.$lang['forums_edit_perm_get_attach'].':</td><td class="altbg2" colspan="5">'.substr($getattachaccess, 2).'</td></tr>';
echo '<tr><td class="altbg1">'.$lang['forums_edit_perm_post_attach'].':</td><td class="altbg2" colspan="5">'.substr($postattachaccess, 2).'</td></tr>';
showtype('settings_formulaperm');
$formulareplace .= '\'<u>'.$lang['settings_creditsformula_digestposts'].'</u>\',\'<u>'.$lang['settings_creditsformula_posts'].'</u>\',\'<u>'.$lang['settings_creditsformula_oltime'].'</u>\',\'<u>'.$lang['settings_creditsformula_pageviews'].'</u>\'';
?>
<script>
function isUndefined(variable) {
return typeof variable == 'undefined' ? true : false;
}
function insertunit(text, textend) {
$('formulapermnew').focus();
textend = isUndefined(textend) ? '' : textend;
if(!isUndefined($('formulapermnew').selectionStart)) {
var opn = $('formulapermnew').selectionStart + 0;
if(textend != '') {
text = text + $('formulapermnew').value.substring($('formulapermnew').selectionStart, $('formulapermnew').selectionEnd) + textend;
}
$('formulapermnew').value = $('formulapermnew').value.substr(0, $('formulapermnew').selectionStart) + text + $('formulapermnew').value.substr($('formulapermnew').selectionEnd);
} else if(document.selection && document.selection.createRange) {
var sel = document.selection.createRange();
if(textend != '') {
text = text + sel.text + textend;
}
sel.text = text.replace(/\r?\n/g, '\r\n');
sel.moveStart('character', -strlen(text));
} else {
$('formulapermnew').value += text;
}
formulaexp();
}
var formulafind = new Array('digestposts', 'posts', 'oltime', 'pageviews');
var formulareplace = new Array(<?=$formulareplace?>);
function formulaexp() {
var result = $('formulapermnew').value;
<?
$extcreditsbtn = '';
for($i = 1; $i <= 8; $i++) {
$extcredittitle = $extcredits[$i]['title'] ? $extcredits[$i]['title'] : $lang['settings_creditsformula_extcredits'].$i;
echo 'result = result.replace(/extcredits'.$i.'/g, \'<u>'.$extcredittitle.'</u>\');';
$extcreditsbtn .= '<a href="###" onclick="insertunit(\'extcredits'.$i.'\')">'.$extcredittitle.'</a> ';
}
echo 'result = result.replace(/digestposts/g, \'<u>'.$lang['settings_creditsformula_digestposts'].'</u>\');';
echo 'result = result.replace(/posts/g, \'<u>'.$lang['settings_creditsformula_posts'].'</u>\');';
echo 'result = result.replace(/oltime/g, \'<u>'.$lang['settings_creditsformula_oltime'].'</u>\');';
echo 'result = result.replace(/pageviews/g, \'<u>'.$lang['settings_creditsformula_pageviews'].'</u>\');';
echo 'result = result.replace(/and/g, \' '.$lang['settings_formulaperm_and'].' \');';
echo 'result = result.replace(/or/g, \' '.$lang['settings_formulaperm_or'].' \');';
echo 'result = result.replace(/>=/g, \'≥\');';
echo 'result = result.replace(/<=/g, \'≤\');';
?>
$('formulapermexp').innerHTML = result;
}
</script>
<tr><td colspan="2" class="altbg1">
<span class="smalltxt"><?=$lang['settings_formulaperm_comment']?></span>
<br />
<img src="images/admincp/zoomin.gif" onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('creditsformulanew', 1)"> <img src="images/admincp/zoomout.gif" onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('creditsformulanew', 0)">
<div style="width:90%" class="formulaeditor">
<div><?=$extcreditsbtn?><br />
<a href="###" onclick="insertunit(' digestposts ')"><?=$lang['settings_creditsformula_digestposts']?></a>
<a href="###" onclick="insertunit(' posts ')"><?=$lang['settings_creditsformula_posts']?></a>
<a href="###" onclick="insertunit(' oltime ')"><?=$lang['settings_creditsformula_oltime']?></a>
<a href="###" onclick="insertunit(' pageviews ')"><?=$lang['settings_creditsformula_pageviews']?></a>
<a href="###" onclick="insertunit(' + ')"> + </a>
<a href="###" onclick="insertunit(' - ')"> - </a>
<a href="###" onclick="insertunit(' * ')"> * </a>
<a href="###" onclick="insertunit(' / ')"> / </a>
<a href="###" onclick="insertunit(' > ')"> > </a>
<a href="###" onclick="insertunit(' >= ')"> >= </a>
<a href="###" onclick="insertunit(' < ')"> < </a>
<a href="###" onclick="insertunit(' <= ')"> <= </a>
<a href="###" onclick="insertunit(' = ')"> = </a>
<a href="###" onclick="insertunit(' (', ') ')"> ( ) </a>
<a href="###" onclick="insertunit(' and ')"> <?=$lang['settings_formulaperm_and']?> </a>
<a href="###" onclick="insertunit(' or ')"> <?=$lang['settings_formulaperm_or']?> </a> <br />
<span id="formulapermexp"><?=$formulapermexp?></span>
</div>
<textarea name="formulapermnew" id="formulapermnew" style="width:100%" rows="3" onkeyup="formulaexp()"><?=dhtmlspecialchars($forum['formulaperm'])?></textarea>
</div><script>formulaexp()</script>
<br /><?=$lang['creditwizard_current_formula_notice']?>
</td></tr>
<?
showtype('', 'bottom');
}
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"detailsubmit\" value=\"$lang[submit]\">";
if($forum['type'] != 'group') {
echo " <input class=\"button\" type=\"submit\" name=\"saveconfigsubmit\" value=\"".$lang['saveconf']."\"></form>";
}
} else {
if(strlen($namenew) > 50) {
cpmsg('forums_name_toolong');
}
if($formulapermnew && !preg_match("/^(\+|\-|\*|\/|\.|>|<|=|\d|\s|extcredits[1-8]|digestposts|posts|pageviews|oltime|and|or)+$/", $formulapermnew) || !is_null(@eval(preg_replace("/(digestposts|posts|pageviews|oltime|extcredits[1-8])/", "\$\\1", $formulapermnew).';'))) {
cpmsg('forums_formulaperm_error');
}
$formulapermary[0] = $formulapermnew;
$formulapermary[1] = preg_replace("/(digestposts|posts|pageviews|oltime|extcredits[1-8])/", "\$_DSESSION['\\1']", $formulapermnew);
$formulapermnew = addslashes(serialize($formulapermary));
if($type == 'group') {
if($namenew) {
$db->query("UPDATE {$tablepre}forums SET name='$namenew',forumcolumns='".intval($forumcolumnsnew)."' WHERE fid='$fid'");
updatecache('forums');
cpmsg('forums_edit_succeed', 'admincp.php?action=forumsedit');
} else {
cpmsg('forums_edit_name_invalid');
}
} else {
$extensionarray = array();
foreach(explode(',', $attachextensionsnew) as $extension) {
if($extension = trim($extension)) {
$extensionarray[] = $extension;
}
}
$attachextensionsnew = implode(', ', $extensionarray);
foreach($perms as $perm) {
${$perm.'new'} = is_array($$perm) && !empty($$perm) ? "\t".implode("\t", $$perm)."\t" : '';
}
$fupadd = '';
if($fupnew != $forum['fup']) {
$query = $db->query("SELECT fid FROM {$tablepre}forums WHERE fup='$fid'");
if($db->num_rows($query)) {
cpmsg('forums_edit_sub_notnull');
}
$query = $db->query("SELECT fid, type, inheritedmod FROM {$tablepre}forums WHERE fid='$fupnew'");
$fup = $db->fetch_array($query);
$fupadd = ", type='".($fup['type'] == 'forum' ? 'sub' : 'forum')."', fup='$fup[fid]'";
$db->query("DELETE FROM {$tablepre}moderators WHERE fid='$fid' AND inherited='1'");
$query = $db->query("SELECT * FROM {$tablepre}moderators WHERE fid='$fupnew' ".($fup['inheritedmod'] ? '' : "AND inherited='1'"));
while($mod = $db->fetch_array($query)) {
$db->query("REPLACE INTO {$tablepre}moderators (uid, fid, displayorder, inherited)
VALUES ('$mod[uid]', '$fid', '0', '1')");
}
$moderators = $tab = '';
$query = $db->query("SELECT m.username FROM {$tablepre}members m, {$tablepre}moderators mo WHERE mo.fid='$fid' AND mo.inherited='0' AND m.uid=mo.uid ORDER BY mo.displayorder");
while($mod = $db->fetch_array($query)) {
$moderators .= $tab.addslashes($mod['username']);
$tab = "\t";
}
$db->query("UPDATE {$tablepre}forumfields SET moderators='$moderators' WHERE fid='$fid'");
}
$statusnew = $supe['status'] && $supe['circlestatus'] && $circlenew ? 2 : $statusnew;
$supe_pushsetting[status] = $statusnew == 2 && !$supe_pushsetting[status] ? 1 : $supe_pushsetting[status];
$supe_pushsettingadd = $supe['status'] ? ", supe_pushsetting='".serialize($supe_pushsetting)."'" : '';
if(!$allowsharenew && (bool)$allowsharenew != (bool)$forum['allowshare']) {
$db->query("UPDATE {$tablepre}threads SET blog='0' WHERE fid='$fid'");
}
$allowpostspecialtrade = intval($allowpostspecialnew[3]);
$allowpostspecialnew = bindec(intval($allowpostspecialnew[6]).intval($allowpostspecialnew[5]).intval($allowpostspecialnew[4]).intval($allowpostspecialnew[3]).intval($allowpostspecialnew[2]).intval($allowpostspecialnew[1]));
$allowspecialonlynew = $allowpostspecialnew ? $allowspecialonlynew : 0;
$forumcolumnsnew = intval($forumcolumnsnew);
$threadcachesnew = max(0, min(100, intval($threadcachesnew)));
$subforumsindexnew = $subforumsindexnew == -1 ? 0 : ($subforumsindexnew == 0 ? 2 : 1);
$simplenew = bindec(sprintf('%02d', decbin($defaultorderfieldnew)).$defaultordernew.sprintf('%02d', decbin($subforumsindexnew)).'00'.$simplenew);
$db->query("UPDATE {$tablepre}forums SET status='$statusnew', name='$namenew', styleid='$styleidnew', allowshare='$allowsharenew', alloweditpost='$alloweditpostnew',
allowpostspecial='$allowpostspecialnew', allowspecialonly='$allowspecialonlynew', allowpaytoauthor='$allowpaytoauthornew', allowhtml='$allowhtmlnew', allowbbcode='$allowbbcodenew', allowimgcode='$allowimgcodenew', allowmediacode='$allowmediacodenew',
allowsmilies='$allowsmiliesnew', alloweditrules='$alloweditrulesnew', modnewposts='$modnewpostsnew',
recyclebin='$recyclebinnew', jammer='$jammernew', allowanonymous='$allowanonymousnew', forumcolumns='$forumcolumnsnew', threadcaches='$threadcachesnew',
simple='$simplenew', disablewatermark='$disablewatermarknew', autoclose='".intval($autoclosenew * $autoclosetimenew)."' $fupadd
WHERE fid='$fid'");
$query = $db->query("SELECT fid FROM {$tablepre}forumfields WHERE fid='$fid'");
if(!($db->num_rows($query))) {
$db->query("INSERT INTO {$tablepre}forumfields (fid)
VALUES ('$fid')");
}
foreach(array('post', 'reply', 'digest', 'postattach', 'getattach') AS $item) {
if(${$item.'creditsnew'}) {
foreach(${$item.'creditsnew'} AS $i => $v) {
if($v == '') {
unset(${$item.'creditsnew'}[$i]);
} else {
$v = intval($v);
${$item.'creditsnew'}[$i] = $v < -99 ? -99 : $v;
${$item.'creditsnew'}[$i] = $v > 99 ? 99 : $v;
}
}
}
${$item.'creditsnew'} = ${$item.'creditsnew'} ? addslashes(serialize(${$item.'creditsnew'})) : '';
}
$threadtypesnew['types'] = $threadtypesnew['flat'] = $threadtypes['selectbox'] = $threadtypes['special'] = $threadtypes['show'] = array();
if($allowthreadtypes && $forum['status'] != 2) {
if(is_array($newname) && $newname) {
$newname = array_unique($newname);
if($newname) {
foreach($newname AS $key => $val) {
$val = trim($val);
if($val) {
$query = $db->query("SELECT typeid FROM {$tablepre}threadtypes WHERE name='$val'");
$newtypeid = $db->result($query, 0);
if(!$newtypeid) {
$db->query("INSERT INTO {$tablepre}threadtypes (name, description) VALUES
('$val', '".dhtmlspecialchars(trim($newdescription[$key]))."')");
$newtypeid = $db->insert_id();
}
if($newoptions[$key] == 1) {
$threadtypesnew['types'][$newtypeid] = $threadtypesnew['flat'][$newtypeid] = $val;
} elseif($newoptions[$key] == 2) {
$threadtypesnew['types'][$newtypeid] = $threadtypesnew['selectbox'][$newtypeid] = $val;
}
}
}
}
$threadtypesnew['status'] = 1;
} else {
$newname = array();
}
if($threadtypesnew['status']) {
if(is_array($threadtypesnew['options']) && $threadtypesnew['options']) {
$typeids = '0';
foreach($threadtypesnew['options'] as $key => $val) {
$typeids .= $val ? ', '.intval($key) : '';
}
$query = $db->query("SELECT * FROM {$tablepre}threadtypes WHERE typeid IN ($typeids) ORDER BY displayorder");
while($type = $db->fetch_array($query)) {
if($threadtypesnew['options'][$type['typeid']] == 1) {
$threadtypesnew['types'][$type['typeid']] = $threadtypesnew['flat'][$type['typeid']] = $type['name'];
} elseif($threadtypesnew['options'][$type['typeid']] == 2) {
$threadtypesnew['types'][$type['typeid']] = $threadtypesnew['selectbox'][$type['typeid']] = $type['name'];
}
$threadtypesnew['special'][$type['typeid']] = $type['special'];
$threadtypesnew['expiration'][$type['typeid']] = $type['expiration'];
$threadtypesnew['show'][$type['typeid']] = $threadtypesnew['options']['show'][$type['typeid']] ? 1 : 0;
$threadtypesnew['typemodelid'][$type['typeid']] = $type['modelid'];
}
}
$threadtypesnew = $threadtypesnew['types'] ? addslashes(serialize(array
(
'required' => (bool)$threadtypesnew['required'],
'listable' => (bool)$threadtypesnew['listable'],
'prefix' => (bool)$threadtypesnew['prefix'],
'types' => $threadtypesnew['types'],
'selectbox' => $threadtypesnew['selectbox'],
'flat' => $threadtypesnew['flat'],
'special' => $threadtypesnew['special'],
'show' => $threadtypesnew['show'],
'expiration' => $threadtypesnew['expiration'],
'modelid' => $threadtypesnew['typemodelid'],
))) : '';
} else {
$threadtypesnew = '';
}
$threadtypesadd = "threadtypes='$threadtypesnew',";
if($typemodel) {
$query = $db->query("SELECT id, name FROM {$tablepre}typemodels WHERE id IN (".implodeids($typemodel).") ORDER BY displayorder");
while($model = $db->fetch_array($query)) {
$threadtypemodel[$model['id']]['name'] = $model['name'];
}
$threadtypemodeladd = addslashes(serialize($threadtypemodel));
}
} else {
$threadtypesadd = $threadtypemodeladd = '';
}
if(!empty($tradetypes) && is_array($tradetypes) && $allowpostspecialtrade) {
if(count($tradetypes) == count($tradetypesnew)) {
$tradetypesnew = '';
} else {
$tradetypesnew = addslashes(serialize($tradetypesnew));
}
} else {
$tradetypesnew = '';
}
$modrecommendnew['num'] = $modrecommendnew['num'] ? intval($modrecommendnew['num']) : 10;
$modrecommendnew['cachelife'] = $modrecommendnew['cachelife'] ? intval($modrecommendnew['cachelife']) : 900;
$modrecommendnew['maxlength'] = $modrecommendnew['maxlength'] ? intval($modrecommendnew['maxlength']) : 0;
$modrecommendnew['dateline'] = $modrecommendnew['dateline'] ? intval($modrecommendnew['dateline']) : 0;
$modrecommendnew = $modrecommendnew && is_array($modrecommendnew) ? addslashes(serialize($modrecommendnew)) : '';
$db->query("UPDATE {$tablepre}forumfields SET description='$descriptionnew', icon='$iconnew', password='$passwordnew', redirect='$redirectnew', rules='$rulesnew',
attachextensions='$attachextensionsnew', $threadtypesadd postcredits='$postcreditsnew', replycredits='$replycreditsnew', digestcredits='$digestcreditsnew',
postattachcredits='$postattachcreditsnew', getattachcredits='$getattachcreditsnew', viewperm='$viewpermnew', postperm='$postpermnew', replyperm='$replypermnew', tradetypes='$tradetypesnew', typemodels='$threadtypemodeladd',
getattachperm='$getattachpermnew', postattachperm='$postattachpermnew', formulaperm='$formulapermnew', modrecommend='$modrecommendnew', keywords='$keywordsnew'$supe_pushsettingadd WHERE fid='$fid'");
if($modrecommendnew && !$modrecommendnew['sort']) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
recommendupdate($fid, $modrecommendnew, '1');
}
if($statusnew == 0) {
$db->query("UPDATE {$tablepre}forums SET status='$statusnew' WHERE fup='$fid'", 'UNBUFFERED');
}
updatecache('forums');
if(submitcheck('saveconfigsubmit') && $type != 'group') {
$projectid = intval($projectid);
dheader("Location: {$boardurl}admincp.php?action=projectadd&id=$fid&type=forum&projectid=$projectid");
} else {
cpmsg('forums_edit_succeed', 'admincp.php?action=forumsedit');
}
}
}
} elseif($action == 'forumdelete') {
if($ajax) {
ob_end_clean();
require_once DISCUZ_ROOT.'./include/post.func.php';
$tids = 0;
$total = intval($total);
$pp = intval($pp);
$currow = intval($currow);
$query = $db->query("SELECT tid FROM {$tablepre}threads WHERE fid='$fid' LIMIT $pp");
while($thread = $db->fetch_array($query)) {
$tids .= ','.$thread['tid'];
}
if($tids) {
$query = $db->query("SELECT attachment, thumb, remote FROM {$tablepre}attachments WHERE tid IN ($tids)");
while($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
foreach(array('threads', 'threadsmod', 'relatedthreads', 'posts', 'polls', 'polloptions', 'trades', 'activities', 'activityapplies', 'debate', 'debateposts', 'videos', 'attachments', 'favorites', 'mythreads', 'myposts', 'subscriptions', 'typeoptionvars', 'forumrecommend') as $value) {
$db->query("DELETE FROM {$tablepre}$value WHERE tid IN ($tids)", 'UNBUFFERED');
}
}
if($currow + $pp > $total) {
$db->query("DELETE FROM {$tablepre}forums WHERE fid='$fid'");
$db->query("DELETE FROM {$tablepre}forumfields WHERE fid='$fid'");
$db->query("DELETE FROM {$tablepre}moderators WHERE fid='$fid'");
$db->query("DELETE FROM {$tablepre}access WHERE fid='$fid'");
echo 'TRUE';
exit;
}
updatecache('forums');
echo 'GO';
exit;
} else {
if($finished) {
cpmsg('forums_delete_succeed', 'admincp.php?action=forumsedit');
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}forums WHERE fup='$fid'");
if($db->result($query, 0)) {
cpmsg('forums_delete_sub_notnull');
}
if(!$confirmed) {
cpmsg('forums_delete_confirm', "admincp.php?action=forumdelete&fid=$fid", 'form');
} else {
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}threads WHERE fid='$fid'");
$threads = $db->result($query, 0);
echo "
<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"6\"><tr><td>
<br /><br /><br /><br /><br /><br />
<table width=\"500\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" class=\"tableborder\">
<tr class=\"header\"><td>".$lang['discuz_message']."</td></tr><tr><td class=\"altbg2\"><div align=\"center\">
<form method=\"post\" action=\"admincp.php?action=forumdelete&fid=2\"><input type=\"hidden\" name=\"formhash\" value=\"6a47c68f\">
<br /><br /><br />".$lang['forums_delete_alarm']."<br /><br />
<div class=\"process\" >
<div id=\"percent\" class=\"processbg\">0%</div>
</div>
<br /><br /><br /><br /></div><br /><br />
</td></tr></table>
<br /><br /><br />
</td></tr></table>
";
echo "<div id=\"statusid\" style=\"display:none\"></div>";
echo "<script src=\"include/javascript/ajax.js\"></script>";
echo "
<script>
var xml_http_building_link = '".$lang['xml_http_building_link']."';
var xml_http_sending = '".$lang['xml_http_sending']."';
var xml_http_loading = '".$lang['xml_http_loading']."';
var xml_http_load_failed = '".$lang['xml_http_load_failed']."';
var xml_http_data_in_processed = '".$lang['xml_http_data_in_processed']."';
function forumsdelete(url, total, pp, currow) {
var x = new Ajax('HTML', 'statusid');
x.get(url+'&ajax=1&pp='+pp+'&total='+total+'&currow='+currow, function(s) {
if(s != 'GO') {
location.href = 'admincp.php?action=forumdelete&finished=1';
}
currow += pp;
var percent = ((currow / total) * 100).toFixed(0);
percent = percent > 100 ? 100 : percent;
document.getElementById('percent').innerHTML = percent+'%';
document.getElementById('percent').style.backgroundPosition = '-'+percent+'%';
if(currow < total) {
forumsdelete(url, total, pp, currow);
}
});
}
forumsdelete('admincp.php?action=forumdelete&fid=$fid&confirmed=1', $threads, 2000, 0);
</script>
";
}
}
} elseif($action == 'forumrules') {
shownav('menu_forums_rules');
if(empty($fid)) {
$forums = "<option value=\"\">$lang[none]</option>";
if($adminid == 2) {
$query = $db->query("SELECT fid, name FROM {$tablepre}forums
WHERE alloweditrules>'0' AND type IN ('forum', 'sub')");
} else {
$query = $db->query("SELECT f.fid, f.name, m.uid FROM {$tablepre}forums f
LEFT JOIN {$tablepre}moderators m ON m.uid='$discuz_uid' AND m.fid=f.fid
WHERE alloweditrules>'0' AND f.type IN ('forum', 'sub')");
}
while($forum = $db->fetch_array($query)) {
if($forum['uid'] || $adminid == 2) {
$forums .= "<option value=\"$forum[fid]\">".strip_tags($forum['name'])."</option>";
}
}
if($forums) {
$forums = '<select onchange="window.location=(\'admincp.php?action=forumrules&fid=\'+this.options[this.selectedIndex].value);">'.$forums.'</select>';
} else {
cpmsg('forums_rules_nopermission');
}
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['forums_edit']?></td></tr>
<tr class="altbg2">
<td><?=$lang['forum']?>:</td><td><?=$forums?></td></tr>
</table><br /><br />
<?
} else {
$access = 0;
if($adminid == 2) {
$access = 1;
} elseif($adminid == 3) {
$query = $db->query("SELECT uid FROM {$tablepre}moderators WHERE uid='$discuz_uid' AND fid='$fid'");
$access = $db->num_rows($query) ? 1 : 0;
}
$query = $db->query("SELECT f.fid, f.name, f.alloweditrules, ff.rules FROM {$tablepre}forums f
LEFT JOIN {$tablepre}forumfields ff USING (fid)
WHERE f.fid='$fid' AND alloweditrules>'0' AND type IN ('forum', 'sub')");
if(!$access || !($forum = $db->fetch_array($query))) {
cpmsg('forums_rules_nopermission');
}
if(!submitcheck('rulessubmit')) {
$comment = $lang[($forum['alloweditrules'] == 1 ? 'forums_edit_edit_rules_html_no' : 'forums_edit_edit_rules_html_yes')];
?>
<form method="post" action="admincp.php?action=forumrules&fid=<?=$fid?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['forums_edit']?> - <?=$forum['name']?></td></tr>
<tr class="altbg2"><td valign="top"><span class="bold"><?=$lang['forums_edit_rules']?></span><br /><?=$comment?></td>
<td><textarea name="rulesnew" rows="5" cols="60"><?=dhtmlspecialchars($forum['rules'])?></textarea></td></tr>
</table><br /><center>
<input class="button" type="submit" name="rulessubmit" value="<?=$lang['submit']?>">
</center></form><br />
<?
} else {
if($forum['alloweditrules'] != 2) {
$rulesnew = dhtmlspecialchars($rulesnew);
}
$db->query("UPDATE {$tablepre}forumfields SET rules='$rulesnew' WHERE fid='$fid'");
cpmsg('forums_rules_succeed');
}
}
} elseif($action == 'forumcopy') {
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
$source = intval($source);
$sourceforum = $_DCACHE['forums'][$source];
if(empty($sourceforum) || $sourceforum['type'] == 'group') {
cpmsg('forums_copy_source_invalid');
}
$optgroups = array
(
'normal' => array('modnewposts', 'recyclebin', 'allowshare', 'allowhtml', 'allowbbcode', 'allowimgcode', 'allowmediacode', 'allowsmilies', 'jammer', 'allowanonymous', 'disablewatermark', 'allowpostspecial'),
'credits' => array('postcredits', 'replycredits'),
'access' => array('password', 'viewperm', 'postperm', 'replyperm', 'getattachperm' ,'postattachperm', 'formulaperm'),
'misc' => array('threadtypes', 'attachextensions', 'modrecommend', 'tradetypes')
);
if(!submitcheck('copysubmit')) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
$forumselect = '<select name="target[]" size="10" multiple="multiple" style="width: 80%">'.forumselect().'</select>';
$optselect = '<select name="options[]" size="10" multiple="multiple" style="width: 80%">';
foreach($optgroups as $optgroup => $options) {
$optselect .= '<optgroup label="'.$lang['forums_copy_optgroups_'.$optgroup]."\">\n";
foreach($options as $option) {
$optselect .= "<option value=\"$option\">".$lang['forums_copy_options_'.$option]."</option>\n";
}
}
$optselect .= '</select>';
showtips('forums_copy_tips');
?>
<form method="post" action="admincp.php?action=forumcopy">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="source" value="<?=$source?>">
<?
showtype($lang['forums_copy'].' - '.$lang['forums_copy_source'].' - '.$sourceforum['name'], 'top');
showsetting('forums_copy_target', '', '', $forumselect);
showsetting('forums_copy_options', '', '', $optselect);
showtype('', 'bottom');
echo "<br /><br /><center><input class=\"button\" type=\"submit\" name=\"copysubmit\" value=\"$lang[submit]\"></form>";
} else {
$fids = $comma = '';
if(is_array($target) && count($target)) {
foreach($target as $fid) {
if(($fid = intval($fid)) && $fid != $source ) {
$fids .= $comma.$fid;
$comma = ',';
}
}
}
if(empty($fids)) {
cpmsg('forums_copy_target_invalid');
}
$forumoptions = array();
if(is_array($options) && !empty($options)) {
foreach($options as $option) {
if($option = trim($option)) {
if(in_array($option, $optgroups['normal'])) {
$forumoptions['forums'][] = $option;
} elseif(in_array($option, $optgroups['misc']) || in_array($option, $optgroups['credits']) || in_array($option, $optgroups['access'])) {
$forumoptions['forumfields'][] = $option;
}
}
}
}
if(empty($forumoptions)) {
cpmsg('forums_copy_options_invalid');
}
foreach(array('forums', 'forumfields') as $table) {
if(is_array($forumoptions[$table]) && !empty($forumoptions[$table])) {
$query = $db->query("SELECT ".implode($forumoptions[$table],',')." FROM {$tablepre}$table WHERE fid='$source'");
if(!$sourceforum = $db->fetch_array($query)) {
cpmsg('forums_copy_source_invalid');
}
$updatequery = 'fid=fid';
foreach($sourceforum as $key => $val) {
$updatequery .= ", $key='".addslashes($val)."'";
}
$db->query("UPDATE {$tablepre}$table SET $updatequery WHERE fid IN ($fids)");
}
}
updatecache('forums');
cpmsg('forums_copy_succeed', 'admincp.php?action=forumsedit');
}
} elseif($action == 'forumrecommend') {
shownav('forums_recommend');
if(empty($fid)) {
if($adminid == 3) {
$query = $db->query("SELECT f.name, f.fid FROM {$tablepre}moderators m, {$tablepre}forums f
WHERE m.uid='$discuz_uid' AND m.fid=f.fid
ORDER BY f.displayorder");
while($forum = $db->fetch_array($query)) {
$forumlist[] = $forum;
}
} else {
$query = $db->query("SELECT name, fid FROM {$tablepre}forums WHERE type!='group' ORDER BY displayorder");
while($forum = $db->fetch_array($query)) {
$forumlist[] = $forum;
}
}
$forums = "<option value=\"\">$lang[none]</option>";
foreach($forumlist as $forum) {
$forums .= "<option value=\"$forum[fid]\">".strip_tags($forum['name'])."</option>";
}
if($forums) {
$forums = '<select onchange="window.location=(\'admincp.php?action=forumrecommend&fid=\'+this.options[this.selectedIndex].value);">'.$forums.'</select>';
} else {
cpmsg('forums_recommend_error');
}
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['forums_recommend']?></td></tr>
<tr class="altbg2">
<td><?=$lang['forum']?>:</td><td><?=$forums?></td></tr>
</table><br /><center>
</center><br />
<?
} else {
if(!submitcheck('recommendsubmit')) {
$useradd = '';
if($adminid == 3) {
$query = $db->query("SELECT * FROM {$tablepre}moderators WHERE uid='$discuz_uid' AND fid='$fid' ORDER BY displayorder");
if(!$db->fetch_array($query)) {
cpmsg('forums_recommend_error');
}
$useradd = "AND moderatorid='$discuz_uid'";
}
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}forumrecommend WHERE fid='$fid' $useradd");
$threadcount = $db->result($query, 0);
$multipage = multi($threadcount, $tpp, $page, "admincp.php?action=forumrecommend&fid=$fid&page=$page");
$threadlist = '';
$query = $db->query("SELECT f.*, m.username, m.uid
FROM {$tablepre}forumrecommend f
LEFT JOIN {$tablepre}members m ON f.moderatorid=m.uid
WHERE f.fid='$fid' $useradd LIMIT $start_limit,$tpp");
while($thread = $db->fetch_array($query)) {
$thread['author'] = $thread['author'] ? $thread['author'] : $lang['anonymous'];
$thread['username'] = $thread['username'] ? "<a href=\"space.php?uid=$thread[uid]\" target=\"_blank\">$thread[username]</a>" : 'System';
$threadlist .= "<tr align=\"center\">\n".
"<td class=\"altbg1\"><input type=\"checkbox\" class=\"checkbox\" name=\"delete[]\" value=\"$thread[tid]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"3\" name=\"displayorder[$thread[tid]]\" value=\"$thread[displayorder]\"></td>\n".
"<td class=\"altbg1\">".$_DCACHE['forums'][$thread['fid']]['name']."</td>\n".
"<td class=\"altbg2\"><a href=\"viewthread.php?tid=$thread[tid]\" target=\"_blank\">$thread[subject]</a></td>\n".
"<td class=\"altbg1\"><a href=\"space.php?uid=$thread[authorid]\" target=\"_blank\">$thread[author]</td>\n".
"<td class=\"altbg2\">$thread[username]</td>\n".
"<td class=\"altbg1\">".($thread['expiration'] ? gmdate("$dateformat $timeformat", $thread['expiration'] + ($timeoffset * 3600)) : $lang['nolimit'])."</td>\n";
}
?>
<form method="post" action="admincp.php?action=forumrecommend">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="fid" value="<?=$fid?>">
<input type="hidden" name="page" value="<?=$page?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td colspan="10"><?=$lang['forums_recommend']?></td></tr>
<tr align="center" class="category">
<td width="5%"><input type="checkbox" name="chkall" class="checkbox" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td width="8%"><?=$lang['display_order']?></td><td width="12%"><?=$lang['forums_recommend_name']?></td><td width="40%"><?=$lang['subject']?></td>
<td width="10%"><?=$lang['author']?></td><td width="10%"><?=$lang['forums_recommend_mod']?></td><td width="15%"><?=$lang['forums_recommend_expiration']?></td></td>
</tr>
<?=$threadlist?>
</table><?=$multipage?><br />
<center><input type="submit" class="button" name="recommendsubmit" value="<?=$lang['submit']?>"></center></form></td></tr>
<?
} else {
if(is_array($displayorder)) {
foreach($displayorder as $id => $val) {
$db->query("UPDATE {$tablepre}forumrecommend SET displayorder='$displayorder[$id]' WHERE tid='$id'");
}
}
if(!empty($delete)) {
$threadtids = array();
if($adminid > 2) {
$query = $db->query("SELECT tid FROM {$tablepre}forumrecommend WHERE fid='$fid' AND moderatorid='$discuz_uid' AND tid IN (".implodeids($delete).")");
while($thread = $db->fetch_array($query)) {
$threadtids[] = $thread['tid'];
}
} else {
$threadtids = $delete;
}
$db->query("DELETE FROM {$tablepre}forumrecommend WHERE tid IN (".implodeids($threadtids).")");
}
cpmsg('forums_recommend_succeed', "admincp.php?action=forumrecommend&fid=$fid&page=$page");
}
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/forums.inc.php | PHP | asf20 | 80,356 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: misc.inc.php 10029 2007-08-22 10:20:04Z tiger $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if($action == 'onlinelist') {
if(!submitcheck('onlinesubmit')) {
$listarray = array();
$query = $db->query("SELECT * FROM {$tablepre}onlinelist");
while($list = $db->fetch_array($query)) {
$list['title'] = dhtmlspecialchars($list['title']);
$listarray[$list['groupid']] = $list;
}
$onlinelist = '';
$query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups WHERE type<>'member'");
$group = array('groupid' => 0, 'grouptitle' => 'Member');
do {
$onlinelist .= "<tr align=\"center\">\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"3\" name=\"displayordernew[$group[groupid]]\" value=\"{$listarray[$group[groupid]][displayorder]}\"></td>\n".
"<td class=\"altbg2\">".($group['groupid'] <= 8 ? $lang['usergroups_system_'.$group['groupid']] : $group['grouptitle'])."</td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"15\" name=\"titlenew[$group[groupid]]\" value=\"".($listarray[$group['groupid']]['title'] ? $listarray[$group['groupid']]['title'] : $group['grouptitle'])."\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"20\" name=\"urlnew[$group[groupid]]\" value=\"{$listarray[$group[groupid]][url]}\">\n".
($listarray[$group['groupid']]['url'] ? "<img src=\"images/common/{$listarray[$group['groupid']]['url']}\">" : '')."</td></tr>\n";
} while($group = $db->fetch_array($query));
shownav('menu_misc_onlinelist');
showtips('onlinelist_tips');
?>
<form method="post" action="admincp.php?action=onlinelist">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td><?=$lang['display_order']?></td><td><?=$lang['usergroups_title']?></td><td><?=$lang['usergroups_title']?></td><td><?=$lang['onlinelist_image']?></td></tr>
<?=$onlinelist?></table><br />
<center><input class="button" type="submit" name="onlinesubmit" value="<?=$lang['submit']?>"></center></form></td></tr>
<?
} else {
if(is_array($urlnew)) {
$db->query("DELETE FROM {$tablepre}onlinelist");
foreach($urlnew as $id => $url) {
$url = trim($url);
if($id == 0 || $url) {
$db->query("INSERT INTO {$tablepre}onlinelist (groupid, displayorder, title, url)
VALUES ('$id', '$displayordernew[$id]', '$titlenew[$id]', '$url')");
}
}
}
updatecache('onlinelist');
cpmsg('onlinelist_succeed', 'admincp.php?action=onlinelist');
}
} elseif($action == 'forumlinks') {
if(!submitcheck('forumlinksubmit')) {
$forumlinks = '';
$query = $db->query("SELECT * FROM {$tablepre}forumlinks ORDER BY displayorder");
while($forumlink = $db->fetch_array($query)) {
$forumlinks .= "<tr align=\"center\">\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$forumlink[id]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"3\" name=\"displayorder[$forumlink[id]]\" value=\"$forumlink[displayorder]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"15\" name=\"name[$forumlink[id]]\" value=\"".dhtmlspecialchars($forumlink[name])."\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"15\" name=\"url[$forumlink[id]]\" value=\"$forumlink[url]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"15\" name=\"description[$forumlink[id]]\" value=\"$forumlink[description]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"15\" name=\"logo[$forumlink[id]]\" value=\"$forumlink[logo]\"></td></tr>\n";
}
shownav('menu_misc_links');
showtips('forumlinks_tips');
?>
<form method="post" action="admincp.php?action=forumlinks">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="6"><?=$lang['forumlinks_edit']?></td></tr>
<tr align="center" class="category">
<td><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['display_order']?></td><td><?=$lang['forumlinks_edit_name']?></td><td><?=$lang['forumlinks_edit_url']?></td><td><?=$lang['forumlinks_edit_description']?></td>
<td><?=$lang['forumlinks_edit_logo']?></td></tr>
<?=$forumlinks?>
<tr class="altbg1" align="center">
<td><?=$lang['add_new']?></td>
<td><input type="text" size="3" name="newdisplayorder"></td>
<td><input type="text" size="15" name="newname"></td>
<td><input type="text" size="15" name="newurl"></td>
<td><input type="text" size="15" name="newdescription"></td>
<td><input type="text" size="15" name="newlogo"></td>
</tr></table><br />
<center><input class="button" type="submit" name="forumlinksubmit" value="<?=$lang['submit']?>"></center></form></td></tr>
<?
} else {
if(is_array($delete)) {
$ids = $comma = '';
foreach($delete as $id) {
$ids .= "$comma'$id'";
$comma = ',';
}
$db->query("DELETE FROM {$tablepre}forumlinks WHERE id IN ($ids)");
}
if(is_array($name)) {
foreach($name as $id => $val) {
$db->query("UPDATE {$tablepre}forumlinks SET displayorder='$displayorder[$id]', name='$name[$id]', url='$url[$id]',description='$description[$id]',logo='$logo[$id]' WHERE id='$id'");
}
}
if($newname != '') {
$db->query("INSERT INTO {$tablepre}forumlinks (displayorder, name, url, description, logo) VALUES ('$newdisplayorder', '$newname', '$newurl', '$newdescription', '$newlogo')");
}
updatecache('forumlinks');
cpmsg('forumlinks_succeed', 'admincp.php?action=forumlinks');
}
} elseif($action == 'medals') {
if(!submitcheck('medalsubmit')) {
$medals = '';
$query = $db->query("SELECT * FROM {$tablepre}medals");
while($medal = $db->fetch_array($query)) {
$checkavailable = $medal['available'] ? 'checked' : '';
$medals .= "<tr align=\"center\">\n".
"<td class=\"altbg1\" width=\"48\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$medal[medalid]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"30\" name=\"name[$medal[medalid]]\" value=\"$medal[name]\"></td>\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"available[$medal[medalid]]\" value=\"1\" $checkavailable></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"25\" name=\"image[$medal[medalid]]\" value=\"$medal[image]\">\n".
"<img src=\"images/common/$medal[image]\"></td></tr>\n";
}
shownav('menu_misc_medals');
showtips('medals_tips');
?>
<form method="post" action="admincp.php?action=medals">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="6"><?=$lang['medals_edit']?></td></tr>
<tr align="center" class="category">
<td><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form, 'delete')"><?=$lang['del']?></td>
<td><?=$lang['name']?></td><td><?=$lang['available']?></td><td><?=$lang['medals_image']?></td></tr>
<?=$medals?>
<tr class="altbg1" align="center">
<td><?=$lang['add_new']?></td>
<td><input type="text" size="30" name="newname"></td>
<td><input class="checkbox" type="checkbox" name="availablenew" value="1"></td>
<td><input type="text" size="25" name="newimage"></td>
</tr></table><br />
<center><input class="button" type="submit" name="medalsubmit" value="<?=$lang['submit']?>"></center></form></td></tr>
<?
} else {
if(is_array($delete)) {
$ids = $comma = '';
foreach($delete as $id) {
$ids .= "$comma'$id'";
$comma = ',';
}
$db->query("DELETE FROM {$tablepre}medals WHERE medalid IN ($ids)");
}
if(is_array($name)) {
foreach($name as $id => $val) {
$db->query("UPDATE {$tablepre}medals SET name=".($name[$id] ? '\''.dhtmlspecialchars($name[$id]).'\'' : 'name').", available='$available[$id]', image=".($image[$id] ? '\''.$image[$id].'\'' : 'image')." WHERE medalid='$id'");
}
}
if($newname != '' && $newimage != '') {
$db->query("INSERT INTO {$tablepre}medals (name, available, image) VALUES ('".dhtmlspecialchars($newname)."', '$newavailable', '$newimage')");
}
updatecache('medals');
cpmsg('medals_succeed', 'admincp.php?action=medals');
}
} elseif($action == 'discuzcodes') {
if(!submitcheck('bbcodessubmit') && !$edit) {
$discuzcodes = '';
$query = $db->query("SELECT * FROM {$tablepre}bbcodes");
while($bbcode = $db->fetch_array($query)) {
$discuzcodes .= "<tr align=\"center\">\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$bbcode[id]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"15\" name=\"tagnew[$bbcode[id]]\" value=\"$bbcode[tag]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"25\" name=\"iconnew[$bbcode[id]]\" value=\"$bbcode[icon]\"></td>\n".
"<td class=\"altbg2\">".($bbcode[icon] ? "<img src=\"images/common/$bbcode[icon]\" border=\"0\"" : ' ')."</td>\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"availablenew[$bbcode[id]]\" value=\"1\" ".($bbcode['available'] ? 'checked' : NULL)."></td>\n".
"<td class=\"altbg2\"><a href=\"admincp.php?action=discuzcodes&edit=$bbcode[id]\">[$lang[detail]]</a></td></tr>\n";
}
shownav('menu_posting_discuzcodes');
showtips('discuzcodes_edit_tips');
?>
<form method="post" action="admincp.php?action=discuzcodes">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="6"><?=$lang['discuzcodes_edit']?></td></tr>
<tr align="center" class="category">
<td width="5%"><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form,'delete')"><?=$lang['del']?></td>
<td><?=$lang['discuzcodes_tag']?><td><?=$lang['discuzcodes_icon_file']?></td><td><?=$lang['discuzcodes_icon']?></td><td><?=$lang['available']?></td>
<td><?=$lang['edit']?></td></tr>
<?=$discuzcodes?>
<tr class="altbg1" align="center">
<td><?=$lang['add_new']?></td>
<td><input type="text" size="15" name="newtag"></td>
<td><input type="text" size="25" name="newicon"></td>
<td colspan="3"> </td>
</tr></table><br />
<center><input class="button" type="submit" name="bbcodessubmit" value="<?=$lang['submit']?>"></center></form></td></tr>
<?
} elseif(submitcheck('bbcodessubmit')) {
if(is_array($delete)) {
$ids = '\''.implode('\',\'', $delete).'\'';
$db->query("DELETE FROM {$tablepre}bbcodes WHERE id IN ($ids)");
}
if(is_array($tagnew)) {
foreach($tagnew as $id => $val) {
if(!preg_match("/^[0-9a-z]+$/i", $tagnew[$id]) && strlen($tagnew[$id]) < 20) {
cpmsg('discuzcodes_edit_tag_invalid');
}
$db->query("UPDATE {$tablepre}bbcodes SET tag='$tagnew[$id]', icon='$iconnew[$id]', available='$availablenew[$id]' WHERE id='$id'");
}
}
if($newtag != '') {
if(!preg_match("/^[0-9a-z]+$/i", $newtag && strlen($newtag) < 20)) {
cpmsg('discuzcodes_edit_tag_invalid');
}
$db->query("INSERT INTO {$tablepre}bbcodes (tag, icon, available, params, nest)
VALUES ('$newtag', '$newicon', '0', '1', '1')");
}
updatecache(array('bbcodes', 'bbcodes_display'));
cpmsg('discuzcodes_edit_succeed', 'admincp.php?action=discuzcodes');
} elseif($edit) {
$query = $db->query("SELECT * FROM {$tablepre}bbcodes WHERE id='$edit'");
if(!$bbcode = $db->fetch_array($query)) {
cpmsg('undefined_action');
}
if(!submitcheck('editsubmit')) {
$bbcode['prompt'] = str_replace("\t", "\n", $bbcode['prompt']);
echo "<form method=\"post\" action=\"admincp.php?action=discuzcodes&edit=$edit&formhash=".FORMHASH."\">\n";
showtype($lang['discuzcodes_edit'].' - '.$bbcode['tag'], 'top');
showsetting('discuzcodes_edit_tag', 'tagnew', $bbcode['tag'], 'text');
showsetting('discuzcodes_edit_replacement', 'replacementnew', $bbcode['replacement'], 'textarea');
showsetting('discuzcodes_edit_example', 'examplenew', $bbcode['example'], 'text');
showsetting('discuzcodes_edit_explanation', 'explanationnew', $bbcode['explanation'], 'text');
showsetting('discuzcodes_edit_params', 'paramsnew', $bbcode['params'], 'text');
showsetting('discuzcodes_edit_prompt', 'promptnew', $bbcode['prompt'], 'textarea');
showsetting('discuzcodes_edit_nest', 'nestnew', $bbcode['nest'], 'text');
showtype('', 'bottom');
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"editsubmit\" value=\"$lang[submit]\"></center></form>";
} else {
$tagnew = trim($tagnew);
if(!preg_match("/^[0-9a-z]+$/i", $tagnew)) {
cpmsg('discuzcodes_edit_tag_invalid');
} elseif($paramsnew < 1 || $paramsnew > 3 || $nestnew < 1 || $nestnew > 3) {
cpmsg('discuzcodes_edit_range_invalid');
}
$promptnew = trim(preg_replace("/\r\n|\r|\n/", "\t", str_replace("\t", '', $promptnew)));
$db->query("UPDATE {$tablepre}bbcodes SET tag='$tagnew', replacement='$replacementnew', example='$examplenew', explanation='$explanationnew', params='$paramsnew', prompt='$promptnew', nest='$nestnew' WHERE id='$edit'");
updatecache(array('bbcodes', 'bbcodes_display'));
cpmsg('discuzcodes_edit_succeed', 'admincp.php?action=discuzcodes');
}
}
} elseif($action == 'censor') {
$page = max(1, intval($page));
$ppp = 30;
$emptycensortable = $adminid == 1 ? '<input type="radio" class="radio" name="overwrite" value="2"> '.$lang['censor_batch_add_clear'] : '';
$addcensors = isset($addcensors) ? trim($addcensors) : '';
if(isset($do) && $do == 'export' && $adminid == 1) {
ob_end_clean();
dheader('Cache-control: max-age=0');
dheader('Expires: '.gmdate('D, d M Y H:i:s', $timestamp - 31536000).' GMT');
dheader('Content-Encoding: none');
dheader('Content-Disposition: attachment; filename=CensorWords.txt');
dheader('Content-Type: text/plain');
$query = $db->query("SELECT find, replacement FROM {$tablepre}words ORDER BY id");
while($censor = $db->fetch_array($query)) {
$censor['replacement'] = str_replace('*', '', $censor['replacement']) <> '' ? $censor['replacement'] : '';
echo $censor['find'].($censor['replacement'] != '' ? '='.stripslashes($censor['replacement']) : '')."\n";
}
exit();
} elseif(submitcheck('addcensorsubmit') && $addcensors != '') {
$oldwords = array();
if($adminid == 1 && $overwrite == 2) {
$db->query("TRUNCATE {$tablepre}words");
} else {
$query = $db->query("SELECT find, admin FROM {$tablepre}words");
while($censor = $db->fetch_array($query)) {
$oldwords[md5($censor['find'])] = $censor['admin'];
}
$db->free_result($query);
}
$censorarray = explode("\n", $addcensors);
$updatecount = $newcount = $ignorecount = 0;
foreach($censorarray as $censor) {
list($newfind, $newreplace) = array_map('trim', explode('=', $censor));
$newreplace = $newreplace <> '' ? daddslashes(str_replace("\\\'", '\'', $newreplace), 1) : '**';
if(strlen($newfind) < 3) {
$ignorecount ++;
continue;
} elseif(isset($oldwords[md5($newfind)])) {
if($overwrite && ($adminid == 1 || $oldwords[md5($newfind)] == $discuz_userss)) {
$updatecount ++;
$db->query("UPDATE {$tablepre}words SET replacement='$newreplace' WHERE `find`='$newfind'");
} else {
$ignorecount ++;
}
} else {
$newcount ++;
$db->query("INSERT INTO {$tablepre}words (admin, find, replacement) VALUES
('$discuz_user', '$newfind', '$newreplace')");
$oldwords[md5($newfind)] = $discuz_userss;
}
}
updatecache('censor');
cpmsg('censor_batch_add_succeed', "admincp.php?action=$action&page=999999");
} elseif(!submitcheck('censorsubmit')) {
$censorwords = '';
$totalcount = $db->result($db->query("SELECT count(*) FROM {$tablepre}words"), 0);
$page = $page > ceil($totalcount / $ppp) ? ceil($totalcount / $ppp) : $page;
$page = max(1, intval($page));
$startlimit = ($page - 1) * $ppp;
$multipage = multi($totalcount, $ppp, $page, "admincp.php?action=$action");
$query = $db->query("SELECT * FROM {$tablepre}words ORDER BY id LIMIT $startlimit, $ppp");
while($censor = $db->fetch_array($query)) {
$censor['replacement'] = stripslashes($censor['replacement']);
$disabled = $adminid != 1 && $censor['admin'] != $discuz_userss ? 'disabled' : NULL;
$censorwords .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$censor[id]\" $disabled></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"30\" name=\"find[$censor[id]]\" value=\"$censor[find]\" $disabled></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"30\" name=\"replace[$censor[id]]\" value=\"$censor[replacement]\" $disabled></td>\n".
"<td class=\"altbg2\">$censor[admin]</td></tr>\n";
}
shownav('menu_posting_censors');
showtips('censor_tips');
?>
<form method="post" action="admincp.php?action=censor">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="page" value="<?=$page?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td width="5%"><input class="checkbox" type="checkbox" name="chkall" class="header" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['censor_word']?></td><td><?=$lang['censor_replacement']?></td><td><?=$lang['operator']?></td></tr>
<?=$censorwords?>
<tr class="altbg1">
<td align="center"><?=$lang['add_new']?></td>
<td align="center"><input type="text" size="30" name="newfind"></td>
<td align="center"><input type="text" size="30" name="newreplace"></td>
<td> </td>
</tr></table><br />
<?=$multipage?>
<center><input class="button" type="submit" name="censorsubmit" value="<?=$lang['submit']?>"></center>
</form><br />
<form method="post" action="admincp.php?action=censor">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="page" value="<?=$page?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['censor_batch_add']?></td></tr>
<tr>
<td width="125" class="altbg1"><?=$lang['censor_batch_add_tips']?></td>
<td class="altbg2">
<textarea style="width: 90%" rows="10" cols="80" name="addcensors"></textarea><br />
<?=$emptycensortable?>
<input type="radio" class="radio" name="overwrite" value="1" > <?=$lang['censor_batch_add_overwrite']?>
<br />
<input type="radio" class="radio" name="overwrite" value="0" checked> <?=$lang['censor_batch_add_no_overwrite']?>
<br />
</td>
</tr></table><br />
<center><input class="button" type="submit" name="addcensorsubmit" value="<?=$lang['submit']?>"></center>
</form><br />
<?
} else {
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}words WHERE id IN ($ids) AND ('$adminid'='1' OR admin='$discuz_user')");
}
if(is_array($find)) {
foreach($find as $id => $val) {
$find[$id] = $val = trim(str_replace('=', '', $find[$id]));
if(strlen($val) < 3) {
cpmsg('censor_keywords_tooshort');
}
$replace[$id] = daddslashes(str_replace("\\\'", '\'', $replace[$id]), 1);
$db->query("UPDATE {$tablepre}words SET find='$find[$id]', replacement='$replace[$id]' WHERE id='$id' AND ('$adminid'='1' OR admin='$discuz_user')");
}
}
$newfind = trim(str_replace('=', '', $newfind));
$newreplace = trim($newreplace);
if($newfind != '') {
if(strlen($newfind) < 3) {
cpmsg('censor_keywords_tooshort');
}
$newreplace = daddslashes(str_replace("\\\'", '\'', $newreplace), 1);
$query = $db->query("SELECT admin FROM {$tablepre}words WHERE find='$newfind'");
if($oldcenser = $db->fetch_array($query)) {
cpmsg('censor_keywords_existence');
} else {
$db->query("INSERT INTO {$tablepre}words (admin, find, replacement) VALUES
('$discuz_user', '$newfind', '$newreplace')");
}
}
updatecache('censor');
cpmsg('censor_succeed', 'admincp.php?action=censor&page='.$page);
}
} elseif($action == 'icons') {
if(!submitcheck('iconsubmit')) {
$icons = $newimages = '';
$imgfilter = array();
$query = $db->query("SELECT * FROM {$tablepre}smilies WHERE type='icon' ORDER BY displayorder");
while($smiley = $db->fetch_array($query)) {
$icons .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$smiley[id]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"2\" name=\"displayorder[$smiley[id]]\" value=\"$smiley[displayorder]\"></td>\n".
"<td class=\"altbg1\" colspan=\"2\">$smiley[url]</td>\n".
"<td class=\"altbg2\"><img src=\"images/icons/$smiley[url]\"></td></tr>\n";
$imgfilter[] = $smiley[url];
}
$newid = 0;
$imgextarray = array('jpg', 'gif');
$iconsdir = dir(DISCUZ_ROOT.'./images/icons');
while($entry = $iconsdir->read()) {
if(in_array(strtolower(fileext($entry)), $imgextarray) && !in_array($entry, $imgfilter) && is_file(DISCUZ_ROOT.'./images/icons/'.$entry)) {
$newimages .= "<tr align=\"center\"><td class=\"altbg1\"><input type=\"checkbox\" name=\"addcheck[$newid]\" class=\"checkbox\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"2\" name=\"adddisplayorder[$newid]\" value=\"0\"></td>\n".
"<td class=\"altbg1\" colspan=\"2\"><input type=\"text\" size=\"35\" name=\"addurl[$newid]\" value=\"$entry\" readonly></td>\n".
"<td class=\"altbg2\"><img src=\"images/icons/$entry\"></td></tr>\n";
$newid ++;
}
}
$iconsdir->close();
$newimages = $newimages ? $newimages : '<tr><td class="altbg1" colspan="5">'.$lang['info_tips'].'</td></tr>';
shownav('menu_thread_icon');
?>
<form method="post" action="admincp.php?action=icons">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="5"><?=$lang['smilies_edit_icon']?></td></tr>
<tr align="center" class="category">
<td width="50"><input type="checkbox" name="chkall" onclick="checkall(this.form, 'delete')" class="checkbox"><?=$lang['del']?></td><td><?=$lang['display_order']?></td>
<td colspan="2"><?=$lang['smilies_edit_filename']?></td><td><?=$lang['smilies_edit_image']?></td></tr>
<?=$icons?>
</table><br />
<center><input class="button" type="submit" name="iconsubmit" value="<?=$lang['submit']?>"></center><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="5"><?=$lang['icon_add']?></td></tr>
<tr align="center" class="category">
<td width="50"><input type="checkbox" name="chkall2" onclick="checkall(this.form, 'addcheck', 'chkall2')" class="checkbox"><?=$lang['enabled']?></td><td><?=$lang['display_order']?></td>
<td colspan="2"><?=$lang['smilies_edit_filename']?></td><td><?=$lang['smilies_edit_image']?></td></tr>
<?=$newimages?>
</table><br />
<center><input class="button" type="submit" name="iconsubmit" value="<?=$lang['submit']?>"></center><br />
</form>
<?
} else {
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}smilies WHERE id IN ($ids)");
}
if(is_array($displayorder)) {
foreach($displayorder AS $id => $val) {
$displayorder[$id] = intval($displayorder[$id]);
$db->query("UPDATE {$tablepre}smilies SET displayorder='$displayorder[$id]' WHERE id='$id'");
}
}
if(is_array($addurl)) {
foreach($addurl as $k => $v) {
if($addcheck[$k]) {
$query = $db->query("INSERT INTO {$tablepre}smilies (displayorder, type, url)
VALUES ('{$adddisplayorder[$k]}', 'icon', '$addurl[$k]')");
}
}
}
updatecache('icons');
cpmsg('thread_icon_succeed', "admincp.php?action=icons");
}
} elseif($action == 'attachtypes') {
if(!submitcheck('typesubmit')) {
$attachtypes = '';
$query = $db->query("SELECT * FROM {$tablepre}attachtypes");
while($type = $db->fetch_array($query)) {
$attachtypes .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$type[id]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"10\" name=\"extension[$type[id]]\" value=\"$type[extension]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"15\" name=\"maxsize[$type[id]]\" value=\"$type[maxsize]\"></td></tr>\n";
}
shownav('menu_posting_attachtypes');
showtips('attachtypes_tips');
?>
<form method="post" action="admincp.php?action=attachtypes">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td width="5%"><input class="checkbox" type="checkbox" name="chkall" class="header" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['attachtypes_ext']?></td><td><?=$lang['attachtypes_maxsize']?></td></tr>
<?=$attachtypes?>
<tr class="altbg1">
<td align="center"><?=$lang['add_new']?></td>
<td align="center"><input type="text" size="10" name="newextension"></td>
<td align="center"><input type="text" size="15" name="newmaxsize"></td>
</tr></table><br />
<center><input class="button" type="submit" name="typesubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}attachtypes WHERE id IN ($ids)");
}
if(is_array($extension)) {
foreach($extension as $id => $val) {
$db->query("UPDATE {$tablepre}attachtypes SET extension='$extension[$id]', maxsize='$maxsize[$id]' WHERE id='$id'");
}
}
if($newextension != '') {
$newextension = trim($newextension);
$query = $db->query("SELECT id FROM {$tablepre}attachtypes WHERE extension='$newextension'");
if($db->result($query, 0)) {
cpmsg('attachtypes_duplicate');
}
$db->query("INSERT INTO {$tablepre}attachtypes (extension, maxsize) VALUES
('$newextension', '$newmaxsize')");
}
cpmsg('attachtypes_succeed', 'admincp.php?action=attachtypes');
}
} elseif($action == 'crons') {
if(empty($edit) && empty($run)) {
if(!submitcheck('cronssubmit')) {
$crons = '';
$query = $db->query("SELECT * FROM {$tablepre}crons ORDER BY type DESC");
while($cron = $db->fetch_array($query)) {
if(!$supe['status'] && substr($cron['name'], 0, 5) == 'supe_') {
continue;
}
$disabled = $cron['weekday'] == -1 && $cron['day'] == -1 && $cron['hour'] == -1 && $cron['minute'] == '' ? 'disabled' : '';
foreach(array('weekday', 'day', 'hour', 'minute') as $key) {
if(in_array($cron[$key], array(-1, ''))) {
$cron[$key] = '<b>*</b>';
} elseif($key == 'weekday') {
$cron[$key] = $lang['crons_week_day_'.$cron[$key]];
} elseif($key == 'minute') {
foreach($cron[$key] = explode("\t", $cron[$key]) as $k => $v) {
$cron[$key][$k] = sprintf('%02d', $v);
}
$cron[$key] = implode(',', $cron[$key]);
}
}
$cron['lastrun'] = $cron['lastrun'] ? gmdate("$dateformat<\b\\r>$timeformat", $cron['lastrun'] + $_DCACHE['settings']['timeoffset'] * 3600) : '<b>N/A</b>';
$cron['nextcolor'] = $cron['nextrun'] && $cron['nextrun'] + $_DCACHE['settings']['timeoffset'] * 3600 < $timestamp ? 'style="color: #ff0000"' : '';
$cron['nextrun'] = $cron['nextrun'] ? gmdate("$dateformat<\b\\r>$timeformat", $cron['nextrun'] + $_DCACHE['settings']['timeoffset'] * 3600) : '<b>N/A</b>';
$crons .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$cron[cronid]\" ".($cron['type'] == 'system' ? 'disabled' : '')."></td>\n".
"<td class=\"altbg2\"><input type=\"text\" name=\"namenew[$cron[cronid]]\" size=\"20\" value=\"$cron[name]\"><br /><b>$cron[filename]</b></td>\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"availablenew[$cron[cronid]]\" value=\"1\" ".($cron['available'] ? 'checked' : '')." $disabled></td>\n".
"<td class=\"altbg2\">".$lang['crons_type_'.$cron['type']]."</td>".
"<td class=\"altbg1\">$cron[minute]</td>\n".
"<td class=\"altbg2\">$cron[hour]</td>\n".
"<td class=\"altbg1\">$cron[day]</td>\n".
"<td class=\"altbg2\">$cron[weekday]</td>\n".
"<td class=\"altbg1\">$cron[lastrun]</td>\n".
"<td class=\"altbg2\" $cron[nextcolor]>$cron[nextrun]</td>\n".
"<td class=\"altbg1\"><a href=\"admincp.php?action=crons&edit=$cron[cronid]\">[$lang[edit]]</a>".
($cron['available'] ? " <a href=\"admincp.php?action=crons&run=$cron[cronid]\">[$lang[crons_run]]</a>" : " <span disabled>[$lang[crons_run]]</span>").
"</td></tr>";
}
shownav('menu_misc_crons');
showtips('crons_tips');
?>
<form method="post" action="admincp.php?action=crons">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td width="5%"><input class="checkbox" type="checkbox" name="chkall" class="header" onclick="checkall(this.form,'delete')"><?=$lang['del']?></td>
<td><?=$lang['name']?></td><td><?=$lang['available']?></td><td><?=$lang['type']?></td><td><?=$lang['crons_minute']?></td>
<td width="5%"><?=$lang['crons_hour']?></td><td width="5%"><?=$lang['crons_day']?></td><td width="6%"><?=$lang['crons_week_day']?></td>
<td><?=$lang['crons_last_run']?></td><td><?=$lang['crons_next_run']?></td><td><?=$lang['operation']?></td></tr>
<?=$crons?>
<tr align="center" class="altbg1">
<td><?=$lang['add_new']?></td><td><input type="text" size="20" name="newname"></td><td colspan="9"> </td>
</tr></table><br />
<center><input class="button" type="submit" name="cronssubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}crons WHERE cronid IN ($ids) AND type='user'");
}
if(is_array($namenew)) {
foreach($namenew as $id => $name) {
$db->query("UPDATE {$tablepre}crons SET name='".dhtmlspecialchars($namenew[$id])."', available='".$availablenew[$id]."' ".($availablenew[$id] ? '' : ', nextrun=\'0\'')." WHERE cronid='$id'");
}
}
if($newname = trim($newname)) {
$db->query("INSERT INTO {$tablepre}crons (name, type, available, weekday, day, hour, minute, nextrun)
VALUES ('".dhtmlspecialchars($newname)."', 'user', '0', '-1', '-1', '-1', '', '$timestamp')");
}
$query = $db->query("SELECT cronid, filename FROM {$tablepre}crons");
while($cron = $db->fetch_array($query)) {
if(!file_exists(DISCUZ_ROOT.'./include/crons/'.$cron['filename'])) {
$db->query("UPDATE {$tablepre}crons SET available='0', nextrun='0' WHERE cronid='$cron[cronid]'");
}
}
//updatecache('crons');
updatecache('settings');
cpmsg('crons_succeed', 'admincp.php?action=crons');
}
} else {
$cronid = empty($run) ? $edit : $run;
$query = $db->query("SELECT * FROM {$tablepre}crons WHERE cronid='$cronid'");
if(!($cron = $db->fetch_array($query))) {
cpmsg('undefined_action');
}
$cron['filename'] = str_replace(array('..', '/', '\\'), array('', '', ''), $cron['filename']);
$cron['minute'] = explode("\t", $cron['minute']);
if(!empty($edit)) {
if(!submitcheck('editsubmit')) {
shownav('menu_misc_crons');
showtips('crons_edit_tips');
$weekdayselect = $dayselect = $hourselect = $minuteselect = '';
for($i = 0; $i <= 6; $i++) {
$weekdayselect .= "<option value=\"$i\" ".($cron['weekday'] == $i ? 'selected' : '').">".$lang['crons_week_day_'.$i]."</option>";
}
for($i = 1; $i <= 31; $i++) {
$dayselect .= "<option value=\"$i\" ".($cron['day'] == $i ? 'selected' : '').">$i</option>";
}
for($i = 0; $i <= 23; $i++) {
$hourselect .= "<option value=\"$i\" ".($cron['hour'] == $i ? 'selected' : '').">$i</option>";
}
for($i = 0; $i < 12; $i++) {
$minuteselect .= '<select name="minutenew[]"><option value="-1">*</option>';
for($j = 0; $j <= 59; $j++) {
$minuteselect .= "<option value=\"$j\" ".($cron['minute'][$i] != '' && $cron['minute'][$i] == $j ? 'selected' : '').">".sprintf("%02d", $j)."</option>";
}
$minuteselect .= '</select>'.($i == 5 ? '<br />' : ' ');
}
echo "<form method=\"post\" action=\"admincp.php?action=crons&edit=$cronid&formhash=".FORMHASH."\">\n";
showtype($lang['crons_edit'].' - '.$cron['name'], 'top');
showsetting('crons_edit_weekday', '', '', "<select name=\"weekdaynew\"><option value=\"-1\">*</option>$weekdayselect</select>");
showsetting('crons_edit_day', '', '', "<select name=\"daynew\"><option value=\"-1\">*</option>$dayselect</select>");
showsetting('crons_edit_hour', '', '', "<select name=\"hournew\"><option value=\"-1\">*</option>$hourselect</select>");
showsetting('crons_edit_minute', '', '', $minuteselect);
showsetting('crons_edit_filename', 'filenamenew', $cron['filename'], 'text');
showtype('', 'bottom');
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"editsubmit\" value=\"$lang[submit]\"></center></form>";
} else {
$daynew = $weekdaynew != -1 ? -1 : $daynew;
if(is_array($minutenew)) {
sort($minutenew = array_unique($minutenew));
foreach($minutenew as $key => $val) {
if($val < 0 || $var > 59) {
unset($minutenew[$key]);
}
}
$minutenew = implode("\t", $minutenew);
} else {
$minutenew = '';
}
if(preg_match("/[\\\\\/\:\*\?\"\<\>\|]+/", $filenamenew)) {
cpmsg('crons_filename_illegal');
} elseif(!is_readable(DISCUZ_ROOT.($cronfile = "./include/crons/$filenamenew"))) {
cpmsg('crons_filename_invalid');
} elseif($weekdaynew == -1 && $daynew == -1 && $hournew == -1 && $minutenew == '') {
cpmsg('crons_time_invalid');
}
$db->query("UPDATE {$tablepre}crons SET weekday='$weekdaynew', day='$daynew', hour='$hournew', minute='$minutenew', filename='".trim($filenamenew)."' WHERE cronid='$cronid'");
updatecache('crons');
require_once DISCUZ_ROOT.'./include/cron.func.php';
cronnextrun($cron);
cpmsg('crons_succeed', 'admincp.php?action=crons');
}
} else {
if(!@include_once DISCUZ_ROOT.($cronfile = "./include/crons/$cron[filename]")) {
cpmsg('crons_run_invalid');
} else {
require_once DISCUZ_ROOT.'./include/cron.func.php';
cronnextrun($cron);
cpmsg('crons_run_succeed', 'admincp.php?action=crons');
}
}
}
} elseif($action == 'creditslog') {
$lpp = empty($lpp) ? 50 : $lpp;
$page = max(1, intval($page));
$start_limit = ($page - 1) * $lpp;
$keywordadd = !empty($keyword) ? "AND c.fromto LIKE '%$keyword%'" : '';
$mpurl = "admincp.php?action=$action&keyword=".rawurlencode($keyword)."&lpp=$lpp";
if(!empty($operations) && is_array($operations)) {
$operationadd = "AND c.operation IN ('".implode('\',\'', $operations)."')";
foreach($operations as $operation) {
$mpurl .= '&operations[]='.rawurlencode($operation);
}
} else {
$operationadd = '';
}
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}creditslog c WHERE 1 $keywordadd $operationadd");
$num = $db->result($query, 0);
$multipage = multi($num, $lpp, $page, $mpurl);
$creditsoperations = '';
foreach(array('TFR', 'RCV', 'EXC', 'UGP', 'AFD') as $operation) {
$creditsoperations .= '<input class="checkbox" type="checkbox" name="operations[]" value="'.$operation.'" '.(!empty($operations) && is_array($operations) && in_array($operation, $operations) ? 'checked' : '').'> '.$lang['logs_credit_operation_'.strtolower($operation)].' ';
}
$logs = '';
$total['send'] = $total['receive'] = array();
$query = $db->query("SELECT c.*, m.username FROM {$tablepre}creditslog c
LEFT JOIN {$tablepre}members m USING (uid)
WHERE 1 $keywordadd $operationadd ORDER BY dateline DESC LIMIT $start_limit, $lpp");
while($log = $db->fetch_array($query)) {
$total['send'][$log['sendcredits']] += $log['send'];
$total['receive'][$log['receivecredits']] += $log['receive'];
$log['dateline'] = gmdate('y-n-j H:i', $log['dateline'] + $timeoffset * 3600);
$log['operation'] = $lang['logs_credit_operation_'.strtolower($log['operation'])];
$logs .= "<tr align=\"center\"><td class=\"altbg1\"><a href=\"space.php?action=viewpro&username=".rawurlencode($log['username'])."\" target=\"_blank\">$log[username]</td>".
"<td class=\"altbg2\">$log[fromto]</td>".
"<td class=\"altbg1\">$log[dateline]</td>".
"<td class=\"altbg2\">".(isset($extcredits[$log['sendcredits']]) ? $extcredits[$log['sendcredits']]['title'].' '.$log['send'].' '.$extcredits[$log['sendcredits']]['unit'] : $log['send'])."</td>".
"<td class=\"altbg1\">".(isset($extcredits[$log['receivecredits']]) ? $extcredits[$log['receivecredits']]['title'].' '.$log['receive'].' '.$extcredits[$log['receivecredits']]['unit'] : $log['receive'])."</td>".
"<td class=\"altbg2\">$log[operation]</td></tr>";
}
$result = array('send' => array(), 'receive' => array());
foreach(array('send', 'receive') as $key) {
foreach($total[$key] as $id => $amount) {
if(isset($extcredits[$id])) {
$result[$key][] = $extcredits[$id]['title'].' '.$amount.' '.$extcredits[$id]['unit'];
}
}
}
shownav('logs_credit');
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="3"><?=$lang['logs_credit']?></td></tr>
<form method="post" action="admincp.php?action=creditslog">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg2"><td width="20%"><?=$lang['logs_lpp']?></td>
<td width="45%"><input type="text" name="lpp" size="40" maxlength="40" value="<?=$lpp?>"></td>
<td width="20%"><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr>
</form>
<form method="post" action="admincp.php?action=creditslog">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg1"><td><?=$lang['logs_search']?></td><td><input type="text" name="keyword" size="40" value="<?=dhtmlspecialchars($keyword)?>"></td>
<td><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr>
</form>
<form method="post" action="admincp.php?action=creditslog">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg2"><td><?=$lang['action']?></td><td><?=$creditsoperations?></td>
<td><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr>
</form>
</table><br /><br />
<?=$multipage?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td width="16%"><?=$lang['username']?></td>
<td width="16%"><?=$lang['logs_credit_fromto']?></td>
<td width="17%"><?=$lang['time']?></td>
<td width="16%"><?=$lang['logs_credit_send']?></td>
<td width="15%"><?=$lang['logs_credit_receive']?></td>
<td width="20%"><?=$lang['action']?></td>
</tr>
<?=$logs?>
<tr class="category" align="right"><td colspan="6"><b><?=$lang['logs_credit_send_total']?></b> <?=implode('; ', $result['receive'])?> <b>|</b> <b><?=$lang['logs_credit_receive_total']?></b> <?=implode(', ', $result['send'])?></td></tr>
</table>
<?=$multipage?>
<?
} elseif($action == 'tags') {
if(!$tagstatus) {
cpmsg('tags_not_open', "admincp.php?action=settings&do=functions#subtitle_tags");
}
if(submitcheck('tagsubmit') && !empty($tag)) {
$tagdelete = $tagclose = $tagopen = array();
foreach($tag as $key => $value) {
if($value == -1) {
$tagdelete[] = $key;
} elseif($value == 1) {
$tagclose[] = $key;
} elseif($value == 0) {
$tagopen[] = $key;
}
}
if($tagdelete) {
$db->query("DELETE FROM {$tablepre}tags WHERE tagname IN (".implodeids($tagdelete).")", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}threadtags WHERE tagname IN (".implodeids($tagdelete).")", 'UNBUFFERED');
}
if($tagclose) {
$db->query("UPDATE {$tablepre}tags SET closed=1 WHERE tagname IN (".implodeids($tagclose).")", 'UNBUFFERED');
}
if($tagopen) {
$db->query("UPDATE {$tablepre}tags SET closed=0 WHERE tagname IN (".implodeids($tagopen).")", 'UNBUFFERED');
}
if($tagdelete || $tagclose || $tagopen) {
updatecache(array('tags_index', 'tags_viewthread'));
}
cpmsg('tags_updated', "admincp.php?action=tags&tagsearchsubmit=yes&cins=".intval($cins)."&tagname=".rawurlencode($tagname)."&threadnumlower=".intval($threadnumlower)."&threadnumhigher=".intval($threadnumhigher));
}
shownav('menu_posting_tags');
if(!submitcheck('tagsearchsubmit', 1)) {
$tagcount[0] = $db->result($db->query("SELECT count(*) FROM {$tablepre}tags"), 0);
$tagcount[1] = $db->result($db->query("SELECT count(*) FROM {$tablepre}tags WHERE closed=1"), 0);
include DISCUZ_ROOT.'./forumdata/cache/cache_index.php';
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['menu_posting_tags']?></td></tr>
<tr><td class="altbg2">
<?=$lang['tags_count']?>: <?=$tagcount[0]?> (<?=$lang['tags_status_1']?> <?=$tagcount[1]?>)<br />
<?=$lang['tags_hot']?>: <br /><?=$_DCACHE['tags']?>
</td></tr><table><br />
<form method="post" action="admincp.php?action=tags">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="2"><?=$lang['tags_search']?></td></tr>
<tr><td class="altbg1" width="45%"><?=$lang['tags_tag']?>:</td>
<td align="right" class="altbg2" width="40%">
<?=$lang['case_insensitive']?> <input type="checkbox" name="cins" value="1" class="checkbox">
<br /><input type="text" name="tagname" size="40" value="<?=dhtmlspecialchars($username)?>"></td></tr>
<tr><td class="altbg1" width="45%"><?=$lang['tags_threadnum_lower']?></td>
<td align="right" class="altbg2" width="40%">
<input type="text" name="threadnumlower" size="40" value="<?=dhtmlspecialchars($username)?>"></td></tr>
<tr><td class="altbg1" width="45%"><?=$lang['tags_threadnum_higher']?></td>
<td align="right" class="altbg2" width="40%">
<input type="text" name="threadnumhigher" size="40" value="<?=dhtmlspecialchars($username)?>"></td></tr>
<tr><td class="altbg1" width="45%"><?=$lang['tags_status']?></td>
<td align="right" class="altbg2" width="40%">
<input type="radio" name="status" value="-1" class="radio" checked> <?=$lang['all']?>
<input type="radio" name="status" value="1" class="radio"> <?=$lang['tags_status_1']?>
<input type="radio" name="status" value="0" class="radio"> <?=$lang['tags_status_0']?>
</td></tr>
</table>
<br /><center>
<input name="tagsearchsubmit" class="button" type="submit" value="<?=$lang['tags_search']?>">
</center>
</form>
<?
} else {
$tagpp = 100;
$page = max(1, intval($page));
$sqladd = $tagname ? ($cins ? '' : 'BINARY')." tagname LIKE '%".str_replace(array('%', '*', '_'), array('\%', '%', '\_'), $tagname)."%'" : '1';
$sqladd .= $threadnumlower ? " AND total<'".intval($threadnumlower)."'" : '';
$sqladd .= $threadnumhigher ? " AND total>'".intval($threadnumhigher)."'" : '';
$sqladd .= $status != -1 ? " AND closed='".intval($status)."'" : '';
$pagetmp = $page;
$num = $db->result($db->query("SELECT count(*) FROM {$tablepre}tags WHERE $sqladd"), 0);
do{
$query = $db->query("SELECT * FROM {$tablepre}tags WHERE $sqladd ORDER BY total DESC LIMIT ".(($pagetmp - 1) * $tagpp).", $tagpp");
$pagetmp--;
} while(!$db->num_rows($query) && $pagetmp);
$tags = '';
while($tag = $db->fetch_array($query)) {
$tags .= '<tr><td class="altbg1">';
$tags .= '<a href="tag.php?name='.rawurlencode($tag['tagname']).'" target="_blank">'.$tag['tagname'].'</a></td>';
$tags .= '<td class="altbg2">'.$tag['total'].'</td>';
$tags .= '<td class="altbg1" style="text-align:center">';
$tags .= '<input name="tag['.$tag['tagname'].']" type="radio" class="radio" value="-1"> '.$lang['delete'].' ';
$tags .= '<input name="tag['.$tag['tagname'].']" type="radio" class="radio" value="1"'.($tag['closed'] ? ' checked' : '').'> '.$lang['tags_status_1'].' ';
$tags .= '<input name="tag['.$tag['tagname'].']" type="radio" class="radio" value="0"'.(!$tag['closed'] ? ' checked' : '').'> '.$lang['tags_status_0'].'';
$tags .= '</td>';
$tags .= '</tr>';
}
$multipage = multi($num, $tagpp, $page, "admincp.php?action=tags&tagsearchsubmit=yes&cins=".intval($cins)."&tagname=".rawurlencode($tagname)."&threadnumlower=".intval($threadnumlower)."&threadnumhigher=".intval($threadnumhigher));
?>
<?=$multipage?>
<form method="post" action="admincp.php?action=tags&page=<?=$page?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="tagname" value="<?=htmlspecialchars($tagname)?>">
<input type="hidden" name="threadnumlower" value="<?=intval($threadnumlower)?>">
<input type="hidden" name="threadnumhigher" value="<?=intval($threadnumhigher)?>">
<input type="hidden" name="status" value="<?=intval($status)?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="3"><?=$lang['menu_posting_tags']?></td></tr>
<tr class="category"><td><?=$lang['tags_tag']?></td>
<td><?=$lang['tags_threadnum']?></td><td width="300">
<input class="button" type="button" value="<?=$lang['tags_all_delete']?>" onclick="checkalloption(this.form, '-1')">
<input class="button" type="button" value="<?=$lang['tags_all_close']?>" onclick="checkalloption(this.form, '1')">
<input class="button" type="button" value="<?=$lang['tags_all_open']?>" onclick="checkalloption(this.form, '0')">
</td></tr>
<?=$tags?>
</table>
<?=$multipage?><br />
<center>
<input name="tagsubmit" class="button" type="submit" value="<?=$lang['submit']?>">
</center>
</form>
<?
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/misc.inc.php | PHP | asf20 | 46,861 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: insenz.func.php 10591 2007-09-07 08:55:16Z liuqiang $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
function insenz_checkfiles() {
global $file;
if(INSENZ_CHECKFILES) {
$insenzfiles = array(
'727ee8758b60a8d281f9d4a7e9778fbc' => './api/insenz.php',
'b19e7fd23c85e4612674d144b20fb95c' => './include/insenz.func.php',
'7a283729f138829bfd3eeae975338ed3' => './include/insenz_cron.func.php',
'e1b1d72d90ef300dedac7c8c8f872fd8' => './include/xmlparser.class.php'
);
foreach($insenzfiles AS $md5 => $file) {
if(!file_exists($file) || $md5 != md5_file(DISCUZ_ROOT.$file)) {
cpmsg('insenz_upload_failed');
}
}
}
}
function checkusername($username) {
$username = trim($username);
if(strlen($username) < 4 || strlen($username) > 20) {
insenz_alert('insenz_username_length_outof_range', 'username');
} elseif(!preg_match("/^\w+$/i", $username)) {
insenz_alert('insenz_username_length_out_of_ranger', 'username');
}
return $username;
}
function checkpassword($password, $password2) {
if($password != $password2) {
insenz_alert('insenz_password_twice_diffenrent', 'password2');
} elseif(strlen($password) < 6 || strlen($password) > 20) {
insenz_alert('insenz_password_length_outof_range', 'password');
} elseif(!preg_match("/^[0-9a-z!#$%&()+\\-.\\[\\]\\/\\\\@?{}|:;]+$/i", $password)) {
insenz_alert('insenz_password_include_special_character', 'password');
}
return $password;
}
function checkname($name) {
$name = trim($name);
if(strlen($name) < 4 || strlen($name) > 30) {
insenz_alert('insenz_name_length_outof_range', 'name');
} elseif(htmlspecialchars($name) != $name) {
insenz_alert('insenz_name_illegal', 'name');
}
return $name;
}
function checkemail($email, $emailname) {
$email = trim($email);
if(strlen($email) < 7 || !preg_match("/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/", $email)) {
insenz_alert('insenz_'.$emailname.'_illegal', $emailname);
}
return htmlspecialchars($email);
}
function checkidcard($idcard) {
$idcard = htmlspecialchars(trim($idcard));
if(strlen($idcard) == 18) {
if(idcard_verify_number(substr($idcard, 0, 17)) == strtoupper($idcard{17})) {
return $idcard;
}
}
insenz_alert('insenz_idcard_illegal', 'idcard');
}
function checktel($tel1, $tel2, $tel3, $telname) {
if(!preg_match("/^\d{2,4}$/", $tel1) || !preg_match("/^\d{5,10}$/", $tel2) || ($tel3 && !preg_match("/^\d{1,5}$/", $tel3))) {
insenz_alert($telname.'insenz_illegal', $telname);
}
return $tel1.'-'.$tel2.'-'.$tel3;
}
function checkqq($qq) {
if(!(preg_match("/^([0-9]+)$/", $qq) && strlen($qq) >= 5 && strlen($qq) <= 12)) {
insenz_alert('insenz_qq_illegal', 'qq');
}
return $qq;
}
function checkmobile($mobile) {
if(!preg_match("/^1(3|5)\d{9}$/", $mobile)) {
insenz_alert('insenz_mobile_illegal', 'mobile');
}
return $mobile;
}
function checkcpc($country, $province, $city) {
$country = intval($country);
if($country < 10000 || $country > 70300) {
insenz_alert('insenz_country_illegal', 'country');
}
$province = intval($province);
if($country == 10000 && ($province < 10100 || $province > 13100)) {
insenz_alert('insenz_province_illegal', 'province');
}
$city = intval($city);
if($country == 10000 && ($city < 10101 || $city > 13107)) {
insenz_alert('insenz_city_illegal', 'city');
}
return array($country, $province, $city);
}
function checkaddress($address) {
$address = htmlspecialchars(trim($address));
if(strlen($address) < 8) {
insenz_alert('insenz_real_address_illegal', 'address');
}
return cutstr($address, 200);
}
function checkpostcode($postcode) {
if(!preg_match("/^\d{6}$/", $postcode)) {
insenz_alert('insenz_post_code_illegal', 'postcode');
}
return $postcode;
}
function idcard_verify_number($idcard_base) {
$factor = array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
$verify_number_list = array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
$checksum = 0;
for($i = 0; $i < strlen($idcard_base); $i++) {
$checksum += substr($idcard_base, $i, 1) * $factor[$i];
}
$mod = $checksum % 11;
$verify_number = $verify_number_list[$mod];
return $verify_number;
}
function checkmasks($return = FALSE) {
global $insenz, $db, $tablepre, $admins, $members, $noneexistusers, $member;
if(!$admins = trim($admins)) {
$return ? cpmsg('insenz_require_one_admin') : insenz_alert('insenz_require_one_admin', 'admins');
} else {
$admins = array_unique(explode("\n", str_replace(array("\r\n", "\r"), array("\n", "\n"), $admins)));
}
$admin_masks = $member_masks = array();
$query = $db->query("SELECT uid, username, adminid FROM {$tablepre}members WHERE username IN ('".implode("','", $admins)."')");
while($member = $db->fetch_array($query)) {
if($member['adminid'] <= 0) {
$return ? cpmsg('insenz_illegal_admin') : insenz_alert('insenz_illegal_admin', 'admins');
}
$admin_masks[$member['uid']] = $member['username'];
}
if($noneexistusers = array_diff($admins, $admin_masks)) {
$noneexistusers = implode(', ', $noneexistusers);
$return ? cpmsg('insenz_user_not_exists') : insenz_alert('insenz_user_not_exists', 'admins');
}
$members = array_unique(explode("\n", str_replace(array("\r\n", "\r"), array("\n", "\n"), trim($members))));
if(count($members) < 2) {
$return ? cpmsg('insenz_require_two_normal_poster') : insenz_alert('insenz_require_two_normal_poster', 'members');
}
$query = $db->query("SELECT uid, username, adminid FROM {$tablepre}members WHERE username IN ('".implode("','", $members)."')");
while($member = $db->fetch_array($query)) {
if($member['adminid'] > 0) {
$return ? cpmsg('insenz_not_normal_user') : insenz_alert('insenz_not_normal_user', 'members');
}
$member_masks[$member['uid']] = $member['username'];
}
if($noneexistusers = array_diff($members, $member_masks)) {
$noneexistusers = implode(', ', $noneexistusers);
$return ? cpmsg('insenz_user_not_exists') : insenz_alert('insenz_user_not_exists', 'members');
}
$modified = $insenz['admin_masks'] != $admin_masks || $insenz['member_masks'] != $member_masks;
if(INSENZ_SAFEMODE && $insenz['member_masks'] != $member_masks) {
if(!empty($insenz['groupid'])) {
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}usergroups WHERE groupid='$insenz[groupid]'");
if(!$db->result($query, 0)) {
unset($insenz['groupid']);
}
}
if(empty($insenz['groupid'])) {
$query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups WHERE type='member' ORDER BY creditslower DESC LIMIT 5");
$groups = array();
while($group = $db->fetch_array($query)) {
$groups[$group['groupid']] = $group['grouptitle'];
}
$randgid = array_rand($groups);
$grouptitle = $groups[$randgid] ? $groups[$randgid] : 'Member';
$query = $db->query("SELECT * FROM {$tablepre}usergroups WHERE groupid='$randgid'");
$fieldnums = mysql_num_fields($query);
$group = $db->fetch_array($query);
$fields = '';
for($i = 0; $i < $fieldnums; $i++) {
$field = mysql_field_name($query, $i);
if(!in_array($field, array('groupid', 'type', 'grouptitle', 'allowpost', 'allowreply'))) {
$fields .= ", $field='$group[$field]'";
}
}
$db->query("INSERT INTO {$tablepre}usergroups SET type='special', grouptitle='$grouptitle', allowpost='1', allowreply='1' $fields");
$insenz['groupid'] = $db->insert_id();
require_once DISCUZ_ROOT.'./include/cache.func.php';
updatecache('usergroups');
}
$db->query("UPDATE {$tablepre}members SET adminid=-1, groupid='$insenz[groupid]' WHERE uid IN (".implodeids(array_keys($member_masks)).")");
}
$insenz['admin_masks'] = $admin_masks;
$insenz['member_masks'] = $member_masks;
if($return) {
return $modified;
}
}
function checkip() {
global $boardurl, $onlineip;
if(INSENZ_CHECKIP) {
$longip = ip2long($onlineip);
if(substr($onlineip, 0, 1) == '0' || substr($onlineip, 0, 3) == '127' || isInRange($longip, 167772160, 184549375) || isInRange($longip, -1408237568, -1407188993) || isInRange($longip, -1062731776, -1062666241)) {
cpmsg('insenz_intranet_not_allowed');
}
}
}
function isInRange($x, $min, $max) {
return $x >= $min && $x <= $max;
}
function insenz_register($type) {
global $insenz, $db, $tablepre, $_DCACHE, $boardurl, $timestamp, $authkey, $discuz_uid, $discuz_user, $response;
checkip();
if($type == 1) {
@extract($insenz['profile']);
foreach(array('username', 'password', 'name', 'idcard', 'email1', 'email2', 'qq', 'msn', 'tel1', 'tel2', 'tel3', 'mobile', 'fax1', 'fax2', 'fax3', 'country', 'province', 'city', 'address', 'postcode', 'alipay') AS $item) {
$$item = stripslashes($$item);
}
} else {
$username = $insenz['profile']['username'];
$password = $insenz['profile']['password'];
}
$insenz['notify'] = is_array($insenz['notify']) ? $insenz['notify'] : array(2);
$insenz['hardadstatus'] = is_array($insenz['hardadstatus']) ? $insenz['hardadstatus'] : array(1, 2, 3, 4, 5);
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}members");
$members = $db->result($query, 0);
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}members WHERE posts>0");
$post_members = $db->result($query, 0);
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}threads WHERE displayorder>='0'");
$threads = $db->result($query, 0);
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE invisible='0'");
$posts = $db->result($query, 0);
$date = getdate($timestamp);
$yesterday_end = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']);
$lastweek_start = $yesterday_end - 7*86400;
$lastweek_pertopics = $lastweek_perposts = $forumstats = array();
$query = $db->query("SELECT DISTINCT(fid) AS fid, COUNT(tid) AS topics FROM {$tablepre}threads WHERE dateline BETWEEN $lastweek_start AND $yesterday_end GROUP BY fid ORDER BY topics DESC");
while($p = $db->fetch_array($query)) {
$lastweek_pertopics[$p['fid']] = ceil($p['topics'] / 7);
}
$query = $db->query("SELECT DISTINCT(fid) AS fid, COUNT(pid) AS posts FROM {$tablepre}posts WHERE dateline BETWEEN $lastweek_start AND $yesterday_end GROUP BY fid ORDER BY posts DESC");
while($p = $db->fetch_array($query)) {
$lastweek_perposts[$p['fid']] = ceil($p['posts'] / 7);
}
$query = $db->query("SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.displayorder, f.status, f.simple, ff.description, ff.redirect FROM {$tablepre}forums f LEFT JOIN {$tablepre}forumfields ff ON f.fid=ff.fid");
while($forum = $db->fetch_array($query)) {
$fid = $forum['fid'];
unset($forum['fid']);
$forum['lastweek_pertopics'] = intval($lastweek_pertopics[$fid]);
$forum['lastweek_perposts'] = intval($lastweek_perposts[$fid]);
$forumstats[$fid] = $forum;
}
$postdata = '<cmd id="register"><handle>'.insenz_convert($username).'</handle>
<passwd>'.$password.'</passwd>';
if($type == 1) {
$postdata .= '<name>'.insenz_convert($name).'</name>
<idcard>'.$idcard.'</idcard>
<tel>'.$tel1.'-'.$tel2.'-'.$tel3.'</tel>
<mobile>'.$mobile.'</mobile>
<fax>'.$fax1.'-'.$fax2.'-'.$fax3.'</fax>
<email>'.$email1.'</email>
<email2>'.$email2.'</email2>
<qq>'.$qq.'</qq>
<msn>'.$msn.'</msn>
<alipay>'.$alipay.'</alipay>
<country>'.$country.'</country>
<province>'.$province.'</province>
<city>'.$city.'</city>
<addr>'.insenz_convert($address).'</addr>
<postcode>'.$postcode.'</postcode>';
}
$postdata .= '<url>'.$boardurl.'</url>
<s_key>'.md5($authkey.'Discuz!INSENZ').'</s_key>
<bbname>'.insenz_convert($_DCACHE['settings']['bbname']).'</bbname>
<members>'.$members.'</members>
<post_members>'.$post_members.'</post_members>
<topics>'.$threads.'</topics>
<posts>'.$posts.'</posts>
<softadstatus>'.intval($insenz['softadstatus']).'</softadstatus>
<notify>'.implode(',', $insenz['notify']).'</notify>
<autoextend>'.intval($insenz['autoextend']).'</autoextend>
<hardadstatus>'.implode(',', $insenz['hardadstatus']).'</hardadstatus>
<relatedadstatus>'.intval($insenz['relatedadstatus']).'</relatedadstatus>
<virtualforumstatus>'.intval($insenz['virtualforumstatus']).'</virtualforumstatus>';
foreach($forumstats AS $fid => $forum) {
$postdata .= '<board>
<board_id>'.$fid.'</board_id>
<parent_id>'.$forum['fup'].'</parent_id>
<board_type>'.$forum['type'].'</board_type>
<name>'.insenz_convert($forum['name']).'</name>
<topics>'.$forum['threads'].'</topics>
<posts>'.$forum['posts'].'</posts>
<lastweek_pertopics>'.$forum['lastweek_pertopics'].'</lastweek_pertopics>
<lastweek_perposts>'.$forum['lastweek_perposts'].'</lastweek_perposts>
<description>'.insenz_convert($forum['description']).'</description>
<status>'.$forum['status'].'</status>
<simple>'.$forum['simple'].'</simple>
<redirect>'.insenz_convert($forum['redirect']).'</redirect>
<displayorder>'.$forum['displayorder'].'</displayorder></board>';
}
$postdata .= '<type>'.($type == 1 ? 'register' : 'bind').'</type></cmd>';
unset($insenz['siteid']);
$response = insenz_request($postdata);
if($response['status']) {
insenz_alert($response['data']);
} else {
$response = $response['data'];
}
$status = $response['response'][0]['status'][0]['VALUE'];
if($status == 0) {
$insenz['authkey'] = $response['response'][0]['authkey'][0]['VALUE'];
$insenz['siteid'] = $response['response'][0]['site_id'][0]['VALUE'];
$insenz['uid'] = $discuz_uid;
$insenz['username'] = $discuz_user;
insenz_updatesettings();
unset($insenz['profile'], $insenz['step']);
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('insenz', '".addslashes(serialize($insenz))."')");
require_once DISCUZ_ROOT.'./include/cache.func.php';
updatecache('settings');
insenz_cpmsg('insenz_register_succeed');
} else {
$response['reason'] = insenz_convert($response['response'][0]['reason'][0]['VALUE'], 0);
unset($insenz['authkey'], $insenz['siteid']);
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('insenz', '".addslashes(serialize($insenz))."')");
insenz_alert('insenz_register_failed');
}
}
function insenz_showsettings($do = '') {
global $insenz, $db, $tablepre, $discuz_user, $timestamp, $lang;
$type = array('basic' => $lang['menu_insenz_settings_basic'], 'softad' => $lang['menu_insenz_settings_softad'], 'hardad' => $lang['menu_insenz_settings_hardad'], 'relatedad' => $lang['menu_insenz_settings_relatedad'], 'virtualforum' => $lang['menu_insenz_settings_virtualforum']);
if(!$do || $do == 'basic') {
$insenz['notify'] = is_array($insenz['notify']) ? $insenz['notify'] : array();
$insenz['notify'][2] = 1;
$insenz_notify = bindec(intval($insenz['notify'][2]).intval($insenz['notify'][1]));
$msgto = '';
if(!empty($insenz['msgtoid'])) {
$query = $db->query("SELECT username FROM {$tablepre}members WHERE uid='$insenz[msgtoid]'");
$msgto = $db->result($query, 0);
}
$msgto = $msgto ? $msgto : $discuz_user;
$disabled = $insenz['notify'][1] ? 0 : 1;
if(!$do) {
echo '<tr class="category"><td colspan="2">'.$type['basic'].'</td></tr>';
} else {
showtype($type['basic'], 'top');
}
//showsetting('insenz_settings_domain', 'host', $insenz['host'], 'text');
showsetting('insenz_settings_notify', array('notify', array($lang['insenz_settings_notify1'], $lang['insenz_settings_notify2']), array('onclick="this.form.msgto.disabled=this.checked?false:true;"', 'disabled')), $insenz_notify, 'mcheckbox');
showsetting('insenz_settings_msgto', 'msgto', $msgto, 'text', '45%', $disabled);
echo '</tbody><tbody>';
}
if(!$do || $do == 'softad') {
$insenz['softadstatus'] = isset($insenz['softadstatus']) ? $insenz['softadstatus'] : 2;
$softadstatus1 = $insenz['softadstatus'] ? 1 : 0;
$softadstatus2 = $insenz['softadstatus'] == 2 ? 1 : 0;
$readonly = $do && !empty($insenz['lastmodified']) && $timestamp - $insenz['lastmodified'] < 14 * 86400;
$nextmodified = gmdate("$GLOBALS[dateformat] $GLOBALS[timeformat]", (empty($insenz['lastmodified']) || $insenz['lastmodified'] + 14 * 86400 < $timestamp ? $timestamp : $insenz['lastmodified'] + 14 * 86400) + $GLOBALS['timeoffset'] * 3600);
if(!$do) {
echo '<tr class="category"><td colspan="2">'.$type['softad'].'</td></tr>';
} else {
showtype($type['softad'], 'top');
}
showsetting('insenz_settings_softadstatus1', 'softadstatus1', $softadstatus1, 'radio', '', '', 1);
showsetting('insenz_settings_softadstatus2', 'softadstatus2', $softadstatus2, 'radio');
//showsetting('insenz_settings_autoextend', 'autoextend', $insenz['autoextend'], 'radio');
showsetting('<b>'.$lang['insenz_settings_admins'].'</b><br><span class="smalltxt">'.$lang['insenz_settings_admins_comment'].$nextmodified.'</span>', 'admins', $insenz['admin_masks'] ? implode("\n", $insenz['admin_masks']) : '', 'textarea', '45%', $readonly);
showsetting('<b>'.$lang['insenz_settings_members'].'</b><br><span class="smalltxt">'.$lang['insenz_settings_members_comment'].$nextmodified.'</span>', 'members', $insenz['member_masks'] ? implode("\n", $insenz['member_masks']) : '', 'textarea', '45%', $readonly);
echo '</tbody><tbody>';
}
if(!$do || $do == 'hardad') {
/* note
$query = $db->query("SELECT COUNT(*) AS nums, type FROM {$tablepre}advertisements WHERE type IN ('headerbanner', 'thread', 'interthread', 'footerbanner') GROUP BY type");
$ads = array();
while($ad = $db->fetch_array($query)) {
$ads[$ad['type']] = $ad['nums'];
}
*/
$availableadvs = array(
1 => $lang['insenz_settings_availableadvs1'],
2 => $lang['insenz_settings_availableadvs2'],
3 => $lang['insenz_settings_availableadvs3'],
4 => $lang['insenz_settings_availableadvs4'],
5 => $lang['insenz_settings_availableadvs5'],
6 => $lang['insenz_settings_availableadvs6'],
7 => $lang['insenz_settings_availableadvs7'],
8 => $lang['insenz_settings_availableadvs8']
);
$insenz['availableadvs'] = is_array($insenz['availableadvs']) ? $insenz['availableadvs'] : array(1, 2, 3, 4, 5);
$insenz['hardadstatus'] = is_array($insenz['hardadstatus']) ? $insenz['hardadstatus']: array(1, 2, 3, 4, 5);
$insenz_availableadvs = array();
foreach($insenz['availableadvs'] AS $ad) {
$insenz_availableadvs[$ad] = $availableadvs[$ad];
}
if(!$do) {
echo '<tr class="category"><td colspan="2">'.$type['hardad'].'</td></tr>';
} else {
showtype($type['hardad'], 'top');
}
$insenz_hardadstatus = '';
for($i = count($insenz['availableadvs']); $i >= 1; $i--) {
$insenz_hardadstatus .= in_array($i, $insenz['hardadstatus']) ? 1 : 0;
}
$insenz_hardadstatus = bindec($insenz_hardadstatus);
showsetting('insenz_settings_hardadstatus', array('hardadstatus', $insenz_availableadvs), $insenz_hardadstatus, 'mcheckbox');
}
if(!$do || $do == 'relatedad') {
$insenz['relatedadstatus'] = isset($insenz['relatedadstatus']) ? $insenz['relatedadstatus'] : 1;
if(!$do) {
echo '<tr class="category"><td colspan="2">'.$type['relatedad'].'</td></tr>';
} else {
showtype($type['relatedad'], 'top');
}
showsetting('insenz_settings_relatedadstatus', 'relatedadstatus', $insenz['relatedadstatus'], 'radio');
}
if(!$do || $do == 'virtualforum') {
$insenz['virtualforumstatus'] = isset($insenz['virtualforumstatus']) ? $insenz['virtualforumstatus'] : 1;
if(!$do) {
echo '<tr class="category"><td colspan="2">'.$type['virtualforum'].'</td></tr>';
} else {
showtype($type['virtualforum'], 'top');
}
showsetting('insenz_settings_virtualforumstatus', 'virtualforumstatus', $insenz['virtualforumstatus'], 'radio');
}
}
function insenz_updatesettings() {
global $insenz, $response;
$insenz['availableadvs'] = explode(',', $response['response'][0]['availableadvs'][0]['VALUE']);
$insenz['hardadstatus'] = array_intersect(is_array($insenz['hardadstatus']) ? $insenz['hardadstatus'] : array(), $insenz['availableadvs']);
if($insenz['relatedadstatus']) {
$insenz['topicrelatedad'] = insenz_convert($response['response'][0]['topicrelatedad'][0]['VALUE'], 0);
$insenz['traderelatedad'] = insenz_convert($response['response'][0]['traderelatedad'][0]['VALUE'], 0);
$insenz['relatedtrades'] = insenz_convert($response['response'][0]['relatedtrades'][0]['VALUE'], 0);
} else {
$insenz['topicrelatedad'] = $insenz['traderelatedad'] = $insenz['relatedtrades'] = '';
}
$jsurl = $response['response'][0]['jsurl'][0]['VALUE'];
$insenz['jsurl'] = $jsurl ? $jsurl : $insenz['jsurl'];
if(isset($response['response'][0]['topicstatus'])) {
$insenz['topicstatus'] = intval($response['response'][0]['topicstatus'][0]['VALUE']);
}
$insenz['status'] = $insenz['softadstatus'] || $insenz['hardadstatus'] || $insenz['topicrelatedad'] || $insenz['traderelatedad'] || $insenz['topicstatus'];
}
function insenz_shownav($navs) {
global $lang;
$navs = isset($GLOBALS['lang'][$navs]) ? $GLOBALS['lang'][$navs] : $navs;
shownav('<a href="admincp.php?action=insenz&operation=campaignlist&c_status=2">'.$lang['header_insenz'].'</a> » '.$navs);
}
function insenz_request($data, $return = TRUE, $fp = '') {
global $insenz, $timestamp;
@include_once DISCUZ_ROOT.'./discuz_version.php';
$authkey = !empty($insenz['authkey']) ? $insenz['authkey'] : 'Discuz!INSENZ';
$t_hex = sprintf("%08x", $timestamp);
$postdata = '<?xml version="1.0" encoding="UTF'.'-8"?><request insenz_version="'.INSENZ_VERSION.'" discuz_version="'.DISCUZ_VERSION.' - '.DISCUZ_RELEASE.'">'.$data.'</request>';
$postdata = insenz_authcode($t_hex.md5($authkey.$postdata.$t_hex).$postdata, 'ENCODE', $authkey);
if(!$fp && !$fp = @fsockopen($insenz['host'], 80)) {
if(!$return) {
return;
} else {
return array('status' => 1, 'data' => $lang['insenz_connect_failed']);
}
}
$insenz['siteid'] = intval($insenz['siteid']);
@fwrite($fp, "POST http://$insenz[url]/discuz.php?s_id=$insenz[siteid] HTTP/1.0\r\n");
@fwrite($fp, "Host: $insenz[host]\r\n");
@fwrite($fp, "Content-Type: file\r\n");
@fwrite($fp, "Content-Length: " . strlen($postdata) ."\r\n\r\n");
@fwrite($fp, $postdata);
if(!$return) {
@fclose($fp);
return;
}
$res = '';
$isheader = 1;
while(!feof($fp)) {
$buffer = @fgets($fp, 1024);
if(!$isheader) {
$res .= $buffer;
} elseif(trim($buffer) == '') {
$isheader = 0;
}
}
@fclose($fp);
if(empty($res)) {
return array('status' => 1, 'data' => $lang['insenz_connect_failed']);
}
if(!$response = insenz_authcode($res, 'DECODE', $authkey)) {
return array('status' => 1, 'data' => $lang['insenz_transport_failed']);
}
$checkKey = substr($response, 0, 40);
$response = substr($response, 40);
$t_hex = substr($checkKey, 0, 8);
$t = base_convert($t_hex, 16, 10);
if(abs($timestamp - $t) > 1200) {
return array('status' => 1, 'data' => $lang['insenz_connect_timeout']);
} elseif($checkKey != $t_hex.md5($authkey.$response.$t_hex)) {
return array('status' => 1, 'data' => 'Invalid Key or Data');
}
require_once DISCUZ_ROOT.'./include/xmlparser.class.php';
$xmlparse = new XMLParser;
$xmlparseddata = $xmlparse->getXMLTree($response);
if(!is_array($xmlparseddata) || !is_array($xmlparseddata['response'])) {
return array('status' => 1, 'data' => $lang['insenz_transport_failed']);
}
return array('status' => 0, 'data' => $xmlparseddata);
}
function insenz_alert($message, $focusobj = '') {
extract($GLOBALS, EXTR_SKIP);
eval("\$message = \"".(isset($msglang[$message]) ? $msglang[$message] : $message)."\";");
echo '<script type="text/javascript">alert(\''.str_replace('\'', '\\\'', $message).'\');'.($focusobj ? 'parent.document.form1.'.$focusobj.'.focus();' : '').'</script>';
exit;
}
function insenz_cpmsg($message, $extra = '') {
extract($GLOBALS, EXTR_SKIP);
eval("\$message = \"".(isset($msglang[$message]) ? $msglang[$message] : $message)."\";");
$url_forward = 'admincp.php?action=insenz'.$extra;
$message .= "<br /><br /><br /><a href=\"$url_forward\">$lang[message_redirect]</a>";
$url_forward = transsid($url_forward);
echo '<script type="text/javascript">parent.setTimeout("redirect(\''.$url_forward.'\');", 2000);parent.$("insenz_body").innerHTML = \'<br /><br /><br /><br /><br /><br /><table width="500" border="0" cellpadding="0" cellspacing="0" align="center" class="tableborder"><tr class="header"><td>'.$lang['discuz_message'].'</td></tr><tr><td class="altbg2"><br /><br /><div align="center">'.$message.'</div><br /><br /></td></tr></table><br /><br /><br />\';</script>';
dexit();
}
?> | zyyhong | trunk/jiaju001/bbs/admin/insenz.func.php | PHP | asf20 | 25,102 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: zip.func.php 10115 2007-08-24 00:58:08Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
// vim: expandtab sw=4 ts=4 sts=4:
class zipfile {
var $datasec = array();
var $ctrl_dir = array();
var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
var $old_offset = 0;
function unix2DosTime($unixtime = 0) {
$timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);
if($timearray['year'] < 1980) {
$timearray['year'] = 1980;
$timearray['mon'] = 1;
$timearray['mday'] = 1;
$timearray['hours'] = 0;
$timearray['minutes'] = 0;
$timearray['seconds'] = 0;
} // end if
return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) |
($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);
} // end of the 'unix2DosTime()' method
function addFile($data, $name, $time = 0) {
$name = str_replace('\\', '/', $name);
$dtime = dechex($this->unix2DosTime($time));
$hexdtime = '\x' . $dtime[6] . $dtime[7]
. '\x' . $dtime[4] . $dtime[5]
. '\x' . $dtime[2] . $dtime[3]
. '\x' . $dtime[0] . $dtime[1];
eval('$hexdtime = "' . $hexdtime . '";');
$fr = "\x50\x4b\x03\x04";
$fr .= "\x14\x00"; // ver needed to extract
$fr .= "\x00\x00"; // gen purpose bit flag
$fr .= "\x08\x00"; // compression method
$fr .= $hexdtime; // last mod time and date
// "local file header" segment
$unc_len = strlen($data);
$crc = crc32($data);
$zdata = gzcompress($data);
$zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug
$c_len = strlen($zdata);
$fr .= pack('V', $crc); // crc32
$fr .= pack('V', $c_len); // compressed filesize
$fr .= pack('V', $unc_len); // uncompressed filesize
$fr .= pack('v', strlen($name)); // length of filename
$fr .= pack('v', 0); // extra field length
$fr .= $name;
// "file data" segment
$fr .= $zdata;
// "data descriptor" segment (optional but necessary if archive is not
// served as file)
// nijel(2004-10-19): this seems not to be needed at all and causes
// problems in some cases (bug #1037737)
//$fr .= pack('V', $crc); // crc32
//$fr .= pack('V', $c_len); // compressed filesize
//$fr .= pack('V', $unc_len); // uncompressed filesize
// add this entry to array
$this -> datasec[] = $fr;
// now add to central directory record
$cdrec = "\x50\x4b\x01\x02";
$cdrec .= "\x00\x00"; // version made by
$cdrec .= "\x14\x00"; // version needed to extract
$cdrec .= "\x00\x00"; // gen purpose bit flag
$cdrec .= "\x08\x00"; // compression method
$cdrec .= $hexdtime; // last mod time & date
$cdrec .= pack('V', $crc); // crc32
$cdrec .= pack('V', $c_len); // compressed filesize
$cdrec .= pack('V', $unc_len); // uncompressed filesize
$cdrec .= pack('v', strlen($name) ); // length of filename
$cdrec .= pack('v', 0 ); // extra field length
$cdrec .= pack('v', 0 ); // file comment length
$cdrec .= pack('v', 0 ); // disk number start
$cdrec .= pack('v', 0 ); // internal file attributes
$cdrec .= pack('V', 32 ); // external file attributes - 'archive' bit set
$cdrec .= pack('V', $this -> old_offset ); // relative offset of local header
$this -> old_offset += strlen($fr);
$cdrec .= $name;
// optional extra field, file comment goes here
// save to central directory
$this -> ctrl_dir[] = $cdrec;
} // end of the 'addFile()' method
function file() {
$data = implode('', $this -> datasec);
$ctrldir = implode('', $this -> ctrl_dir);
return
$data .
$ctrldir .
$this -> eof_ctrl_dir .
pack('v', sizeof($this -> ctrl_dir)) . // total # of entries "on this disk"
pack('v', sizeof($this -> ctrl_dir)) . // total # of entries overall
pack('V', strlen($ctrldir)) . // size of central dir
pack('V', strlen($data)) . // offset to start of central dir
"\x00\x00"; // .zip file comment length
} // end of the 'file()' method
} // end of the 'zipfile' class
class SimpleUnzip {
// 2003-12-02 - HB >
var $Comment = '';
// 2003-12-02 - HB <
var $Entries = array();
var $Name = '';
var $Size = 0;
var $Time = 0;
function SimpleUnzip($in_FileName = '') {
if($in_FileName !== '') {
SimpleUnzip::ReadFile($in_FileName);
}
} // end of the 'SimpleUnzip' constructor
function Count() {
return count($this->Entries);
} // end of the 'Count()' method
function GetData($in_Index) {
return $this->Entries[$in_Index]->Data;
} // end of the 'GetData()' method
function GetEntry($in_Index) {
return $this->Entries[$in_Index];
} // end of the 'GetEntry()' method
function GetError($in_Index) {
return $this->Entries[$in_Index]->Error;
} // end of the 'GetError()' method
function GetErrorMsg($in_Index) {
return $this->Entries[$in_Index]->ErrorMsg;
} // end of the 'GetErrorMsg()' method
function GetName($in_Index) {
return $this->Entries[$in_Index]->Name;
} // end of the 'GetName()' method
function GetPath($in_Index) {
return $this->Entries[$in_Index]->Path;
} // end of the 'GetPath()' method
function GetTime($in_Index) {
return $this->Entries[$in_Index]->Time;
} // end of the 'GetTime()' method
function ReadFile($in_FileName) {
$this->Entries = array();
// Get file parameters
$this->Name = $in_FileName;
$this->Time = filemtime($in_FileName);
$this->Size = filesize($in_FileName);
// Read file
$oF = fopen($in_FileName, 'rb');
$vZ = fread($oF, $this->Size);
fclose($oF);
// 2003-12-02 - HB >
// Cut end of central directory
$aE = explode("\x50\x4b\x05\x06", $vZ);
// Easiest way, but not sure if format changes
//$this->Comment = substr($aE[1], 18);
// Normal way
$aP = unpack('x16/v1CL', $aE[1]);
$this->Comment = substr($aE[1], 18, $aP['CL']);
// Translates end of line from other operating systems
$this->Comment = strtr($this->Comment, array("\r\n" => "\n",
"\r" => "\n"));
// 2003-12-02 - HB <
// Cut the entries from the central directory
$aE = explode("\x50\x4b\x01\x02", $vZ);
// Explode to each part
$aE = explode("\x50\x4b\x03\x04", $aE[0]);
// Shift out spanning signature or empty entry
array_shift($aE);
// Loop through the entries
foreach($aE as $vZ) {
$aI = array();
$aI['E'] = 0;
$aI['EM'] = '';
// Retrieving local file header information
$aP = unpack('v1VN/v1GPF/v1CM/v1FT/v1FD/V1CRC/V1CS/V1UCS/v1FNL', $vZ);
// Check if data is encrypted
$bE = ($aP['GPF'] && 0x0001) ? TRUE : FALSE;
$nF = $aP['FNL'];
// Special case : value block after the compressed data
if($aP['GPF'] & 0x0008) {
$aP1 = unpack('V1CRC/V1CS/V1UCS', substr($vZ, -12));
$aP['CRC'] = $aP1['CRC'];
$aP['CS'] = $aP1['CS'];
$aP['UCS'] = $aP1['UCS'];
$vZ = substr($vZ, 0, -12);
}
// Getting stored filename
$aI['N'] = substr($vZ, 26, $nF);
if(substr($aI['N'], -1) == '/') {
// is a directory entry - will be skipped
continue;
}
// Truncate full filename in path and filename
$aI['P'] = dirname($aI['N']);
$aI['P'] = $aI['P'] == '.' ? '' : $aI['P'];
$aI['N'] = basename($aI['N']);
$vZ = substr($vZ, 26 + $nF);
if(strlen($vZ) != $aP['CS']) {
$aI['E'] = 1;
$aI['EM'] = 'Compressed size is not equal with the value in header information.';
} else {
if($bE) {
$aI['E'] = 5;
$aI['EM'] = 'File is encrypted, which is not supported from this class.';
} else {
switch($aP['CM']) {
case 0: // Stored
// Here is nothing to do, the file ist flat.
break;
case 8: // Deflated
$vZ = gzinflate($vZ);
break;
case 12: // BZIP2
// 2003-12-02 - HB >
if(! extension_loaded('bz2')) {
if(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
@dl('php_bz2.dll');
} else {
@dl('bz2.so');
}
}
if(extension_loaded('bz2')) {
// 2003-12-02 - HB <
$vZ = bzdecompress($vZ);
// 2003-12-02 - HB >
} else {
$aI['E'] = 7;
$aI['EM'] = "PHP BZIP2 extension not available.";
}
// 2003-12-02 - HB <
break;
default:
$aI['E'] = 6;
$aI['EM'] = "De-/Compression method {$aP['CM']} is not supported.";
}
// 2003-12-02 - HB >
if(! $aI['E']) {
// 2003-12-02 - HB <
if($vZ === FALSE) {
$aI['E'] = 2;
$aI['EM'] = 'Decompression of data failed.';
} else {
if(strlen($vZ) != $aP['UCS']) {
$aI['E'] = 3;
$aI['EM'] = 'Uncompressed size is not equal with the value in header information.';
} else {
if(crc32($vZ) != $aP['CRC']) {
$aI['E'] = 4;
$aI['EM'] = 'CRC32 checksum is not equal with the value in header information.';
}
}
}
// 2003-12-02 - HB >
}
// 2003-12-02 - HB <
}
}
$aI['D'] = $vZ;
// DOS to UNIX timestamp
$aI['T'] = mktime(($aP['FT'] & 0xf800) >> 11,
($aP['FT'] & 0x07e0) >> 5,
($aP['FT'] & 0x001f) << 1,
($aP['FD'] & 0x01e0) >> 5,
($aP['FD'] & 0x001f),
(($aP['FD'] & 0xfe00) >> 9) + 1980);
$this->Entries[] = &new SimpleUnzipEntry($aI);
} // end for each entries
return $this->Entries;
} // end of the 'ReadFile()' method
} // end of the 'SimpleUnzip' class
class SimpleUnzipEntry {
var $Data = '';
var $Error = 0;
var $ErrorMsg = '';
var $Name = '';
var $Path = '';
var $Time = 0;
function SimpleUnzipEntry($in_Entry) {
$this->Data = $in_Entry['D'];
$this->Error = $in_Entry['E'];
$this->ErrorMsg = $in_Entry['EM'];
$this->Name = $in_Entry['N'];
$this->Path = $in_Entry['P'];
$this->Time = $in_Entry['T'];
} // end of the 'SimpleUnzipEntry' constructor
} // end of the 'SimpleUnzipEntry' class
?>
| zyyhong | trunk/jiaju001/bbs/admin/zip.func.php | PHP | asf20 | 13,678 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: templates.inc.php 9848 2007-08-16 09:05:22Z monkey $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if(!isfounder()) cpmsg('noaccess_isfounder');
if($action == 'templates') {
if(!$edit) {
if(!submitcheck('tplsubmit')) {
$templates = '';
$query = $db->query("SELECT * FROM {$tablepre}templates");
while($tpl = $db->fetch_array($query)) {
$templates .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" ".($tpl[templateid] == 1 ? 'disabled ' : '')."value=\"$tpl[templateid]\"></td>\n".
"<td class=\"altbg2\"><input type=\"text\" size=\"8\" name=\"namenew[$tpl[templateid]]\" value=\"$tpl[name]\"></td>\n".
"<td class=\"altbg1\"><input type=\"text\" size=\"20\" name=\"directorynew[$tpl[templateid]]\" value=\"$tpl[directory]\"></td>\n".
"<td class=\"altbg2\">$tpl[copyright]</td>\n".
"<td class=\"altbg1\"><a href=\"admincp.php?action=templates&edit=$tpl[templateid]\">[$lang[detail]]</a></td></tr>\n";
}
shownav('menu_styles_templates');
?>
<form method="post" action="admincp.php?action=templates&">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td width="48"><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['templates_name']?></td><td><?=$lang['templates_directory']?></td><td><?=$lang['copyright']?></td><td><?=$lang['edit']?></td></tr>
<?=$templates?>
<tr align="center" class="altbg1"><td><?=$lang['add_new']?></td>
<td><input type="text" size="8" name="newname"></td>
<td><input type="text" size="20" name="newdirectory"></td>
<td><input type="text" size="25" name="newcopyright"></td>
<td> </td>
</tr></table><br />
<center><input class="button" type="submit" name="tplsubmit" value="<?=$lang['submit']?>"></center></form>
<?
} else {
if($newname) {
if(!$newdirectory) {
cpmsg('templates_new_directory_invalid');
} elseif(!istpldir($newdirectory)) {
$directory = $newdirectory;
cpmsg('templates_directory_invalid');
}
$db->query("INSERT INTO {$tablepre}templates (name, directory, copyright)
VALUES ('$newname', '$newdirectory', '$newcopyright')", 'UNBUFFERED');
}
foreach($directorynew as $id => $directory) {
if(!$delete || ($delete && !in_array($id, $delete))) {
if(!istpldir($directory)) {
cpmsg('templates_directory_invalid');
} elseif($id == 1 && $directory != './templates/default') {
cpmsg('templates_default_directory_invalid');
}
$db->query("UPDATE {$tablepre}templates SET name='$namenew[$id]', directory='$directorynew[$id]' WHERE templateid='$id'", 'UNBUFFERED');
}
}
if(is_array($delete)) {
if(in_array('1', $delete)) {
cpmsg('templates_delete_invalid');
}
$ids = implodeids($delete);
$db->query("DELETE FROM {$tablepre}templates WHERE templateid IN ($ids) AND templateid<>'1'", 'UNBUFFERED');
$db->query("UPDATE {$tablepre}styles SET templateid='1' WHERE templateid IN ($ids)", 'UNBUFFERED');
}
updatecache('styles');
cpmsg('templates_update_succeed', 'admincp.php?action=templates');
}
} else {
$query = $db->query("SELECT * FROM {$tablepre}templates WHERE templateid='$edit'");
if(!$template = $db->fetch_array($query)) {
cpmsg('undefined_action');
} elseif(!istpldir($template['directory'])) {
$directory = $template['directory'];
cpmsg('templates_directory_invalid');
}
$warning = $template['templateid'] == 1 ? 'templates_edit_default_comment' : 'templates_edit_nondefault_comment';
if($keyword) {
$keywordadd = " - $lang[templates_keyword] <i>".dhtmlspecialchars(stripslashes($keyword))."</i> - <a href=\"admincp.php?action=templates&edit=$edit\">[$lang[templates_view_all]]</a>";
$keywordenc = rawurlencode($keyword);
}
$tpldir = dir(DISCUZ_ROOT.'./'.$template['directory']);
$tplarray = $langarray = $differ = $new = array();
while($entry = $tpldir->read()) {
$extension = strtolower(fileext($entry));
if($extension == 'htm' || $extension == 'php') {
if($extension == 'htm') {
$tplname = substr($entry, 0, -4);
$pos = strpos($tplname, '_');
if($keyword) {
if(!stristr(implode("\n", file(DISCUZ_ROOT."./$template[directory]/$entry")), $keyword)) {
continue;
}
}
if(!$pos) {
$tplarray[$tplname][] = $tplname;
} else {
$tplarray[substr($tplname, 0, $pos)][] = $tplname;
}
} else {
$langarray[] = substr($entry, 0, -9);
}
if($template['templateid'] != 1) {
if(file_exists(DISCUZ_ROOT."./templates/default/$entry")) {
if(md5_file(DISCUZ_ROOT."./templates/default/$entry") != md5_file(DISCUZ_ROOT."./$template[directory]/$entry")) {
$differ[] = $entry;
}
} else {
$new[] = $entry;
}
}
}
}
$tpldir->close();
ksort($tplarray);
ksort($langarray);
$templates = $languages = '';
$allowedittpls = checkpermission('tpledit', 0);
foreach($tplarray as $tpl => $subtpls) {
$templates .= "<ul><li><b>$tpl</b><ul>\n";
foreach($subtpls as $subtpl) {
$filename = "$subtpl.htm";
$resetlink = '';
if(in_array($filename, $differ)) {
$subtpl = '<font color=\'#FF0000\'>'.$subtpl.'</font>';
$resetlink = " <a href=\"admincp.php?action=tpledit&templateid=$template[templateid]&fn=$filename&reset=yes\">[$lang[templates_reset]]</a>";
}
if(in_array($filename, $new)) {
$subtpl = '<font color=\'#00FF00\'>'.$subtpl.'</font>';
}
if($allowedittpls) {
$templates .= "<li>$subtpl <a href=\"admincp.php?action=tpledit&templateid=$template[templateid]&fn=$filename&keyword=$keywordenc\">[$lang[edit]]</a> ".
"<a href=\"admincp.php?action=tpledit&templateid=$template[templateid]&fn=$filename&delete=yes\">[$lang[delete]]</a>$resetlink";
} else {
$templates .= "<li>$subtpl <a href=\"admincp.php?action=tpledit&templateid=$template[templateid]&fn=$filename&keyword=$keywordenc\">[$lang[view]]</a> ";
}
}
$templates .= "</ul></ul>\n";
}
foreach($langarray as $langpack) {
$resetlink = '';
$langpackname = $langpack;
if(is_array($differ) && in_array($langpack.'.lang.php', $differ)) {
$langpackname = '<font color=\'#FF0000\'>'.$langpackname.'</font>';
$resetlink = " <a href=\"admincp.php?action=tpledit&templateid=$template[templateid]&fn=$langpack.lang.php&reset=yes\">[$lang[templates_reset]]</a>";
}
if($allowedittpls) {
$languages .= "<ul><li>$langpackname <a href=\"admincp.php?action=tpledit&templateid=$template[templateid]&fn=$langpack.lang.php\">[$lang[edit]]</a>";
$languages .= $template['templateid'] != 1 ? " <a href=\"admincp.php?action=tpledit&templateid=$template[templateid]&fn=$langpack.lang.php&delete=yes\">[$lang[delete]]</a>" : '';
$languages .= "$resetlink</ul>\n";
} else {
$languages .= "<ul><li>$langpackname <a href=\"admincp.php?action=tpledit&templateid=$template[templateid]&fn=$langpack.lang.php\">[$lang[view]]</a>";
$languages .= "</ul>\n";
}
}
shownav('templates_maint');
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td colspan="3"><?=$lang['templates_maint']?> - <?=$template['name']?></td></tr>
<form method="post" action="admincp.php?action=tpladd&edit=<?=$edit?>&">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<tr class="altbg2"><td width="25%"><?=$lang['templates_maint_new']?></td>
<td width="55%"><input type="text" name="name" size="40" maxlength="40"></td>
<td width="20%"><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr></form>
<form method="get" action="admincp.php">
<input type="hidden" name="action" value="templates">
<input type="hidden" name="edit" value="<?=$edit?>">
<tr class="altbg1"><td><?=$lang['templates_maint_search']?></td><td><input type="text" name="keyword" size="40"></td>
<td><input class="button" type="submit" value="<?=$lang['submit']?>"></td></tr></form>
</table><br />
<?
showtips($warning);
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['templates_select']?><?=$keywordadd?></td></tr>
<tr class="altbg1"><td>
<ul><li><b>Discuz! <?=$lang['templates_language_pack']?></b><?=$languages?></ul>
<ul><li><b>Discuz! <?=$lang['templates_html']?></b><?=$templates?></ul>
</td></tr></table>
<?
}
} elseif($action == 'tplcopy') {
checkpermission('tpledit');
$query = $db->query("SELECT directory FROM {$tablepre}templates WHERE templateid='$templateid'");
if(!$srctemplate = $db->fetch_array($query)) {
cpmsg('templates_edit_nonexistence');
}
$query = $db->query("SELECT directory FROM {$tablepre}templates WHERE templateid='$copyto'");
if(!$desctemplate = $db->fetch_array($query)) {
cpmsg('templates_edit_nonexistence');
}
if(!file_exists(DISCUZ_ROOT.$desctemplate['directory'])) {
$directory = $desctemplate['directory'];
cpmsg('templates_directory_invalid');
}
$newfilename = DISCUZ_ROOT.$desctemplate['directory']."/$fn";
if(file_exists($newfilename) && !$confirmed) {
cpmsg('templates_desctpl_exists', "admincp.php?action=tplcopy&templateid=$templateid&fn=$fn©to=$copyto", 'form');
}
if(!copy(DISCUZ_ROOT."./$srctemplate[directory]/$fn", $newfilename)) {
cpmsg('templates_tplcopy_invalid');
}
cpmsg('templates_tplcopy_succeed', "admincp.php?action=tpledit&templateid=$templateid&fn=$fn");
} elseif($action == 'tpledit') {
$allowedittpls = checkpermission('tpledit', 0);
$query = $db->query("SELECT * FROM {$tablepre}templates WHERE templateid='$templateid'");
if(!$template = $db->fetch_array($query)) {
cpmsg('templates_edit_nonexistence');
}
$directorys = '';
$query = $db->query("SELECT templateid, directory FROM {$tablepre}templates WHERE templateid!='$templateid' GROUP BY directory");
while($directory = $db->fetch_array($query)) {
$directorys .='<option value="'.$directory['templateid'].'">'.$directory['directory'].'</option>';
}
$fn = str_replace(array('..', '/', '\\'), array('', '', ''), $fn);
$filename = DISCUZ_ROOT."./$template[directory]/$fn";
if(!is_writeable($filename)) {
cpmsg('templates_edit_invalid');
}
$keywordenc = rawurlencode($keyword);
if(!submitcheck('editsubmit') && $delete != 'yes' && $reset != 'yes') {
$islang = FALSE;
if(preg_match('/\.lang\.php$/i', $filename) && $fn != 'customfaq.lang.php') {
$currentlang = $lang;
$currentmsglang = $msglang;
unset($lang, $msglang);
include $filename;
$islang = TRUE;
$langinputs = '';
isset($actioncode) && $langinputs .= langedit('actioncode');
isset($language) && $langinputs .= langedit('language');
isset($lang) && $langinputs .= langedit('lang');
isset($msglang) && $langinputs .= langedit('msglang');
isset($spacelanguage) && $langinputs .= langedit('spacelanguage');
$lang = $currentlang;
$msglang = $currentmsglang;
} else {
$fp = @fopen($filename, 'rb');
$content = @fread($fp, filesize($filename));
fclose($fp);
}
$resetbutton = $onclickevent = $checkresult = '';
if($template['templateid'] != 1) {
$defaulttpl = DISCUZ_ROOT."./templates/default/$fn";
if(file_exists($defaulttpl) && md5_file($defaulttpl) != md5_file($filename)) {
$resetbutton = ' <input class="button" style="vertical-align: middle" type="button" value="'.$lang['templates_reset'].'" accesskey="r" onclick="location.href=\'admincp.php?action=tpledit&templateid='.$template['templateid'].'&fn='.$fn.'&keyword='.$keywordenc.'&reset=yes\'"> '.
(strtolower(fileext($fn)) == 'htm' ? '<input class="button" style="vertical-align: middle" type="button" value="'.$lang['templates_check'].'" onclick="location.href=\'admincp.php?action=tpledit&templateid='.$template['templateid'].'&fn='.$fn.'&keyword='.$keywordenc.'&checktpl=yes\'"> ' : '');
}
$dellist = $addlist = array();
if($checktpl && strtolower(fileext($fn)) == 'htm') {
$fp = @fopen($defaulttpl, 'rb');
$defaultcontent = @fread($fp, filesize($defaulttpl));
fclose($fp);
if(substr($fn, 0, 3) == 'css') {
$find = "/\.[^\{]+?\s+{/s";
} else {
$find = "/(\<\!\-\-)?\{.+?\}(\-\-\>)?/s";
}
preg_match_all($find, $defaultcontent, $defaultmatch);
preg_match_all($find, $content, $match);
$defaultarray = $matcharray = array();
foreach($defaultmatch[0] as $value) {
while(in_array($value, $defaultarray)) {
$value .= ' ';
}
$defaultarray[] = $value;
}
foreach($match[0] as $value) {
while(in_array($value, $matcharray)) {
$value .= ' ';
}
$matcharray[] = $value;
}
$dellist = dhtmlspecialchars(array_diff($defaultarray, $matcharray));
$addlist = dhtmlspecialchars(array_diff($matcharray, $defaultarray));
if($dellist) {
$checkresult .= '<tr class="category"><td>'.$lang['templates_check_del'].'</td></tr>';
foreach($dellist as $item) {
$checkresult .= '<tr><td class="altbg2">'.trim($item).'</td></tr>';
}
}
if($addlist) {
$checkresult .= '<tr class="category"><td>'.$lang['templates_check_add'].'</td></tr>';
foreach($addlist as $item) {
$checkresult .= '<tr><td class="altbg2">'.trim($item).'</td></tr>';
}
}
$result = '<br /><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder"><tr class="header"><td>'.$lang['templates_check_result'].
' <a href="admincp.php?action=tpledit&templateid=1&fn='.$fn.'&keyword='.$keywordenc.'" target="_blank">['.$lang['templates_default'].']</a></td></tr>';
if($checkresult) {
$result .= $checkresult.'</table>';
} else {
$result .= '<tr><td class="altbg2">'.$lang['templates_check_ok'].'</td></tr></table>';
}
$checkresult = $result;
}
} else {
$onclickevent = 'onclick="return confirm(\''.$lang['templates_edit_default_overwriteconfirm'].'\')"';
}
$content = dhtmlspecialchars($content);
shownav('templates_edit');
$filemtime = date("$dateformat $timeformat", filemtime($filename));
?>
<script language="JavaScript">
var n = 0;
function displayHTML(obj) {
win = window.open(" ", 'popup', 'toolbar = no, status = no, scrollbars=yes');
win.document.write("" + obj.value + "");
}
function HighlightAll(obj) {
obj.focus();
obj.select();
if(document.all) {
obj.createTextRange().execCommand("Copy");
window.status = "<?=$lang['templates_edit_clickboard']?>";
setTimeout("window.status=''", 1800);
}
}
function findInPage(obj, str, noalert) {
var txt, i, found;
if(str == "") {
return false;
}
if(document.layers) {
if(!obj.find(str)) {
while(obj.find(str, false, true)) {
n++;
}
} else {
n++;
}
if(n == 0 && !noalert) {
alert("<?=$lang['templates_edit_keyword_not_found']?>");
}
}
if(document.all) {
txt = obj.createTextRange();
for(i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart('character', 1);
txt.moveEnd('textedit');
}
if(found) {
txt.moveStart('character', -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
return true;
} else {
if(n > 0) {
n = 0;
findInPage(obj, str, noalert);
} else if(!noalert) {
alert("<?=$lang['templates_edit_keyword_not_found']?>");
}
}
}
return false;
}
<?
if($islang) {
?>
var ni = 0;
var niprev = 0;
function MultifindInPage(obj, str) {
for(var i = ni; i < obj.elements.length; i++) {
if(obj.elements[i].type == 'textarea') {
if(findInPage(obj.elements[i], str, 1)) {
ni = i;
break;
}
}
if(i == obj.elements.length - 1) ni = 0;
}
}
<?
}
?>
</script>
<form method="post" action="admincp.php?action=tpledit&templateid=<?=$templateid?>&fn=<?=$fn?>&">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="keyword" value="<?=$keywordenc?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['templates_edit']?> - <?=$template['name']?> <?=$fn?> - <?=$lang['filecheck_filemtime']?>: <?=$filemtime?></td></tr>
<tr><td class="altbg1" align="center"><div align="center">
<?
if($islang) {
?>
<div style="overflow-x: hidden;overflow-y: scroll; width:100%; height: 300px">
<table width="100%" border="0">
<?=$langinputs?>
</table>
</div>
</td></tr><tr><td class="altbg1" align="center"><div align="center">
<?
} else {
?>
<textarea cols="100" rows="25" name="templatenew" style="width: 95%;"><?=$content?></textarea><br />
<?
}
?>
<input name="search" type="text" accesskey="t" size="20" onChange="n=0;">
<?
if($islang) {
?>
<input class="button" type="button" value="<?=$lang['search']?>" accesskey="f" onClick="MultifindInPage(this.form, this.form.search.value)">
<?
} else {
?>
<input class="button" type="button" value="<?=$lang['search']?>" accesskey="f" onClick="findInPage(this.form.templatenew, this.form.search.value)">
<?
}
?>
<input class="button" type="button" value="<?=$lang['return']?>" accesskey="e" onClick="location.href='admincp.php?action=templates&edit=<?=$templateid?>&keyword=<?=$keywordenc?>'">
<input class="button" type="button" value="<?=$lang['preview']?>" accesskey="p" onClick="displayHTML(this.form.templatenew)">
<input class="button" type="button" value="<?=$lang['copy']?>" accesskey="c" onClick="HighlightAll(this.form.templatenew)">
<?
if($allowedittpls) {
echo "<input class=\"button\" type=\"submit\" name=\"editsubmit\" value=\"$lang[submit]\" $onclickevent><br />";
if($directorys) {
echo $lang['templates_copyto_otherdirs']."<select id=\"copyto\" style=\"vertical-align: middle\">".
"$directorys</select> <input style=\"vertical-align: middle\" class=\"button\" type=\"button\" value=\"$lang[templates_start_copy]\" ".
"accesskey=\"r\" onclick=\"if(\$('copyto').value == 1 && confirm('$lang[templates_edit_default_overwriteconfirm]') || \$('copyto').value != 1) location.href='admincp.php?action=tplcopy&templateid={$template['templateid']}&fn={$fn}©to='+\$('copyto').value\">";
}
echo $resetbutton;
}
echo '</div></td></tr></table></form>'.$checkresult;
} elseif($delete == 'yes') {
checkpermission('tpledit');
if(!$confirmed) {
cpmsg('templates_delete_confirm', "admincp.php?action=tpledit&templateid=$templateid&fn=$fn&delete=yes", 'form');
} else {
if(@unlink($filename)) {
cpmsg('templates_delete_succeed', "admincp.php?action=templates&edit=$templateid");
} else {
cpmsg('templates_delete_fail');
}
}
} elseif($reset == 'yes') {
checkpermission('tpledit');
if(!$confirmed) {
cpmsg('templates_reset_confirm', "admincp.php?action=tpledit&templateid=$templateid&fn=$fn&keyword=$keywordenc&reset=yes", 'form');
} else {
$defaultfilename = DISCUZ_ROOT.'./templates/default/'.$fn;
$filename = DISCUZ_ROOT."./$template[directory]/$fn";
if(!copy($defaultfilename, $filename)) {
cpmsg('templates_edit_invalid');
}
cpmsg('templates_reset_succeed', "admincp.php?action=templates&edit=$templateid&keyword=$keywordenc");
}
} else {
checkpermission('tpledit');
if(preg_match('/\.lang\.php$/i', $filename) && $fn != 'customfaq.lang.php') {
$templatenew = '';
foreach($langnew as $key => $value) {
$templatenew .= '$'.$key." = array\n(\n";
foreach($value as $key1 => $value1) {
if(substr($value1, strlen($value1) -1 , 1) == '\\') {
$value1 .= '\\\\';
}
$templatenew .= "\t'$key1' => '".str_replace('\\\\\'', '\\\'', addcslashes(stripslashes(str_replace("\x0d\x0a", "\x0a", $value1)), "'"))."',\n";
}
$templatenew .= ");\n";
}
$templatenew = "<?php\n\n// Language Pack for Discuz! Version 1.0.0\n\n$templatenew\n?>";
} else {
$templatenew = stripslashes(str_replace("\x0d\x0a", "\x0a", $templatenew));
}
$fp = fopen($filename, 'wb');
flock($fp, 2);
fwrite($fp, $templatenew);
fclose($fp);
if(substr(basename($filename), 0, 3) == 'css') {
updatecache('styles');
}
cpmsg('templates_edit_succeed', "admincp.php?action=templates&edit=$templateid&keyword=$keywordenc");
}
} elseif($action == 'tpladd') {
checkpermission('tpledit');
$query = $db->query("SELECT * FROM {$tablepre}templates WHERE templateid='$edit'");
if(!$template = $db->fetch_array($query)) {
cpmsg('templates_add_invalid');
} elseif(!istpldir($template['directory'])) {
$directory = $template['directory'];
cpmsg('templates_directory_invalid');
} elseif(file_exists(DISCUZ_ROOT."./$template[directory]/$name.htm")) {
cpmsg('templates_add_duplicate');
} elseif(!@$fp = fopen(DISCUZ_ROOT."./$template[directory]/$name.htm", 'wb')) {
cpmsg('templates_add_file_invalid');
}
@fclose($fp);
cpmsg('templates_add_succeed', "admincp.php?action=tpledit&templateid=1&fn=$name.htm");
}
function langedit($var) {
$return = '<tr><td colspan="2"><b>'.$var.'</b></td></tr>';
global $$var;
foreach($$var as $key => $value) {
$return .= '<tr><td width="100" style="border:0">'.$key.'</td><td style="border:0"><textarea cols="100" rows="3" name="langnew['.$var.']['.$key.']" style="width: 95%;">'.dhtmlspecialchars($value).'</textarea></td></tr>';
}
return $return;
}
?> | zyyhong | trunk/jiaju001/bbs/admin/templates.inc.php | PHP | asf20 | 22,056 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: header.inc.php 10042 2007-08-23 02:14:14Z heyond $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
@dheader('Content-Type: text/html; charset='.$charset);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" id="css" href="./images/admincp/admincp.css">
<script>
var menus = new Array('basic', 'forums', 'users', 'posts', 'api', 'others', 'tools', 'home', 'insenz');
function togglemenu(id) {
if(parent.menu) {
for(k in menus) {
if(parent.menu.document.getElementById(menus[k])) {
parent.menu.document.getElementById(menus[k]).style.display = menus[k] == id ? '' : 'none';
}
}
}
}
function sethighlight(n) {
var lis = document.getElementsByTagName('li');
for(var i = 0; i < lis.length; i++) {
lis[i].id = '';
}
lis[n].id = 'menuon';
}
<?php
$menu = !empty($_GET['menu']) ? $_GET['menu'] : (!empty($_POST['menu']) ? $_POST['menu'] : 'home');
if($menu) {
echo 'togglemenu("'.$menu.'");';
}
?>
</script>
<script src="include/javascript/common.js" type="text/javascript"></script>
<script src="include/javascript/menu.js" type="text/javascript"></script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="topmenubg">
<tr>
<td rowspan="2" width="160px">
<div class="logo">
<a href="http://www.discuz.net/" target="_blank"><img src="./images/admincp/logo.gif" alt="Discuz!" class="logoimg" border="0"/></a>
<span class="editiontext">Discuz! <span class="editionnumber"><?=$version?></span><br /><?=$lang['admincp']?></span>
</div>
</td><td>
<div class="topmenu">
<ul>
<?if($adminid == 1) {?>
<li><span><a href="#" onclick="sethighlight(0); togglemenu('basic'); parent.main.location='admincp.php?action=settings&do=basic';return false;"><?=$lang['header_basic']?></a></span></li>
<li><span><a href="#" onclick="sethighlight(1); togglemenu('forums'); parent.main.location='admincp.php?action=forumsedit';return false;"><?=$lang['header_forum']?></a></span></li>
<li><span><a href="#" onclick="sethighlight(2); togglemenu('users'); parent.main.location='admincp.php?action=members';return false;"><?=$lang['header_user']?></a></span></li>
<li><span><a href="#" onclick="sethighlight(3); togglemenu('posts'); parent.main.location='admincp.php?action=modthreads';return false;"><?=$lang['header_topic']?></a></span></li>
<li><span><a href="#" onclick="sethighlight(4); togglemenu('api'); parent.main.location='admincp.php?action=pluginsconfig';return false;"><?=$lang['header_extended']?></a></span></li>
<li><span><a href="#" onclick="sethighlight(5); togglemenu('others'); parent.main.location='admincp.php?action=announcements';return false;"><?=$lang['header_misc']?></a></span></li>
<?
echo '<li><span><a href="#" onclick="sethighlight(6); togglemenu(\'insenz\'); parent.main.location=\'admincp.php?action=insenz&operation=campaignlist&c_status=2\';return false;">'.$lang['header_insenz'].'</a></span></li>';
if($isfounder && checkpermission('dbimport', 0)) {
echo '<li><span><a href="#" onclick="sethighlight(7); togglemenu(\'tools\'); parent.main.location=\'admincp.php?action=export\';return false;">'.$lang['header_tools'].'</a></span></li>';
} else {
echo '<li><span><a href="#" onclick="sethighlight(7); togglemenu(\'tools\'); parent.main.location=\'admincp.php?action=counter\';return false;">'.$lang['header_tools'].'</a></span></li>';
}
} else {
?>
<li><span><a href="#" onClick="parent.location='<?=$indexname?>'"><?=$lang['header_home']?></a></span></li>
<li><span><a href="#" onClick="parent.menu.location='admincp.php?action=menu'; parent.main.location='admincp.php?action=home';return false;"><?=$lang['header_admin']?></a></span></li>
<li><span><a href="admincp.php?action=logout&sid=<?=$sid?>" target="_top"><?=$lang['menu_logout']?></a></span></li>
<?}?>
</ul>
</div>
</td></tr>
</table>
</body></html> | zyyhong | trunk/jiaju001/bbs/admin/header.inc.php | PHP | asf20 | 4,208 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: video.inc.php 10417 2007-08-29 06:53:17Z heyond $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
$query = $db->query("SELECT value FROM {$tablepre}settings WHERE variable='videoinfo'");
$settings = unserialize($db->result($query, 0));
if($action == 'videoconfig') {
$settings['bbname'] = $settings['bbname'] ? $settings['bbname'] : $bbname;
$settings['url'] = $settings['url'] ? $settings['url'] : $boardurl;
$settingsnew['sitetype'] = $settings['sitetype'];
$sitetypeselect = $br = '';
if($sitetypearray = explode("\t", $settings['sitetype'])) {
foreach($sitetypearray as $key => $sitetype) {
$br = ($key + 1) % 6 == 0 ? '<br />' : '';
$selected = $settings['type'] == $key + 1 ? 'checked' : '';
$sitetypeselect .= '<input type="radio" class="radio" name="settingsnew[type]" value="'.($key + 1).'" '.$selected.'> '.$sitetype.' '.$br;
}
}
if(!submitcheck('configsubmit')) {
shownav('video_config');
if(empty($settings['email'])) {
showtips('video_tips');
} else {
showtips('video_tips_account');
}
?>
<form method="post" name="settings" action="admincp.php?action=videoconfig">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
showtype('video_config','top');
showsetting('video_open', 'settingsnew[open]', $settings['open'], 'radio');
showtype('video_basic');
showsetting('video_site_name', 'settingsnew[bbname]', $settings['bbname'], 'text');
showsetting('video_site_url', 'settingsnew[url]', $settings['url'], 'text');
showsetting('video_site_email', 'settingsnew[email]', $settings['email'], 'text');
showsetting('video_site_logo', 'settingsnew[logo]', $settings['logo'], 'text');
showsetting('video_site_type', '', '', $sitetypeselect);
showtype('', 'bottom');
echo '<br /><center><input class="button" type="submit" name="configsubmit" value="'.$lang['submit'].'"></form>';
} else {
if($charset != 'utf-8') {
require_once DISCUZ_ROOT.'./include/chinese.class.php';
$chs = new Chinese($charset, 'UTF-8');
$settingsnew['bbnameu8'] = $chs->Convert($settingsnew['bbname']);
} else {
$settingsnew['bbnameu8'] = $settingsnew['bbname'];
}
$settingsnew['vtype'] = str_replace("\r\n", "\n", $settingsnew['vtype']);
$settingsnew['vtype'] = str_replace("\n", "\t", $settingsnew['vtype']);
if($settingsnew['vtype']) {
$sitetypexml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<channels>\n";
foreach(explode("\t", $settingsnew['vtype']) as $key => $typename) {
$sitetypexml .= $typename ? " <channel id='".intval($key + 32)."' name='".($charset != 'utf-8' ? $chs->Convert(htmlspecialchars($typename)) : $typename)."' />\n" : '';
}
$sitetypexml .= "</channels>";
if($fp = @fopen(DISCUZ_ROOT.'./forumdata/video_category.xml', 'wb')) {
fwrite($fp, $sitetypexml);
fclose($fp);
}
}
if(!$settings['vsiteid'] && $settingsnew['open']) {
if(!$settingsnew['bbname'] || !$settingsnew['url'] || !$settingsnew['email'] || !$settingsnew['type']) {
cpmsg('video_config_invalid');
}
$videoinfo = dfopen("http://union.bokecc.com/discuz2/reg.bo?siteName=".urlencode($settingsnew['bbnameu8'])."&siteUrl=".urlencode($settingsnew['url'])."&siteLogo=".urlencode($settingsnew['logo'])."&siteType=".intval($settingsnew['type'])."&siteEmail=".urlencode($settingsnew['email']));
videocheckcode($videoinfo);
$videoinfo = explode(',', $videoinfo);
if($videoinfo[0] != '-1') {
$settingsnew['vsiteid'] = trim($videoinfo[0]);
$settingsnew['vpassword'] = trim($videoinfo[1]);
$settingsnew['vkey'] = trim($videoinfo[2]);
}
} else {
if($settingsnew['bbname'] != $settings['bbname'] || $settingsnew['email'] != $settings['email'] || $settingsnew['url'] != $settings['url'] || $settingsnew['logo'] != $settings['logo'] || $settingsnew['type'] != $settings['type']) {
$code = urlencode(authcode("vpassword=$vpassword&siteName=".urlencode($settingsnew['bbnameu8'])."&siteUrl=".urlencode($settingsnew['url'])."&siteLogo=".urlencode($settingsnew['logo'])."&siteType=".intval($settingsnew['type'])."&siteEmail=".urlencode($settingsnew['email']), 'ENCODE', $vkey));
$videoinfo = dfopen("http://union.bokecc.com/discuz2/edit.bo?siteid=$vsiteid&code=$code");
if($videoinfo == '-1') {
cpmsg('video_error_code_update_error');
}
}
$settingsnew['vsiteid'] = trim($settings['vsiteid']);
$settingsnew['vpassword'] = trim($settings['vpassword']);
$settingsnew['vkey'] = trim($settings['vkey']);
}
$settingsnew['vclasses'] = $settings['vclasses'];
$settingsnew['vclassesable'] = $settings['vclassesable'];
unset($settingsnew['bbnameu8']);
$settingsnew = addslashes(serialize($settingsnew));
$db->query("UPDATE {$tablepre}settings SET value='$settingsnew' WHERE variable='videoinfo'");
updatecache('settings');
cpmsg('video_config_succeed');
}
} elseif($action == 'videobind') {
if(!submitcheck('bindsubmit')) {
shownav('menu_video_bind');
if(empty($vsiteid)) {
showtips('video_tips_bind');
} else {
showtips('video_tips_account_exists');
}
?>
<form method="post" name="settings" action="admincp.php?action=videobind">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
showtype('video_cc_bind','top');
showsetting('video_cc_email', 'settingsnew[vemail]', $settings['email'], 'text');
showsetting('video_cc_password', 'settingsnew[vpassword]', $settings['vpassword'], 'text');
showtype('', 'bottom');
echo '<br /><center><input class="button" type="submit" name="bindsubmit" value="'.$lang['submit'].'"></form>';
} else {
$returninfo = dfopen("http://union.bokecc.com/discuz2/bind.bo?vpassword=$settingsnew[vpassword]&siteEmail=$settingsnew[vemail]");
if(videocheckbind($returninfo)) {
list($vsiteid, $vkey) = explode(',', $returninfo);
$settings['vsiteid'] = $vsiteid;
$settings['vkey'] = $vkey;
$settings['email'] = $settingsnew['vemail'];
$settings['vpassword'] = $settingsnew['vpassword'];
$settings = addslashes(serialize($settings));
$db->query("UPDATE {$tablepre}settings SET value='$settings' WHERE variable='videoinfo'");
updatecache('settings');
cpmsg('video_bind_succeed');
}
}
} elseif($action == 'videoclass') {
$settingsnew['sitetype'] = $settings['sitetype'];
$sitetypeselect = $br = '';
if($sitetypearray = explode("\t", $settings['sitetype'])) {
foreach($sitetypearray as $key => $sitetype) {
$br = ($key + 1) % 6 == 0 ? '<br />' : '';
$selected = $settings['type'] == $key + 1 ? 'checked' : '';
$sitetypeselect .= '<input type="radio" class="radio" name="settingsnew[type]" value="'.($key + 1).'" '.$selected.'> '.$sitetype.' '.$br;
}
}
if(!submitcheck('classsubmit')) {
//vclasses
$vclasses = $settings['vclasses'];
$vclassesable = $settings['vclassesable'];
$insideclasses = $customclasses = '<div style="clear: both; overflow: hidden;">';
for($i=1; $i<33; $i++) {
$checked = in_array($i, $vclassesable) ? ' checked="checked"' : '';
$vclasses[$i] && $insideclasses .= '<li style="list-style: none; width: 100px; float: left;"><input type="checkbox" name="vclassesablenew[]" class="radio"'.$checked.' value="'.$i.'"> '.$vclasses[$i].'</li>';
}
$insideclasses .= '</div>';
for($i=33; $i<45; $i++) {
$checked = in_array($i, $vclassesable) ? ' checked="checked"' : '';
$customclasses .= '<li style="list-style: none; width: 100px; float: left;""><input type="checkbox" name="vclassesablenew[]" class="radio"'.$checked.' value="'.$i.'"> <input type="text" size="8" name="vclassesnew['.$i.']" value="'.$vclasses[$i].'"></li>';
}
$customclasses .= '</div>';
?>
<form method="post" name="settings" action="admincp.php?action=videoclass">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<?
showtype('menu_video_class', 'top');
showsetting('video_class', '', '', $insideclasses.$customclasses);
showtype('', 'bottom');
echo '<br /><center><input class="button" type="submit" name="classsubmit" value="'.$lang['submit'].'"></form>';
} else {
foreach($vclassesnew as $k=>$v) {
$settings['vclasses'][$k] = $vclassesnew[$k];
}
foreach($vclassesnew as $k=>$v) {
if(empty($settings['vclasses'][$k])) {
unset($settings['vclasses'][$k]);
}
}
$settings['vclassesable'] = $vclassesablenew;
$settings = addslashes(serialize($settings));
$db->query("UPDATE {$tablepre}settings SET value='$settings' WHERE variable='videoinfo'");
updatecache('settings');
cpmsg('video_class_update_succeed');
}
}
function videocheckcode($code) {
if($code == '-1') {
cpmsg('video_error_code_email_invalid');
} elseif($code == '-2') {
cpmsg('video_error_code_email_registered');
} elseif($code == '-3') {
cpmsg('video_error_code_url_invalid');
} elseif($code == '-4') {
cpmsg('video_error_code_sitename_invalid');
} elseif($code == '-5') {
cpmsg('video_error_code_sitetype_invalid');
} elseif($code == '-6') {
cpmsg('video_error_code_server_unknown');
} elseif(empty($code)) {
cpmsg('video_error_code_server_busy');
} else {
return TRUE;
}
}
function videocheckbind($code) {
if($code == '-1') {
cpmsg('video_bind_error_code_1');
} elseif($code == '-2') {
cpmsg('video_bind_error_code_2');
} elseif($code == '-3') {
cpmsg('video_bind_error_code_3');
} elseif($code == '-4' || $code == '') {
cpmsg('video_bind_error_code_4');
} else {
return TRUE;
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/video.inc.php | PHP | asf20 | 9,793 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: settings.inc.php 10346 2007-08-27 02:47:20Z tiger $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
$operation = $operation ? $operation : (!empty($do) ? $do : '');
cpheader();
$query = $db->query("SELECT * FROM {$tablepre}settings");
while($setting = $db->fetch_array($query)) {
$settings[$setting['variable']] = $setting['value'];
}
if(!$isfounder) {
unset($settings['ftp']);
}
$extbutton = '';
if(!submitcheck('settingsubmit')) {
shownav($operation == 'basic' ? 'settings_general' : 'settings_'.$operation);
?>
<form method="post" name="settings" id="settings" action="admincp.php?action=settings&edit=yes">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<input type="hidden" name="operation" value="<?=$operation?>">
<?
if($operation == 'access') {
$wmsgcheck = array($settings['welcomemsg'] =>'checked');
$settings['inviteconfig'] = unserialize($settings['inviteconfig']);
$settings['extcredits'] = unserialize($settings['extcredits']);
$buycredits = $rewardcredist = '';
for($i = 0; $i <= 8; $i++) {
$extcredit = 'extcredits'.$i.($settings['extcredits'][$i]['available'] ? ' ('.$settings['extcredits'][$i]['title'].')' : '');
$buycredits .= '<option value="'.$i.'" '.($i == intval($settings['inviteconfig']['invitecredit']) ? 'selected' : '').'>'.($i ? $extcredit : $lang['none']).'</option>';
$rewardcredits .= '<option value="'.$i.'" '.($i == intval($settings['inviteconfig']['inviterewardcredit']) ? 'selected' : '').'>'.($i ? $extcredit : $lang['none']).'</option>';
}
$groupselect = '';
$query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups WHERE type='special'");
while($group = $db->fetch_array($query)) {
$groupselect .= "<option value=\"$group[groupid]\" ".($group['groupid'] == $settings['inviteconfig']['invitegroupid'] ? 'selected' : '').">$group[grouptitle]</option>\n";
}
showtype('settings_subtitle_register', 'top', 'settingsubmit');
showsetting('settings_regstatus', array('settingsnew[regstatus]', array(
array(0, $lang['settings_register_close'], array('showinvite' => 'none')),
array(1, $lang['settings_register_open'], array('showinvite' => 'none')),
array(2, $lang['settings_register_invite'], array('showinvite' => '')),
array(3, $lang['settings_register_open_invite'], array('showinvite' => '')))), $settings['regstatus'], 'mradio');
echo '</tbody><tbody class="sub" id="showinvite" style="display: '.($settings['regstatus'] > 1 ? '' : 'none').'">';
showsetting('settings_register_invite_credit', '', '', '<select name="settingsnew[inviteconfig][inviterewardcredit]">'.$rewardcredits.'</select>');
showsetting('settings_register_invite_addcredit', 'settingsnew[inviteconfig][inviteaddcredit]', $settings['inviteconfig']['inviteaddcredit'], 'text');
showsetting('settings_register_invite_invitedcredit', 'settingsnew[inviteconfig][invitedaddcredit]', $settings['inviteconfig']['invitedaddcredit'], 'text');
showsetting('settings_register_invite_addfriend', 'settingsnew[inviteconfig][inviteaddbuddy]', $settings['inviteconfig']['inviteaddbuddy'], 'radio');
showsetting('settings_register_invite_group', '', '', '<select name="settingsnew[inviteconfig][invitegroupid]"><option value="0">'.$lang['usergroups_system_0'].'</option>'.$groupselect.'</select>');
echo '</tbody><tbody>';
showsetting('settings_reg_name', 'settingsnew[regname]', $settings['regname'], 'text');
showsetting('settings_reglink_name', 'settingsnew[reglinkname]', $settings['reglinkname'], 'text');
showsetting('settings_register_advanced', 'settingsnew[regadvance]', $settings['regadvance'], 'radio');
showsetting('settings_censoruser', 'settingsnew[censoruser]', $settings['censoruser'], 'textarea');
showsetting('settings_regverify', array('settingsnew[regverify]', array(
array(0, $lang['none']),
array(1, $lang['settings_regverify_email']),
array(2, $lang['settings_regverify_manual']))), $settings['regverify'], 'select');
showsetting('settings_doublee', 'settingsnew[doublee]', $settings['doublee'], 'radio');
showsetting('settings_email_allowurl', 'settingsnew[accessemail]', $settings['accessemail'], 'textarea');
showsetting('settings_censoremail', 'settingsnew[censoremail]', $settings['censoremail'], 'textarea');
showsetting('settings_regctrl', 'settingsnew[regctrl]', $settings['regctrl'], 'text');
showsetting('settings_regfloodctrl', 'settingsnew[regfloodctrl]', $settings['regfloodctrl'], 'text');
showsetting('settings_newbiespan', 'settingsnew[newbiespan]', $settings['newbiespan'], 'text');
showsetting('settings_welcomemsg', array('settingsnew[welcomemsg]', array(
array(0, $lang['settings_welcomemsg_nosend'], array('welcomemsgext' => 'none')),
array(1, $lang['settings_welcomemsg_pm'], array('welcomemsgext' => '')),
array(2, $lang['settings_welcomemsg_email'], array('welcomemsgext' => '')))), $settings['welcomemsg'], 'mradio');
echo '</tbody><tbody class="sub" id="welcomemsgext" style="display: '.($settings['welcomemsg'] ? '' : 'none').'">';
showsetting('settings_welcomemsgtitle', 'settingsnew[welcomemsgtitle]', $settings['welcomemsgtitle'], 'text');
showsetting('settings_welcomemsgtxt', 'settingsnew[welcomemsgtxt]', $settings['welcomemsgtxt'], 'textarea');
echo '</tbody><tbody>';
showsetting('settings_bbrules', 'settingsnew[bbrules]', $settings['bbrules'], 'radio', '', '', 1);
showsetting('settings_bbrulestxt', 'settingsnew[bbrulestxt]', $settings['bbrulestxt'], 'textarea');
echo '</tbody></table><br />';
showtype('settings_subtitle_access', 'top', 'settingsubmit');
showsetting('settings_ipregctrl', 'settingsnew[ipregctrl]', $settings['ipregctrl'], 'textarea');
showsetting('settings_ipaccess', 'settingsnew[ipaccess]', $settings['ipaccess'], 'textarea');
showsetting('settings_adminipaccess', 'settingsnew[adminipaccess]', $settings['adminipaccess'], 'textarea');
} elseif($operation == 'styles') {
$stylelist = "<select name=\"settingsnew[styleid]\">\n";
$query = $db->query("SELECT styleid, name FROM {$tablepre}styles");
while($style = $db->fetch_array($query)) {
$selected = $style['styleid'] == $settings['styleid'] ? 'selected="selected"' : NULL;
$stylelist .= "<option value=\"$style[styleid]\" $selected>$style[name]</option>\n";
}
$stylelist .= '</select>';
$showsettings = str_pad(decbin($settings['showsettings']), 3, 0, STR_PAD_LEFT);
$settings['showsignatures'] = $showsettings{0};
$settings['showavatars'] = $showsettings{1};
$settings['showimages'] = $showsettings{2};
$settings['postnocustom'] = implode("\n", (array)unserialize($settings['postnocustom']));
showtips('settings_tips');
showtype('settings_subtitle_style', 'top', 'settingsubmit');
showsetting('settings_styleid', '', '', $stylelist);
showsetting('settings_stylejump', 'settingsnew[stylejump]', $settings['stylejump'], 'radio');
showsetting('settings_frameon', array('settingsnew[frameon]', array(
array(0, $lang['settings_frameon_0'], array('frameonext' => 'none')),
array(1, $lang['settings_frameon_1'], array('frameonext' => '')),
array(2, $lang['settings_frameon_2'], array('frameonext' => '')))), $settings['frameon'], 'mradio');
echo '</tbody><tbody class="sub" id="frameonext" style="display: '.($settings['frameon'] ? '' : 'none').'">';
showsetting('settings_framewidth', 'settingsnew[framewidth]', $settings['framewidth'], 'text');
echo '</tbody></table><br />';
showtype('settings_subtitle_index', 'top', 'settingsubmit');
showsetting('settings_subforumsindex', 'settingsnew[subforumsindex]', $settings['subforumsindex'], 'radio');
showsetting('settings_forumlinkstatus', 'settingsnew[forumlinkstatus]', $settings['forumlinkstatus'], 'radio');
showsetting('settings_index_members', 'settingsnew[maxbdays]', $settings['maxbdays'], 'text');
showsetting('settings_moddisplay', array('settingsnew[moddisplay]', array(
array('flat', $lang['settings_moddisplay_flat']),
array('selectbox', $lang['settings_moddisplay_selectbox']))), $settings['moddisplay'], 'mradio');
showsetting('settings_whosonline', array('settingsnew[whosonlinestatus]', array(
array(0, $lang['settings_display_none']),
array(1, $lang['settings_whosonline_index']),
array(2, $lang['settings_whosonline_forum']),
array(3, $lang['settings_whosonline_both']))), $settings['whosonlinestatus'], 'select');
showsetting('settings_whosonline_contract', 'settingsnew[whosonline_contract]', $settings['whosonline_contract'], 'radio');
showsetting('settings_online_more_members', 'settingsnew[maxonlinelist]', $settings['maxonlinelist'], 'text');
echo '</tbody></table><br />';
showtype('settings_subtitle_forumdisplay', 'top', 'settingsubmit');
showsetting('settings_tpp', 'settingsnew[topicperpage]', $settings['topicperpage'], 'text');
showsetting('settings_threadmaxpages', 'settingsnew[threadmaxpages]', $settings['threadmaxpages'], 'text');
showsetting('settings_hottopic', 'settingsnew[hottopic]', $settings['hottopic'], 'text');
showsetting('settings_fastpost', 'settingsnew[fastpost]', $settings['fastpost'], 'radio');
showsetting('settings_globalstick', 'settingsnew[globalstick]', $settings['globalstick'], 'radio');
showsetting('settings_stick', 'settingsnew[threadsticky]', $settings['threadsticky'], 'text');
echo '</tbody></table><br />';
showtype('settings_subtitle_viewthread', 'top', 'settingsubmit');
showsetting('settings_ppp', 'settingsnew[postperpage]', $settings['postperpage'], 'text');
showsetting('settings_starthreshold', 'settingsnew[starthreshold]', $settings['starthreshold'], 'text');
showsetting('settings_maxsigrows', 'settingsnew[maxsigrows]', $settings['maxsigrows'], 'text');
showsetting('settings_rate_number', 'settingsnew[ratelogrecord]', $settings['ratelogrecord'], 'text');
showsetting('settings_show_signature', 'settingsnew[showsignatures]', $settings['showsignatures'], 'radio');
showsetting('settings_show_face', 'settingsnew[showavatars]', $settings['showavatars'], 'radio');
showsetting('settings_show_images', 'settingsnew[showimages]', $settings['showimages'], 'radio');
showsetting('settings_zoomstatus', 'settingsnew[zoomstatus]', $settings['zoomstatus'], 'radio');
showsetting('settings_vtonlinestatus', array('settingsnew[vtonlinestatus]', array(
array(0, $lang['settings_display_none']),
array(1, $lang['settings_online_easy']),
array(2, $lang['settings_online_exactitude']))), $settings['vtonlinestatus'], 'select');
showsetting('settings_userstatusby', array('settingsnew[userstatusby]', array(
array(0, $lang['settings_display_none']),
array(1, $lang['settings_userstatusby_usergroup']),
array(2, $lang['settings_userstatusby_rank']))), $settings['userstatusby'], 'select');
showsetting('settings_postno', 'settingsnew[postno]', $settings['postno'], 'text');
showsetting('settings_postnocustom', 'settingsnew[postnocustom]', $settings['postnocustom'], 'textarea');
showsetting('settings_maxsmilies', 'settingsnew[maxsmilies]', $settings['maxsmilies'], 'text');
echo '</tbody><tbody><tr><td colspan="2" class="altbg1"><a name="customauthorinfo"></a><b>'.$lang['settings_customauthorinfo'].'</b><br />'.$lang['settings_customauthorinfo_comment'].'</td></tr><tr><td colspan="2" style="padding: 0">';
$authorinfoitems = array(
'uid' => 'UID',
'posts' => $lang['authorinfoitems_posts'],
'digest' => $lang['authorinfoitems_digest'],
'credits' => $lang['authorinfoitems_credits'],
);
if(!empty($extcredits)) {
foreach($extcredits as $key => $value) {
if($value['showinthread']) {
$authorinfoitems['extcredits'.$key] = $value['title'];
}
}
}
$query = $db->query("SELECT fieldid,title FROM {$tablepre}profilefields WHERE available='1' AND invisible='0' AND showinthread='1' ORDER BY displayorder");
while($profilefields = $db->fetch_array($query)) {
$authorinfoitems['field_'.$profilefields['fieldid']] = $profilefields['title'];
}
$authorinfoitems = array_merge($authorinfoitems, array(
'readperm' => $lang['authorinfoitems_readperm'],
'gender' => $lang['authorinfoitems_gender'],
'location' => $lang['authorinfoitems_location'],
'oltime' => $lang['authorinfoitems_oltime'],
'regtime' => $lang['authorinfoitems_regtime'],
'lastdate' => $lang['authorinfoitems_lastdate'],
));
$authorinfoitemsetting = '<table width="100%" cellspacing="0"><tr class="category"><td width="25%"> </td><td width="25%">'.$lang['authorinfoitems_left'].'</td><td width="25%">'.$lang['authorinfoitems_special'].'</td><td width="25%">'.$lang['authorinfoitems_menu'].'</td></tr>';
$settings['customauthorinfo'] = unserialize($settings['customauthorinfo']);
$settings['customauthorinfo'] = $settings['customauthorinfo'][0];
foreach($authorinfoitems as $key => $value) {
$authorinfoitemsetting .= '<tr><td>'.$value.
'</td><td><input name="settingsnew[customauthorinfo]['.$key.'][left]" type="checkbox" class="checkbox" value="1" '.($settings['customauthorinfo'][$key]['left'] ? 'checked' : '').'>'.
'</td><td><input name="settingsnew[customauthorinfo]['.$key.'][special]" type="checkbox" class="checkbox" value="1" '.($settings['customauthorinfo'][$key]['special'] ? 'checked' : '').'>'.
'</td><td><input name="settingsnew[customauthorinfo]['.$key.'][menu]" type="checkbox" class="checkbox" value="1" '.($settings['customauthorinfo'][$key]['menu'] ? 'checked' : '').'>'.
'</td></tr>';
}
$authorinfoitemsetting .= '</table></td></tr></table><br />';
echo $authorinfoitemsetting;
showtype('settings_subtitle_member', 'top', 'settingsubmit');
showsetting('settings_mpp', 'settingsnew[memberperpage]', $settings['memberperpage'], 'text');
showsetting('settings_membermaxpages', 'settingsnew[membermaxpages]', $settings['membermaxpages'], 'text');
echo '</tbody></table><br />';
$settings['msgforward'] = !empty($settings['msgforward']) ? unserialize($settings['msgforward']) : array();
$settings['msgforward']['messages'] = !empty($settings['msgforward']['messages']) ? implode("\n", $settings['msgforward']['messages']) : '';
showtype('settings_subtitle_refresh', 'top', 'settingsubmit');
showsetting('settings_refresh_refreshtime', 'settingsnew[msgforward][refreshtime]', $settings['msgforward']['refreshtime'], 'text');
showsetting('settings_refresh_quick', 'settingsnew[msgforward][quick]', $settings['msgforward']['quick'], 'radio', '', '', 1);
showsetting('settings_refresh_messages', 'settingsnew[msgforward][messages]', $settings['msgforward']['messages'], 'textarea');
echo '</tbody></table><br />';
showtype('settings_subtitle_other', 'top', 'settingsubmit');
showsetting('settings_hideprivate', 'settingsnew[hideprivate]', $settings['hideprivate'], 'radio');
showsetting('settings_visitedforums', 'settingsnew[visitedforums]', $settings['visitedforums'], 'text');
} elseif($operation == 'seo') {
showtips('settings_tips');
showtype('settings_seo', 'top', 'settingsubmit');
showsetting('settings_archiverstatus', array('settingsnew[archiverstatus]', array(
array(0, $lang['settings_archiverstatus_none']),
array(1, $lang['settings_archiverstatus_full']),
array(2, $lang['settings_archiverstatus_searchengine']),
array(3, $lang['settings_archiverstatus_browser']))), $settings['archiverstatus'], 'mradio');
showsetting('settings_rewritestatus', array('settingsnew[rewritestatus]', array(
$lang['settings_rewritestatus_forumdisplay'],
$lang['settings_rewritestatus_viewthread'],
$lang['settings_rewritestatus_space'],
$lang['settings_rewritestatus_tag'],
$lang['settings_rewritestatus_archiver'])), $settings['rewritestatus'], 'mcheckbox');
showsetting('settings_rewritecompatible', 'settingsnew[rewritecompatible]', $settings['rewritecompatible'], 'radio');
showsetting('settings_seotitle', 'settingsnew[seotitle]', $settings['seotitle'], 'text');
showsetting('settings_seokeywords', 'settingsnew[seokeywords]', $settings['seokeywords'], 'text');
showsetting('settings_seodescription', 'settingsnew[seodescription]', $settings['seodescription'], 'text');
showsetting('settings_seohead', 'settingsnew[seohead]', $settings['seohead'], 'textarea');
echo '</tbody></table><br />';
showtype('settings_subtitle_sitemap', 'top', 'settingsubmit');
showsetting('settings_sitemap_baidu_open', 'settingsnew[baidusitemap]', $settings['baidusitemap'], 'radio', '', '', 1);
showsetting('settings_sitemap_baidu_expire', 'settingsnew[baidusitemap_life]', $settings['baidusitemap_life'], 'text');
} elseif($operation == 'functions') {
$jsmenu = array();
$settings['jsmenustatus'] = sprintf('%b', $settings['jsmenustatus']);
for($i = 1; $i <= strlen($settings['jsmenustatus']); $i++) {
$jsmenu[$i] = substr($settings['jsmenustatus'], -$i, 1) ? 'checked' : '';
}
$editoroptions = str_pad(decbin($settings['editoroptions']), 2, 0, STR_PAD_LEFT);
$settings['defaulteditormode'] = $editoroptions{0};
$settings['allowswitcheditor'] = $editoroptions{1};
showtips('settings_tips');
showtype('settings_subtitle_menu', 'top', 'settingsubmit');
showsetting('settings_jsmenu', 'settingsnew[forumjump]', $settings['forumjump'], 'radio');
showsetting('settings_jsmenu_enable', '', '', '<input class="checkbox" type="checkbox" name="settingsnew[jsmenustatus][1]" value="1" '.$jsmenu[1].'> '.$lang['settings_jsmenu_enable_jump'].'<br /><input class="checkbox" type="checkbox" name="settingsnew[jsmenustatus][2]" value="1" '.$jsmenu[2].'> '.$lang['settings_jsmenu_enable_memcp'].'<br /><input class="checkbox" type="checkbox" name="settingsnew[jsmenustatus][3]" value="1" '.$jsmenu[3].'> '.$lang['settings_jsmenu_enable_stat'].'<br /><input class="checkbox" type="checkbox" name="settingsnew[jsmenustatus][4]" value="1" '.$jsmenu[4].'> '.$lang['settings_jsmenu_enable_my'].'<br />');
showsetting('settings_pluginjsmenu', 'settingsnew[pluginjsmenu]', $settings['pluginjsmenu'], 'text');
echo '</tbody></table><br />';
showtype('settings_subtitle_editor', 'top', 'settingsubmit');
showsetting('settings_editor_mode_default', array('settingsnew[defaulteditormode]', array(
array(0, $lang['settings_editor_mode_discuzcode']),
array(1, $lang['settings_editor_mode_wysiwyg']))), $settings['defaulteditormode'], 'mradio');
showsetting('settings_editor_swtich_enable', 'settingsnew[allowswitcheditor]', $settings['allowswitcheditor'], 'radio');
showsetting('settings_bbinsert', 'settingsnew[bbinsert]', $settings['bbinsert'], 'radio');
showsetting('settings_smileyinsert', 'settingsnew[smileyinsert]', $settings['smileyinsert'], 'radio', '', '', 1);
showsetting('settings_smthumb', 'settingsnew[smthumb]', $settings['smthumb'], 'text');
showsetting('settings_smcols', 'settingsnew[smcols]', $settings['smcols'], 'text');
showsetting('settings_smrows', 'settingsnew[smrows]', $settings['smrows'], 'text');
echo '</tbody></table><br />';
showtype('settings_subtitle_stat', 'top', 'settingsubmit');
showsetting('settings_statstatus', 'settingsnew[statstatus]', $settings['statstatus'], 'radio');
showsetting('settings_statscachelife', 'settingsnew[statscachelife]', $settings['statscachelife'], 'text');
showsetting('settings_pvfrequence', 'settingsnew[pvfrequence]', $settings['pvfrequence'], 'text');
showsetting('settings_oltimespan', 'settingsnew[oltimespan]', $settings['oltimespan'], 'text');
echo '</tbody></table><br />';
showtype('settings_subtitle_mod', 'top', 'settingsubmit');
showsetting('settings_modworkstatus', 'settingsnew[modworkstatus]', $settings['modworkstatus'], 'radio');
showsetting('settings_maxmodworksmonths', 'settingsnew[maxmodworksmonths]', $settings['maxmodworksmonths'], 'text');
showsetting('settings_myfunction_savetime', 'settingsnew[myrecorddays]', $settings['myrecorddays'], 'text');
showsetting('settings_losslessdel', 'settingsnew[losslessdel]', $settings['losslessdel'], 'text');
showsetting('settings_modreasons', 'settingsnew[modreasons]', $settings['modreasons'], 'textarea');
showsetting('settings_bannedmessages', 'settingsnew[bannedmessages]', $settings['bannedmessages'], 'radio');
echo '</tbody></table><br /><a name="subtitle_tags"></a>';
showtype('settings_subtitle_tags', 'top', '');
showsetting('settings_tagstatus', 'settingsnew[tagstatus]', $settings['tagstatus'], 'radio', '', '', 1);
showsetting('settings_index_hottags', 'settingsnew[hottags]', $settings['hottags'], 'text');
showsetting('settings_viewthtrad_hottags', 'settingsnew[viewthreadtags]', $settings['viewthreadtags'], 'text');
echo '</tbody></table><br />';
showtype('settings_subtitle_other', 'top', '');
showsetting('settings_rssstatus', 'settingsnew[rssstatus]', $settings['rssstatus'], 'radio');
showsetting('settings_rssttl', 'settingsnew[rssttl]', $settings['rssttl'], 'text');
showsetting('settings_csscache', 'settingsnew[allowcsscache]', $settings['allowcsscache'], 'radio');
showsetting('settings_send_birthday', 'settingsnew[bdaystatus]', $settings['bdaystatus'], 'radio');
showsetting('settings_debug', 'settingsnew[debug]', $settings['debug'], 'radio');
showsetting('settings_activity_type', 'settingsnew[activitytype]', $settings['activitytype'], 'textarea');
} elseif($operation == 'credits') {
showtips('settings_credits_tips');
if(!empty($projectid)) {
$query = $db->query("SELECT value FROM {$tablepre}projects WHERE id='$projectid'");
$settings = @array_merge($settings, unserialize($db->result($query, 0)));
}
$projectselect = "<select name=\"projectid\" onchange=\"window.location='admincp.php?action=settings&do=credits&projectid='+this.options[this.options.selectedIndex].value\"><option value=\"0\" selected=\"selected\">".$lang['none']."</option>";
$query = $db->query("SELECT id, name FROM {$tablepre}projects WHERE type='extcredit'");
while($project = $db->fetch_array($query)) {
$projectselect .= "<option value=\"$project[id]\" ".($project['id'] == $projectid ? 'selected="selected"' : NULL).">$project[name]</option>\n";
}
$projectselect .= '</select>';
showtype('settings_credits_scheme_title', 'top');
showsetting('settings_credits_scheme', '', '', $projectselect);
echo '</tbody></table><br />';
echo '<script>
function switchpolicy(obj, col) {
var status = !obj.checked;
$("policy" + col).disabled = status;
var policytable = $("policytable");
for(var row=2; row<14; row++) {
if(is_opera) {
policytable.rows[row].cells[col].firstChild.disabled = true;
} else {
policytable.rows[row].cells[col].disabled = status;
}
}
}
</script>';
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'.
'<tr class="header"><td colspan="9">'.$lang['settings_credits_extended'].'</td></tr>'.
'<tr align="center" class="category"><td>'.$lang['credits_id'].'</td><td>'.$lang['credits_title'].'</td><td>'.$lang['credits_unit'].'</td><td>'.$lang['settings_credits_ratio'].'</td><td>'.$lang['settings_credits_init'].'</td><td>'.$lang['settings_credits_available'].'</td><td>'.$lang['settings_credits_show_in_thread'].'</td><td>'.$lang['credits_inport'].'</td><td>'.$lang['credits_import'].'</td></tr>';
$settings['extcredits'] = unserialize($settings['extcredits']);
$settings['initcredits'] = explode(',', $settings['initcredits']);
for($i = 1; $i <= 8; $i++) {
echo "<tr align=\"center\"><td class=\"altbg1\">extcredits$i</td>".
"<td class=\"altbg2\"><input type=\"text\" size=\"8\" name=\"settingsnew[extcredits][$i][title]\" value=\"{$settings['extcredits'][$i]['title']}\"></td>".
"<td class=\"altbg1\"><input type=\"text\" size=\"5\" name=\"settingsnew[extcredits][$i][unit]\" value=\"{$settings['extcredits'][$i]['unit']}\"></td>".
"<td class=\"altbg2\"><input type=\"text\" size=\"3\" name=\"settingsnew[extcredits][$i][ratio]\" value=\"".(float)$settings['extcredits'][$i]['ratio']."\" onkeyup=\"if(this.value != '0' && \$('allowexchangeout$i').checked == false && \$('allowexchangein$i').checked == false) {\$('allowexchangeout$i').checked = true;\$('allowexchangein$i').checked = true;} else if(this.value == '0') {\$('allowexchangeout$i').checked = false;\$('allowexchangein$i').checked = false;}\"></td>".
"<td class=\"altbg1\"><input type=\"text\" size=\"3\" name=\"settingsnew[initcredits][$i]\" value=\"".intval($settings['initcredits'][$i])."\"></td>".
"<td class=\"altbg2\"><input class=\"checkbox\" type=\"checkbox\" name=\"settingsnew[extcredits][$i][available]\" value=\"1\" ".($settings['extcredits'][$i]['available'] ? 'checked' : '')." onclick=\"switchpolicy(this, $i)\"></td>".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"settingsnew[extcredits][$i][showinthread]\" value=\"1\" ".($settings['extcredits'][$i]['showinthread'] ? 'checked' : '')."></td>".
"<td class=\"altbg2\"><input class=\"checkbox\" type=\"checkbox\" size=\"3\" name=\"settingsnew[extcredits][$i][allowexchangeout]\" value=\"1\" ".($settings['extcredits'][$i]['allowexchangeout'] ? 'checked' : '')." id=\"allowexchangeout$i\"></td>".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" size=\"3\" name=\"settingsnew[extcredits][$i][allowexchangein]\" value=\"1\" ".($settings['extcredits'][$i]['allowexchangein'] ? 'checked' : '')." id=\"allowexchangein$i\"></td></tr>";
}
echo '<tr><td class="altbg1" colspan="9">'.$lang['settings_credits_extended_comment'].'</td></tr>'.
'</table><br />';
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder" id="policytable">'.
'<tr class="header"><td colspan="11">'.$lang['settings_credits_policy'].'</td></tr>'.'<tr align="center" class="category"><td width="12%">'.$lang['credits_id'].'</td>';
$settings['creditspolicy'] = unserialize($settings['creditspolicy']);
for($i = 1; $i <= 8; $i++) {
echo "<td id=\"policy$i\" ".($settings['extcredits'][$i]['available'] ? '' : 'disabled')." class=\"category\" align=\"center\"> extcredits$i<br />".($settings['extcredits'][$i]['title'] ? '('.$settings['extcredits'][$i]['title'].')' : '')."</td>";
}
echo '<tr align="center" class="altbg1" title="'.$lang['settings_credits_policy_post_comment'].'"><td>'.$lang['settings_credits_policy_post'].'</td>'.creditsrow('post').'</tr>'.
'<tr align="center" class="altbg1" title="'.$lang['settings_credits_policy_reply_comment'].'"><td>'.$lang['settings_credits_policy_reply'].'</td>'.creditsrow('reply').'</tr>'.
'<tr align="center" class="altbg1" title="'.$lang['settings_credits_policy_digest_comment'].'"><td>'.$lang['settings_credits_policy_digest'].'</td>'.creditsrow('digest').'</tr>'.
'<tr align="center" class="altbg1" title="'.$lang['settings_credits_policy_post_attach_comment'].'"><td>'.$lang['settings_credits_policy_post_attach'].'</td>'.creditsrow('postattach').'</tr>'.
'<tr align="center" class="altbg1" title="'.$lang['settings_credits_policy_get_attach_comment'].'"><td>'.$lang['settings_credits_policy_get_attach'].'</td>'.creditsrow('getattach').'</tr>'.
'<tr align="center" class="altbg1" title="'.$lang['settings_credits_policy_send_pm_comment'].'"><td>'.$lang['settings_credits_policy_send_pm'].'</td>'.creditsrow('pm').'</tr>'.
'<tr align="center" class="altbg1" title="'.$lang['settings_credits_policy_search_comment'].'"><td>'.$lang['settings_credits_policy_search'].'</td>'.creditsrow('search').'</tr>'.
'<tr align="center" class="altbg1" title="'.$lang['settings_credits_policy_promotion_visit_comment'].'"><td>'.$lang['settings_credits_policy_promotion_visit'].'</td>'.creditsrow('promotion_visit').'</tr>'.
'<tr align="center" class="altbg1" title="'.$lang['settings_credits_policy_promotion_register_comment'].'"><td>'.$lang['settings_credits_policy_promotion_register'].'</td>'.creditsrow('promotion_register').'</tr>'.
'<tr align="center" class="altbg1" title="'.$lang['settings_credits_policy_trade_comment'].'"><td>'.$lang['settings_credits_policy_trade'].'(+)</td>'.creditsrow('tradefinished').'</tr>'.
'<tr align="center" class="altbg1" title="'.$lang['settings_credits_policy_poll_comment'].'"><td>'.$lang['settings_credits_policy_poll'].'(+)</td>'.creditsrow('votepoll').'</tr>'.
'<tr align="center" class="altbg1" title="'.$lang['settings_credits_lowerlimit_comment'].'"><td>'.$lang['settings_credits_lowerlimit'].'</td>'.creditsrow('lowerlimit').'</tr>'.
'<tr><td class="altbg1" colspan="12">'.$lang['settings_credits_policy_comment'].'</td></tr></table><br />';
showtype('settings_credits', 'top', 'settingsubmit');
showsetting('settings_creditsformula', 'settingsnew[creditsformula]', $settings['creditsformula'], 'textarea');
$creditstrans = '';
for($i = 0; $i <= 8; $i++) {
$creditstrans .= '<option value="'.$i.'" '.($i == intval($settings['creditstrans']) ? 'selected' : '').'>'.($i ? 'extcredits'.$i.($settings['extcredits'][$i]['title'] ? '('.$settings['extcredits'][$i]['title'].')' : '') : $lang['none']).'</option>';
}
showsetting('settings_creditstrans', '', '', '<select name="settingsnew[creditstrans]">'.$creditstrans.'</select>');
showsetting('settings_creditstax', 'settingsnew[creditstax]', $settings['creditstax'], 'text');
showsetting('settings_transfermincredits', 'settingsnew[transfermincredits]', $settings['transfermincredits'], 'text');
showsetting('settings_exchangemincredits', 'settingsnew[exchangemincredits]', $settings['exchangemincredits'], 'text');
showsetting('settings_maxincperthread', 'settingsnew[maxincperthread]', $settings['maxincperthread'], 'text');
showsetting('settings_maxchargespan', 'settingsnew[maxchargespan]', $settings['maxchargespan'], 'text');
$extbutton = ' <input name="projectsave" type="hidden" value="0"><input class="button" type="button" onclick="$(\'settings\').projectsave.value=1;$(\'settings\').settingsubmit.click()" value="'.$lang['saveconf'].'">';
} elseif($operation == 'serveropti') {
$checkgzipfunc = !function_exists('ob_gzhandler') ? 1 : 0;
showtips('settings_tips');
showtype('settings_serveropti', 'top', 'settingsubmit');
showsetting('settings_gzipcompress', 'settingsnew[gzipcompress]', $settings['gzipcompress'], 'radio', '', $checkgzipfunc);
showsetting('settings_delayviewcount', array('settingsnew[delayviewcount]', array(
array(0, $lang['none']),
array(1, $lang['settings_delayviewcount_thread']),
array(2, $lang['settings_delayviewcount_attach']),
array(3, $lang['settings_delayviewcount_thread_attach']))), $settings['delayviewcount'], 'select');
showsetting('settings_nocacheheaders', 'settingsnew[nocacheheaders]', $settings['nocacheheaders'], 'radio');
showsetting('settings_transsidstatus', 'settingsnew[transsidstatus]', $settings['transsidstatus'], 'radio');
showsetting('settings_maxonlines', 'settingsnew[maxonlines]', $settings['maxonlines'], 'text');
showsetting('settings_onlinehold', 'settingsnew[onlinehold]', $settings['onlinehold'], 'text');
showsetting('settings_loadctrl', 'settingsnew[loadctrl]', $settings['loadctrl'], 'text');
showsetting('settings_floodctrl', 'settingsnew[floodctrl]', $settings['floodctrl'], 'text');
echo '</tbody></table><br />';
showtype('settings_subtitle_search', 'top', 'settingsubmit');
showsetting('settings_searchctrl', 'settingsnew[searchctrl]', $settings['searchctrl'], 'text');
showsetting('settings_maxspm', 'settingsnew[maxspm]', $settings['maxspm'], 'text');
showsetting('settings_maxsearchresults', 'settingsnew[maxsearchresults]', $settings['maxsearchresults'], 'text');
} elseif($operation == 'seccode') {
$checksc = array();
$settings['seccodedata'] = unserialize($settings['seccodedata']);
$seccodetypearray = array(
array(0, $lang['settings_seccodetype_image'], array('seccodeimageext' => '')),
array(1, $lang['settings_seccodetype_chnfont'], array('seccodeimageext' => ''))
);
extension_loaded('ming') && $seccodetypearray[] = array(2, $lang['settings_seccodetype_flash'], array('seccodeimageext' => 'none'));
showtips('settings_seccode_tips');
showtype('settings_seccode', 'top', 'settingsubmit');
showsetting('settings_seccodestatus', array('settingsnew[seccodestatus]', array(
$lang['settings_seccodestatus_register'],
$lang['settings_seccodestatus_login'],
$lang['settings_seccodestatus_post'],
$lang['settings_seccodestatus_sendpm'],
$lang['settings_seccodestatus_profile'])), $settings['seccodestatus'], 'mcheckbox');
showsetting('settings_seccodeminposts', 'settingsnew[seccodedata][minposts]', $settings['seccodedata']['minposts'], 'text');
showsetting('settings_seccodeloginfailedcount', 'settingsnew[seccodedata][loginfailedcount]', $settings['seccodedata']['loginfailedcount'], 'radio');
showsetting('settings_seccodewidth', 'settingsnew[seccodedata][width]', $settings['seccodedata']['width'], 'text');
showsetting('settings_seccodeheight', 'settingsnew[seccodedata][height]', $settings['seccodedata']['height'], 'text');
showsetting('settings_seccodetype', array('settingsnew[seccodedata][type]', $seccodetypearray), $settings['seccodedata']['type'], 'mradio');
echo '</tbody><tbody class="sub" id="seccodeimageext" style="display: '.($settings['seccodedata']['type'] != 2 ? '' : 'none').'">';
showsetting('settings_seccodebackground', 'settingsnew[seccodedata][background]', $settings['seccodedata']['background'], 'radio');
showsetting('settings_seccodeadulterate', 'settingsnew[seccodedata][adulterate]', $settings['seccodedata']['adulterate'], 'radio');
showsetting('settings_seccodettf', 'settingsnew[seccodedata][ttf]', $settings['seccodedata']['ttf'], 'radio', '', !function_exists('imagettftext'));
showsetting('settings_seccodeangle', 'settingsnew[seccodedata][angle]', $settings['seccodedata']['angle'], 'radio');
showsetting('settings_seccodecolor', 'settingsnew[seccodedata][color]', $settings['seccodedata']['color'], 'radio');
showsetting('settings_seccodesize', 'settingsnew[seccodedata][size]', $settings['seccodedata']['size'], 'radio');
showsetting('settings_seccodeshadow', 'settingsnew[seccodedata][shadow]', $settings['seccodedata']['shadow'], 'radio');
showsetting('settings_seccodeanimator', 'settingsnew[seccodedata][animator]', $settings['seccodedata']['animator'], 'radio', '', !function_exists('imagegif'));
echo '<script language="JavaScript">var seccodedata = ['.$settings['seccodedata']['width'].', '.$settings['seccodedata']['height'].', '.$settings['seccodedata']['type'].'];updateseccode()</script>';
} elseif($operation == 'secqaa') {
$settings['secqaa'] = unserialize($settings['secqaa']);
$page = max(1, intval($page));
$start_limit = ($page - 1) * 10;
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}itempool");
$secqaanums = $db->result($query, 0);
$multipage = multi($secqaanums, 10, $page, 'admincp.php?action=settings&do=secqaa');
$query = $db->query("SELECT * FROM {$tablepre}itempool LIMIT $start_limit, 10");
$secqaa = '';
while($item = $db->fetch_array($query)) {
$secqaa .= '<tr align="center"><td class="altbg1" ><input class="checkbox" type="checkbox" name="delete[]" value="'.$item['id'].'"></td><td class="altbg1"><textarea name="question['.$item['id'].']" rows="3" cols="60">'.dhtmlspecialchars($item['question']).'</textarea></td><td class="altbg2"><input type="text" name="answer['.$item['id'].']" size="30" maxlength="50" value="'.$item['answer'].'"></td></tr>';
}
showtips('settings_secqaa_tips');
showtype('settings_secqaa', 'top', 'settingsubmit');
showsetting('settings_secqaa_status', array('settingsnew[secqaa][status]', array(
$lang['settings_seccodestatus_register'],
$lang['settings_seccodestatus_post'],
$lang['settings_seccodestatus_sendpm'])), $settings['secqaa']['status'], 'mcheckbox');
showsetting('settings_secqaa_minposts', 'settingsnew[secqaa][minposts]', $settings['secqaa']['minposts'], 'text');
echo '</table><br /><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'.
'<tr class="header"><td colspan="3">'.$lang['settings_secqaa_qaa'].'</td></tr>';
echo '<tr class="category"><td><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form, \'delete\')">'.$lang['del'].'</td><td>'.$lang['settings_secqaa_question'].'</td><td>'.$lang['settings_secqaa_answer'].'</td></tr>'.
$secqaa.($multipage ? '<tr><td colspan=5>'.$multipage.'</td></tr>' : '').'<tbody id="secqaabody"><tr align="center"><td class="altbg1">'.$lang['add_new'].'<a href="###" onclick="newnode = $(\'secqaabodyhidden\').firstChild.cloneNode(true); $(\'secqaabody\').appendChild(newnode)">[+]</a></td><td class="altbg1"><textarea name="newquestion[]" rows="3" cols="60"></textarea></td><td class="altbg2"><input type="text" name="newanswer[]" size="30" maxlength="50"></td></tr></tbody><tbody id="secqaabodyhidden" style="display:none"><tr align="center"><td class="altbg1"></td><td class="altbg1"><textarea name="newquestion[]" rows="3" cols="60"></textarea></td><td class="altbg2"><input type="text" name="newanswer[]" size="30" maxlength="50"></td></tr></tbody>';
echo '<tr><td colspan=3>'.$lang['settings_secqaa_comment'].'</td></tr></table>';
} elseif($operation == 'datetime') {
$checktimeformat = array($settings['timeformat'] == 'H:i' ? 24 : 12 => 'checked');
$settings['userdateformat'] = dateformat($settings['userdateformat']);
$settings['dateformat'] = dateformat($settings['dateformat']);
showtype('settings_subtitle_datetime', 'top', 'settingsubmit');
showsetting('settings_dateformat', 'settingsnew[dateformat]', $settings['dateformat'], 'text');
showsetting('settings_timeformat', '', '', '<input class="radio" type="radio" name="settingsnew[timeformat]" value="24" '.$checktimeformat[24].'> 24 '.$lang['hour'].' <input class="radio" type="radio" name="settingsnew[timeformat]" value="12" '.$checktimeformat[12].'> 12 '.$lang['hour'].'');
showsetting('settings_timeoffset', 'settingsnew[timeoffset]', $settings['timeoffset'], 'text');
showsetting('settings_customformat', 'settingsnew[userdateformat]', $settings['userdateformat'], 'textarea');
echo '</tbody></table><br />';
showtype('settings_subtitle_periods', 'top', 'settingsubmit');
showsetting('settings_visitbanperiods', 'settingsnew[visitbanperiods]', $settings['visitbanperiods'], 'textarea');
showsetting('settings_postbanperiods', 'settingsnew[postbanperiods]', $settings['postbanperiods'], 'textarea');
showsetting('settings_postmodperiods', 'settingsnew[postmodperiods]', $settings['postmodperiods'], 'textarea');
showsetting('settings_ban_downtime', 'settingsnew[attachbanperiods]', $settings['attachbanperiods'], 'textarea');
showsetting('settings_searchbanperiods', 'settingsnew[searchbanperiods]', $settings['searchbanperiods'], 'textarea');
} elseif($operation == 'permissions') {
showtype('settings_permissions', 'top', 'settingsubmit');
showsetting('settings_memliststatus', 'settingsnew[memliststatus]', $settings['memliststatus'], 'radio');
showsetting('settings_reportpost', array('settingsnew[reportpost]', array(
array(0, $lang['settings_reportpost_none']),
array(1, $lang['settings_reportpost_level_1']),
array(2, $lang['settings_reportpost_level_2']),
array(3, $lang['settings_reportpost_level_3']))), $settings['reportpost'], 'select');
showsetting('settings_minpostsize', 'settingsnew[minpostsize]', $settings['minpostsize'], 'text');
showsetting('settings_maxpostsize', 'settingsnew[maxpostsize]', $settings['maxpostsize'], 'text');
showsetting('settings_favorite_storage', 'settingsnew[maxfavorites]', $settings['maxfavorites'], 'text');
showsetting('settings_subscriptions', 'settingsnew[maxsubscriptions]', $settings['maxsubscriptions'], 'text');
showsetting('settings_maxavatarsize', 'settingsnew[maxavatarsize]', $settings['maxavatarsize'], 'text');
showsetting('settings_maxavatarpixel', 'settingsnew[maxavatarpixel]', $settings['maxavatarpixel'], 'text');
showsetting('settings_maxpolloptions', 'settingsnew[maxpolloptions]', $settings['maxpolloptions'], 'text');
showsetting('settings_edittimelimit', 'settingsnew[edittimelimit]', $settings['edittimelimit'], 'text');
showsetting('settings_editby', 'settingsnew[editedby]', $settings['editedby'], 'radio');
echo '</tbody></table><br />';
showtype('settings_subtitle_rate', 'top', 'settingsubmit');
showsetting('settings_karmaratelimit', 'settingsnew[karmaratelimit]', $settings['karmaratelimit'], 'text');
showsetting('settings_modratelimit', 'settingsnew[modratelimit]', $settings['modratelimit'], 'radio');
showsetting('settings_dupkarmarate', 'settingsnew[dupkarmarate]', $settings['dupkarmarate'], 'radio');
} elseif($operation == 'attachments') {
$checkwm = array($settings['watermarkstatus'] => 'checked');
$checkmkdirfunc = !function_exists('mkdir') ? 'disabled' : '';
$settings['watermarktext'] = unserialize($settings['watermarktext']);
$settings['watermarktext']['fontpath'] = str_replace(array('ch/', 'en/'), '', $settings['watermarktext']['fontpath']);
showtype('settings_attachments', 'top', 'settingsubmit');
showsetting('settings_attachdir', 'settingsnew[attachdir]', $settings['attachdir'], 'text');
showsetting('settings_attachurl', 'settingsnew[attachurl]', $settings['attachurl'], 'text');
showsetting('settings_attachimgpost', 'settingsnew[attachimgpost]', $settings['attachimgpost'], 'radio');
showsetting('settings_attachrefcheck', 'settingsnew[attachrefcheck]', $settings['attachrefcheck'], 'radio');
showsetting('settings_attachsave', array('settingsnew[attachsave]', array(
array(0, $lang['settings_attachsave_default']),
array(1, $lang['settings_attachsave_forum']),
array(2, $lang['settings_attachsave_type']),
array(3, $lang['settings_attachsave_month']),
array(4, $lang['settings_attachsave_day']))), $settings['attachsave'], 'select', '', $checkmkdirfunc);
echo '</tbody></table><br />';
showtype('settings_pictureattachments', 'top', 'settingsubmit');
showsetting('settings_imagelib', array('settingsnew[imagelib]', array(
array(0, $lang['settings_watermarktype_GD'], array('imagelibext' => 'none')),
array(1, $lang['settings_watermarktype_IM'], array('imagelibext' => '')))), $settings['imagelib'], 'mradio');
echo '</tbody><tbody class="sub" id="imagelibext" style="display: '.($settings['imagelib'] ? '' : 'none').'">';
showsetting('settings_imageimpath', 'settingsnew[imageimpath]', $settings['imageimpath'], 'text');
echo '</tbody><tbody>';
showsetting('settings_thumbstatus', array('settingsnew[thumbstatus]', array(
array(0, $lang['settings_thumbstatus_none']),
array(1, $lang['settings_thumbstatus_add']),
array(2, $lang['settings_thumbstatus_replace']))), $settings['thumbstatus'], 'mradio');
showsetting('settings_thumbwidthheight', '', '', '<input name="settingsnew[thumbwidth]" size="20" value="'.intval($settings['thumbwidth']).'"> <span style="vertical-align: middle">X</span> <input name="settingsnew[thumbheight]" size="20" value="'.intval($settings['thumbheight']).'">');
showsetting('settings_watermarkstatus', '', '', '<table cellspacing="'.INNERBORDERWIDTH.'" cellpadding="'.TABLESPACE.'" class="tableborder" style="margin-bottom: 3px; margin-top:3px;"><tr><td colspan="3"><input class="radio" type="radio" name="settingsnew[watermarkstatus]" value="0" '.$checkwm[0].'>'.$lang['settings_watermarkstatus_none'].'</td></tr><tr align="center" class="altbg2"><td><input class="radio" type="radio" name="settingsnew[watermarkstatus]" value="1" '.$checkwm[1].'> #1</td><td><input class="radio" type="radio" name="settingsnew[watermarkstatus]" value="2" '.$checkwm[2].'> #2</td><td><input class="radio" type="radio" name="settingsnew[watermarkstatus]" value="3" '.$checkwm[3].'> #3</td></tr><tr align="center" class="altbg2"><td><input class="radio" type="radio" name="settingsnew[watermarkstatus]" value="4" '.$checkwm[4].'> #4</td><td><input class="radio" type="radio" name="settingsnew[watermarkstatus]" value="5" '.$checkwm[5].'> #5</td><td><input class="radio" type="radio" name="settingsnew[watermarkstatus]" value="6" '.$checkwm[6].'> #6</td></tr><tr align="center" class="altbg2"><td><input class="radio" type="radio" name="settingsnew[watermarkstatus]" value="7" '.$checkwm[7].'> #7</td><td><input class="radio" type="radio" name="settingsnew[watermarkstatus]" value="8" '.$checkwm[8].'> #8</td><td><input class="radio" type="radio" name="settingsnew[watermarkstatus]" value="9" '.$checkwm[9].'> #9</td></tr></table>');
showsetting('settings_watermarkminwidthheight', '', '', '<input name="settingsnew[watermarkminwidth]" size="20" value="'.intval($settings['watermarkminwidth']).'"> <span style="vertical-align: middle">X</span> <input name="settingsnew[watermarkminheight]" size="20" value="'.intval($settings['watermarkminheight']).'">');
showsetting('settings_watermarktype', array('settingsnew[watermarktype]', array(
array(0, $lang['settings_watermarktype_gif'], array('watermarktypeext' => 'none')),
array(1, $lang['settings_watermarktype_png'], array('watermarktypeext' => 'none')),
array(2, $lang['settings_watermarktype_text'], array('watermarktypeext' => '')))), $settings['watermarktype'], 'mradio');
showsetting('settings_watermarktrans', 'settingsnew[watermarktrans]', $settings['watermarktrans'], 'text');
showsetting('settings_watermarkquality', 'settingsnew[watermarkquality]', $settings['watermarkquality'], 'text');
echo '</tbody><tbody class="sub" id="watermarktypeext" style="display: '.($settings['watermarktype'] == 2 ? '' : 'none').'">';
showsetting('settings_watermarktext_text', 'settingsnew[watermarktext][text]', $settings['watermarktext']['text'], 'textarea');
showsetting('settings_watermarktext_fontpath', 'settingsnew[watermarktext][fontpath]', $settings['watermarktext']['fontpath'], 'text');
showsetting('settings_watermarktext_size', 'settingsnew[watermarktext][size]', $settings['watermarktext']['size'], 'text');
showsetting('settings_watermarktext_angle', 'settingsnew[watermarktext][angle]', $settings['watermarktext']['angle'], 'text');
showsetting('settings_watermarktext_color', 'settingsnew[watermarktext][color]', $settings['watermarktext']['color'], 'color');
showsetting('settings_watermarktext_shadowx', 'settingsnew[watermarktext][shadowx]', $settings['watermarktext']['shadowx'], 'text');
showsetting('settings_watermarktext_shadowy', 'settingsnew[watermarktext][shadowy]', $settings['watermarktext']['shadowy'], 'text');
showsetting('settings_watermarktext_shadowcolor', 'settingsnew[watermarktext][shadowcolor]', $settings['watermarktext']['shadowcolor'], 'color');
showsetting('settings_watermarktext_imtranslatex', 'settingsnew[watermarktext][translatex]', $settings['watermarktext']['translatex'], 'text');
showsetting('settings_watermarktext_imtranslatey', 'settingsnew[watermarktext][translatey]', $settings['watermarktext']['translatey'], 'text');
showsetting('settings_watermarktext_imskewx', 'settingsnew[watermarktext][skewx]', $settings['watermarktext']['skewx'], 'text');
showsetting('settings_watermarktext_imskewy', 'settingsnew[watermarktext][skewy]', $settings['watermarktext']['skewy'], 'text');
if($isfounder) {
$settings['ftp'] = unserialize($settings['ftp']);
$settings['ftp'] = is_array($settings['ftp']) ? $settings['ftp'] : array();
$settings['ftp']['password'] = authcode($settings['ftp']['password'], 'DECODE', md5($authkey));
$settings['ftp']['password'] = $settings['ftp']['password'] ? $settings['ftp']['password']{0}.'********'.$settings['ftp']['password']{strlen($settings['ftp']['password']) - 1} : '';
echo '</tbody></table><br />';
showtype('settings_remote', 'top', 'settingsubmit');
showsetting('settings_remote_enabled', array('settingsnew[ftp][on]', array(
array(1, $lang['yes'], array('ftpext' => '', 'ftpcheckbutton' => '')),
array(0, $lang['no'], array('ftpext' => 'none', 'ftpcheckbutton' => 'none')))), $settings['ftp']['on'], 'mradio');
echo '</tbody><tbody class="sub" id="ftpext" style="display: '.($settings['ftp']['on'] ? '' : 'none').'">';
showsetting('settings_remote_enabled_ssl', 'settingsnew[ftp][ssl]', $settings['ftp']['ssl'], 'radio');
showsetting('settings_remote_ftp_host', 'settingsnew[ftp][host]', $settings['ftp']['host'], 'text');
showsetting('settings_remote_ftp_port', 'settingsnew[ftp][port]', $settings['ftp']['port'], 'text');
showsetting('settings_remote_ftp_user', 'settingsnew[ftp][username]', $settings['ftp']['username'], 'text');
showsetting('settings_remote_ftp_pass', 'settingsnew[ftp][password]', $settings['ftp']['password'], 'text');
showsetting('settings_remote_ftp_pasv', 'settingsnew[ftp][pasv]', $settings['ftp']['pasv'], 'radio');
showsetting('settings_remote_dir', 'settingsnew[ftp][attachdir]', $settings['ftp']['attachdir'], 'text');
showsetting('settings_remote_url', 'settingsnew[ftp][attachurl]', $settings['ftp']['attachurl'], 'text');
showsetting('settings_remote_hide_dir', 'settingsnew[ftp][hideurl]', $settings['ftp']['hideurl'], 'radio');
showsetting('settings_remote_timeout', 'settingsnew[ftp][timeout]', $settings['ftp']['timeout'], 'text');
$extbutton = '<span id="ftpcheckbutton" style="display: '.($settings['ftp']['on'] ? '' : 'none').'"> <input class="button" type="submit" name="ftpcheck" value="'.$lang['settings_remote_ftpcheck'].'" onclick="this.form.action=\'admincp.php?action=ftpcheck\';this.form.target=\'ftpcheckiframe\';"></span><iframe name="ftpcheckiframe" style="display: none"></iframe>';
}
} elseif($operation == 'javascript') {
showtype('jswizard', 'top');
echo '<tr><td class="altbg2"><a href="admincp.php?action=settings&do=javascript">'.$lang['jswizard_basesettings'].'</a> ';
if($settings['jsstatus']) {
echo '<a href="admincp.php?action=jswizard">'.$lang['jswizard_project'].'</a>';
}
echo '</td></tr>';
showtype('', 'bottom');
echo '<br />';
$settings['jsdateformat'] = dateformat($settings['jsdateformat']);
showtype('settings_javascript', 'top', 'settingsubmit');
showsetting('settings_jsstatus', 'settingsnew[jsstatus]', $settings['jsstatus'], 'radio', '', '', 1);
showsetting('settings_jscachelife', 'settingsnew[jscachelife]', $settings['jscachelife'], 'text');
showsetting('settings_jsdateformat', 'settingsnew[jsdateformat]', $settings['jsdateformat'], 'text');
showsetting('settings_jsrefdomains', 'settingsnew[jsrefdomains]', $settings['jsrefdomains'], 'textarea');
} elseif($operation == 'wap') {
$settings['wapdateformat'] = dateformat($settings['wapdateformat']);
showtype('settings_wap', 'top', 'settingsubmit');
showsetting('settings_wapstatus', 'settingsnew[wapstatus]', $settings['wapstatus'], 'radio', '', '', 1);
showsetting('settings_wap_register', 'settingsnew[wapregister]', $settings['wapregister'], 'radio');
showsetting('settings_wapcharset', array('settingsnew1[wapcharset]', array(
array(1, 'UTF-8'),
array(2, 'UNICODE'))), $settings['wapcharset'], 'mradio');
showsetting('settings_waptpp', 'settingsnew[waptpp]', $settings['waptpp'], 'text');
showsetting('settings_wapppp', 'settingsnew[wapppp]', $settings['wapppp'], 'text');
showsetting('settings_wapdateformat', 'settingsnew[wapdateformat]', $settings['wapdateformat'], 'text');
showsetting('settings_wapmps', 'settingsnew[wapmps]', $settings['wapmps'], 'text');
} elseif($operation == 'space') {
$settings['spacedata'] = unserialize($settings['spacedata']);
showtype('settings_space', 'top', 'settingsubmit');
showsetting('settings_spacestatus', 'settingsnew[spacestatus]', $settings['spacestatus'], 'radio', '', '', 1);
showsetting('settings_spacecachelife', 'settingsnew[spacedata][cachelife]', $settings['spacedata']['cachelife'], 'text');
showsetting('settings_spacelimitmythreads', 'settingsnew[spacedata][limitmythreads]', $settings['spacedata']['limitmythreads'], 'text');
showsetting('settings_spacelimitmyreplies', 'settingsnew[spacedata][limitmyreplies]', $settings['spacedata']['limitmyreplies'], 'text');
showsetting('settings_spacelimitmyrewards', 'settingsnew[spacedata][limitmyrewards]', $settings['spacedata']['limitmyrewards'], 'text');
showsetting('settings_spacelimitmytrades', 'settingsnew[spacedata][limitmytrades]', $settings['spacedata']['limitmytrades'], 'text');
showsetting('settings_spacelimitmyvideos', 'settingsnew[spacedata][limitmyvideos]', $settings['spacedata']['limitmyvideos'], 'text');
showsetting('settings_spacelimitmyblogs', 'settingsnew[spacedata][limitmyblogs]', $settings['spacedata']['limitmyblogs'], 'text');
showsetting('settings_spacelimitmyfriends', 'settingsnew[spacedata][limitmyfriends]', $settings['spacedata']['limitmyfriends'], 'text');
showsetting('settings_spacelimitmyfavforums', 'settingsnew[spacedata][limitmyfavforums]', $settings['spacedata']['limitmyfavforums'], 'text');
showsetting('settings_spacelimitmyfavthreads', 'settingsnew[spacedata][limitmyfavthreads]', $settings['spacedata']['limitmyfavthreads'], 'text');
showsetting('settings_spacetextlength', 'settingsnew[spacedata][textlength]', $settings['spacedata']['textlength'], 'text');
} elseif($operation == 'cachethread') {
include_once DISCUZ_ROOT.'./include/forum.func.php';
$forumselect = '<select name="fids[]" multiple="multiple" style="width: 70%" size="10"><option value="all">'.$lang['all_forum'].'</option><option value=""> </option>'.forumselect().'</select>';
showtype('settings_cachethread', 'top', 'settingsubmit');
showsetting('settings_cachethread_indexlife', 'settingsnew[cacheindexlife]', $settings['cacheindexlife'], 'text');
showsetting('settings_cachethread_life', 'settingsnew[cachethreadlife]', $settings['cachethreadlife'], 'text');
showsetting('settings_cachethread_dir', 'settingsnew[cachethreaddir]', $settings['cachethreaddir'], 'text');
echo '</tbody></table><br />';
showtype('settings_cachethread_coefficient_set', 'top', 'settingsubmit');
showsetting('settings_cachethread_coefficient', 'settingsnew[threadcaches]', '', "<input type=\"text\" size=\"30\" name=\"settingsnew[threadcaches]\" value=\"\">");
showsetting('settings_cachethread_coefficient_forum', '', '', $forumselect);
} elseif($operation == 'ecommerce') {
if($from == 'creditwizard') {
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td><?=$lang['menu_tools_creditwizard']?></td></tr>
<tr><td><?=$lang['creditwizard_tips']?></td></tr></table><br />
<?
}
$settings['tradetypes'] = unserialize($settings['tradetypes']);
$query = $db->query("SELECT * FROM {$tablepre}threadtypes WHERE special='1' ORDER BY displayorder");
$tradetypeselect = '';
while($type = $db->fetch_array($query)) {
$tradetypeselect .= '<input class="checkbox" type="checkbox" name="settingsnew[tradetypes][]" value="'.$type['typeid'].'" '.(@in_array($type['typeid'], $settings['tradetypes']) ? 'checked' : '').'> '.$type['name'].'<br />';
}
showtype('settings_ecommerce_sub_credittrade', 'top', 'settingsubmit');
showsetting('alipay_ratio', 'settingsnew[ec_ratio]', $settings['ec_ratio'], 'text');
showsetting('alipay_mincredits', 'settingsnew[ec_mincredits]', $settings['ec_mincredits'], 'text');
showsetting('alipay_maxcredits', 'settingsnew[ec_maxcredits]', $settings['ec_maxcredits'], 'text');
showsetting('alipay_maxcreditspermonth', 'settingsnew[ec_maxcreditspermonth]', $settings['ec_maxcreditspermonth'], 'text');
echo '</tbody></table><br />';
showtype('settings_ecommerce_sub_goodstrade', 'top', 'settingsubmit');
showsetting('settings_trade_biosize', 'settingsnew[maxbiotradesize]', $settings['maxbiotradesize'], 'text');
showsetting('settings_trade_imagewidthheight', '', '', '<input name="settingsnew[tradeimagewidth]" size="20" value="'.intval($settings['tradeimagewidth']).'"> <span style="vertical-align: middle">X</span> <input name="settingsnew[tradeimageheight]" size="20" value="'.intval($settings['tradeimageheight']).'">');
showsetting('settings_trade_type', '', '', $tradetypeselect);
} elseif($operation == 'mail' && $isfounder) {
$settings['mail'] = unserialize($settings['mail']);
showtype('settings_mail', 'top', 'settingsubmit');
showsetting('settings_mail_send', array('settingsnew[mail][mailsend]', array(
array(1, $lang['settings_mail_send_1'], array('hidden1' => 'none', 'hidden2' => 'none')),
array(2, $lang['settings_mail_send_2'], array('hidden1' => '', 'hidden2' => '')),
array(3, $lang['settings_mail_send_3'], array('hidden1' => '', 'hidden2' => 'none')))), $settings['mail']['mailsend'], 'mradio');
echo '</tbody><tbody class="sub" id="hidden1" style="display:'.($settings['mail']['mailsend'] == 1 ? ' none' : '').'">';
showsetting('settings_mail_server', 'settingsnew[mail][server]', $settings['mail']['server'], 'text');
showsetting('settings_mail_port', 'settingsnew[mail][port]', $settings['mail']['port'], 'text');
echo '</tbody><tbody class="sub" id="hidden2" style="display:'.($settings['mail']['mailsend'] != 2 ? ' none' : '').'">';
showsetting('settings_mail_auth', 'settingsnew[mail][auth]', $settings['mail']['auth'], 'radio');
showsetting('settings_mail_from', 'settingsnew[mail][from]', $settings['mail']['from'], 'text');
showsetting('settings_mail_username', 'settingsnew[mail][auth_username]', $settings['mail']['auth_username'], 'text');
showsetting('settings_mail_password', 'settingsnew[mail][auth_password]', $settings['mail']['auth_password'], 'text');
echo '</tbody><tbody>';
showsetting('settings_mail_delimiter', array('settingsnew[mail][maildelimiter]', array(
array(1, $lang['settings_mail_delimiter_crlf']),
array(0, $lang['settings_mail_delimiter_lf']),
array(2, $lang['settings_mail_delimiter_cr']))), $settings['mail']['maildelimiter'], 'mradio');
showsetting('settings_mail_includeuser', 'settingsnew[mail][mailusername]', $settings['mail']['mailusername'], 'radio');
showsetting('settings_mail_silent', 'settingsnew[mail][sendmail_silent]', $settings['mail']['sendmail_silent'], 'radio');
echo '</table><br />';
showtype('settings_mail_test', 'top', 'settingsubmit');
showsetting('settings_mail_test_from', 'test_from', '', 'text');
showsetting('settings_mail_test_to', 'test_to', '', 'textarea');
echo '</tbody>';
$extbutton = ' <input class="button" type="submit" name="mailcheck" value="'.$lang['settings_mailcheck'].'" onclick="this.form.action=\'admincp.php?action=mailcheck\';this.form.target=\'mailcheckiframe\'"><iframe name="mailcheckiframe" style="display: none"></iframe>';
} else {
$operation = 'basic';
showtype('settings_general', 'top');
showsetting('settings_bbname', 'settingsnew[bbname]', $settings['bbname'], 'text');
showsetting('settings_sitename', 'settingsnew[sitename]', $settings['sitename'], 'text');
showsetting('settings_siteurl', 'settingsnew[siteurl]', $settings['siteurl'], 'text');
showsetting('settings_index_name', 'settingsnew[indexname]', $settings['indexname'], 'text');
showsetting('settings_icp', 'settingsnew[icp]', $settings['icp'], 'text');
showsetting('settings_boardlicensed', 'settingsnew[boardlicensed]', $settings['boardlicensed'], 'radio');
showsetting('settings_bbclosed', 'settingsnew[bbclosed]', $settings['bbclosed'], 'radio');
showsetting('settings_closedreason', 'settingsnew[closedreason]', $settings['closedreason'], 'textarea');
}
showtype('', 'bottom');
echo '<br /><center><input type="hidden" name="from" value="'.$from.'"><input class="button" type="submit" name="settingsubmit" value="'.$lang['submit'].'">'.$extbutton.'</center></form>';
} else {
if(isset($settingsnew['bbname'])) {
$settingsnew['bbname'] = dhtmlspecialchars($settingsnew['bbname']);
}
if(isset($settingsnew['regname'])) {
$settingsnew['regname'] = dhtmlspecialchars($settingsnew['regname']);
}
if(isset($settingsnew['reglinkname'])) {
$settingsnew['reglinkname'] = dhtmlspecialchars($settingsnew['reglinkname']);
}
if(isset($settingsnew['censoruser'])) {
$settingsnew['censoruser'] = trim(preg_replace("/\s*(\r\n|\n\r|\n|\r)\s*/", "\r\n", $settingsnew['censoruser']));
}
if(isset($settingsnew['censoremail'])) {
$settingsnew['censoremail'] = trim(preg_replace("/\s*(\r\n|\n\r|\n|\r)\s*/", "\r\n", $settingsnew['censoremail']));
}
if(isset($settingsnew['ipregctrl'])) {
$settingsnew['ipregctrl'] = trim(preg_replace("/\s*(\r\n|\n\r|\n|\r)\s*/", "\r\n", $settingsnew['ipregctrl']));
}
if(isset($settingsnew['ipaccess'])) {
if($settingsnew['ipaccess'] = trim(preg_replace("/(\s*(\r\n|\n\r|\n|\r)\s*)/", "\r\n", $settingsnew['ipaccess']))) {
if(!ipaccess($onlineip, $settingsnew['ipaccess'])) {
cpmsg('settings_ipaccess_invalid');
}
}
}
if(isset($settingsnew['adminipaccess'])) {
if($settingsnew['adminipaccess'] = trim(preg_replace("/(\s*(\r\n|\n\r|\n|\r)\s*)/", "\r\n", $settingsnew['adminipaccess']))) {
if(!ipaccess($onlineip, $settingsnew['adminipaccess'])) {
cpmsg('settings_adminipaccess_invalid');
}
}
}
if(isset($settingsnew['welcomemsgtitle'])) {
$settingsnew['welcomemsgtitle'] = cutstr(trim(dhtmlspecialchars($settingsnew['welcomemsgtitle'])), 75);
}
if(isset($settingsnew['showsignatures']) && isset($settingsnew['showavatars']) && isset($settingsnew['showimages'])) {
$settingsnew['showsettings'] = bindec($settingsnew['showsignatures'].$settingsnew['showavatars'].$settingsnew['showimages']);
}
if(!empty($settingsnew['globalstick'])) {
updatecache('globalstick');
}
if(isset($settingsnew['inviteconfig'])) {
$settingsnew['inviteconfig'] = addslashes(serialize($settingsnew['inviteconfig']));
}
if(isset($settingsnew['tradetypes'])) {
$settingsnew['tradetypes'] = addslashes(serialize($settingsnew['tradetypes']));
}
if($operation == 'functions') {
$jsmenumax = is_array($settingsnew['jsmenustatus']) ? max(array_keys($settingsnew['jsmenustatus'])) : 0;
$jsmenustatus = '';
for($i = $jsmenumax; $i > 0; $i --) {
$jsmenustatus .= intval($settingsnew['jsmenustatus'][$i]);
}
$settingsnew['jsmenustatus'] = bindec($jsmenustatus);
$settingsnew['smthumb'] = intval($settingsnew['smthumb']) >= 20 && intval($settingsnew['smthumb']) <= 40 ? intval($settingsnew['smthumb']) : 20;
}
if(isset($settingsnew['defaulteditormode']) && isset($settingsnew['allowswitcheditor'])) {
$settingsnew['editoroptions'] = bindec($settingsnew['defaulteditormode'].$settingsnew['allowswitcheditor']);
}
if(isset($settingsnew['myrecorddays'])) {
$settingsnew['myrecorddays'] = intval($settingsnew['myrecorddays']) > 0 ? intval($settingsnew['myrecorddays']) : 30;
}
if(!empty($settingsnew['thumbstatus']) && !function_exists('imagejpeg')) {
$settingsnew['thumbstatus'] = 0;
}
if(isset($settingsnew['creditsformula']) && isset($settingsnew['extcredits']) && isset($settingsnew['creditspolicy']) && isset($settingsnew['initcredits']) && isset($settingsnew['creditstrans']) && isset($settingsnew['creditstax'])) {
if(!preg_match("/^([\+\-\*\/\.\d\(\)]|((extcredits[1-8]|digestposts|posts|pageviews|oltime)([\+\-\*\/\(\)]|$)+))+$/", $settingsnew['creditsformula']) || !is_null(@eval(preg_replace("/(digestposts|posts|pageviews|oltime|extcredits[1-8])/", "\$\\1", $settingsnew['creditsformula']).';'))) {
cpmsg('settings_creditsformula_invalid');
}
$extcreditsarray = array();
if(is_array($settingsnew['extcredits'])) {
foreach($settingsnew['extcredits'] as $key => $value) {
if($value['available'] && !$value['title']) {
cpmsg('settings_credits_title_invalid');
}
$extcreditsarray[$key] = array
(
'title' => dhtmlspecialchars(stripslashes($value['title'])),
'unit' => dhtmlspecialchars(stripslashes($value['unit'])),
'ratio' => ($value['ratio'] > 0 ? (float)$value['ratio'] : 0),
'available' => $value['available'],
'lowerlimit' => intval($settingsnew['creditspolicy']['lowerlimit'][$key]),
'showinthread' => $value['showinthread'],
'allowexchangein' => $value['allowexchangein'],
'allowexchangeout' => $value['allowexchangeout']
);
$settingsnew['initcredits'][$key] = intval($settingsnew['initcredits'][$key]);
}
}
if(is_array($settingsnew['creditspolicy'])) {
foreach($settingsnew['creditspolicy'] as $key => $value) {
for($i = 1; $i <= 8; $i++) {
if(empty($value[$i])) {
unset($settingsnew['creditspolicy'][$key][$i]);
} else {
$value[$i] = $value[$i] > 99 ? 99 : ($value[$i] < -99 ? -99 : $value[$i]);
$settingsnew['creditspolicy'][$key][$i] = intval($value[$i]);
}
}
}
} else {
$settingsnew['creditspolicy'] = array();
}
if($settingsnew['creditstrans'] && empty($settingsnew['extcredits'][$settingsnew['creditstrans']]['available'])) {
cpmsg('settings_creditstrans_invalid');
}
$settingsnew['creditspolicy'] = addslashes(serialize($settingsnew['creditspolicy']));
$settingsnew['creditsformulaexp'] = $settingsnew['creditsformula'];
foreach(array('digestposts', 'posts', 'oltime', 'pageviews', 'extcredits1', 'extcredits2', 'extcredits3', 'extcredits4', 'extcredits5', 'extcredits6', 'extcredits7', 'extcredits8') as $var) {
if($extcreditsarray[$creditsid = preg_replace("/^extcredits(\d{1})$/", "\\1", $var)]['available']) {
$replacement = $extcreditsarray[$creditsid]['title'];
} else {
$replacement = $lang['settings_creditsformula_'.$var];
}
$settingsnew['creditsformulaexp'] = str_replace($var, '<u>'.$replacement.'</u>', $settingsnew['creditsformulaexp']);
}
$settingsnew['creditsformulaexp'] = addslashes('<u>'.$lang['settings_creditsformula_credits'].'</u>='.$settingsnew['creditsformulaexp']);
$initformula = str_replace('posts', '0', $settingsnew['creditsformula']);
for($i = 1; $i <= 8; $i++) {
$initformula = str_replace('extcredits'.$i, $settingsnew['initcredits'][$i], $initformula);
}
eval("\$initcredits = round($initformula);");
$settingsnew['extcredits'] = addslashes(serialize($extcreditsarray));
$settingsnew['initcredits'] = $initcredits.','.implode(',', $settingsnew['initcredits']);
if($settingsnew['creditstax'] < 0 || $settingsnew['creditstax'] >= 1) {
$settingsnew['creditstax'] = 0;
}
}
if(isset($settingsnew['gzipcompress'])) {
if(!function_exists('ob_gzhandler') && $settingsnew['gzipcompress']) {
cpmsg('settings_gzip_invalid');
}
}
if(isset($settingsnew['maxonlines'])) {
if($settingsnew['maxonlines'] > 65535 || !is_numeric($settingsnew['maxonlines'])) {
cpmsg('settings_maxonlines_invalid');
}
$db->query("ALTER TABLE {$tablepre}sessions MAX_ROWS=$settingsnew[maxonlines]");
if($settingsnew['maxonlines'] < $settings['maxonlines']) {
$db->query("DELETE FROM {$tablepre}sessions");
}
}
if(isset($settingsnew['seccodedata'])) {
$settingsnew['seccodedata']['width'] = intval($settingsnew['seccodedata']['width']);
$settingsnew['seccodedata']['height'] = intval($settingsnew['seccodedata']['height']);
$settingsnew['seccodedata']['width'] = $settingsnew['seccodedata']['width'] < 100 ? 100 : ($settingsnew['seccodedata']['width'] > 200 ? 200 : $settingsnew['seccodedata']['width']);
$settingsnew['seccodedata']['height'] = $settingsnew['seccodedata']['height'] < 50 ? 50 : ($settingsnew['seccodedata']['height'] > 80 ? 80 : $settingsnew['seccodedata']['height']);
$settingsnew['seccodedata']['loginfailedcount'] = !empty($settingsnew['seccodedata']['loginfailedcount']) ? 3 : 0;
$settingsnew['seccodedata'] = addslashes(serialize($settingsnew['seccodedata']));
}
if($operation == 'seccode' || isset($settingsnew['seccodestatus'])) {
$settingsnew['seccodestatus'] = bindec(intval($settingsnew['seccodestatus'][5]).intval($settingsnew['seccodestatus'][4]).intval($settingsnew['seccodestatus'][3]).intval($settingsnew['seccodestatus'][2]).intval($settingsnew['seccodestatus'][1]));
}
if($operation == 'seo') {
$settingsnew['rewritestatus'] = bindec(intval($settingsnew['rewritestatus'][5]).intval($settingsnew['rewritestatus'][4]).intval($settingsnew['rewritestatus'][3]).intval($settingsnew['rewritestatus'][2]).intval($settingsnew['rewritestatus'][1]));
$settingsnew['baidusitemap_life'] = max(1, min(24, intval($settingsnew['baidusitemap_life'])));
}
if($operation == 'secqaa') {
if(is_array($delete)) {
$db->query("DELETE FROM {$tablepre}itempool WHERE id IN (".implodeids($delete).")");
}
if(is_array($question)) {
foreach($question AS $key => $q) {
$q = trim($q);
$a = cutstr(dhtmlspecialchars(trim($answer[$key])), 50);
if($q && $a) {
$db->query("UPDATE {$tablepre}itempool SET question='$q', answer='$a' WHERE id='$key'");
}
}
}
if(is_array($newquestion) && is_array($newanswer)) {
foreach($newquestion AS $key => $q) {
$q = trim($q);
$a = cutstr(dhtmlspecialchars(trim($newanswer[$key])), 50);
if($q && $a) {
$db->query("INSERT INTO {$tablepre}itempool (question, answer) VALUES ('$q', '$a')");
}
}
}
updatecache('secqaa');
$settingsnew['secqaa']['status'] = bindec(intval($settingsnew['secqaa']['status'][3]).intval($settingsnew['secqaa']['status'][2]).intval($settingsnew['secqaa']['status'][1]));
$settingsnew['secqaa'] = serialize($settingsnew['secqaa']);
}
if($operation == 'ecommerce') {
if($settingsnew['ec_ratio']) {
if($settingsnew['ec_ratio'] < 0) {
cpmsg('alipay_ratio_invalid');
}
} else {
$settingsnew['ec_mincredits'] = $settingsnew['ec_maxcredits'] = 0;
}
foreach(array('ec_ratio', 'ec_mincredits', 'ec_maxcredits', 'ec_maxcreditspermonth', 'tradeimagewidth', 'tradeimageheight') as $key) {
$settingsnew[$key] = intval($settingsnew[$key]);
}
}
if(isset($settingsnew['visitbanperiods']) && isset($settingsnew['postbanperiods']) && isset($settingsnew['postmodperiods']) && isset($settingsnew['searchbanperiods'])) {
foreach(array('visitbanperiods', 'postbanperiods', 'postmodperiods', 'searchbanperiods') as $periods) {
$periodarray = array();
foreach(explode("\n", $settingsnew[$periods]) as $period) {
if(preg_match("/^\d{1,2}\:\d{2}\-\d{1,2}\:\d{2}$/", $period = trim($period))) {
$periodarray[] = $period;
}
}
$settingsnew[$periods] = implode("\r\n", $periodarray);
}
}
if(isset($settingsnew['timeformat'])) {
$settingsnew['timeformat'] = $settingsnew['timeformat'] == '24' ? 'H:i' : 'h:i A';
}
if(isset($settingsnew['dateformat'])) {
$settingsnew['dateformat'] = dateformat($settingsnew['dateformat'], 'format');
}
if(isset($settingsnew['userdateformat'])) {
$settingsnew['userdateformat'] = dateformat($settingsnew['userdateformat'], 'format');
}
if($isfounder && isset($settingsnew['ftp'])) {
$settings['ftp'] = unserialize($settings['ftp']);
$settings['ftp']['password'] = authcode($settings['ftp']['password'], 'DECODE', md5($authkey));
if(!empty($settingsnew['ftp']['password'])) {
$pwlen = strlen($settingsnew['ftp']['password']);
if($pwlen < 3) {
cpmsg('ftp_password_short');
}
if($settingsnew['ftp']['password']{0} == $settings['ftp']['password']{0} && $settingsnew['ftp']['password']{$pwlen - 1} == $settings['ftp']['password']{strlen($settings['ftp']['password']) - 1} && substr($settingsnew['ftp']['password'], 1, $pwlen - 2) == '********') {
$settingsnew['ftp']['password'] = $settings['ftp']['password'];
}
$settingsnew['ftp']['password'] = authcode($settingsnew['ftp']['password'], 'ENCODE', md5($authkey));
}
$settingsnew['ftp'] = serialize($settingsnew['ftp']);
}
if($isfounder && isset($settingsnew['mail'])) {
$settingsnew['mail'] = serialize($settingsnew['mail']);
}
if(isset($settingsnew['jsrefdomains'])) {
$settingsnew['jsrefdomains'] = trim(preg_replace("/(\s*(\r\n|\n\r|\n|\r)\s*)/", "\r\n", $settingsnew['jsrefdomains']));
}
if(isset($settingsnew['jsdateformat'])) {
$settingsnew['jsdateformat'] = dateformat($settingsnew['jsdateformat'], 'format');
}
if(isset($settingsnew['wapdateformat'])) {
$settingsnew['wapdateformat'] = dateformat($settingsnew['wapdateformat'], 'format');
}
if(isset($settingsnew['cachethreaddir']) && isset($settingsnew['threadcaches'])) {
if($settingsnew['cachethreaddir'] && !is_writable(DISCUZ_ROOT.'./'.$settingsnew['cachethreaddir'])) {
cpmsg('cachethread_dir_noexists');
}
if(!empty($fids)) {
$sqladd = in_array('all', $fids) ? '' : " WHERE fid IN ('".implode("', '", $fids)."')";
$db->query("UPDATE {$tablepre}forums SET threadcaches='$settingsnew[threadcaches]'$sqladd");
}
}
if(isset($settingsnew['watermarktext'])) {
$settingsnew['watermarktext']['size'] = intval($settingsnew['watermarktext']['size']);
$settingsnew['watermarktext']['angle'] = intval($settingsnew['watermarktext']['angle']);
$settingsnew['watermarktext']['shadowx'] = intval($settingsnew['watermarktext']['shadowx']);
$settingsnew['watermarktext']['shadowy'] = intval($settingsnew['watermarktext']['shadowy']);
$settingsnew['watermarktext']['fontpath'] = str_replace(array('\\', '/'), '', $settingsnew['watermarktext']['fontpath']);
if($settingsnew['watermarktype'] == 2 && $settingsnew['watermarktext']['fontpath']) {
$fontpath = $settingsnew['watermarktext']['fontpath'];
$fontpathnew = 'ch/'.$fontpath;
$settingsnew['watermarktext']['fontpath'] = file_exists('images/fonts/'.$fontpathnew) ? $fontpathnew : '';
if(!$settingsnew['watermarktext']['fontpath']) {
$fontpathnew = 'en/'.$fontpath;
$settingsnew['watermarktext']['fontpath'] = file_exists('images/fonts/'.$fontpathnew) ? $fontpathnew : '';
}
if(!$settingsnew['watermarktext']['fontpath']) {
cpmsg('watermarkpreview_fontpath_error');
}
}
$settingsnew['watermarktext'] = addslashes(serialize($settingsnew['watermarktext']));
}
if(isset($settingsnew['msgforward'])) {
if(!empty($settingsnew['msgforward']['messages'])) {
$tempmsg = explode("\n", $settingsnew['msgforward']['messages']);
$settingsnew['msgforward']['messages'] = array();
foreach($tempmsg as $msg) {
if($msg = strip_tags(trim($msg))) {
$settingsnew['msgforward']['messages'][] = $msg;
}
}
} else {
$settingsnew['msgforward']['messages'] = array();
}
$tmparray = array(
'refreshtime' => intval($settingsnew['msgforward']['refreshtime']),
'quick' => $settingsnew['msgforward']['quick'] ? 1 : 0,
'messages' => $settingsnew['msgforward']['messages']
);
$settingsnew['msgforward'] = addslashes(serialize($tmparray));
}
if(isset($settingsnew['onlinehold'])) {
$settingsnew['onlinehold'] = intval($settingsnew['onlinehold']) > 0 ? intval($settingsnew['onlinehold']) : 15;
}
if(isset($settingsnew['postno'])) {
$settingsnew['postno'] = trim($settingsnew['postno']);
}
if(isset($settingsnew['postnocustom'])) {
$settingsnew['postnocustom'] = addslashes(serialize(explode("\n", $settingsnew['postnocustom'])));
}
if($operation == 'styles') {
$settingsnew['customauthorinfo'] = addslashes(serialize(array($settingsnew['customauthorinfo'])));
}
if(isset($settingsnew['spacedata'])) {
$settingsnew['spacedata'] = serialize($settingsnew['spacedata']);
}
$updatecache = FALSE;
foreach($settingsnew AS $key => $val) {
if(isset($settings[$key]) && $settings[$key] != $val) {
$$key = $val;
$updatecache = TRUE;
if(in_array($key, array('newbiespan', 'topicperpage', 'postperpage', 'memberperpage', 'hottopic', 'starthreshold', 'delayviewcount',
'visitedforums', 'maxsigrows', 'timeoffset', 'statscachelife', 'pvfrequence', 'oltimespan', 'seccodestatus',
'maxprice', 'rssttl', 'rewritestatus', 'bdaystatus', 'maxonlines', 'loadctrl', 'floodctrl', 'regctrl', 'regfloodctrl',
'searchctrl', 'extcredits1', 'extcredits2', 'extcredits3', 'extcredits4', 'extcredits5', 'extcredits6',
'extcredits7', 'extcredits8', 'transfermincredits', 'exchangemincredits', 'maxincperthread', 'maxchargespan',
'maxspm', 'maxsearchresults', 'maxsmilies', 'threadmaxpages', 'membermaxpages', 'maxpostsize', 'minpostsize', 'maxavatarsize',
'maxavatarpixel', 'maxpolloptions', 'karmaratelimit', 'losslessdel', 'edittimelimit', 'smcols',
'watermarktrans', 'watermarkquality', 'jscachelife', 'waptpp', 'wapppp', 'wapmps', 'maxmodworksmonths', 'frameon', 'maxonlinelist'))) {
$val = (float)$val;
}
$db->query("REPLACE INTO {$tablepre}settings (variable, value)
VALUES ('$key', '$val')");
}
}
if($updatecache) {
updatecache('settings');
if(isset($settingsnew['forumlinkstatus']) && $settingsnew['forumlinkstatus'] != $settings['forumlinkstatus']) {
updatecache('forumlinks');
}
if(isset($settingsnew['userstatusby']) && $settingsnew['userstatusby'] != $settings['userstatusby']) {
updatecache('usergroups');
updatecache('ranks');
}
if((isset($settingsnew['tagstatus']) && $settingsnew['tagstatus'] != $settings['tagstatus']) || (isset($settingsnew['hottags']) && $settingsnew['hottags'] != $settings['hottags']) || (isset($settingsnew['viewthreadtags']) && $settingsnew['viewthreadtags'] != $settings['viewthreadtags'])) {
updatecache(array('tags_index', 'tags_viewthread'));
}
if((isset($settingsnew['smthumb']) && $settingsnew['smthumb'] != $settings['smthumb']) || (isset($settingsnew['smcols']) && $settingsnew['smcols'] != $settings['smcols']) || (isset($settingsnew['smrows']) && $settingsnew['smrows'] != $settings['smrows'])) {
updatecache('smilies_display');
}
if(isset($settingsnew['customauthorinfo']) && $settingsnew['customauthorinfo'] != $settings['customauthorinfo']) {
updatecache('custominfo');
}
if($operation == 'credits') {
updatecache('custominfo');
}
}
if($operation == 'credits' && $projectsave) {
$projectid = intval($projectid);
dheader("Location: {$boardurl}admincp.php?action=projectadd&type=extcredit&projectid=$projectid");
}
cpmsg('settings_update_succeed', 'admincp.php?action=settings&operation='.$operation.(!empty($from) ? '&from='.$from : ''));
}
function creditsrow($rowname) {
global $settings;
$policyrow = '';
for($i = 1; $i <= 8; $i++) {
$policyrow .="<td ".($settings['extcredits'][$i]['available'] ? '' : 'disabled')." class=\"altbg".(is_int($i/2) ? 1 : 2)."\"><input type=\"text\" size=\"2\" name=\"settingsnew[creditspolicy][$rowname][$i]\" ".($settings['extcredits'][$i]['available'] ? '' : 'readonly')." value=\"".intval($settings['creditspolicy'][$rowname][$i])."\"></td>";
}
return $policyrow;
}
function dateformat($string, $operation = 'formalise') {
$string = htmlspecialchars(trim($string));
$replace = $operation == 'formalise' ? array(array('n', 'j', 'y', 'Y'), array('mm', 'dd', 'yy', 'yyyy')) : array(array('mm', 'dd', 'yyyy', 'yy'), array('n', 'j', 'Y', 'y'));
return str_replace($replace[0], $replace[1], $string);
}
?> | zyyhong | trunk/jiaju001/bbs/admin/settings.inc.php | PHP | asf20 | 80,051 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: styles.inc.php 19193 2009-08-17 02:59:31Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
if($action == 'styles' && $export) {
$stylearray = $db->fetch_first("SELECT s.name, s.templateid, t.name AS tplname, t.directory, t.copyright FROM {$tablepre}styles s LEFT JOIN {$tablepre}templates t ON t.templateid=s.templateid WHERE styleid='$export'");
if(!$stylearray) {
cpheader();
cpmsg('styles_export_invalid');
}
$stylearray['version'] = strip_tags($version);
$time = gmdate("$dateformat $timeformat", $timestamp + $timeoffset * 3600);
$query = $db->query("SELECT * FROM {$tablepre}stylevars WHERE styleid='$export'");
while($style = $db->fetch_array($query)) {
$stylearray['style'][$style['variable']] = $style['substitute'];
}
$style_export = "# Discuz! Style Dump\n".
"# Version: Discuz! $version\n".
"# Time: $time\n".
"# From: $bbname ($boardurl)\n".
"#\n".
"# This file was BASE64 encoded\n".
"#\n".
"# Discuz! Community: http://www.Discuz.net\n".
"# Please visit our website for latest news about Discuz!\n".
"# --------------------------------------------------------\n\n\n".
wordwrap(base64_encode(serialize($stylearray)), 50, "\n", 1);
ob_end_clean();
dheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
dheader('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
dheader('Cache-Control: no-cache, must-revalidate');
dheader('Pragma: no-cache');
dheader('Content-Encoding: none');
dheader('Content-Length: '.strlen($style_export));
dheader('Content-Disposition: attachment; filename=discuz_style_'.$stylearray['name'].'.txt');
dheader('Content-Type: '.(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? 'application/octetstream' : 'application/octet-stream'));
echo $style_export;
dexit();
}
cpheader();
if($action == 'styles' && !$export) {
$predefinedvars = array('available', 'bgcolor', 'altbg1', 'altbg2', 'link', 'bordercolor', 'headercolor', 'headertext', 'catcolor',
'tabletext', 'text', 'borderwidth', 'tablespace', 'fontsize', 'msgfontsize', 'msgbigsize', 'msgsmallsize',
'font', 'smfontsize', 'smfont', 'boardimg', 'imgdir', 'maintablewidth', 'stypeid', 'bgborder',
'catborder', 'inputborder', 'lighttext', 'headermenu', 'headermenutext', 'framebgcolor',
'noticebg', 'commonboxborder', 'tablebg', 'highlightlink', 'commonboxbg', 'boxspace', 'portalboxbgcode',
'noticeborder', 'noticetext');
if(!submitcheck('stylesubmit') && !submitcheck('importsubmit') && !$edit && !$export) {
$defaultstyleid = $db->result_first("SELECT value FROM {$tablepre}settings WHERE variable='styleid'");
$styleselect = '';
$query = $db->query("SELECT s.styleid, s.available, s.name, t.name AS tplname, t.copyright FROM {$tablepre}styles s LEFT JOIN {$tablepre}templates t ON t.templateid=s.templateid");
while($styleinfo = $db->fetch_array($query)) {
$styleselect .= "<tr align=\"center\"><td class=\"altbg1\">".($styleinfo['styleid'] != $defaultstyleid ? "<input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$styleinfo[styleid]\">" : NULL)."</td>\n".
"<td class=\"altbg2\"><input type=\"text\" name=\"namenew[$styleinfo[styleid]]\" value=\"$styleinfo[name]\" size=\"18\"></td>\n".
"<td class=\"altbg1\">".($styleinfo['styleid'] != $defaultstyleid ? "<input class=\"checkbox\" type=\"checkbox\" name=\"availablenew[$styleinfo[styleid]]\" value=\"1\" ".($styleinfo['available'] ? 'checked' : NULL).">" : "<input class=\"checkbox\" type=\"hidden\" name=\"availablenew[$styleinfo[styleid]]\" value=\"1\">")."</td>\n".
"<td class=\"altbg2\">$styleinfo[styleid]</td>\n".
"<td class=\"altbg1\">$styleinfo[tplname]</td>\n".
"<td class=\"altbg2\"><a href=\"admincp.php?action=styles&export=$styleinfo[styleid]\">[$lang[download]]</a></td>\n".
"<td class=\"altbg1\"><a href=\"admincp.php?action=styles&edit=$styleinfo[styleid]\">[$lang[detail]]</a></td></tr>\n";
}
shownav('menu_styles');
showtips('styles_tips');
?>
<form method="post" action="admincp.php?action=styles">
<input name="updatecsscache" type="hidden" value="0">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td width="48"><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['styles_name']?></td><td><?=$lang['available']?></td><td>styleID</td><td><?=$lang['styles_template']?></td></td><td><?=$lang['export']?></td><td><?=$lang['edit']?></td></tr>
<?=$styleselect?>
<tr align="center" class="altbg1"><td class="altbg1"><?=$lang['add_new']?></td>
<td><input type='text' name="newname" size="18"></td>
<td colspan="6"> </td>
</tr></table><br />
<center><input class="button" type="submit" name="stylesubmit" value="<?=$lang['submit']?>"> <input onclick="this.form.updatecsscache.value = 1" class="button" type="submit" name="stylesubmit" value="<?=$lang['styles_csscache_update']?>"></center></form><br />
<form method="post" action="admincp.php?action=styles">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td><?=$lang['styles_import']?></td></tr>
<tr><td class="altbg1"><div align="center"><textarea name="styledata" cols="80" rows="8"></textarea><br />
<input class="checkbox" type="checkbox" name="ignoreversion" value="1"> <?=$lang['styles_import_ignore_version']?></div></td></tr>
</table><br /><center><input class="button" type="submit" name="importsubmit" value="<?=$lang['submit']?>"></center></form>
<?
} elseif(submitcheck('stylesubmit')) {
if($updatecsscache) {
updatecache('styles');
cpmsg('csscache_update', 'admincp.php?action=styles');
} else {
if(is_array($namenew)) {
foreach($namenew as $id => $val) {
$db->query("UPDATE {$tablepre}styles SET name='$namenew[$id]', available='$availablenew[$id]' WHERE styleid='$id'");
}
}
if($ids = implodeids($delete)) {
if($db->result_first("SELECT COUNT(*) FROM {$tablepre}settings WHERE variable='styleid' AND value IN ($ids)")) {
cpmsg('styles_delete_invalid');
}
$db->query("DELETE FROM {$tablepre}styles WHERE styleid IN ($ids)");
$db->query("DELETE FROM {$tablepre}stylevars WHERE styleid IN ($ids)");
$db->query("UPDATE {$tablepre}members SET styleid='0' WHERE styleid IN ($ids)");
$db->query("UPDATE {$tablepre}forums SET styleid='0' WHERE styleid IN ($ids)");
$db->query("UPDATE {$tablepre}sessions SET styleid='$_DCACHE[settings][styleid]' WHERE styleid IN ($ids)");
}
if($newname) {
$db->query("INSERT INTO {$tablepre}styles (name, templateid) VALUES ('$newname', '1')");
$styleidnew = $db->insert_id();
foreach($predefinedvars as $variable) {
$db->query("INSERT INTO {$tablepre}stylevars (styleid, variable)
VALUES ('$styleidnew', '$variable')");
}
}
updatecache('settings');
updatecache('styles');
cpmsg('styles_edit_succeed', 'admincp.php?action=styles');
}
} elseif(submitcheck('importsubmit')) {
$styledata = preg_replace("/(#.*\s+)*/", '', $styledata);
$stylearray = daddslashes(unserialize(base64_decode($styledata)), 1);
if(!is_array($stylearray)) {
cpmsg('styles_import_data_invalid');
} elseif(empty($ignoreversion) && strip_tags($stylearray['version']) != strip_tags($version)) {
cpmsg('styles_import_version_invalid');
}
$renamed = 0;
if($stylearray['templateid'] != 1) {
$templatedir = DISCUZ_ROOT.'./'.$stylearray['directory'];
if(!is_dir($templatedir)) {
if(!@mkdir($templatedir, 0777)) {
$basedir = dirname($stylearray['directory']);
cpmsg('styles_import_directory_invalid');
}
}
if($db->result_first("SELECT COUNT(*) FROM {$tablepre}templates WHERE name='$stylearray[tplname]'")) {
$stylearray['tplname'] .= '_'.random(4);
$renamed = 1;
}
$db->query("INSERT INTO {$tablepre}templates (name, directory, copyright)
VALUES ('$stylearray[tplname]', '$stylearray[directory]', '$stylearray[copyright]')");
$templateid = $db->insert_id();
} else {
$templateid = 1;
}
if($db->result_first("SELECT COUNT(*) FROM {$tablepre}styles WHERE name='$stylearray[name]'")) {
$stylearray['name'] .= '_'.random(4);
$renamed = 1;
}
$db->query("INSERT INTO {$tablepre}styles (name, templateid)
VALUES ('$stylearray[name]', '$templateid')");
$styleidnew = $db->insert_id();
foreach($stylearray['style'] as $variable => $substitute) {
$substitute = @htmlspecialchars($substitute);
$db->query("INSERT INTO {$tablepre}stylevars (styleid, variable, substitute)
VALUES ('$styleidnew', '$variable', '$substitute')");
}
updatecache('styles');
updatecache('settings');
cpmsg($renamed ? 'styles_import_succeed_renamed' : 'styles_import_succeed', 'admincp.php?action=styles');
} elseif($edit) {
if(!submitcheck('editsubmit')) {
$style = $db->fetch_first("SELECT name, templateid FROM {$tablepre}styles WHERE styleid='$edit'");
if(!$style) {
cpmsg('undefined_action');
}
$stylecustom = '';
$stylestuff = $existvars = array();
$query = $db->query("SELECT * FROM {$tablepre}stylevars WHERE styleid='$edit'");
while($stylevar = $db->fetch_array($query)) {
if(in_array($stylevar['variable'], $predefinedvars)) {
$stylestuff[$stylevar['variable']] = array('id' => $stylevar['stylevarid'], 'subst' => $stylevar['substitute']);
$existvars[] = $stylevar['variable'];
} else {
$stylecustom .= "<tr align=\"center\"><td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$stylevar[stylevarid]\"></td>\n".
"<td class=\"altbg2\"><b>{".strtoupper($stylevar[variable])."}</b></td>\n".
"<td class=\"altbg1\"><textarea name=\"stylevar[$stylevar[stylevarid]]\" cols=\"50\" rows=\"2\">$stylevar[substitute]</textarea></td>\n".
"</tr>";
}
}
if($diffvars = array_diff($predefinedvars, $existvars)) {
foreach($diffvars as $variable) {
$db->query("INSERT INTO {$tablepre}stylevars (styleid, variable, substitute)
VALUES ('$edit', '$variable', '')");
$stylestuff[$variable] = array('id' => $db->insert_id(), 'subst' => '');
}
}
$tplselect = array();
$query = $db->query("SELECT templateid, name FROM {$tablepre}templates");
while($template = $db->fetch_array($query)) {
$tplselect[] = array($template['templateid'], $template['name']);
}
$smileytypes = array();
$query = $db->query("SELECT typeid, name FROM {$tablepre}imagetypes");
while($type = $db->fetch_array($query)) {
$smileytypes[] = array($type['typeid'], $type['name']);
}
shownav('styles_edit');
echo "<form method=\"post\" action=\"admincp.php?action=styles&edit=$edit&formhash=".FORMHASH."\">\n";
showtype($lang['styles_edit'].' - '.$style['name'], 'top');
showsetting('styles_edit_name', 'namenew', $style['name'], 'text', '55%');
showsetting('styles_edit_tpl', array('templateidnew', $tplselect), $style['templateid'], 'select');
showsetting('styles_edit_smileytype', array("stylevar[{$stylestuff[stypeid][id]}]", $smileytypes), $stylestuff['stypeid']['subst'], 'select');
showsetting('styles_edit_logo', "stylevar[{$stylestuff[boardimg][id]}]", $stylestuff['boardimg']['subst'], 'text', '55%');
showsetting('styles_edit_imgdir', "stylevar[{$stylestuff[imgdir][id]}]", $stylestuff['imgdir']['subst'], 'text', '55%');
showtype('styles_edit_font_color');
showsetting('styles_edit_font', "stylevar[{$stylestuff[font][id]}]", $stylestuff['font']['subst'], 'text', '55%');
showsetting('styles_edit_fontsize', "stylevar[{$stylestuff[fontsize][id]}]", $stylestuff['fontsize']['subst'], 'text', '55%');
showsetting('styles_edit_msgfontsize', "stylevar[{$stylestuff[msgfontsize][id]}]", $stylestuff['msgfontsize']['subst'], 'text', '55%');
showsetting('styles_edit_msgbigsize', "stylevar[{$stylestuff[msgbigsize][id]}]", $stylestuff['msgbigsize']['subst'], 'text', '55%');
showsetting('styles_edit_msgsmallsize', "stylevar[{$stylestuff[msgsmallsize][id]}]", $stylestuff['msgsmallsize']['subst'], 'text', '55%');
showsetting('styles_edit_smfont', "stylevar[{$stylestuff[smfont][id]}]", $stylestuff['smfont']['subst'], 'text', '55%');
showsetting('styles_edit_smfontsize', "stylevar[{$stylestuff[smfontsize][id]}]", $stylestuff['smfontsize']['subst'], 'text', '55%');
showsetting('styles_edit_link', "stylevar[{$stylestuff[link][id]}]", $stylestuff['link']['subst'], 'color', '55%');
showsetting('styles_edit_highlightlink', "stylevar[{$stylestuff[highlightlink][id]}]", $stylestuff['highlightlink']['subst'], 'color', '55%');
showsetting('styles_edit_headertext', "stylevar[{$stylestuff[headertext][id]}]", $stylestuff['headertext']['subst'], 'color', '55%');
showsetting('styles_edit_tabletext', "stylevar[{$stylestuff[tabletext][id]}]", $stylestuff['tabletext']['subst'], 'color', '55%');
showsetting('styles_edit_text', "stylevar[{$stylestuff[text][id]}]", $stylestuff['text']['subst'], 'color', '55%');
showsetting('styles_edit_lighttext', "stylevar[{$stylestuff[lighttext][id]}]", $stylestuff['lighttext']['subst'], 'color', '55%');
showtype('styles_edit_table');
showsetting('styles_edit_maintablewidth', "stylevar[{$stylestuff[maintablewidth][id]}]", $stylestuff['maintablewidth']['subst'], 'text', '55%');
showsetting('styles_edit_tablespace', "stylevar[{$stylestuff[tablespace][id]}]", $stylestuff['tablespace']['subst'], 'text', '55%');
showsetting('styles_edit_tablebg', "stylevar[{$stylestuff[tablebg][id]}]", $stylestuff['tablebg']['subst'], 'color', '55%');
showsetting('styles_edit_borderwidth', "stylevar[{$stylestuff[borderwidth][id]}]", $stylestuff['borderwidth']['subst'], 'text', '55%');
showsetting('styles_edit_bordercolor', "stylevar[{$stylestuff[bordercolor][id]}]", $stylestuff['bordercolor']['subst'], 'color', '55%');
showsetting('styles_edit_bgcolor', "stylevar[{$stylestuff[bgcolor][id]}]", $stylestuff['bgcolor']['subst'], 'color', '55%');
showsetting('styles_edit_headercolor', "stylevar[{$stylestuff[headercolor][id]}]", $stylestuff['headercolor']['subst'], 'color', '55%');
showsetting('styles_edit_catcolor', "stylevar[{$stylestuff[catcolor][id]}]", $stylestuff['catcolor']['subst'], 'color', '55%');
showsetting('styles_edit_catborder', "stylevar[{$stylestuff[catborder][id]}]", $stylestuff['catborder']['subst'], 'color', '55%');
showsetting('styles_edit_portalboxbgcode', "stylevar[{$stylestuff[portalboxbgcode][id]}]", $stylestuff['portalboxbgcode']['subst'], 'color', '55%');
showsetting('styles_edit_altbg1', "stylevar[{$stylestuff[altbg1][id]}]", $stylestuff['altbg1']['subst'], 'color', '55%');
showsetting('styles_edit_altbg2', "stylevar[{$stylestuff[altbg2][id]}]", $stylestuff['altbg2']['subst'], 'color', '55%');
showsetting('styles_edit_bgborder', "stylevar[{$stylestuff[bgborder][id]}]", $stylestuff['bgborder']['subst'], 'color', '55%');
showsetting('styles_edit_noticebg', "stylevar[{$stylestuff[noticebg][id]}]", $stylestuff['noticebg']['subst'], 'color', '55%');
showsetting('styles_edit_noticeborder', "stylevar[{$stylestuff[noticeborder][id]}]", $stylestuff['noticeborder']['subst'], 'color', '55%');
showsetting('styles_edit_noticetext', "stylevar[{$stylestuff[noticetext][id]}]", $stylestuff['noticetext']['subst'], 'color', '55%');
showsetting('styles_edit_commonboxborder', "stylevar[{$stylestuff[commonboxborder][id]}]", $stylestuff['commonboxborder']['subst'], 'color', '55%');
showsetting('styles_edit_commonboxbg', "stylevar[{$stylestuff[commonboxbg][id]}]", $stylestuff['commonboxbg']['subst'], 'color', '55%');
showsetting('styles_edit_boxspace', "stylevar[{$stylestuff[boxspace][id]}]", $stylestuff['boxspace']['subst'], 'text', '55%');
showtype('styles_other_table');
showsetting('styles_edit_inputborder', "stylevar[{$stylestuff[inputborder][id]}]", $stylestuff['inputborder']['subst'], 'color', '55%');
showsetting('styles_edit_headermenu', "stylevar[{$stylestuff[headermenu][id]}]", $stylestuff['headermenu']['subst'], 'color', '55%');
showsetting('styles_edit_headermenutext', "stylevar[{$stylestuff[headermenutext][id]}]", $stylestuff['headermenutext']['subst'], 'color', '55%');
showsetting('styles_edit_framebgcolor', "stylevar[{$stylestuff[framebgcolor][id]}]", $stylestuff['framebgcolor']['subst'], 'color', '55%');
showtype('', 'bottom');
?>
<br /><br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td width="48"><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['styles_edit_variable']?></td><td><?=$lang['styles_edit_subst']?></td></tr>
<?=$stylecustom?>
<tr align="center" class="altbg1"><td><?=$lang['add_new']?></td>
<td><input type='text' name="newcvar" size="20"></td>
<td><textarea name="newcsubst" cols="50" rows="2"></textarea></td>
</tr></table>
<?
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"editsubmit\" value=\"$lang[submit]\"></center></form>";
} else {
if($newcvar && $newcsubst) {
if($db->result_first("SELECT COUNT(*) FROM {$tablepre}stylevars WHERE variable='$newcvar' AND styleid='$edit'")) {
cpmsg('styles_edit_variable_duplicate');
} elseif(!preg_match("/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/", $newcvar)) {
cpmsg('styles_edit_variable_illegal');
}
$newcvar = strtolower($newcvar);
$db->query("INSERT INTO {$tablepre}stylevars (styleid, variable, substitute)
VALUES ('$edit', '$newcvar', '$newcsubst')");
}
$db->query("UPDATE {$tablepre}styles SET name='$namenew', templateid='$templateidnew' WHERE styleid='$edit'");
foreach($stylevar as $id => $substitute) {
$substitute = @htmlspecialchars($substitute);
$db->query("UPDATE {$tablepre}stylevars SET substitute='$substitute' WHERE stylevarid='$id' AND styleid='$edit'");
}
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}stylevars WHERE stylevarid IN ($ids) AND styleid='$edit'");
}
updatecache('styles');
cpmsg('styles_edit_succeed', 'admincp.php?action=styles'.($newcvar && $newcsubst ? '&edit='.$edit : ''));
}
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/styles.inc.php | PHP | asf20 | 18,823 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: faq.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
if(!isfounder()) cpmsg('noaccess_isfounder');
if($action == 'faqlist') {
if(!submitcheck('faqsubmit')) {
$faqparent = $faqsub = array();
$faqlists = $faqselect = '';
$query = $db->query("SELECT * FROM {$tablepre}faqs ORDER BY displayorder");
while($faq = $db->fetch_array($query)) {
if(empty($faq['fpid'])) {
$faqparent[$faq['id']] = $faq;
$faqselect .= "<option value=\"$faq[id]\">$faq[title]</option>";
} else {
$faqsub[$faq['fpid']][] = $faq;
}
}
foreach($faqparent as $parent) {
$disabled = !empty($faqsub[$parent['id']]) ? 'disabled' : '';
$faqlists .= "<tr class=\"altbg1\">\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$parent[id]\" $disabled></td>".
"<td class=\"altbg2\"><input type=\"text\" size=\"30\" name=\"title[$parent[id]]\" value=\"".dhtmlspecialchars($parent['title'])."\"></td>".
"<td class=\"altbg1\"><input type=\"text\" size=\"3\" name=\"displayorder[$parent[id]]\" value=\"$parent[displayorder]\"></td>".
"<td class=\"altbg2\">$lang[none]</td>".
"<td class=\"altbg1\">[<a href=\"admincp.php?action=faqdetail&id=$parent[id]\">".$lang['detail']."</a>]</td>".
"</tr>";
if(!empty($faqsub[$parent['id']])) {
foreach($faqsub[$parent['id']] as $sub) {
$faqlists .= "<tr class=\"altbg1\">\n".
"<td class=\"altbg1\"><input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$sub[id]\"></td>".
"<td class=\"altbg2\" style=\"padding-left:45px\"><input type=\"text\" size=\"30\" name=\"title[$sub[id]]\" value=\"".dhtmlspecialchars($sub['title'])."\"></td>".
"<td class=\"altbg1\"><input type=\"text\" size=\"3\" name=\"displayorder[$sub[id]]\" value=\"$sub[displayorder]\"></td>".
"<td class=\"altbg2\">{$faqparent[$sub['fpid']][title]}</td>".
"<td class=\"altbg1\">[<a href=\"admincp.php?action=faqdetail&id=$sub[id]\">".$lang['detail']."</a>]</td>".
"</tr>";
}
}
}
shownav('faq_forum');
?>
<form method="post" action="admincp.php?action=faqlist">
<input type="hidden" name="formhash" value="<?=FORMHASH?>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header">
<td><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form)"><?=$lang['del']?></td>
<td><?=$lang['faq_thread']?></td><td><?=$lang['display_order']?></td><td><?=$lang['faq_sortup']?></td><td><?=$lang['detail']?></td></tr>
<?=$faqlists?>
<tr class="altbg1" align="center">
<td><?=$lang['add_new']?></td>
<td><input type="text" size="30" name="newtitle"></td>
<td><input type="text" size="3" name="newdisplayorder"></td>
<td><select name="newfpid"><option value="0"><?=$lang['none']?></option><?=$faqselect?></select></td>
<td></td>
</tr></table><br />
<center><input class="button" type="submit" name="faqsubmit" value="<?=$lang['submit']?>"></center></form>
<?
} else {
if($ids = implodeids($delete)) {
$db->query("DELETE FROM {$tablepre}faqs WHERE id IN ($ids)");
}
if(is_array($title)) {
foreach($title as $id => $val) {
$db->query("UPDATE {$tablepre}faqs SET displayorder='$displayorder[$id]', title='$title[$id]' WHERE id='$id'");
}
}
if($newtitle != '') {
$newdisplayorder = intval($newdisplayorder);
$db->query("INSERT INTO {$tablepre}faqs (fpid, displayorder, title)
VALUES ('$newfpid', '$newdisplayorder', '$newtitle')");
}
cpmsg('faq_list_update', 'admincp.php?action=faqlist');
}
} elseif($action == 'faqdetail') {
if(!submitcheck('detailsubmit')) {
$query = $db->query("SELECT * FROM {$tablepre}faqs WHERE id='$id'");
if(!($faq = $db->fetch_array($query))) {
cpmsg('undefined_action');
}
$query = $db->query("SELECT * FROM {$tablepre}faqs WHERE fpid='0' ORDER BY displayorder, fpid ");
while($parent = $db->fetch_array($query)) {
$faqselect .= "<option value=\"$parent[id]\" ".($faq['fpid'] == $parent['id'] ? 'selected' : '').">$parent[title]</option>";
}
shownav('faq_forum');
echo "<form method=\"post\" action=\"admincp.php?action=faqdetail&id=$id&formhash=".FORMHASH."\">";
showtype('faq_edit', 'top');
showsetting('faq_title', 'titlenew', $faq['title'], 'text');
if(!empty($faq['fpid'])) {
showsetting('faq_sortup', '', '', '<select name="fpidnew"><option value=\"\">'.$lang['none'].'</option>'.$faqselect.'</select>');
showsetting('faq_identifier', 'identifiernew', $faq['identifier'], 'text');
showsetting('faq_keywords', 'keywordnew', $faq['keyword'], 'text');
showsetting('faq_content', 'messagenew', $faq['message'], 'textarea');
}
showtype('', 'bottom');
echo "<br /><center><input class=\"button\" type=\"submit\" name=\"detailsubmit\" value=\"".$lang['submit']."\"></center></form>";
} else {
if(!$titlenew) {
cpmsg('faq_no_title');
}
if(!empty($identifiernew)) {
$query = $db->query("SELECT id FROM {$tablepre}faqs WHERE identifier='$identifiernew' AND id!='$id'");
if($db->num_rows($query)) {
cpmsg('faq_identifier_invalid');
}
}
if(strlen($keywordnew) > 50) {
cpmsg('faq_keyword_toolong');
}
$fpidnew = $fpidnew ? intval($fpidnew) : 0;
$titlenew = trim($titlenew);
$messagenew = trim($messagenew);
$identifiernew = trim($identifiernew);
$keywordnew = trim($keywordnew);
$db->query("UPDATE {$tablepre}faqs SET fpid='$fpidnew', identifier='$identifiernew', keyword='$keywordnew', title='$titlenew', message='$messagenew' WHERE id='$id'");
updatecache('faqs');
cpmsg('faq_list_update', 'admincp.php?action=faqlist');
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/faq.inc.php | PHP | asf20 | 6,001 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: supesite.inc.php 9769 2007-08-14 02:08:43Z cnteacher $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
cpheader();
$query = $db->query("SELECT variable, value FROM {$tablepre}settings WHERE variable IN ('supe', 'supe_siteurl', 'supe_sitename', 'supe_status', 'supe_circlestatus', 'supe_tablepre')");
while($setting = $db->fetch_array($query)) {
$settings[$setting['variable']] = $setting['value'];
}
$settings['supe'] = (array)unserialize($settings['supe']);
$settings = daddslashes($settings, 1);
if(!$settings['supe_siteurl']) {
shownav('supe_settings');
showtips('supe_tips_unstalled');
} else {
if(!submitcheck('settingsubmit')) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
if($settings['supe_circlestatus']) {
$query = $db->query("SELECT fid FROM {$tablepre}forums WHERE status=2");
$circlefids = $delimiter = '';
while($forum = $db->fetch_array($query)) {
$circlefids .= $delimiter.$forum['fid'];
$delimiter = '|';
}
$forumselect = '<select name="circlefids[]" size="10" multiple="multiple">'.preg_replace("/(\<option value=\"(".$circlefids.")\")(\>)/", "\\1 selected=\"selected\"\\3", forumselect()).'</select>';
}
$orderbycheck = array($settings['supe']['items']['orderby'] => 'checked');
$dbmodecheck = array($settings['supe']['dbmode'] => 'checked');
shownav('supe_settings');
showtips('supe_tips_installed');
echo '<form method="post" name="settings" action="admincp.php?action=xspace">';
echo '<input type="hidden" name="formhash" value="'.FORMHASH.'">';
showtype('supe_settings', 'top');
showsetting('supe_status', 'settingsnew[supe][status]', $settings['supe_status'], 'radio');
showsetting('supe_tablepre', 'settingsnew[supe][tablepre]', $settings['supe_tablepre'], 'text');
showsetting('supe_siteurl', 'settingsnew[supe][siteurl]', $settings['supe_siteurl'], 'text');
showsetting('supe_sitename', 'settingsnew[supe][sitename]', $settings['supe_sitename'], 'text');
showsetting('supe_last_newuser', 'settingsnew[supe][maxupdateusers]', $settings['supe']['maxupdateusers'], 'text');
showsetting('supe_hot', 'settingsnew[supe][items][status]', $settings['supe']['items']['status'], 'radio', '', '', 1);
showsetting('supe_hot_hours', 'settingsnew[supe][items][hours]', $settings['supe']['items']['hours'], 'text');
showsetting('supe_hot_lines', 'settingsnew[supe][items][rows]', $settings['supe']['items']['rows'], 'text');
showsetting('supe_hot_cols', 'settingsnew[supe][items][columns]', $settings['supe']['items']['columns'], 'text');
echo '<tr><td class="altbg1"><b>'.$lang['supe_hot_order'].'</b><br />'.$lang['supe_hot_order_comment'].'</td>';
echo '<td class="altbg2"><input class="radio" type="radio" name="settingsnew[supe][items][orderby]" value="1" '.$orderbycheck[1].'>'.$lang['supe_hot_order_views'].'<br /><input class="radio" type="radio" name="settingsnew[supe][items][orderby]" value="2" '.$orderbycheck[2].'>'.$lang['supe_hot_order_replies'].'<br /><input class="radio" type="radio" name="settingsnew[supe][items][orderby]" value="3" '.$orderbycheck[3].'>'.$lang['supe_hot_lasttime'].'<br /><input class="radio" type="radio" name="settingsnew[supe][items][orderby]" value="4" '.$orderbycheck[4].'>'.$lang['supe_hot_lasttime_reply'].'</td></tr>';
echo '</tbody><tbody>';
echo '<tr><td class="altbg1"><b>'.$lang['supe_status_batch'].'</b><br />'.$lang['supe_collection_mode_comment'].'</td>';
echo '<td class="altbg2"><input class="radio" type="radio" name="supe_pushsetting[status]" value="-1" onclick="$(\'supe_pushsetting_filter_div\').style.display=\'none\'" checked>'.$lang['supe_status_batch_noopt'].'<br /><input class="radio" type="radio" name="supe_pushsetting[status]" value="0" onclick="$(\'supe_pushsetting_filter_div\').style.display=\'none\'">'.$lang['supe_pushsetting_status_0'].'<br /><input class="radio" type="radio" name="supe_pushsetting[status]" value="1" onclick="$(\'supe_pushsetting_filter_div\').style.display=\'none\'">'.$lang['supe_pushsetting_status_1'].'<br /><input class="radio" type="radio" name="supe_pushsetting[status]" value="2" onclick="$(\'supe_pushsetting_filter_div\').style.display=\'none\'">'.$lang['supe_pushsetting_status_2'].'<br /><input class="radio" type="radio" name="supe_pushsetting[status]" value="3" onclick="$(\'supe_pushsetting_filter_div\').style.display=\'block\'">'.$lang['supe_pushsetting_status_3'];
echo '<div id="supe_pushsetting_filter_div" style="display:'.($forum['supe_pushsetting']['status'] == 3 ? 'block' : 'none').'">';
echo ''.$lang['supe_pushsetting_views'].' >= <input type="input" name="supe_pushsetting[filter][views]" value="'.$forum['supe_pushsetting']['filter']['views'].'" size="8">';
echo '<br />'.$lang['supe_pushsetting_replys'].' >= <input type="input" name="supe_pushsetting[filter][replies]" value="'.$forum['supe_pushsetting']['filter']['replies'].'" size="8">';
echo '<br />'.$lang['supe_pushsetting_digest'].' >= <select name="supe_pushsetting[filter][digest]"><option value="0"></option><option value="1">'.$lang['forums_digest_one'].'</option><option value="2">'.$lang['forums_digest_two'].'</option><option value="3">'.$lang['forums_digest_three'].'</option></select>';
echo '<br />'.$lang['supe_pushsetting_stick'].' >= <select name="supe_pushsetting[filter][displayorder]"><option value="0"></option><option value="1">'.$lang['forums_stick_one'].'</option><option value="2">'.$lang['forums_stick_two'].'</option><option value="3">'.$lang['forums_stick_three'].'</option></select>';
echo '</div><br />';
echo '<select name="collectfids[]" size="10" multiple="multiple">'.forumselect().'</select>';
echo '</td></tr>';
if($settings['supe_circlestatus']) {
showsetting('sup_group_discuss_show', 'settingsnew[supe][updatecircles]', $settings['supe']['updatecircles'], 'radio');
showsetting('sup_group_discuss', '', '', $forumselect);
}
showtype('', 'bottom');
echo '<br />';
showtype('supe_dbsettings', 'top');
showsetting('supe_dbmode', 'settingsnew[supe][dbmode]', $settings['supe']['dbmode'], 'radio', '', '', 1);
showsetting('supe_dbhost', 'settingsnew[supe][dbhost]', $settings['supe']['dbhost'], 'text');
showsetting('supe_dbuser', 'settingsnew[supe][dbuser]', $settings['supe']['dbuser'], 'text');
showsetting('supe_dbpw', 'settingsnew[supe][dbpw]', $settings['supe']['dbpw'], 'text');
showsetting('supe_dbname', 'settingsnew[supe][dbname]', $settings['supe']['dbname'], 'text');
showtype('', 'bottom');
?>
<br /><center><input class="button" type="submit" name="settingsubmit" value="<?=$lang['submit']?>"></center>
</form>
<?
} else {
$settingsnew['supe']['maxupdateusers'] = intval($settingsnew['supe']['maxupdateusers']);
$supe = $settingsnew['supe'];
$supe['circlestatus'] = $settings['supe_circlestatus'];
if($supe['dbmode'] == 1) {
if($supe['dbhost'] == $dbhost) {
$supe['dbmode'] = 0;
} else {
$supe_dblink = @mysql_connect($supe['dbhost'], $supe['dbuser'], $supe['dbpw']);
if(!$supe_dblink) {
cpmsg('supe_database_connect_error');
} elseif(!@mysql_select_db($supe['dbname'], $supe_dblink)) {
cpmsg('supe_database_select_db_error');
} else {
mysql_close($supe_dblink);
unset($supe_dblink);
}
}
}
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('supe', '".addslashes(serialize($supe))."')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('supe_status', '$supe[status]')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('supe_tablepre', '$supe[tablepre]')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('supe_siteurl', '$supe[siteurl]')");
$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('supe_sitename', '$supe[sitename]')");
if($supe_pushsetting['status'] != '-1' && $collectfids = implodeids($collectfids)) {
$db->query("UPDATE {$tablepre}forumfields SET supe_pushsetting='".serialize($supe_pushsetting)."' WHERE fid IN ($collectfids)");
}
updatecache('settings');
updatecache(array('supe_updateusers', 'supe_updateitems', 'supe_updatecircles'));
if($settings['supe_circlestatus'] && $circlefids && is_array($circlefids)) {
$db->query("UPDATE {$tablepre}forums SET status=1 WHERE fid NOT IN (".implode(',', $circlefids).") AND status=2");
$db->query("UPDATE {$tablepre}forums SET status=2 WHERE fid IN (".implode(',', $circlefids).")");
}
$db->query("TRUNCATE TABLE {$tablepre}spacecaches", 'UNBUFFERED');
cpmsg('supe_update_succeed');
}
}
?> | zyyhong | trunk/jiaju001/bbs/admin/supesite.inc.php | PHP | asf20 | 9,105 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: viewthread.php 10561 2007-09-05 08:24:49Z monkey $
*/
define('CURSCRIPT', 'viewthread');
define('SQL_ADD_THREAD', ' t.dateline, t.special, t.lastpost AS lastthreadpost,');
require_once './include/common.inc.php';
require_once DISCUZ_ROOT.'./include/forum.func.php';
$page = max($page, 1);
if($cachethreadlife && $forum['threadcaches'] && !$discuz_uid && $page == 1 && !$forum['special']) {
viewthread_loadcache();
}
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
$discuz_action = 3;
$supe['status'] && supe_dbconnect();
$query = $db->query("SELECT * FROM {$tablepre}threads t WHERE tid='$tid' AND displayorder>='0'");
if(!$thread = $db->fetch_array($query)) {
$tid = $_GET['tid'];
if($supe['status'] && is_numeric($tid) && !empty($supe_fromsupesite) && md5("$discuz_auth_key-$tid") == $supe_fromsupesite) {
$supe['db']->query("UPDATE {$supe[tablepre]}spaceitems SET tid='0' WHERE tid='$tid'", 'SILENT');
}
showmessage('thread_nonexistence');
}
$oldtopics = isset($_DCOOKIE['oldtopics']) ? $_DCOOKIE['oldtopics'] : 'D';
if(strpos($oldtopics, 'D'.$tid.'D') === FALSE) {
$oldtopics = 'D'.$tid.$oldtopics;
if(strlen($oldtopics) > 3072) {
$oldtopics = preg_replace("((D\d+)+D).*$", "\\1", substr($oldtopics, 0, 3072));
}
dsetcookie('oldtopics', $oldtopics, 3600);
}
if($lastvisit < $thread['lastpost'] && (!isset($_DCOOKIE['fid'.$fid]) || $thread['lastpost'] > $_DCOOKIE['fid'.$fid])) {
dsetcookie('fid'.$fid, $thread['lastpost'], 3600);
}
$thisgid = 0;
$thread['subjectenc'] = rawurlencode($thread['subject']);
$fromuid = $creditspolicy['promotion_visit'] && $discuz_uid ? '&fromuid='.$discuz_uid : '';
$supe_fromdiscuz = $supe['status'] && $thread['itemid'] ? md5("$discuz_auth_key-$thread[itemid]") : '';
$iscircle = $supe['status'] && $supe['circlestatus'] && $forum['status'] == 2 && $thread['sgid'];
$navigation = '» <a href="'.($iscircle && empty($frombbs) ? $supe['siteurl'].'?action_mygroup_gid_'.$thread['sgid'].'_op_list_type_bbs_fid_'.$fid : 'forumdisplay.php?fid='.$fid.($extra ? '&'.preg_replace("/^(&)*/", '', $extra) : '')).'">'.$forum['name'].'</a> » '.$thread['subject'];
$navtitle = $thread['subject'].' - '.strip_tags($forum['name']);
if($forum['type'] == 'sub') {
$query = $db->query("SELECT fid, name FROM {$tablepre}forums WHERE fid='$forum[fup]'");
$fup = $db->fetch_array($query);
$navigation = '» <a href="'.($iscircle ? $supe['siteurl'].'?action_mygroup_gid_'.$thread['sgid'].'_op_list_type_bbs_fid_'.$fup[fid] : 'forumdisplay.php?fid='.$fup[fid]).'">'.$fup[name].'</a> '.$navigation;
$navtitle = $navtitle.' - '.strip_tags($fup['name']);
}
$navtitle .= ' - ';
$forum['typemodels'] = $forum['typemodels'] ? unserialize($forum['typemodels']) : array();
$threadtype = isset($forum['threadtypes']['types'][$thread['typeid']]) ? 1 : 0;
$typetemplate = '';
$optiondata = $optionlist = array();
if($thread['typeid'] && $threadtype) {
if($forum['threadtypes']['special'][$thread['typeid']]) {
if(@include_once DISCUZ_ROOT.'./forumdata/cache/threadtype_'.$thread['typeid'].'.php') {
$query = $db->query("SELECT optionid, value FROM {$tablepre}typeoptionvars WHERE tid='$tid'");
while($option = $db->fetch_array($query)) {
$optiondata[$option['optionid']] = $option['value'];
}
foreach($_DTYPE as $optionid => $option) {
$optionlist[$option['identifier']]['title'] = $_DTYPE[$optionid]['title'];
if($_DTYPE[$optionid]['type'] == 'checkbox') {
$optionlist[$option['identifier']]['value'] = '';
foreach(explode("\t", $optiondata[$optionid]) as $choiceid) {
$optionlist[$option['identifier']]['value'] .= $_DTYPE[$optionid]['choices'][$choiceid].' ';
}
} elseif(in_array($_DTYPE[$optionid]['type'], array('radio', 'select'))) {
$optionlist[$option['identifier']]['value'] = $_DTYPE[$optionid]['choices'][$optiondata[$optionid]];
} elseif($_DTYPE[$optionid]['type'] == 'image') {
$maxwidth = $_DTYPE[$optionid]['maxwidth'] ? 'width="'.$_DTYPE[$optionid]['maxwidth'].'"' : '';
$maxheight = $_DTYPE[$optionid]['maxheight'] ? 'height="'.$_DTYPE[$optionid]['maxheight'].'"' : '';
$optionlist[$option['identifier']]['value'] = $optiondata[$optionid] ? "<a href=\"$optiondata[$optionid]\" target=\"_blank\"><img src=\"$optiondata[$optionid]\" $maxwidth $maxheight border=\"0\"></a>" : '';
} elseif($_DTYPE[$optionid]['type'] == 'url') {
$optionlist[$option['identifier']]['value'] = $optiondata[$optionid] ? "<a href=\"$optiondata[$optionid]\" target=\"_blank\">$optiondata[$optionid]</a>" : '';
} else {
$optionlist[$option['identifier']]['value'] = $optiondata[$optionid];
}
}
$typetemplate = $_DTYPETEMPLATE ? preg_replace(array("/\[(.+?)value\]/ies", "/{(.+?)}/ies"), array("showoption('\\1', 'value')", "showoption('\\1', 'title')"), $_DTYPETEMPLATE) : '';
}
}
$thread['subject'] = ($forum['threadtypes']['listable'] ? '<a href="forumdisplay.php?fid='.$fid.'&filter=type&typeid='.$thread['typeid'].'">['.$forum['threadtypes']['types'][$thread['typeid']].']</a>' : '['.$forum['threadtypes']['types'][$thread['typeid']].']').' '.$thread['subject'];
}
if(empty($forum['allowview'])) {
if(!$forum['viewperm'] && !$readaccess) {
showmessage('group_nopermission', NULL, 'NOPERM');
} elseif($forum['viewperm'] && !forumperm($forum['viewperm'])) {
$navtitle = '';
showmessage('forum_nopermission', NULL, 'NOPERM');
}
}
if($forum['formulaperm']) {
forumformulaperm($forum['formulaperm']);
}
if($forum['password'] && $forum['password'] != $_DCOOKIE['fidpw'.$fid]) {
dheader("Location: {$boardurl}forumdisplay.php?fid=$fid&sid=$sid");
}
if($thread['readperm'] && $thread['readperm'] > $readaccess && !$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
showmessage('thread_nopermission', NULL, 'NOPERM');
}
if($thread['price'] > 0 && $thread['special'] == 0) {
if($maxchargespan && $timestamp - $thread['dateline'] >= $maxchargespan * 3600) {
$db->query("UPDATE {$tablepre}threads SET price='0' WHERE tid='$tid'");
$thread['price'] = 0;
} else {
if(!$discuz_uid) {
showmessage('group_nopermission', NULL, 'NOPERM');
} elseif(!$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
$query = $db->query("SELECT tid FROM {$tablepre}paymentlog WHERE tid='$tid' AND uid='$discuz_uid'");
if(!$db->num_rows($query)) {
require_once DISCUZ_ROOT.'./include/threadpay.inc.php';
$threadpay = TRUE;
}
}
}
}
if($iscircle) {
require_once DISCUZ_ROOT.'./include/supesite_circle.inc.php';
}
$forum['modrecommend'] = $forum['modrecommend'] ? unserialize($forum['modrecommend']) : array();
$raterange = $modratelimit && $adminid == 3 && !$forum['ismoderator'] ? array() : $raterange;
$extra = rawurlencode($extra);
$allowgetattach = !empty($forum['allowgetattach']) || ($allowgetattach && !$forum['getattachperm']) || forumperm($forum['getattachperm']);
$postlist = $attachtags = $attachlist = array();
$attachpids = $announcepm = 0;
if(empty($action) && $tid) {
$thisgid = $forum['type'] == 'forum' ? $forum['fup'] : $_DCACHE['forums'][$forum['fup']]['fup'];
$lastmod = $thread['moderated'] ? viewthread_lastmod() : array();
$pmlist = array();
if($_DCACHE['pmlist']) {
$readapmids = !empty($_DCOOKIE['readapmid']) ? explode('D', $_DCOOKIE['readapmid']) : array();
foreach($_DCACHE['pmlist'] as $pm) {
if($discuz_uid && (empty($pm['groups']) || in_array($groupid, $pm['groups']))) {
if(!in_array($pm['pmid'], $readapmids)) {
$pm['announce'] = TRUE;
$pmlist[] = $pm;
$announcepm++;
}
}
}
}
if($discuz_uid && $newpm) {
require_once DISCUZ_ROOT.'./include/pmprompt.inc.php';
}
$showsettings = str_pad(decbin($showsettings), 3, '0', STR_PAD_LEFT);
$customshow = $discuz_uid ? str_pad(base_convert($customshow, 10, 3), 3, '0', STR_PAD_LEFT) : '222';
$showsignatures = $customshow{0} == 2 ? $showsettings{0} : $customshow{0};
$showavatars = $customshow{1} == 2 ? $showsettings{1} : $customshow{1};
$showimages = $customshow{2} == 2 ? $showsettings{2} : $customshow{2};
$allowpaytoauthor = $forum['allowpaytoauthor'];
$highlightstatus = isset($highlight) && str_replace('+', '', $highlight) ? 1 : 0;
$usesigcheck = $discuz_uid && $sigstatus ? 'checked="checked"' : '';
$allowpostreply = ((!$thread['closed'] && !checkautoclose()) || $forum['ismoderator']) && ((!$forum['replyperm'] && $allowreply) || ($forum['replyperm'] && forumperm($forum['replyperm'])) || $forum['allowreply']);
$allowpost = (!$forum['postperm'] && $allowpost) || ($forum['postperm'] && forumperm($forum['postperm'])) || $forum['allowpost'];
if($allowpost) {
$allowpostpoll = $allowpostpoll && ($forum['allowpostspecial'] & 1);
$allowposttrade = $allowposttrade && ($forum['allowpostspecial'] & 2);
$allowpostreward = $allowpostreward && ($forum['allowpostspecial'] & 4) && isset($extcredits[$creditstrans]);
$allowpostactivity = $allowpostactivity && ($forum['allowpostspecial'] & 8);
$allowpostdebate = $allowpostdebate && ($forum['allowpostspecial'] & 16);
$allowpostvideo = $allowpostvideo && ($forum['allowpostspecial'] & 32) && $videoopen;
} else {
$allowpostpoll = $allowposttrade = $allowpostreward = $allowpostactivity = $allowpostdebate = $allowpostvideo = FALSE;
}
$visitedforums = $visitedforums ? visitedforums() : '';
$forumselect = $forummenu = '';
$forumselect = $forummenu = '';
if($forumjump) {
if($jsmenu[1]) {
$forummenu = forumselect(FALSE, 1);
} else {
$forumselect = forumselect();
}
}
$relatedthreadlist = array();
$relatedthreadupdate = FALSE;
$relatedkeywords = $tradekeywords = $metakeywords = $firstpid = '';
$randnum = $qihoo['relate']['webnum'] ? rand(1, 1000) : '';
$statsdata = $statsdata ? dhtmlspecialchars($statsdata) : '';
if($qihoo['relate']['bbsnum'] || $insenz['topicrelatedad'] || ($insenz['traderelatedad'] && $thread['special'] == 2)) {
$site = site();
$query = $db->query("SELECT type, expiration, keywords, relatedthreads FROM {$tablepre}relatedthreads WHERE tid='$tid'");
if($db->num_rows($query)) {
while($related = $db->fetch_array($query)) {
if($related['expiration'] <= $timestamp) {
$relatedthreadupdate = TRUE;
$qihoo_up = 1;
} elseif($qihoo['relate']['bbsnum'] && $related['type'] == 'general') {
$relatedthreadlist = unserialize($related['relatedthreads']);
if($related['keywords']) {
$keywords = str_replace("\t", ' ', $related['keywords']);
$searchkeywords = rawurlencode($keywords);
$statskeywords = urlencode($keywords);
$statsurl = urlencode($boardurl.'viewthread.php?tid='.$tid);
foreach(explode("\t", $related['keywords']) as $keyword) {
$relatedkeywords .= $keyword ? '<a href="http://search.qihoo.com/sint/qusearch.html?kw='.rawurlencode($keyword).'&domain='.site().'&ics='.$charset.'" target="_blank">'.$keyword.'</a> ' : '';
$metakeywords .= $keyword ? $keyword.',' : '';
}
}
} elseif($related['type'] == 'trade') {
$tradekeywords = explode("\t", $related['keywords']);
$tradekeywords = $tradekeywords[array_rand($tradekeywords)];
}
}
} else {
$relatedthreadupdate = TRUE;
$qihoo_up = 0;
}
$relatedthreadupdate && $verifykey = md5($authkey.$tid.$thread['subjectenc'].$charset.$site);
}
$relatedthreads = array();
if(!empty($relatedthreadlist)) {
if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], 'relatedthreads') === FALSE) {
$relatedthreads['img'] = 'collapsed_no.gif';
$relatedthreads['style'] = '';
} else {
$relatedthreads['img'] = 'collapsed_yes.gif';
$relatedthreads['style'] = 'display: none';
}
}
$supe_pushstatusadd = '';
if($supe['status'] && $supe_allowpushthread && $forum['supe_pushsetting']['status'] == 3) {
if(($thread['views'] && $forum['supe_pushsetting']['filter']['views'] && $thread['views'] >= intval($forum['supe_pushsetting']['filter']['views'])) ||
($thread['replies'] && $forum['supe_pushsetting']['filter']['replies'] && $thread['replies'] >= intval($forum['supe_pushsetting']['filter']['replies'])) ||
($thread['digest'] && $forum['supe_pushsetting']['filter']['digest'] && $thread['digest'] >= intval($forum['supe_pushsetting']['filter']['digest'])) ||
($thread['displayorder'] && $forum['supe_pushsetting']['filter']['displayorder'] && $thread['displayorder'] >= intval($forum['supe_pushsetting']['filter']['displayorder']))) {
if($thread['supe_pushstatus'] == 0) {
$supe_pushstatusadd = ", supe_pushstatus='3'";
}
} elseif($thread['supe_pushstatus'] == 3) {
$supe_pushstatusadd = ", supe_pushstatus='0'";
}
}
if($tagstatus) {
$query = $db->query("SELECT tagname FROM {$tablepre}threadtags WHERE tid='$tid'");
$thread['tags'] = '';
while($tags = $db->fetch_array($query)) {
$metakeywords .= $tags['tagname'].',';
$thread['tags'] .= '<a href="tag.php?name='.rawurlencode($tags['tagname']).'" target="_blank">'.$tags['tagname'].'</a> ';
}
$relatedthreadupdate && $thread['tagsenc'] = rawurlencode(strip_tags($thread['tags']));
}
viewthread_updateviews();
@extract($_DCACHE['custominfo']);
if($thread['special'] > 0) {
$thread['starttime'] = gmdate("$dateformat $timeformat", $thread['dateline'] + $timeoffset * 3600);
$thread['remaintime'] = '';
if(!empty($do) && $do == 'viewspecialpost') {
include_once DISCUZ_ROOT.'./include/viewthread_special.inc.php';
} else {
switch($thread['special']) {
case 1: include_once DISCUZ_ROOT.'./include/viewthread_poll.inc.php'; break;
case 2: include_once DISCUZ_ROOT.'./include/viewthread_trade.inc.php'; break;
case 3: include_once DISCUZ_ROOT.'./include/viewthread_reward.inc.php'; break;
case 4: include_once DISCUZ_ROOT.'./include/viewthread_activity.inc.php'; break;
case 5: include_once DISCUZ_ROOT.'./include/viewthread_debate.inc.php'; break;
case 6: include_once DISCUZ_ROOT.'./include/viewthread_video.inc.php'; break;
}
}
}
$onlyauthoradd = '';
$authorid = intval($authorid);
if($authorid) {
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='$tid' AND invisible='0' AND authorid='$authorid'");
$thread['replies'] = $db->result($query, 0) - 1;
if($thread['replies'] < 0) {
showmessage('undefined_action');
}
$onlyauthoradd = "AND p.authorid='$authorid'";
};
$ppp = $forum['threadcaches'] && !$discuz_uid ? $_DCACHE['settings']['postperpage'] : $ppp;
$totalpage = ceil(($thread['replies'] + 1) / $ppp);
$page > $totalpage && $page = $totalpage;
$pagebydesc = $page > 50 && $page > ($totalpage / 2) ? TRUE : FALSE;
if($pagebydesc) {
$firstpagesize = ($thread['replies'] + 1) % $ppp;
$ppp2 = $page == $totalpage && $firstpagesize ? $firstpagesize : $ppp;
$realpage = $totalpage - $page + 1;
$start_limit = max(0, ($realpage - 2) * $ppp + $firstpagesize);
$numpost = ($page - 1) * $ppp;
$pageadd = "ORDER BY dateline DESC LIMIT $start_limit, $ppp2";
} else {
$start_limit = $numpost = ($page - 1) * $ppp;
if($start_limit > $thread['replies']) {
$start_limit = $numpost = 0;
$page = 1;
}
$pageadd = "ORDER BY dateline LIMIT $start_limit, $ppp";
}
$multipage = multi($thread['replies'] + 1, $ppp, $page, "viewthread.php?tid=$tid&extra=$extra".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : '').(!empty($authorid) ? "&authorid=$authorid" : ''));
$newpostanchor = $postcount = $ratelogpids = 0;
$onlineauthors = array();
$query = $db->query("SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestposts, m.oltime,
m.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5, m.extcredits6,
m.extcredits7, m.extcredits8, m.email, m.gender, m.showemail, m.invisible, m.xspacestatus, mf.nickname, mf.site,
mf.icq, mf.qq, mf.yahoo, mf.msn, mf.taobao, mf.alipay, mf.location, mf.medals, mf.avatar, mf.avatarwidth,
mf.avatarheight, mf.sightml AS signature, mf.customstatus, mf.spacename $fieldsadd
FROM {$tablepre}posts p
LEFT JOIN {$tablepre}members m ON m.uid=p.authorid
LEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid
WHERE p.tid='$tid' AND p.invisible='0' $onlyauthoradd $pageadd");
while($post = $db->fetch_array($query)) {
$postlist[$post['pid']] = viewthread_procpost($post);
}
if($pagebydesc) {
$postlist = array_reverse($postlist, TRUE);
}
if($vtonlinestatus == 2 && $onlineauthors) {
$query = $db->query("SELECT uid FROM {$tablepre}sessions WHERE uid IN(".(implode(',', $onlineauthors)).") AND invisible=0");
$onlineauthors = array();
while($author = $db->fetch_array($query)) {
$onlineauthors[$author['uid']] = 1;
}
} else {
$onlineauthors = array();
}
if($ratelogpids) {
$query = $db->query("SELECT * FROM {$tablepre}ratelog WHERE pid IN ($ratelogpids) ORDER BY dateline DESC");
while($ratelog = $db->fetch_array($query)) {
if(count($postlist[$ratelog['pid']]['ratelog']) < $ratelogrecord) {
$ratelog['dateline'] = gmdate("$dateformat $timeformat", $ratelog['dateline'] + $timeoffset * 3600);
$ratelog['score'] = $ratelog['score'] > 0 ? '+'.$ratelog['score'] : $ratelog['score'];
$ratelog['reason'] = dhtmlspecialchars($ratelog['reason']);
$postlist[$ratelog['pid']]['ratelog'][] = $ratelog;
}
}
}
if($attachpids) {
require_once DISCUZ_ROOT.'./include/attachment.func.php';
parseattach($attachpids, $attachtags, $postlist, $showimages);
}
viewthread_parsetags();
if(empty($postlist)) {
showmessage('undefined_action', NULL, 'HALTED');
} else {
$seodescription = current($postlist);
$seodescription = cutstr(htmlspecialchars(strip_tags($seodescription['message'])), 150);
}
$areaid=$forum['areaid'];
if($areaid==2){
$siteurl='http://shy.jiaju001.com';
}else{
$siteurl='http://www.jiaju001.com';
}
include template('viewthread');
} elseif($action == 'printable' && $tid) {
require_once DISCUZ_ROOT.'./include/printable.inc.php';
}
function viewthread_updateviews() {
global $delayviewcount, $supe_pushstatusadd, $timestamp, $tablepre, $tid, $db, $adminid;
if(($delayviewcount == 1 || $delayviewcount == 3) && !$supe_pushstatusadd) {
$logfile = './forumdata/cache/cache_threadviews.log';
if(substr($timestamp, -2) == '00') {
require_once DISCUZ_ROOT.'./include/misc.func.php';
updateviews('threads', 'tid', 'views', $logfile);
}
if(@$fp = fopen(DISCUZ_ROOT.$logfile, 'a')) {
fwrite($fp, "$tid\n");
fclose($fp);
} elseif($adminid == 1) {
showmessage('view_log_invalid');
}
} else {
$db->query("UPDATE LOW_PRIORITY {$tablepre}threads SET views=views+1 $supe_pushstatusadd WHERE tid='$tid'", 'UNBUFFERED');
}
unset($supe_pushstatusadd);
}
function viewthread_procpost($post, $special = 0) {
global $_DCACHE, $newpostanchor, $numpost, $thisbg, $postcount, $ratelogpids, $onlineauthors, $lastvisit, $thread,
$attachpids, $attachtags, $forum, $dateformat, $timeformat, $timeoffset, $userstatusby, $allowgetattach,
$allowpaytoauthor, $ratelogrecord, $showimages, $forum, $discuz_uid, $showavatars, $pagebydesc, $ppp2,
$firstpid, $videoopen;
if(!$newpostanchor && $post['dateline'] > $lastvisit) {
$post['newpostanchor'] = '<a name="newpost"></a>';
$newpostanchor = 1;
} else {
$post['newpostanchor'] = '';
}
$post['lastpostanchor'] = $numpost == $thread['replies'] ? '<a name="lastpost"></a>' : '';
$post['count'] = $postcount++;
if($pagebydesc) {
$post['number'] = $numpost + $ppp2--;
} else {
$post['number'] = ++$numpost;
}
$post['dbdateline'] = $post['dateline'];
$post['dateline'] = gmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600);
$post['groupid'] = $_DCACHE['usergroups'][$post['groupid']] ? $post['groupid'] : 7;
if($post['username']) {
$onlineauthors[] = $post['authorid'];
$post['usernameenc'] = rawurlencode($post['username']);
!$special && $post['groupid'] = getgroupid($post['authorid'], $_DCACHE['usergroups'][$post['groupid']], $post);
$post['readaccess'] = $_DCACHE['usergroups'][$post['groupid']]['readaccess'];
if($userstatusby == 1 || $_DCACHE['usergroups'][$post['groupid']]['byrank'] == 0) {
$post['authortitle'] = $_DCACHE['usergroups'][$post['groupid']]['grouptitle'];
$post['stars'] = $_DCACHE['usergroups'][$post['groupid']]['stars'];
} elseif($userstatusby == 2) {
foreach($_DCACHE['ranks'] as $rank) {
if($post['posts'] > $rank['postshigher']) {
$post['authortitle'] = $rank['ranktitle'];
$post['stars'] = $rank['stars'];
break;
}
}
}
$post['alipay'] = $allowpaytoauthor ? $post['alipay']: '';
$post['taobaoas'] = addslashes($post['taobao']);
$post['authoras'] = !$post['anonymous'] ? ' '.addslashes($post['author']) : '';
$post['regdate'] = gmdate($dateformat, $post['regdate'] + $timeoffset * 3600);
$post['lastdate'] = gmdate($dateformat, $post['lastactivity'] + $timeoffset * 3600);
$post['allowuseblog'] = $_DCACHE['usergroups'][$post['groupid']]['allowuseblog'];
if($post['medals']) {
@include_once DISCUZ_ROOT.'./forumdata/cache/cache_medals.php';
foreach($post['medals'] = explode("\t", $post['medals']) as $key => $medalid) {
if(isset($_DCACHE['medals'][$medalid])) {
$post['medals'][$key] = $_DCACHE['medals'][$medalid];
} else {
unset($post['medals'][$key]);
}
}
}
if($showavatars) {
if($_DCACHE['usergroups'][$post['groupid']]['allowavatar'] && $post['avatar']) {
$post['avatar'] = '<div class="avatar"><img src="'.$post['avatar'].'" width="'.$post['avatarwidth'].'" height="'.$post['avatarheight'].'" border="0" alt="" />';
} else {
$post['avatar'] = '<div class="avatar"><img class="avatar" src="images/avatars/noavatar.gif" alt="" />';
}
if($_DCACHE['usergroups'][$post['groupid']]['groupavatar']) {
$post['avatar'] .= '<br /><img src="'.$_DCACHE['usergroups'][$post['groupid']]['groupavatar'].'" border="0" alt="" />';
}
$post['avatar'] .= '</div>';
}
} else {
if(!$post['authorid']) {
$post['useip'] = substr($post['useip'], 0, strrpos($post['useip'], '.')).'.x';
}
}
$post['attachments'] = array();
if($post['attachment']) {
if($allowgetattach) {
$attachpids .= ",$post[pid]";
$post['attachment'] = 0;
if(preg_match_all("/\[attach\](\d+)\[\/attach\]/i", $post['message'], $matchaids)) {
$attachtags[$post['pid']] = $matchaids[1];
}
} else {
$post['message'] = preg_replace("/\[attach\](\d+)\[\/attach\]/i", '', $post['message']);
}
}
$ratelogpids .= ($ratelogrecord && $post['ratetimes']) ? ','.$post['pid'] : '';
$forum['allowbbcode'] = $forum['allowbbcode'] ? ($_DCACHE['usergroups'][$post['groupid']]['allowcusbbcode'] ? 2 : 1) : 0;
$post['ratings'] = karmaimg($post['rate'], $post['ratetimes']);
$post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $forum['allowsmilies'], $forum['allowbbcode'], ($forum['allowimgcode'] && $showimages ? 1 : 0), $forum['allowhtml'], ($forum['jammer'] && $post['authorid'] != $discuz_uid ? 1 : 0), 0, $post['authorid'], $forum['allowmediacode'], $post['pid']);
$videoopen && $post['message'] = videocode($post['message'], $post['tid'], $post['pid']);
$post['signature'] = $post['usesig'] ? $post['signature'] : '';
$post['first'] && $firstpid = $post['pid'];
return $post;
}
function showoption($var, $type) {
global $optionlist;
if($optionlist[$var][$type]) {
return $optionlist[$var][$type];
} else {
return 'none';
}
}
function viewthread_loadcache() {
global $tid, $forum, $timestamp, $cachethreadlife, $_DCACHE, $gzipcompress, $supe_pushstatusadd, $debug, $styleid;
$forum['livedays'] = ceil(($timestamp - $forum['dateline']) / 86400);
$forum['lastpostdays'] = ceil(($timestamp - $forum['lastthreadpost']) / 86400);
$threadcachemark = 100 - (
$forum['displayorder'] * 15 +
$forum['digest'] * 10 +
min($forum['views'] / max($forum['livedays'], 10) * 2, 50) +
max(-10, (15 - $forum['lastpostdays'])) +
min($forum['replies'] / $_DCACHE['settings']['postperpage'] * 1.5, 15));
if($threadcachemark < $forum['threadcaches']) {
$threadcache = getcacheinfo($tid);
if($timestamp - $threadcache['filemtime'] > $cachethreadlife) {
@unlink($threadcache['filename']);
define('CACHE_FILE', $threadcache['filename']);
$styleid = $_DCACHE['settings']['styleid'];
@include DISCUZ_ROOT.'./forumdata/cache/style_'.$styleid.'.php';
} else {
readfile($threadcache['filename']);
$supe_pushstatusadd = '';
viewthread_updateviews();
$debug && debuginfo();
die('<script type="text/javascript">document.getElementById("debuginfo").innerHTML = " '.($debug ? 'Update at '.gmdate("H:i:s", $threadcache['filemtime'] + 3600 * 8).', Processed in '.$debuginfo['time'].' second(s), '.$debuginfo['queries'].' Queries'.($gzipcompress ? ', Gzip enabled' : '') : '').'";</script>');
}
}
}
function viewthread_lastmod() {
global $db, $tablepre, $dateformat, $timeformat, $timeoffset, $tid;
$query = $db->query("SELECT uid AS moduid, username AS modusername, dateline AS moddateline, action AS modaction, magicid
FROM {$tablepre}threadsmod
WHERE tid='$tid' ORDER BY dateline DESC LIMIT 1");
if($lastmod = $db->fetch_array($query)) {
include language('modactions');
$lastmod['modusername'] = $lastmod['modusername'] ? $lastmod['modusername'] : 'System';
$lastmod['moddateline'] = gmdate("$dateformat $timeformat", $lastmod['moddateline'] + $timeoffset * 3600);
$lastmod['modaction'] = $modactioncode[$lastmod['modaction']];
if($lastmod['magicid']) {
require_once DISCUZ_ROOT.'./forumdata/cache/cache_magics.php';
$lastmod['magicname'] = $_DCACHE['magics'][$lastmod['magicid']]['name'];
}
} else {
$db->query("UPDATE {$tablepre}threads SET moderated='0' WHERE tid='$tid'", 'UNBUFFERED');
}
return $lastmod;
}
function viewthread_parsetags() {
global $tagstatus, $_DCACHE, $firstpid, $postlist;
if($firstpid && $tagstatus && !($postlist[$firstpid]['htmlon'] & 2) && !empty($_DCACHE['tags'])) {
$postlist[$firstpid]['message'] = preg_replace('#(^|>)([^<]+)(?=<|$)#sUe', "highlight('\\2', \$_DCACHE[tags], '\\1')", $postlist[$firstpid]['message']);
}
}
function remaintime($time) {
$seconds = $time % 60;
$minutes = $time % 3600 / 60;
$hours = $time % 86400 / 3600;
$days = $time / 86400;
return array((int)$days, (int)$hours, (int)$minutes, (int)$seconds);
}
?> | zyyhong | trunk/jiaju001/bbs/viewthread.php | PHP | asf20 | 27,123 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: index.php 10115 2007-08-24 00:58:08Z cnteacher $
*/
$kw_spiders = 'Bot|Crawl|Spider';
// keywords regular expression of search engine spiders
$kw_browsers = 'MSIE|Netscape|Opera|Konqueror|Mozilla';
// keywords regular expression of Internet browsers
$kw_searchengines = 'google|yahoo|msn|baidu|yisou|sogou|iask|zhongsou|sohu|sina|163';
// keywords regular expression of search engine names
error_reporting(0);
//error_reporting(E_ERROR | E_WARNING | E_PARSE);
ob_start();
$runtime = explode (' ', microtime());
$starttime = $runtime[1] + $runtime[0];
define('DISCUZ_ROOT', '../');
define('IN_DISCUZ', TRUE);
define('CURSCRIPT', 'archiver');
require_once '../forumdata/cache/cache_settings.php';
require_once '../forumdata/cache/cache_archiver.php';
if(!$_DCACHE['settings']['archiverstatus']) {
exit('Sorry, Discuz! Archiver is not available.');
} elseif($_DCACHE['settings']['bbclosed']) {
exit('Sorry, the bulletin board has been closed temporarily.');
}
$_SERVER = empty($_SERVER) ? $HTTP_SERVER_VARS : $_SERVER;
require_once '../config.inc.php';
require_once '../include/db_'.$database.'.class.php';
require_once '../templates/default/archiver.lang.php';
require_once '../forumdata/cache/cache_forums.php';
require_once '../forumdata/cache/style_'.$_DCACHE['settings']['styleid'].'.php';
$db = new dbstuff;
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
$db->select_db($dbname);
unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
$PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$boardurl = 'http://'.$_SERVER['HTTP_HOST'].substr($PHP_SELF, 0, strpos($PHP_SELF, 'archiver/'));
$groupid = 7;
$extgroupids = '';
header('Content-Type: text/html; charset='.$charset);
$navtitle = $meta_contentadd = '';
$fid = $page = $tid = 0;
$qm = $_DCACHE['settings']['rewritestatus'] & 16 ? '' : '?';
$fullversion = array('title' => $_DCACHE['settings']['bbname'], 'link' => $_DCACHE['settings']['indexname']);
$querystring = preg_replace("/\.html$/i", '', trim($_SERVER['QUERY_STRING']));
if($querystring) {
$queryparts = explode('-', $querystring);
$lastpart = '';
foreach($queryparts as $querypart) {
if(empty($lastpart)) {
$lastpart = in_array($querypart, array('fid', 'page', 'tid')) ? $querypart : '';
} else {
$$lastpart = intval($querypart);
$lastpart = '';
}
}
}
if($tid) {
$action = 'thread';
$forward = 'viewthread.php?tid='.$tid;
} elseif($fid) {
$action = 'forum';
$forward = 'forumdisplay.php?fid='.$fid;
} else {
$action = 'index';
$forward = 'index.php';
}
if($_DCACHE['settings']['archiverstatus'] != 1 && !preg_match("/($kw_spiders)/i", $_SERVER['HTTP_USER_AGENT']) &&
(($_DCACHE['settings']['archiverstatus'] == 2 && preg_match("/($kw_searchengines)/", $_SERVER['HTTP_REFERER'])) ||
($_DCACHE['settings']['archiverstatus'] == 3 && preg_match("/($kw_browsers)/", $_SERVER['HTTP_USER_AGENT'])))) {
header("Location: $boardurl$forward");
exit;
}
if(($globaladvs = $_DCACHE['settings']['globaladvs']) || !empty($_DCACHE['advs'])) {
$redirectadvs = $_DCACHE['settings']['redirectadvs'];
require_once '../include/advertisements.inc.php';
}
$headerbanner = !empty($advlist['headerbanner']) ? $advlist[headerbanner] : '';
require_once "./include/$action.inc.php";
$runtime = explode(' ', microtime());
$totaltime = round(($runtime[1] + $runtime[0] - $starttime), 6);
?>
<div class="archiver_fullversion"><?=$lang['full_version']?>: <strong><a href="<?=$fullversion['link']?>" target="_blank"><?=$fullversion['title']?></a></strong></div>
</div>
<?
if(!empty($advlist['footerbanner1'])) {
echo '<div class="archiver_banner">'.$advlist[footerbanner1].'</div>';
}
if(!empty($advlist['footerbanner2'])) {
echo '<div class="archiver_banner">'.$advlist[footerbanner2].'</div>';
}
if(!empty($advlist['footerbanner3'])) {
echo '<div class="archiver_banner">'.$advlist[footerbanner3].'</div>';
}
?>
<p id="copyright">Powered by <strong><a href="http://www.discuz.net" target="_blank">Discuz! Archiver</a></strong> <em><?=$_DCACHE['settings']['version']?></em>
© 2001-2006 <a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a><br /><br /></p>
</body>
</html>
<?
function multi($total, $page, $perpage, $link) {
$pages = @ceil($total / $perpage) + 1;
$pagelink = '';
if($pages > 1) {
$pagelink .= "{$GLOBALS[lang][page]}: \n";
$pagestart = $page - 10 < 1 ? 1 : $page - 10;
$pageend = $page + 10 >= $pages ? $pages : $page + 10;
for($i = $pagestart; $i < $pageend; $i++) {
$pagelink .= ($i == $page ? "<strong>[$i]</strong>" : "<a href=archiver/$link-page-$i.html>$i</a>")." \n";
}
}
return $pagelink;
}
function forumperm($viewperm) {
return (empty($viewperm) || ($viewperm && strstr($viewperm, "\t7\t")));
}
function forumformulaperm($formula) {
$formula = unserialize($formula);$formula = $formula[1];
if(!$formula) {
return TRUE;
}
$_DSESSION = array();
@eval("\$formulaperm = ($formula) ? TRUE : FALSE;");
return $formulaperm;
}
?> | zyyhong | trunk/jiaju001/bbs/archiver/index.php | PHP | asf20 | 5,268 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: thread.inc.php 9806 2007-08-15 06:04:37Z cnteacher $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$query = $db->query("SELECT * FROM {$tablepre}threads t
LEFT JOIN {$tablepre}forums f ON f.fid=t.fid
LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid
WHERE t.tid='$tid' AND t.readperm='0' AND t.price<='0' AND t.displayorder>='0'
AND f.status>0 AND ff.password=''");
$thread = $db->fetch_array($query);
$page = max(1, intval($page));
$navtitle = $thread['subject']. '('.$lang['page'].' '.$page.') '.
($thread['type'] == 'sub' ? ' - '.strip_tags($_DCACHE['forums'][$thread['fup']]['name']) : '').' - '.strip_tags($thread['name']).' - ';
echo $_DSESSION['extcredits2'];
if(!$thread || !(!$thread['viewperm'] || ($thread['viewperm'] && forumperm($thread['viewperm']))) || !forumformulaperm($thread['formulaperm'])) {
$navtitle = '';
require_once './include/header.inc.php';
?>
<div id="nav"><a href="archiver/"><?=$_DCACHE['settings']['bbname']?></a></div><br />
<div class="simpletable smalltxt"><div class="subtable altbg2"><br /><?=$lang['thread_nonexistence']?><br /><br /></div></div>
<?
} else {
$navsub = $thread['type'] == 'sub' ? " <a href=\"archiver/{$qm}fid-$thread[fup].html\">{$_DCACHE[forums][$thread[fup]][name]}</a> <b>»</b> ": ' ';
$fullversion = array('title' => $thread['subject'], 'link' => "viewthread.php?tid=$tid");
$ppp = $_DCACHE['settings']['postperpage'] * 2;
$start = ($page - 1) * $ppp;
$query = $db->query("SELECT p.author, p.dateline, p.subject, p.message, p.anonymous, p.status, m.groupid
FROM {$tablepre}posts p
LEFT JOIN {$tablepre}members m ON p.authorid=m.uid
WHERE p.tid='$tid' AND p.invisible='0'
ORDER BY dateline LIMIT $start, $ppp");
if($firstpost = $db->fetch_array($query)) {
if(in_array($firstpost['groupid'], array(4, 5, 6))) {
include_once language('misc');
$firstpost['message'] = $language['post_banned'];
} elseif($firstpost['status'] == 1) {
include_once language('misc');
$firstpost['message'] = $language['post_single_banned'];
}
$meta_contentadd = cutstr(strip_tags(str_replace(array("\r", "\n", "\t"), array('', '', ''), $firstpost['message'])), 200);
}
require_once './include/header.inc.php';
?>
<div id="nav">
<a href="archiver/"><?=$_DCACHE['settings']['bbname']?></a> »<?=$navsub?><a href="archiver/<?=$qm?>fid-<?=$thread['fid']?>.html"><?=$thread['name']?></a> » <?=$thread[subject]?></div>
<h1><a href="<?=$fullversion['link']?>" target="_blank"><?=$lang['full_version']?>: <?=$fullversion['title']?></a></h1>
<?
while(($post = $firstpost) || ($post = $db->fetch_array($query))) {
if(in_array($post['groupid'], array(4, 5, 6))) {
include_once language('misc');
$post['message'] = $language['post_banned'];
} elseif($post['status'] == 1) {
include_once language('misc');
$post['message'] = $language['post_single_banned'];
}
if(!empty($firstpost)) $firstpost = array();
$post['dateline'] = gmdate($_DCACHE['settings']['dateformat'].' '.$_DCACHE['settings']['timeformat'], $post['dateline'] + $_DCACHE['settings']['timeoffset'] * 3600);
$post['message'] = ($post['subject'] ? '<h2>'.$post['subject'].'</h2>' : '').nl2br(preg_replace(array('/&(#\d{3,5};)/', "/\[hide=?\d*\](.+?)\[\/hide\]/is"),
array('&\\1', '<b>**** Hidden Message *****</b>'),
str_replace(array('&', '"', '<', '>', "\t", ' ', ' '),
array('&', '"', '<', '>', ' ', ' ', ' '),
$post['message'])));
if($thread['jammer']) {
$post['message'] = preg_replace("/\<br \/\>/e", "jammer()", $post['message']);
}
$post['author'] = !$post['anonymous'] ? $post['author'] : $lang['anonymous'];
?>
<div class="archiver_post">
<p><cite><?=$post['author']?></cite> <?=$post['dateline']?></p>
<div class="archiver_postbody"><?=$post['message']?></div>
</div>
<?
}
echo "<div class=\"archiver_pages\">".multi($thread['replies'] + 1, $page, $ppp, "{$qm}tid-$tid")."</div>";
}
function jammer() {
$randomstr = '';
for($i = 0; $i < mt_rand(5, 15); $i++) {
$randomstr .= chr(mt_rand(0, 59)).chr(mt_rand(63, 126));
}
return mt_rand(0, 1) ? '<font style="font-size:0px;color:'.ALTBG2.'">'.$randomstr.'</font><br />' :
'<br /><span style="display:none">'.$randomstr.'</span>';
}
function cutstr($string, $length) {
$strcut = '';
if(strlen($string) > $length) {
for($i = 0; $i < $length - 3; $i++) {
$strcut .= ord($string[$i]) > 127 ? $string[$i].$string[++$i] : $string[$i];
}
return $strcut.' ...';
} else {
return $string;
}
}
function language($file, $templateid = 0, $tpldir = '') {
$tpldir = $tpldir ? $tpldir : TPLDIR;
$templateid = $templateid ? $templateid : TEMPLATEID;
$languagepack = DISCUZ_ROOT.'./'.$tpldir.'/'.$file.'.lang.php';
if(file_exists($languagepack)) {
return $languagepack;
} elseif($templateid != 1 && $tpldir != './templates/default') {
return language($file, 1, './templates/default');
} else {
return FALSE;
}
}
?> | zyyhong | trunk/jiaju001/bbs/archiver/include/thread.inc.php | PHP | asf20 | 5,233 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: forum.inc.php 9806 2007-08-15 06:04:37Z cnteacher $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$query = $db->query("SELECT * FROM {$tablepre}forums f
LEFT JOIN {$tablepre}forumfields ff USING (fid)
WHERE f.fid='$fid' AND f.status>0 AND f.type<>'group' AND ff.password=''");
$forum = $db->fetch_array($query);
if($forum['redirect']) {
header("Location: $forum[redirect]");
exit();
}
$page = max(1, intval($page));
$navtitle = ($forum['type'] == 'sub' ? ' - '.strip_tags($_DCACHE['forums'][$forum['fup']]['name']) : '').
strip_tags($forum['name']).'('.$lang['page'].' '.$page.') - ';
require_once './include/header.inc.php';
?>
<div id="nav">
<?
if(!$forum || !forumperm($forum['viewperm']) || !forumformulaperm($forum['formulaperm'])) {
?>
<a href="archiver/"><?=$_DCACHE['settings']['bbname']?></a></div>
<div><?=$lang['forum_nonexistence']?></div>
<?
} else {
$navsub = $forum['type'] == 'sub' ? "<a href=\"archiver/{$qm}fid-$forum[fup].html\">{$_DCACHE[forums][$forum[fup]][name]}</a> » ": ' ';
$fullversion = array('title' => $forum['name'], 'link' => "forumdisplay.php?fid=$fid");
$tpp = $_DCACHE['settings']['topicperpage'] * 2;
$start = ($page - 1) * $tpp;
?>
<a href="archiver/"><?=$_DCACHE['settings']['bbname']?></a> » <?=$navsub?><a href="archiver/<?=$qm?>fid-<?=$fid?>.html"><?=$forum['name']?></a></div>
<h1><a href="<?=$fullversion['link']?>" target="_blank"><?=$lang['full_version']?>: <?=$fullversion['title']?></a></h1>
<?
echo "<ul class=\"archiver_threadlist\" type=\"1\" start=\"".($start + 1)."\">\n";
$query = $db->query("SELECT * FROM {$tablepre}threads WHERE fid='$fid' AND displayorder>='0' ORDER BY displayorder DESC, lastpost DESC LIMIT $start, $tpp");
while($thread = $db->fetch_array($query)) {
echo "<li><a href=\"archiver/{$qm}tid-$thread[tid].html\">$thread[subject]</a> <em>($thread[replies] $lang[replies])</em></li>\n";
}
echo "</ul>\n";
echo "<div class=\"archiver_pages\">".multi($forum['threads'], $page, $tpp, "{$qm}fid-$fid")."</div>";
}
?>
| zyyhong | trunk/jiaju001/bbs/archiver/include/forum.inc.php | PHP | asf20 | 2,223 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: index.inc.php 9806 2007-08-15 06:04:37Z cnteacher $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
require_once './include/header.inc.php';
?>
<div id="nav"><a href="archiver/"><?=$_DCACHE['settings']['bbname']?></a></div>
<h1><a href="<?=$fullversion['link']?>" target="_blank"><?=$lang['full_version']?>: <?=$fullversion['title']?></a></h1>
<?
$forums = $subforums = array();
$categories = array(0 => array('fid' => 0, 'name' => $_DCACHE['settings']['bbname']));
foreach($_DCACHE['forums'] as $forum) {
if(forumperm($forum['viewperm'])) {
if($forum['type'] == 'group') {
$categories[] = $forum;
} else {
$forum['type'] == 'sub' ? $subforums[$forum['fup']][] = $forum : $forums[$forum['fup']][] = $forum;
}
}
}
echo "<ul class=\"archiver_forumlist\">\n";
foreach($categories as $category) {
if(isset($forums[$category['fid']])) {
echo "<li><h3>$category[name]</h3><ul>\n";
foreach($forums[$category[fid]] as $forum) {
echo "<li><a href=\"archiver/{$qm}fid-{$forum[fid]}.html\">$forum[name]</a>\n";
if(isset($subforums[$forum['fid']])) {
echo "<ul>\n";
foreach($subforums[$forum['fid']] as $subforum) {
echo "<li><a href=\"archiver/{$qm}fid-$subforum[fid].html\">$subforum[name]</a></li>\n";
}
echo "</ul></li>\n";
}
}
echo "</li></ul>\n";
}
}
echo "</ul>\n";
?> | zyyhong | trunk/jiaju001/bbs/archiver/include/index.inc.php | PHP | asf20 | 1,503 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: header.inc.php 9806 2007-08-15 06:04:37Z cnteacher $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<base href="<?=$boardurl?>" />
<title><?=$navtitle?> <?=$_DCACHE['settings']['bbname']?> <?=$_DCACHE['settings']['seotitle']?> - Powered by Discuz! Archiver</title>
<?=$_DCACHE['settings']['seohead']?>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>" />
<meta name="keywords" content="Discuz!,Board,Comsenz,forums,bulletin board,<?=$_DCACHE['settings']['seokeywords']?>" />
<meta name="description" content="<?=$meta_contentadd?> <?=$_DCACHE['settings']['bbname']?> <?=$_DCACHE['settings']['seodescription']?> - Discuz! Archiver" />
<meta name="generator" content="Discuz! Archiver <?=$_DCACHE['settings']['version']?>" />
<meta name="author" content="Discuz! Team & Comsenz UI Team" />
<meta name="copyright" content="2001-2007 Comsenz Inc." />
<link rel="stylesheet" type="text/css" href="forumdata/cache/style_<?=$_DCACHE['settings']['styleid']?>.css" />
<style type="text/css">
</style>
</head>
<body class="archiver">
<?if($headerbanner) {?><div class="archiver_banner"><?=$headerbanner?></div><?}?>
<div class="wrap">
| zyyhong | trunk/jiaju001/bbs/archiver/include/header.inc.php | PHP | asf20 | 1,480 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: topicadmin.php 10115 2007-08-24 00:58:08Z cnteacher $
*/
define('CURSCRIPT', 'topicadmin');
define('NOROBOT', TRUE);
require_once './include/common.inc.php';
require_once DISCUZ_ROOT.'./include/post.func.php';
require_once DISCUZ_ROOT.'./include/misc.func.php';
$discuz_action = 201;
$modpostsnum = $iscircleadmin = 0;
$resultarray = $thread = array();
if($gid = intval($gid)) {
if($supe['circlestatus'] && $discuz_uid && $action == 'moderate' && $operation == 'delete' && supe_submitcheck(1)) {
supe_dbconnect();
$query = $supe['db']->query("SELECT COUNT(*) FROM {$supe[tablepre]}groupuid WHERE gid='$gid' AND uid='$discuz_uid' AND flag>1", 'SILENT');
$iscircleadmin = $db->result($query, 0);
}
}
if(!$discuz_uid || !($forum['ismoderator'] || $iscircleadmin)) {
showmessage('admin_nopermission', NULL, 'HALTED');
}
if($forum['type'] == 'forum') {
$navigation = "» <a href=\"forumdisplay.php?fid=$fid\">$forum[name]</a>";
$navtitle = strip_tags($forum['name']);
} else {
$query = $db->query("SELECT fid, name FROM {$tablepre}forums WHERE fid='$forum[fup]'");
$fup = $db->fetch_array($query);
$navigation = "» <a href=\"forumdisplay.php?fid=$fup[fid]\">$fup[name]</a> » <a href=\"forumdisplay.php?fid=$fid\">$forum[name]</a> ";
$navtitle = strip_tags($fup['name']).' - '.strip_tags($forum['name']);
}
if(!empty($tid)) {
$query = $db->query("SELECT * FROM {$tablepre}threads WHERE tid='$tid' AND fid='$fid' AND displayorder>='0'");
if(!$thread = $db->fetch_array($query)) {
showmessage('thread_nonexistence');
}
$navigation .= " » <a href=\"viewthread.php?tid=$tid\">$thread[subject]</a> ";
$navtitle .= ' - '.$thread['subject'].' - ';
if(($thread['special'] && in_array($action, array('copy', 'split', 'merge'))) || ($thread['digest'] == '-1' && !in_array($action, array('delpost', 'banpost', 'getip')))) {
showmessage('special_noaction');
}
}
// Reason P.M. Preprocess Start
$reasonpmcheck = $reasonpm == 2 || $reasonpm == 3 ? 'checked="checked" disabled' : '';
if(($reasonpm == 2 || $reasonpm == 3) || !empty($sendreasonpm)) {
$forumname = strip_tags($forum['name']);
$sendreasonpm = 1;
} else {
$sendreasonpm = 0;
}
// End
$postcredits = $forum['postcredits'] ? $forum['postcredits'] : $creditspolicy['post'];
$replycredits = $forum['replycredits'] ? $forum['replycredits'] : $creditspolicy['reply'];
$digestcredits = $forum['digestcredits'] ? $forum['digestcredits'] : $creditspolicy['digest'];
$postattachcredits = $forum['postattachcredits'] ? $forum['postattachcredits'] : $creditspolicy['postattach'];
if(in_array($action, array('moderate', 'delete', 'move', 'highlight', 'type', 'close', 'stick', 'digest', 'supe_push', 'bump', 'recommend'))) {
require_once DISCUZ_ROOT.'./include/moderation.inc.php';
} elseif($action == 'delpost') {
if(!($deletepids = implodeids($topiclist))) {
showmessage('admin_delpost_invalid');
} elseif(!$allowdelpost || !$tid) {
showmessage('admin_nopermission', NULL, 'HALTED');
} else {
$query = $db->query("SELECT pid FROM {$tablepre}posts WHERE pid IN ($deletepids) AND first='1'");
if($db->num_rows($query)) {
dheader("Location: {$boardurl}topicadmin.php?action=delete&tid=$thread[tid]");
}
}
if(!submitcheck('delpostsubmit')) {
$deleteid = '';
foreach($topiclist as $id) {
$deleteid .= '<input type="hidden" name="topiclist[]" value="'.$id.'" />';
}
include template('topicadmin_delpost');
} else {
checkreasonpm();
$pids = 0;
$posts = $uidarray = $puidarray = $auidarray = array();
$losslessdel = $losslessdel > 0 ? $timestamp - $losslessdel * 86400 : 0;
$query = $db->query("SELECT pid, authorid, dateline, message, first FROM {$tablepre}posts WHERE pid IN ($deletepids) AND tid='$tid'");
while($post = $db->fetch_array($query)) {
if(!$post['first']) {
$posts[] = $post;
$pids .= ','.$post['pid'];
if($post['dateline'] < $losslessdel) {
$uidarray[] = $post['authorid'];
} else {
$puidarray[] = $post['authorid'];
}
$modpostsnum ++;
}
}
if($uidarray) {
updatepostcredits('-', $uidarray, array());
}
if($puidarray) {
updatepostcredits('-', $puidarray, $replycredits);
}
$query = $db->query("SELECT uid, attachment, thumb, remote FROM {$tablepre}attachments WHERE pid IN ($pids)");
while($attach = $db->fetch_array($query)) {
if(in_array($attach['uid'], $puidarray)) {
$auidarray[$attach['uid']] = !empty($auidarray[$attach['uid']]) ? $auidarray[$attach['uid']] + 1 : 1;
}
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
if($auidarray) {
updateattachcredits('-', $auidarray, $postattachcredits);
}
$logs = array();
$query = $db->query("SELECT r.extcredits, r.score, p.authorid, p.author FROM {$tablepre}ratelog r LEFT JOIN {$tablepre}posts p ON r.pid=p.pid WHERE r.pid IN ($pids)");
while($author = $db->fetch_array($query)) {
if($author['score'] > 0) {
$db->query("UPDATE {$tablepre}members SET extcredits{$author[extcredits]}=extcredits{$author[extcredits]}-($author[score]) WHERE uid = $author[authorid]");
$author[score] = $extcredits[$id]['title'].' '.-$author[score].' '.$extcredits[$id]['unit'];
$logs[] = dhtmlspecialchars("$timestamp\t$discuz_userss\t$adminid\t$author[author]\t$author[extcredits]\t$author[score]\t$thread[tid]\t$thread[subject]\t$delpostsubmit");
}
}
if(!empty($logs)) {
writelog('ratelog', $logs);
unset($logs);
}
$db->query("DELETE FROM {$tablepre}ratelog WHERE pid IN ($pids)");
$db->query("DELETE FROM {$tablepre}myposts WHERE pid IN ($pids)");
$db->query("DELETE FROM {$tablepre}attachments WHERE pid IN ($pids)");
$db->query("DELETE FROM {$tablepre}posts WHERE pid IN ($pids)");
if($thread['special']) {
$db->query("DELETE FROM {$tablepre}trades WHERE pid IN ($pids)");
}
updatethreadcount($tid, 1);
updateforumcount($fid);
$forum['threadcaches'] && deletethreadcaches($thread['tid']);
$modaction = 'DLP';
$resultarray = array(
'redirect' => "viewthread.php?tid=$tid&page=$page",
'reasonpm' => ($sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_delete_post') : array()),
'modtids' => 0,
'modlog' => $thread
);
}
} elseif($action == 'refund' && $allowrefund && $thread['price'] > 0) {
if(!isset($extcredits[$creditstrans])) {
showmessage('credits_transaction_disabled');
}
if($thread['special'] != 0) {
showmessage('special_refundment_invalid');
}
if(!submitcheck('refundsubmit')) {
$query = $db->query("SELECT COUNT(*) AS payers, SUM(netamount) AS netincome FROM {$tablepre}paymentlog WHERE tid='$tid'");
$payment = $db->fetch_array($query);
include template('topicadmin_refund');
} else {
$modaction = 'RFD';
$modpostsnum ++;
checkreasonpm();
$totalamount = 0;
$amountarray = array();
$logarray = array();
$query = $db->query("SELECT * FROM {$tablepre}paymentlog WHERE tid='$tid'");
while($log = $db->fetch_array($query)) {
$totalamount += $log['amount'];
$amountarray[$log['amount']][] = $log['uid'];
}
$db->query("UPDATE {$tablepre}members SET extcredits$creditstrans=extcredits$creditstrans-$totalamount WHERE uid='$thread[authorid]'");
$db->query("UPDATE {$tablepre}threads SET price='-1', moderated='1' WHERE tid='$thread[tid]'");
foreach($amountarray as $amount => $uidarray) {
$db->query("UPDATE {$tablepre}members SET extcredits$creditstrans=extcredits$creditstrans+$amount WHERE uid IN (".implode(',', $uidarray).")");
}
$db->query("UPDATE {$tablepre}paymentlog SET amount='0', netamount='0' WHERE tid='$tid'");
$resultarray = array(
'redirect' => "viewthread.php?tid=$tid",
'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'item' => 'reason_moderate') : array()),
'modtids' => $thread['tid'],
'modlog' => $thread
);
}
} elseif($action == 'repair') {
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='$tid' AND invisible='0'");
$replies = $db->result($query, 0) - 1;
$query = $db->query("SELECT a.aid FROM {$tablepre}posts p, {$tablepre}attachments a WHERE a.tid='$tid' AND a.pid=p.pid AND p.invisible='0' LIMIT 1");
$attachment = $db->num_rows($query) ? 1 : 0;
$query = $db->query("SELECT pid, subject, rate FROM {$tablepre}posts WHERE tid='$tid' AND invisible='0' ORDER BY dateline LIMIT 1");
$firstpost = $db->fetch_array($query);
$firstpost['subject'] = addslashes(cutstr($firstpost['subject'], 79));
@$firstpost['rate'] = $firstpost['rate'] / abs($firstpost['rate']);
$query = $db->query("SELECT author, dateline FROM {$tablepre}posts WHERE tid='$tid' AND invisible='0' ORDER BY dateline DESC LIMIT 1");
$lastpost = $db->fetch_array($query);
$db->query("UPDATE {$tablepre}threads SET subject='$firstpost[subject]', replies='$replies', lastpost='$lastpost[dateline]', lastposter='".addslashes($lastpost['author'])."', rate='$firstpost[rate]', attachment='$attachment' WHERE tid='$tid'", 'UNBUFFERED');
$db->query("UPDATE {$tablepre}posts SET first='1', subject='$firstpost[subject]' WHERE pid='$firstpost[pid]'", 'UNBUFFERED');
$db->query("UPDATE {$tablepre}posts SET first='0' WHERE tid='$tid' AND pid<>'$firstpost[pid]'", 'UNBUFFERED');
showmessage('admin_succeed', "viewthread.php?tid=$tid");
} elseif($action == 'getip' && $allowviewip) {
$query = $db->query("SELECT m.adminid, p.first, p.useip FROM {$tablepre}posts p
LEFT JOIN {$tablepre}members m ON m.uid=p.authorid
WHERE pid='$pid' AND tid='$tid'");
if(!$member = $db->fetch_array($query)) {
showmessage('thread_nonexistence', NULL, 'HALTED');
} elseif(($member['adminid'] == 1 && $adminid > 1) || ($member['adminid'] == 2 && $adminid > 2)) {
showmessage('admin_getip_nopermission', NULL, 'HALTED');
} elseif($member['first'] && $thread['digest'] == '-1') {
showmessage('special_noaction');
}
$member['iplocation'] = convertip($member['useip']);
include template('topicadmin_getip');
} elseif($action == 'split') {
if(!submitcheck('splitsubmit')) {
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
$replies = $thread['replies'];
if($replies <= 0) {
showmessage('admin_split_invalid');
}
$postlist = array();
$query = $db->query("SELECT * FROM {$tablepre}posts WHERE tid='$tid' ORDER BY dateline");
while($post = $db->fetch_array($query)) {
$post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], sprintf('%00b', $post['htmlon']), $forum['allowsmilies'], $forum['allowbbcode'], $forum['allowimgcode'], $forum['allowhtml']);
$postlist[] = $post;
}
include template('topicadmin_split');
} else {
if(!trim($subject)) {
showmessage('admin_split_subject_invalid');
} elseif(!$pids = implodeids($split)) {
showmessage('admin_split_new_invalid');
}
$modaction = 'SPL';
checkreasonpm();
$db->query("INSERT INTO {$tablepre}threads (fid, subject) VALUES ('$fid', '".dhtmlspecialchars($subject)."')");
$newtid = $db->insert_id();
$db->query("UPDATE {$tablepre}posts SET tid='$newtid' WHERE pid IN ($pids)");
$db->query("UPDATE {$tablepre}attachments SET tid='$newtid' WHERE pid IN ($pids)");
$splitauthors = array();
$query = $db->query("SELECT pid, tid, authorid, subject, dateline FROM {$tablepre}posts WHERE tid='$newtid' AND invisible='0' GROUP BY authorid ORDER BY dateline");
while($splitauthor = $db->fetch_array($query)) {
$splitauthor['subject'] = $subject;
$splitauthors[] = $splitauthor;
}
$db->query("UPDATE {$tablepre}posts SET first='1', subject='$subject' WHERE pid='".$splitauthors[0]['pid']."'", 'UNBUFFERED');
$query = $db->query("SELECT pid, author, authorid, dateline FROM {$tablepre}posts WHERE tid='$tid' ORDER BY dateline LIMIT 1");
$fpost = $db->fetch_array($query);
$db->query("UPDATE {$tablepre}threads SET author='$fpost[author]', authorid='$fpost[authorid]', dateline='$fpost[dateline]', moderated='1' WHERE tid='$tid'");
$db->query("UPDATE {$tablepre}posts SET subject='".addslashes($thread['subject'])."' WHERE pid='$fpost[pid]'");
$query = $db->query("SELECT author, authorid, dateline, rate FROM {$tablepre}posts WHERE tid='$newtid' ORDER BY dateline ASC LIMIT 1");
$fpost = $db->fetch_array($query);
$db->query("UPDATE {$tablepre}threads SET author='$fpost[author]', authorid='$fpost[authorid]', dateline='$fpost[dateline]', rate='".intval(@($fpost['rate'] / abs($fpost['rate'])))."', moderated='1' WHERE tid='$newtid'");
updatethreadcount($tid);
updatethreadcount($newtid);
updateforumcount($fid);
$forum['threadcaches'] && deletethreadcaches($thread['tid']);
$modpostsnum++;
$resultarray = array(
'redirect' => "forumdisplay.php?fid=$fid",
'reasonpm' => ($sendreasonpm ? array('data' => $splitauthors, 'var' => 'thread', 'item' => 'reason_moderate') : array()),
'modtids' => $thread['tid'].','.$newtid,
'modlog' => array($thread, array('tid' => $newtid, 'subject' => $subject))
);
}
} elseif($action == 'merge') {
if(!submitcheck('mergesubmit')) {
include template('topicadmin_merge');
} else {
$modaction = 'MRG';
checkreasonpm();
$query = $db->query("SELECT tid, fid, authorid, subject, views, replies, dateline, special FROM {$tablepre}threads WHERE tid='$othertid' AND displayorder>='0'");
if(!$other = $db->fetch_array($query)) {
showmessage('admin_merge_nonexistence');
} elseif($other['special']) {
showmessage('special_noaction');
}
if($othertid == $tid || ($adminid == 3 && $other['fid'] != $forum['fid'])) {
showmessage('admin_merge_invalid');
}
$other['views'] = intval($other['views']);
$other['replies']++;
$db->query("UPDATE {$tablepre}posts SET tid='$tid' WHERE tid='$othertid'");
$postsmerged = $db->affected_rows();
$db->query("UPDATE {$tablepre}attachments SET tid='$tid' WHERE tid='$othertid'");
$db->query("DELETE FROM {$tablepre}threads WHERE tid='$othertid'");
$db->query("DELETE FROM {$tablepre}threadsmod WHERE tid='$othertid'");
$db->query("DELETE FROM {$tablepre}mythreads WHERE tid='$othertid'");
$db->query("DELETE FROM {$tablepre}myposts WHERE tid='$othertid'");
$query = $db->query("SELECT pid, fid, authorid, author, subject, dateline FROM {$tablepre}posts WHERE tid='$tid' AND invisible='0' ORDER BY dateline LIMIT 1");
$firstpost = $db->fetch_array($query);
$db->query("UPDATE {$tablepre}posts SET first=(pid='$firstpost[pid]'), fid='$firstpost[fid]' WHERE tid='$tid'");
$db->query("UPDATE {$tablepre}threads SET authorid='$firstpost[authorid]', author='".addslashes($firstpost['author'])."', subject='".addslashes($firstpost['subject'])."', dateline='$firstpost[dateline]', views=views+$other[views], replies=replies+$other[replies], moderated='1' WHERE tid='$tid'");
if($fid == $other['fid']) {
$db->query("UPDATE {$tablepre}forums SET threads=threads-1 WHERE fid='$fid'");
} else {
$db->query("UPDATE {$tablepre}forums SET threads=threads-1, posts=posts-$postsmerged WHERE fid='$other[fid]'");
$db->query("UPDATE {$tablepre}forums SET posts=$posts+$postsmerged WHERE fid='$fid'");
}
$forum['threadcaches'] && deletethreadcaches($thread['tid']);
$modpostsnum ++;
$resultarray = array(
'redirect' => "forumdisplay.php?fid=$fid",
'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'item' => 'reason_merge') : array()),
'modtids' => $thread['tid'],
'modlog' => array($thread, $other)
);
}
} elseif($action == 'copy' && $thread) {
if(!submitcheck('copysubmit')) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
$forumselect = forumselect();
include template('topicadmin_copy');
} else {
$modaction = 'CPY';
checkreasonpm();
$query = $db->query("SELECT fid, name, modnewposts FROM {$tablepre}forums WHERE fid='$copyto' AND status>0 AND type<>'group'");
if(!$toforum = $db->fetch_array($query)) {
showmessage('admin_copy_invalid');
} else {
$modnewthreads = (!$allowdirectpost || $allowdirectpost == 1) && $toforum['modnewposts'] ? 1 : 0;
$modnewreplies = (!$allowdirectpost || $allowdirectpost == 2) && $toforum['modnewposts'] ? 1 : 0;
if($modnewthreads || $modnewreplies) {
showmessage('admin_copy_hava_mod');
}
}
$thread['tid'] = '';
$thread['fid'] = $copyto;
$thread['dateline'] = $thread['lastpost'] = $timestamp;
$thread['lastposter'] = $thread['author'];
$thread['views'] = $thread['replies'] = 0;
$thread['digest'] = $thread['blog'] = $thread['rate'] = 0;
$thread['displayorder'] = 0;
$thread['attachment'] = 0;
$db->query("INSERT INTO {$tablepre}threads VALUES ('".implode("', '", daddslashes($thread, 1))."')");
$threadid = $db->insert_id();
$query = $db->query("SELECT * FROM {$tablepre}posts WHERE tid='$tid' AND first=1 LIMIT 1");
if($post = $db->fetch_array($query)) {
$post['pid'] = '';
$post['tid'] = $threadid;
$post['fid'] = $copyto;
$post['dateline'] = $timestamp;
$post['attachment'] = 0;
$post['invisible'] = $post['rate'] = $post['ratetimes'] = 0;
$db->query("INSERT INTO {$tablepre}posts VALUES ('".implode("', '", daddslashes($post, 1))."')");
}
updatepostcredits('+', $post['authorid'], '');
updateforumcount($copyto);
updateforumcount($fid);
$modpostsnum ++;
$resultarray = array(
'redirect' => "forumdisplay.php?fid=$fid",
'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'item' => 'reason_copy') : array()),
'modtids' => $thread['tid'],
'modlog' => array($thread, $other)
);
}
} elseif($action == 'removereward') {
$modaction = 'RMR';
if(!is_array($thread) || $thread['special'] != '3' || $thread['price'] >= 0) {
showmessage('reward_end');
}
$query = $db->query("SELECT answererid FROM {$tablepre}rewardlog WHERE tid='$thread[tid]'");
$answererid = $db->result($query, 0);
$thread[price] = abs($thread[price]);
$db->query("UPDATE {$tablepre}members SET extcredits$creditstrans=extcredits$creditstrans+$thread[price] WHERE uid='$thread[authorid]'", 'UNBUFFERED');
$db->query("UPDATE {$tablepre}members SET extcredits$creditstrans=extcredits$creditstrans-$thread[price] WHERE uid='$answererid'", 'UNBUFFERED');
$db->query("UPDATE {$tablepre}threads SET special='0', price='0' WHERE tid='$thread[tid]'", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}rewardlog WHERE tid='$thread[tid]'", 'UNBUFFERED');
showmessage('admin_succeed', "viewthread.php?tid=$tid");
} elseif($action == 'banpost') {
if(!($banpids = implodeids($topiclist))) {
showmessage('admin_banpost_invalid');
} elseif(!$allowbanpost || !$tid) {
showmessage('admin_nopermission', NULL, 'HALTED');
}
$posts = array();
$query = $db->query("SELECT first, authorid FROM {$tablepre}posts WHERE pid IN ($banpids) AND tid='$tid'");
while($post = $db->fetch_array($query)) {
if($post['first'] && $thread['digest'] == '-1') {
showmessage('special_noaction');
}
$posts[] = $post;
}
if(!submitcheck('banpostsubmit')) {
$banid = '';
foreach($topiclist as $id) {
$banid .= '<input type="hidden" name="topiclist[]" value="'.$id.'" />';
}
include template('topicadmin_banpost');
} else {
$banned = intval($banned);
$modaction = $banned ? 'BNP' : 'UBN';
checkreasonpm();
$db->query("UPDATE {$tablepre}posts SET status='$banned' WHERE pid IN ($banpids) AND tid='$tid'", 'UNBUFFERED');
$resultarray = array(
'redirect' => "viewthread.php?tid=$tid&page=$page",
'reasonpm' => ($sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_ban_post') : array()),
'modtids' => 0,
'modlog' => $thread
);
}
} else {
showmessage('undefined_action', NULL, 'HALTED');
}
if($resultarray) {
if($resultarray['modtids']) {
updatemodlog($resultarray['modtids'], $modaction, $resultarray['expiration']);
}
updatemodworks($modaction, $modpostsnum);
if(is_array($resultarray['modlog'])) {
if(isset($resultarray['modlog']['tid'])) {
modlog($resultarray['modlog'], $modaction);
} else {
foreach($resultarray['modlog'] as $thread) {
modlog($thread, $modaction);
}
}
}
if($resultarray['reasonpm']) {
include language('modactions');
$modaction = $modactioncode[$modaction];
foreach($resultarray['reasonpm']['data'] as ${$resultarray['reasonpm']['var']}) {
sendreasonpm($resultarray['reasonpm']['var'], $resultarray['reasonpm']['item']);
}
}
showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'), $resultarray['redirect']);
}
?> | zyyhong | trunk/jiaju001/bbs/topicadmin.php | PHP | asf20 | 21,158 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: redirect.php 10496 2007-09-03 08:57:02Z monkey $
*/
define('CURSCRIPT', 'viewthread');
require_once './include/common.inc.php';
if($goto == 'findpost') {
$pid = intval($pid);
$ptid = intval($ptid);
$query = $db->query("SELECT p.tid, p.dateline, t.special FROM {$tablepre}posts p LEFT JOIN {$tablepre}threads t USING(tid) WHERE p.pid='$pid'");
if($post = $db->fetch_array($query)) {
$sqladd = $post['special'] ? "AND first=0" : '';
$query = $db->query("SELECT count(*) FROM {$tablepre}posts WHERE tid='$post[tid]' AND dateline<='$post[dateline]' $sqladd");
$page = ceil($db->result($query, 0) / $ppp);
if(empty($special)) {
dheader("Location: viewthread.php?tid=$post[tid]&page=$page#pid$pid");
} elseif($special == 'trade') {
dheader("Location: viewthread.php?do=tradeinfo&tid=$post[tid]&pid=$pid");
}
} else {
$ptid = !empty($ptid) ? intval($ptid) : 0;
showmessage('post_check', NULL, 'HALTED');
}
}
$tid = $forum['closed'] < 2 ? $tid : $forum['closed'];
if(isset($fid) && empty($forum)) {
showmessage('forum_nonexistence', NULL, 'HALTED');
}
@include DISCUZ_ROOT.'./forumdata/cache/cache_viewthread.php';
if($goto == 'lastpost') {
if($tid) {
$query = $db->query("SELECT tid, replies, special FROM {$tablepre}threads WHERE tid='$tid' AND displayorder>='0'");
} else {
$query = $db->query("SELECT tid, replies, special FROM {$tablepre}threads WHERE fid='$fid' AND displayorder>='0' ORDER BY lastpost DESC LIMIT 1");
}
if(!$thread = $db->fetch_array($query)) {
showmessage('thread_nonexistence');
}
$page = ceil(($thread['special'] ? $thread['replies'] : $thread['replies'] + 1) / $ppp);
$tid = $thread['tid'];
require_once DISCUZ_ROOT.'./viewthread.php';
exit();
} elseif($goto == 'newpost') {
$query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='$tid' AND dateline<='$lastvisit'");
$page = max(ceil($db->result($query, 0) / $ppp), 1);
require_once DISCUZ_ROOT.'./viewthread.php';
exit();
} elseif($goto == 'nextnewset') {
if($fid && $tid) {
$query = $db->query("SELECT lastpost FROM {$tablepre}threads WHERE tid='$tid' AND displayorder>='0'");
$this_lastpost = $db->result($query, 0);
$query = $db->query("SELECT tid FROM {$tablepre}threads WHERE fid='$fid' AND displayorder>='0' AND lastpost>'$this_lastpost' ORDER BY lastpost ASC LIMIT 1");
if($next = $db->fetch_array($query)) {
$tid = $next['tid'];
require_once DISCUZ_ROOT.'./viewthread.php';
exit();
} else {
showmessage('redirect_nextnewset_nonexistence');
}
} else {
showmessage('undefined_action', NULL, 'HALTED');
}
} elseif($goto == 'nextoldset') {
if($fid && $tid) {
$query = $db->query("SELECT lastpost FROM {$tablepre}threads WHERE tid='$tid' AND displayorder>='0'");
$this_lastpost = $db->result($query, 0);
$query = $db->query("SELECT tid FROM {$tablepre}threads WHERE fid='$fid' AND displayorder>='0' AND lastpost<'$this_lastpost' ORDER BY lastpost DESC LIMIT 1");
if($last = $db->fetch_array($query)) {
$tid = $last['tid'];
require_once DISCUZ_ROOT.'./viewthread.php';
exit();
} else {
showmessage('redirect_nextoldset_nonexistence');
}
} else {
showmessage('undefined_action', NULL, 'HALTED');
}
} else {
showmessage('undefined_action', NULL, 'HALTED');
}
?> | zyyhong | trunk/jiaju001/bbs/redirect.php | PHP | asf20 | 3,494 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: ajax.php 9804 2007-08-15 05:56:19Z cnteacher $
*/
define('NOROBOT', TRUE);
require_once './include/common.inc.php';
if($action == 'updatesecqaa') {
require_once DISCUZ_ROOT.'./forumdata/cache/cache_secqaa.php';
$seccode = random(1, 1) * 1000000 + substr($seccode, -6);
updatesession();
showmessage($_DCACHE['secqaa'][substr($seccode, 0, 1)]['question']);
} elseif($action == 'checkseccode') {
$tmp = $seccode;
seccodeconvert($tmp);
if(strtoupper($seccodeverify) != $tmp) {
showmessage('submit_seccode_invalid');
}
} elseif($action == 'checksecanswer') {
require_once DISCUZ_ROOT.'./forumdata/cache/cache_secqaa.php';
if(!$headercharset) {
@dheader('Content-Type: text/html; charset='.$charset);
}
if(md5($secanswer) != $_DCACHE['secqaa'][$seccode{0}]['answer']) {
showmessage('submit_secqaa_invalid');
}
} elseif($action == 'checkusername') {
$username = trim($username);
$guestexp = '\xA1\xA1|^Guest|^\xD3\xCE\xBF\xCD|\xB9\x43\xAB\xC8';
$censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($censoruser = trim($censoruser)), '/')).')$/i';
if(preg_match("/^\s*$|^c:\\con\\con$|[%,\*\"\s\t\<\>\&]|$guestexp/is", $username) || ($censoruser && @preg_match($censorexp, $username))) {
showmessage('profile_username_illegal');
}
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE username='$username'");
$username = dhtmlspecialchars(stripslashes($username));
if($db->num_rows($query)) {
showmessage('register_check_found');
}
} elseif($action == 'checkemail' && !$doublee) {
$email = trim($email);
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE email='$email' LIMIT 1");
if($db->num_rows($query)) {
showmessage('profile_email_duplicate');
}
} elseif($action == 'checkuserexists') {
$username = trim($username);
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE username='$username'");
$username = dhtmlspecialchars(stripslashes($username));
if($db->num_rows($query)) {
showmessage('<img src="'.IMGDIR.'/check_right.gif" width="13" height="13">');
} else {
showmessage('username_nonexistence');
}
} elseif($action == 'checkinvitecode') {
$invitecode = trim($invitecode);
$query = $db->query("SELECT invitecode FROM {$tablepre}invites WHERE invitecode='$invitecode' AND status IN ('1', '3')");
if(!$db->num_rows($query)) {
showmessage('invite_invalid');
}
}
showmessage('succeed');
?> | zyyhong | trunk/jiaju001/bbs/ajax.php | PHP | asf20 | 2,628 |
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: space.php 10115 2007-08-24 00:58:08Z cnteacher $
*/
define('CURSCRIPT', 'space');
require_once './include/common.inc.php';
$discuz_action = 150;
$querystring = explode('/', $_SERVER['QUERY_STRING']);
$uid = !empty($uid) ? intval($uid) : intval($querystring[0]);
$username = !isset($username) || $uid ? '' : $username;
$mod = !empty($mod) ? $mod : $querystring[1];
$starttime = !empty($starttime) ? intval($starttime) : intval($querystring[2]);
$endtime = !empty($endtime) ? intval($endtime) : intval($querystring[3]);
$multipage = $titleextra = '';
$menulist = $modulelist = array();
$action = $inajax ? 'viewpro' : $action;
if(!empty($action) && $action == 'viewpro') {
require_once DISCUZ_ROOT.'./include/viewpro.inc.php';
}
if(!$mod || $mod == 'myblogs') {
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
}
require_once DISCUZ_ROOT.'./include/space.func.php';
include_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
include_once language('spaces');
$query = $db->query("SELECT m.*, mf.*, s.lastactivity as online
FROM {$tablepre}members m
LEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid
LEFT JOIN {$tablepre}sessions s ON s.uid=m.uid AND s.invisible='0'
WHERE ".($uid ? "m.uid='$uid'" : "m.username='$username'")." LIMIT 1");
if(!$member = $db->fetch_array($query)) {
showmessage('member_nonexistence');
}
$uid = $member['uid'];
if($spacestatus && $supe['status'] && $member['xspacestatus']) {
dheader("location: $supe[siteurl]?uid/$uid");
}
if(!$spacestatus || in_array($member['groupid'], array(4, 5, 6))) {
dheader("location: {$boardurl}space.php?action=viewpro&uid=$uid");
}
$spacesettings = getspacesettings($uid);
if(!empty($preview) && $uid == $discuz_uid) {
$spacesettings['layout'] = explode('|', $preview);
$spacesettings['side'] = intval($spaceside);
} else {
$spacesettings['layout'] = explode("\t", $spacesettings['layout']);
}
if(!empty($style)) {
$spacesettings['style'] = str_replace('/', '', $style);
if(!file_exists(DISCUZ_ROOT.'./mspace/'.$spacesettings['style'].'/style.ini')) {
showmessage('space_style_nofound', NULL, 'HALTED');
}
}
$layout = $moduledata = array();
foreach($spacesettings['layout'] as $k => $layoutitem) {
$layout[$k] = explode('][', ']'.$layoutitem.'[');
$layout[$k] = array_slice($layout[$k], 1, count($layout[$k]) - 2);
$newlayout = array();
foreach($layout[$k] as $module) {
if(array_key_exists($module, $modulesettings)) {
$newlayout[] = $module;
}
}
$layout[$k] = $newlayout;
$modulelist = array_merge($modulelist, $layout[$k]);
}
if(!empty($mod) && array_key_exists($mod, $listmodule)) {
if(!intval($spacedata['limit'.$mod]) || !in_array($mod, $modulelist)) {
if($mod == 'mytrades' && intval($spacedata['limit'.$mod])) {
$modulelist[] = 'mytrades';
$spacesettings['layout'][1] .= '[mytrades]';
$spacesettings['layout'] = daddslashes($spacesettings['layout'], 1);
$db->query("UPDATE {$tablepre}memberspaces SET layout='".$spacesettings['layout'][0]."\t".$spacesettings['layout'][1]."\t".$spacesettings['layout'][2]."' WHERE uid='$uid'");
} else {
dheader("location: {$boardurl}space.php?uid=$uid");
}
}
if($spacesettings['side'] == 1) {
$side = 0;
} elseif($spacesettings['side'] == 2) {
$side = 2;
} else {
$side = 0;
$spacesettings['side'] = 1;
}
$layout[$side] = array('userinfo');
$layout[1] = array($mod);
$titleextra = ' - '.$spacelanguage[$mod];
$moduledata[$mod]['value'] = updatespacecache($uid, $mod, TRUE);
if($mod == 'myblogs') {
$layout[$side][] = 'calendar';
if($discuz_uid && $uid == $discuz_uid && $allowpost && $allowuseblog) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
$forumselect = forumselect();
if($discuz_uid == $uid) {
$layout[$side][] = 'postblog';
}
}
$layout[$side][] = 'hotblog';
$layout[$side][] = 'lastpostblog';
$hotblog = spacecaches($uid, array('hotblog', 'lastpostblog'));
$moduledata = array_merge($moduledata, $hotblog);
} elseif($mod == 'mytrades') {
$layout[$side][] = 'mytradetypes';
$layout[$side][] = 'tradeinfo';
if(!isset($tradetypeid)) {
$layout[1][] = 'mycounters';
$moduledata['mycounters']['value'] = updatespacecache($uid, 'mycounters', TRUE);
}
$tmp = spacecaches($uid, 'mytradetypes');
$moduledata['mytradetypes']['value'] = $tmp['mytradetypes']['value'];
$moduledata['tradeinfo']['value'] = $member;
}
} else {
$moduledata = spacecaches($uid, $modulelist);
}
foreach($modulelist as $module) {
if(array_key_exists($module, $listmodule) && intval($spacedata['limit'.$module])) {
$menulist[$listmodule[$module]] = $module;
}
}
ksort($menulist);
$moduledata['userinfo']['value'] = $member;
include template('space_module');
include template('space');
?> | zyyhong | trunk/jiaju001/bbs/space.php | PHP | asf20 | 4,983 |