First commit

This commit is contained in:
2025-06-18 10:24:27 +08:00
commit ebc39cd5dd
3873 changed files with 412712 additions and 0 deletions

View File

@@ -0,0 +1,324 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: home_editor.php 35193 2015-02-02 02:15:19Z hypowang $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if (empty($_GET['charset']) || !in_array(strtolower($_GET['charset']), array('gbk', 'big5', 'utf-8')))
$_GET['charset'] = '';
$allowhtml = empty($_GET['allowhtml']) ? 0 : 1;
$doodle = empty($_GET['doodle']) ? 0 : 1;
$isportal = empty($_GET['isportal']) ? 0 : 1;
if (empty($_GET['op'])) {
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="<?php echo $_GET['charset']; ?>" />
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Editor</title>
<script type="text/javascript" src="<?php echo STATICURL; ?>js/common.js"></script>
<script type="text/javascript" src="<?php echo STATICURL; ?>js/home.js"></script>
<script language="javascript" src="<?php echo STATICURL; ?>image/editor/editor_base.js"></script>
<style type="text/css">
html, body { height: 100%; }
body{margin:0;padding:0;}
body, td, input, button, select, textarea {font: 12px/1.5em Tahoma, Arial, Helvetica, sans-serif;}
textarea { resize: none; font-size: 14px; line-height: 1.8em; }
.submit { padding: 0 10px; height: 22px; border: 1px solid; border-color: #DDD #264F6E #264F6E #DDD; background: #2782D6; color: #FFF; line-height: 20px; letter-spacing: 1px; cursor: pointer; }
a.dm{text-decoration:none}
a.dm:hover{text-decoration:underline}
a{font-size:12px}
img{border:0}
td.icon{width:24px;height:24px;text-align:center;vertical-align:middle}
td.sp{width:8px;height:24px;text-align:center;vertical-align:middle}
td.xz{width:47px;height:24px;text-align:center;vertical-align:middle}
td.bq{width:49px;height:24px;text-align:center;vertical-align:middle}
div a.n{height:16px;line-height:16px;display:block;padding:2px;color:#000000;text-decoration:none}
div a.n:hover{background:#E5E5E5}
.r_op { float: right; }
.eMenu{position:absolute;margin-top: -2px;background:#FFFFFF;border:1px solid #C5C5C5;padding:4px}
.eMenu ul, .eMenu ul li { margin: 0; padding: 0; }
.eMenu ul li{list-style: none;float:left}
#editFaceBox { padding: 5px; }
#editFaceBox li { width: 25px; height: 25px; overflow: hidden; }
.t_input { padding: 3px 2px; border-style: solid; border-width: 1px; border-color: #7C7C7C #C3C3C3 #DDD; line-height: 16px; }
a.n1{height:16px;line-height:16px;display:block;padding:2px;color:#000000;text-decoration:none}
a.n1:hover{background:#E5E5E5}
a.cs{height:15px;position:relative}
*:lang(zh) a.cs{height:12px}
.cs .cb{font-size:0;display:block;width:10px;height:8px;position:absolute;left:4px;top:3px;cursor:hand!important;cursor:pointer}
.cs span{position:absolute;left:19px;top:0px;cursor:hand!important;cursor:pointer;color:#333}
.fRd1 .cb{background-color:#800}
.fRd2 .cb{background-color:#800080}
.fRd3 .cb{background-color:#F00}
.fRd4 .cb{background-color:#F0F}
.fBu1 .cb{background-color:#000080}
.fBu2 .cb{background-color:#00F}
.fBu3 .cb{background-color:#0FF}
.fGn1 .cb{background-color:#008080}
.fGn2 .cb{background-color:#008000}
.fGn3 .cb{background-color:#808000}
.fGn4 .cb{background-color:#0F0}
.fYl1 .cb{background-color:#FC0}
.fBk1 .cb{background-color:#000}
.fBk2 .cb{background-color:#808080}
.fBk3 .cb{background-color:#C0C0C0}
.fWt0 .cb{background-color:#FFF;border:1px solid #CCC}
.mf_nowchose{height:30px;background-color:#DFDFDF;border:1px solid #B5B5B5;border-left:none}
.mf_other{height:30px;border-left:1px solid #B5B5B5}
.mf_otherdiv{height:30px;width:30px;border:1px solid #FFF;border-right-color:#D6D6D6;border-bottom-color:#D6D6D6;background-color:#F8F8F8}
.mf_otherdiv2{height:30px;width:30px;border:1px solid #B5B5B5;border-left:none;border-top:none}
.mf_link{font-size:12px;color:#000000;text-decoration:none}
.mf_link:hover{font-size:12px;color:#000000;text-decoration:underline}
.ico{height:24px;width:24px;vertical-align:middle;text-align:center}
.ico2{height:24px;width:27px;vertical-align:middle;text-align:center}
.ico3{height:24px;width:25px;vertical-align:middle;text-align:center}
.ico4{height:24px;width:8px;vertical-align:middle;text-align:center}
.edTb { background: #F2F2F2; }
.icons a,.sepline,.switch{background-image:url(<?php echo STATICURL; ?>image/editor/editor.gif)}
.toobar, .toobarmini{position:relative;height:26px;overflow:hidden}
.toobarmini .icoSwitchTxt, .toobarmini .tble{ display: none !important;}
.toobar .icoSwitchMdi{ display: none;}
.tble{position:absolute;left:0;top:2px }
*:lang(zh) .tble{top:2px}
.tbri{width:60px;position:absolute;right:3px;top:2px;}
.icons a{width:20px;height:20px;background-repeat:no-repeat;display:block;float:left;border:1px solid #F2F2F2;}
*:lang(zh) .icons a{margin-right:1px}
.icons a:hover{border-color: #369 #CCC;background-color:#FFF}
a.icoCut{background-position:-140px -60px;}
a.icoCpy{background-position:-160px -60px;}
a.icoPse{background-position:-40px -60px}
a.icoFfm{background-position:-100px 0}
a.icoFsz{background-position:-120px 0;}
a.icoWgt{background-position:0 0;}
a.icoIta{background-position:-20px 0;}
a.icoUln{background-position:-40px 0;}
a.icoAgn{background-position:-60px 0}
a.icoAgL{background-position:-80px -20px}
a.icoAgC{background-position:-240px -40px}
a.icoAgR{background-position:-260px -40px}
a.icoLst{background-position:-100px -20px}
a.icoOdt{background-position:-180px -60px}
a.icoIdt{background-position:-180px -60px}
a.icoFcl{background-position:-60px 0}
a.icoBcl{background-position:-80px 0}
a.icoUrl{background-position:-40px -20px;}
a.icoMoveUrl{background-position:-60px -20px}
a.icoRenew {background-position:-180px -40px}
a.icoFace {background-position:-20px -20px}
a.icoPage {background-position:-200px -60px}
a.icoDown {background-position:-80px -60px}
a.icoDoodle {background-position:-260px -60px}
a.icoImg{background-position:0 -20px}
a.icoAttach{background-position:-200px -20px}
a.icoSwf{background-position:-240px -20px}
a.icoSwitchTxt{background-position:-220px -60px;float:right}
a.icoFullTxt{ float: right; width: 35px; height: 20px; line-height: 20px; border: 1px solid #C2D5E3; background: url(<?php echo STATICURL; ?>image/common/card_btn.png) repeat-x 0 100%; text-align: center; color: #333; text-decoration: none; }
a.icoSwitchMdi{background-position:-239px -60px;float:right}
.edTb{border-bottom:1px solid #c5c5c5;background-position:0 -28px}
.sepline{width:4px;height:20px;margin-top:2px;margin-right:3px;background-position:-476px 0;background-repeat:no-repeat;float:left }
</style>
<script language="JavaScript">
function fontname(obj){format('fontname',obj.innerHTML);obj.parentNode.style.display='none'}
function fontsize(size,obj){format('fontsize',size);obj.parentNode.style.display='none'}
</script>
</head>
<body style="overflow-y:hidden">
<div style="height:100%">
<div style="position: absolute;width: 100%;height: 31px;">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="edTb">
<tr>
<td height="31" style="padding-left:3px">
<div class="toobar" id="dvToolbar">
<div class="icons tble">
<a href="javascript:;" class="icoCut" title="<?php echo lang('home/editor', 'editor_cut'); ?>" onClick="format('Cut');return false;"></a>
<a href="javascript:;" class="icoCpy" title="<?php echo lang('home/editor', 'editor_copy'); ?>" onClick="format('Copy');return false;"></a>
<a href="javascript:;" class="icoPse" title="<?php echo lang('home/editor', 'editor_paste'); ?>" onClick="format('Paste');return false;"></a>
<div class="sepline"></div>
<a href="javascript:;" class="icoFfm" id="imgFontface" title="<?php echo lang('home/editor', 'editor_font'); ?>" onClick="fGetEv(event);fDisplayElement('fontface','');return false;"></a>
<a href="javascript:;" class="icoFsz" id="imgFontsize" title="<?php echo lang('home/editor', 'editor_fontsize'); ?>" onClick="fGetEv(event);fDisplayElement('fontsize','');return false;"></a>
<a href="javascript:;" class="icoWgt" onClick="format('Bold');return false;" title="<?php echo lang('home/editor', 'editor_fontbold'); ?>"></a>
<a href="javascript:;" class="icoIta" title="<?php echo lang('home/editor', 'editor_fontitalic'); ?>" onClick="format('Italic');return false;"></a>
<a href="javascript:;" class="icoUln" onClick="format('Underline');return false;" title="<?php echo lang('home/editor', 'editor_fontunderline'); ?>"></a>
<a href="javascript:;" class="icoFcl" title="<?php echo lang('home/editor', 'editor_funtcolor'); ?>" onClick="foreColor(event);return false;" id="imgFontColor"></a>
<a href="javascript:;" class="icoAgL" id="imgJustifyleft" onClick="fGetEv(event);format('Justifyleft');return false;" title="<?php echo lang('home/editor', 'editor_align_left'); ?>"></a>
<a href="javascript:;" class="icoAgC" id="imgJustifycenter" onClick="fGetEv(event);format('Justifycenter');return false;" title="<?php echo lang('home/editor', 'editor_align_center'); ?>"></a>
<a href="javascript:;" class="icoAgR" id="imgJustifyright" onClick="fGetEv(event);format('Justifyright');return false;" title="<?php echo lang('home/editor', 'editor_align_right'); ?>"></a>
<a href="javascript:;" class="icoLst" id="imgList" onClick="fGetEv(event);fDisplayElement('divList','');return false;"title="<?php echo lang('home/editor', 'editor_list'); ?>"></a>
<a href="javascript:;" class="icoOdt" id="imgInOut" onClick="fGetEv(event);fDisplayElement('divInOut','');return false;" title="<?php echo lang('home/editor', 'editor_indent'); ?>"></a>
<div class="sepline"></div>
<a href="javascript:;" class="icoUrl" id="icoUrl" onClick="createLink(event, 1);return false;" title="<?php echo lang('home/editor', 'editor_hyperlink'); ?>"></a>
<a href="javascript:;" class="icoMoveUrl" onClick="clearLink();return false;" title="<?php echo lang('home/editor', 'editor_remove_link'); ?>"></a>
<a href="javascript:;" class="icoImg" id="icoImg" onClick="parent.createImageBox(<?php echo ($isportal ? 'parent.check_catid' : '')?>);return false;" title="<?php echo lang('home/editor', 'editor_link_image'); ?>"></a>
<?php if ($isportal) { ?>
<a href="javascript:;" class="icoAttach" id="icoAttach" onClick="parent.createAttachBox(<?php echo ($isportal ? 'parent.check_catid' : '')?>);return false;" title="<?php echo lang('home/editor', 'editor_link_attach'); ?>"></a>
<?php } ?>
<a href="javascript:;" class="icoSwf" id="icoSwf" onClick="createFlash(event, 1);return false;" title="<?php echo lang('home/editor', 'editor_link_flash'); ?>"></a>
<a href="javascript:;" class="icoFace" id="faceBox" onClick="faceBox(event);return false;" title="<?php echo lang('home/editor', 'editor_insert_smiley'); ?>"></a>
<?php if ($doodle) { ?>
<a href="javascript:;" class="icoDoodle" id="doodleBox" onClick="doodleBox(event, this.id);return false;" title="<?php echo lang('home/editor', 'editor_doodle'); ?>"></a>
<?php } ?>
<?php if ($isportal) { ?>
<a href="javascript:;" class="icoPage" id="icoPage" onClick="pageBreak(event, 1);return false;" title="<?php echo lang('home/editor', 'editor_pagebreak'); ?>"></a>
<a href="javascript:;" class="icoDown" id="icoDown" onClick="parent.downRemoteFile();return false;" title="<?php echo lang('home/editor', 'editor_download_remote'); ?>"></a>
<?php } ?>
<a href="javascript:;" class="icoRenew" onClick="renewContent();return false;" title="<?php echo lang('home/editor', 'editor_restore'); ?>"></a>
<?php if ($allowhtml) { ?>
<input type="checkbox" value="1" name="switchMode" id="switchMode" style="float:left;margin-top:6px!important;margin-top:2px" onClick="setMode(this.checked)" onMouseOver="fSetModeTip(this)" onMouseOut="fHideTip()">
<?php } else { ?>
<input type="hidden" value="1" name="switchMode" id="switchMode">
<?php } ?>
</div>
<div class="icons tbri">
<a href="javascript:;" class="icoSwitchMdi" title="<?php echo lang('home/editor', 'editor_switch_media'); ?>" onClick="changeEditType(true, event);return false;"></a>
<a href="javascript:;" class="icoSwitchTxt" title="<?php echo lang('home/editor', 'editor_switch_text'); ?>" onClick="changeEditType(false, event);return false;"></a>
<a href="javascript:;" class="icoFullTxt" onClick="changeEditFull(true, event);return false;"><?php echo lang('home/editor', 'editor_full_screen'); ?></a>
</div>
</div>
</td>
</tr>
</table>
<div style="width:100px;height:100px;position:absolute;display:none;top:-500px;left:-500px" ID="dvPortrait"></div>
<div id="fontface" class="eMenu" style="z-index:99;display:none;top:35px;left:2px;width:110px;height:265px">
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px '<?php echo lang('home/editor', 'editor_font_song'); ?>';"><?php echo lang('home/editor', 'editor_font_song'); ?></a>
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px '<?php echo lang('home/editor', 'editor_font_hei'); ?>';"><?php echo lang('home/editor', 'editor_font_hei'); ?></a>
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px '<?php echo lang('home/editor', 'editor_font_kai'); ?>';"><?php echo lang('home/editor', 'editor_font_kai'); ?></a>
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px '<?php echo lang('home/editor', 'editor_font_li'); ?>';"><?php echo lang('home/editor', 'editor_font_li'); ?></a>
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px '<?php echo lang('home/editor', 'editor_font_you'); ?>';"><?php echo lang('home/editor', 'editor_font_you'); ?></a>
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px Arial;">Arial</a>
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px 'Arial Narrow';">Arial Narrow</a>
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px 'Arial Black';">Arial Black</a>
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px 'Comic Sans MS';">Comic Sans MS</a>
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px Courier;">Courier</a>
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px System;">System</a>
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px 'Times New Roman';">Times New Roman</a>
<a href="javascript:;" onClick="fontname(this);return false;" class="n" style="font:normal 12px Verdana;">Verdana</a>
</div>
<div id="fontsize" class="eMenu" style="display:none;top:35px;left:26px;width:125px;height:120px">
<a href="javascript:;" onClick="fontsize(1,this);return false;" class="n" style="font-size:xx-small;line-height:120%;"><?php echo lang('home/editor', 'editor_fontsize_xxsmall'); ?></a>
<a href="javascript:;" onClick="fontsize(2,this);return false;" class="n" style="font-size:x-small;line-height:120%;"><?php echo lang('home/editor', 'editor_fontsize_xsmall'); ?></a>
<a href="javascript:;" onClick="fontsize(3,this);return false;" class="n" style="font-size:small;line-height:120%;"><?php echo lang('home/editor', 'editor_fontsize_small'); ?></a>
<a href="javascript:;" onClick="fontsize(4,this);return false;" class="n" style="font-size:medium;line-height:120%;"><?php echo lang('home/editor', 'editor_fontsize_medium'); ?></a>
<a href="javascript:;" onClick="fontsize(5,this);return false;" class="n" style="font-size:large;line-height:120%;"><?php echo lang('home/editor', 'editor_fontsize_large'); ?></a>
</div>
<div id="divList" class="eMenu" style="display:none;top:35px;left:26px;width:64px;height:40px;"><a href="javascript:;" onClick="format('Insertorderedlist');fHide(this.parentNode);return false;" class="n"><?php echo lang('home/editor', 'editor_list_order'); ?></a><a href="javascript:;" onClick="format('Insertunorderedlist');fHide(this.parentNode);return false;" class="n"><?php echo lang('home/editor', 'editor_list_unorder'); ?></a></div>
<div id="divInOut" class="eMenu" style="display:none;top:35px;left:26px;width:64px;height:40px;"><a href="javascript:;" onClick="format('Indent');fHide(this.parentNode);return false;" class="n"><?php echo lang('home/editor', 'editor_indent_inc'); ?></a><a href="javascript:;" onClick="format('Outdent');fHide(this.parentNode);return false;" class="n"><?php echo lang('home/editor', 'editor_indent_dec'); ?></a></div>
<div id="dvForeColor" class="eMenu" style="display:none;top:35px;left:26px;width:90px;">
<a href="javascript:;" onClick="format(gSetColorType,'#800000');return false;" class="n cs fRd1"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_darkred'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#800080');return false;" class="n cs fRd2"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_purple'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#F00000');return false;" class="n cs fRd3"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_red'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#F000F0');return false;" class="n cs fRd4"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_pink'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#000080');return false;" class="n cs fBu1"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_darkblue'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#0000F0');return false;" class="n cs fBu2"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_blue'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#00F0F0');return false;" class="n cs fBu3"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_lakeblue'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#008080');return false;" class="n cs fGn1"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_greenblue'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#008000');return false;" class="n cs fGn2"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_green'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#808000');return false;" class="n cs fGn3"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_olives'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#00F000');return false;" class="n cs fGn4"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_lightgreen'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#F0C000');return false;" class="n cs fYl1"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_orange'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#000000');return false;" class="n cs fBk1"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_black'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#808080');return false;" class="n cs fBk2"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_grey'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#C0C0C0');return false;" class="n cs fBk3"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_silver'); ?></span></a>
<a href="javascript:;" onClick="format(gSetColorType,'#FFFFFF');return false;" class="n cs fWt0"><b class="cb"></b><span><?php echo lang('home/editor', 'editor_color_white'); ?></span></a>
</div>
<div id="editFaceBox" class="eMenu" style="display:none;top:35px;left:26px;width:165px;"></div>
<div id="createUrl" class="eMenu" style="display:none;top:35px;left:26px;width:300px;font-size:12px">
<?php echo lang('home/editor', 'editor_prompt_textlink'); ?>:<br/>
<input type="text" id="insertUrl" name="url" value="http://" onfocus="checkURL(this, 1);" onblur="checkURL(this, 0);" class="t_input" style="width: 190px;"> <input type="button" onclick="createLink();" name="createURL" value="<?php echo lang('home/editor', 'editor_ok'); ?>" class="submit" /> <a href="javascript:;" onclick="fHide($('createUrl'));return false;"><?php echo lang('home/editor', 'editor_cancel'); ?></a>
</div>
<div id="createImg" class="eMenu" style="display:none;top:35px;left:26px;width:300px;font-size:12px">
<?php echo lang('home/editor', 'editor_prompt_imagelink'); ?>:<br/>
<input type="text" id="imgUrl" name="imgUrl" value="http://" onfocus="checkURL(this, 1);" onblur="checkURL(this, 0);" class="t_input" style="width: 190px;" /> <input type="button" onclick="createImg();" name="createURL" value="<?php echo lang('home/editor', 'editor_ok'); ?>" class="submit" /> <a href="javascript:;" onclick="fHide($('createImg'));return false;"><?php echo lang('home/editor', 'editor_cancel'); ?></a>
</div>
<div id="createSwf" class="eMenu" style="display:none;top:35px;left:26px;width:400px;font-size:12px">
<?php echo lang('home/editor', 'editor_prompt_videolink'); ?>:<br/>
<select name="vtype" id="vtype">
<option value="0"><?php echo lang('home/editor', 'editor_prompt_video_flash'); ?></option>
<option value="1"><?php echo lang('home/editor', 'editor_prompt_video_media'); ?></option>
<option value="2"><?php echo lang('home/editor', 'editor_prompt_video_real'); ?></option>
<option value="3"><?php echo lang('home/editor', 'editor_prompt_mp3'); ?></option>
</select>
<input type="text" id="videoUrl" name="videoUrl" value="http://" onfocus="checkURL(this, 1);" onblur="checkURL(this, 0);" class="t_input" style="width: 200px;" />
<input type="button" onclick="createFlash();" name="createURL" value="<?php echo lang('home/editor', 'editor_ok'); ?>" class="submit" />
<a href="javascript:;" onclick="fHide($('createSwf'));return false;"><?php echo lang('home/editor', 'editor_cancel'); ?></a>
</div>
<div id="createPage" class="eMenu" style="display:none;top:35px;left:26px;width:300px;font-size:12px">
<?php echo lang('home/editor', 'editor_prompt_pagetitle'); ?>:<br/>
<input type="text" id="pageTitle" name="pageTitle" value="" class="t_input" style="width: 190px;" /> <input type="button" onclick="pageBreak();" name="createURL" value="<?php echo lang('home/editor', 'editor_ok'); ?>" class="submit" /> <a href="javascript:;" onclick="fHide($('createPage'));return false;"><?php echo lang('home/editor', 'editor_cancel'); ?></a>
</div>
</div>
<div style="height: 100%;padding-top: 31px;box-sizing: border-box;">
<textarea id="dvtext" style="overflow-y:auto; margin-top: 0; padding:0px 4px 4px;width:100%;height:100%;word-wrap:break-word;border:0;display:none;"></textarea>
<div id="dvhtml" style="height:100%;width:100%;overflow:hidden">
<SCRIPT LANGUAGE="JavaScript">
function blank_load() {
var inihtml = '';
var obj = parent.document.getElementById('uchome-ttHtmlEditor');
if(obj) {
inihtml = obj.value;
}
if(! inihtml && !window.Event) {
inihtml = '<div></div>';
}
if(!inihtml) {
inihtml = '&nbsp;';
}
window.frames['HtmlEditor'].document.body.innerHTML = inihtml;
}
document.write('<div id="divEditor" style="padding-left:4px;height:100%;background-color:#fff"><IFRAME class="HtmlEditor" ID="HtmlEditor" name="HtmlEditor" style="height:100%;width:100%;" frameBorder="0" marginHeight=0 marginWidth=0 src="home.php?mod=editor&op=blank&charset=<?php echo $_GET['charset']; ?>" onload="blank_load();"></IFRAME></div>');
</SCRIPT>
<textarea id="sourceEditor" style="overflow-y:auto;padding-left:4px;width:100%;height:100%;word-wrap:break-word;display:none;border:0;"></textarea>
</div>
</div>
</div>
<input type="hidden" name="uchome-editstatus" id="uchome-editstatus" value="html">
</body>
</html>
<?php
} else {
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="<?php echo $_GET['charset']; ?>" />
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Editor</title>
<style>
body { margin: 0; padding: 0; word-wrap: break-word; font-size:14px; line-height:1.8em; font-family: Tahoma, Arial, Helvetica, snas-serif; }
</style>
</head>
<body>
</body>
</html>
<?php
}?>

View File

@@ -0,0 +1,264 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: home_follow.php 33660 2013-07-29 07:51:05Z nemohou $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if(!$_G['setting']['followstatus']) {
showmessage('follow_status_off');
}
if(!$_G['uid']) {
showmessage('login_before_enter_home', null, array(), array('showmsg' => true, 'login' => 1));
}
$dos = array('feed', 'follower', 'following', 'view');
$do = (!empty($_GET['do']) && in_array($_GET['do'], $dos)) ? $_GET['do'] : (!$_GET['uid'] ? 'feed' : 'view');
$page = empty($_GET['page']) ? 1 : intval($_GET['page']);
if($page<1) $page=1;
$perpage = 20;
$start = ($page-1)*$perpage;
$multi = '';
$theurl = 'home.php?mod='.($do == 'view' ? 'space' : 'follow').(!in_array($do, array('feed', 'view')) ? '&do='.$do : '');
$uid = $_GET['uid'] ? $_GET['uid'] : $_G['uid'];
$viewself = $uid == $_G['uid'] ? true : false;
$space = $viewself ? $_G['member'] : getuserbyuid($uid, 1);
if(empty($space)) {
showmessage('follow_visituser_not_exist');
} elseif(in_array($space['groupid'], array(4, 5, 6)) && ($_G['adminid'] != 1 && $space['uid'] != $_G['uid'])) {
dheader("Location:home.php?mod=space&uid=$uid&do=profile");
}
space_merge($space, 'count');
space_merge($space, 'profile');
space_merge($space, 'field_home');
if($viewself) {
$showguide = false;
} else {
$theurl .= $uid ? '&uid='.$uid : '';
$do = $do == 'feed' ? 'view' : $do;
$flag = C::t('home_follow')->fetch_status_by_uid_followuid($_G['uid'], $uid);
}
$showrecommend = true;
$archiver = $primary = 1;
$followerlist = array();
$space['bio'] = cutstr($space['bio'], 200);
$lastviewtime = 0;
if($do == 'feed') {
$view = 'follow';
if(in_array($_GET['view'], array('special', 'follow', 'other'))) {
$view = $_GET['view'];
$theurl .= '&view='.$_GET['view'];
}
$vuid = $view == 'other' ? 0 : $_G['uid'];
$list = getfollowfeed($vuid, $view, false, $start, $perpage);
if((empty($list['feed']) || !is_array($list['feed']) || count($list['feed']) < 20) && (!empty($list['user']) || $view == 'other')) {
$primary = 0;
$alist = getfollowfeed($vuid, $view, true, $start, $perpage);
if(empty($list['feed']) && empty($alist['feed'])) {
$showguide = true;
$archiver = 0;
} else {
$showguide = false;
foreach($alist as $key => $values) {
if($key != 'user') {
foreach($values as $id => $value) {
if(!isset($list[$key][$id])) {
$list[$key][$id] = $value;
}
}
}
}
}
} elseif(empty($list['user']) && $view != 'other') {
$archiver = $primary = 0;
$showguide = false;
}
if($showguide) {
if(!empty($_G['cookie']['lastshowtime'])) {
$time = explode('|', $_G['cookie']['lastshowtime']);
$today = strtotime(dgmdate($_G['timestamp'], 'Y-m-d'));
if($time[0] == $uid && (TIMESTAMP - $time[1] < 86400 && $time[1] > $today)) {
$showguide = false;
}
}
dsetcookie('lastshowtime', $uid.'|'.TIMESTAMP, 86400);
}
if(!empty($_G['cookie']['lastviewtime'])) {
$time = explode('|', $_G['cookie']['lastviewtime']);
if($time[0] == $_G['uid']) {
$lastviewtime = $time[1];
}
} else {
$lastviewtime = getuserprofile('lastactivity');
}
dsetcookie('lastviewtime', $_G['uid'].'|'.TIMESTAMP, 31536000);
if($_G['member']['newprompt_num']['follow']) {
C::t('home_notification')->delete_by_type('follow', $_G['uid']);
helper_notification::update_newprompt($_G['uid'], 'follow');
}
$recommend = $users = array();
if(helper_access::check_module('follow')) {
loadcache('recommend_follow');
if(empty($_G['cache']['recommend_follow']) || !empty($_G['cache']['recommend_follow']) && (empty($_G['cache']['recommend_follow']['users']) || TIMESTAMP - $_G['cache']['recommend_follow']['dateline'] > 86400)) {
foreach(C::t('home_specialuser')->fetch_all_by_status(0, 10) as $value) {
$recommend[$value['uid']] = $value['username'];
}
unset($recommend[$_G['uid']]);
if(count($recommend) < 10) {
$followuser = C::t('common_member_count')->range_by_field(0, 100, 'follower', 'DESC');
$userstatus = C::t('common_member_status')->fetch_all_orderby_lastpost(array_keys($followuser), 0, 20);
$users = C::t('common_member')->fetch_all_username_by_uid(array_keys($userstatus));
}
savecache('recommend_follow', array('dateline'=>TIMESTAMP, 'users'=>$users, 'defaultusers' => $recommend));
} else {
$users = &$_G['cache']['recommend_follow']['users'];
$recommend = &$_G['cache']['recommend_follow']['defaultusers'];
}
if(!empty($users)) {
if(count($recommend) < 10) {
$randkeys = array_rand($users, min(count($users), 11 - count($recommend)));
foreach($randkeys as $ruid) {
if($ruid != $_G['uid']) {
$recommend[$ruid] = $users[$ruid];
}
}
}
}
if($do == 'following') {
foreach($list as $ruid => $user) {
if(isset($recommend[$ruid])) {
unset($recommend[$ruid]);
}
}
}
if($recommend) {
$users = C::t('home_follow')->fetch_all_by_uid_followuid($_G['uid'], array_keys($recommend));
foreach($users as $ruid => $user) {
if(isset($recommend[$ruid])) {
unset($recommend[$ruid]);
}
}
}
}
$navactives = array('feed' => ' class="a"');
$actives = array($view => ' class="a"');
list($seccodecheck, $secqaacheck) = seccheck('publish');
} elseif($do == 'view') {
$list = getfollowfeed($uid, 'self', false, $start, $perpage);
if(empty($list['feed'])) {
$primary = 0;
$list = getfollowfeed($uid, 'self', true, $start, $perpage);
if(empty($list['user'])) {
$archiver = 0;
}
}
if(!isset($_G['cache']['forums'])) {
loadcache('forums');
}
if(helper_access::check_module('follow')) {
$followerlist = C::t('home_follow')->fetch_all_following_by_uid($uid, 0, 9);
}
list($seccodecheck, $secqaacheck) = seccheck('publish');
} elseif($do == 'follower') {
$count = C::t('home_follow')->count_follow_user($uid, 1);
if($viewself && !empty($_G['member']['newprompt_num']['follower'])) {
$newfollower = C::t('home_notification')->fetch_all_by_uid($uid, -1, 'follower', 0, $_G['member']['newprompt_num']['follower']);
$newfollower_list = array();
foreach($newfollower as $val) {
$newfollower_list[] = $val['from_id'];
}
C::t('home_notification')->delete_by_type('follower', $_G['uid']);
helper_notification::update_newprompt($_G['uid'], 'follower');
}
if($count) {
$list = C::t('home_follow')->fetch_all_follower_by_uid($uid, $start, $perpage);
$multi = multi($count, $perpage, $page, $theurl);
}
if(helper_access::check_module('follow')) {
$followerlist = C::t('home_follow')->fetch_all_following_by_uid($uid, 0, 9);
}
$navactives = array($do => ' class="a"');
} elseif($do == 'following') {
$count = C::t('home_follow')->count_follow_user($uid);
if($count) {
$status = $_GET['status'] ? 1 : 0;
$list = C::t('home_follow')->fetch_all_following_by_uid($uid, $status, $start, $perpage);
$multi = multi($count, $perpage, $page, $theurl);
}
if(helper_access::check_module('follow')) {
$followerlist = C::t('home_follow')->fetch_all_follower_by_uid($uid, 9);
}
$navactives = array($do => ' class="a"');
}
if(($do == 'follower' || $do == 'following') && $list) {
$uids = array_keys($list);
$fieldhome = C::t('common_member_field_home')->fetch_all($uids);
foreach($fieldhome as $fuid => $val) {
$list[$fuid]['recentnote'] = $val['recentnote'];
}
$memberinfo = C::t('common_member_count')->fetch_all($uids);
$memberprofile = C::t('common_member_profile')->fetch_all($uids);
if(!$viewself) {
$myfollow = C::t('home_follow')->fetch_all_by_uid_followuid($_G['uid'], $uids);
foreach($uids as $muid) {
$list[$muid]['mutual'] = 0;
if(!empty($myfollow[$muid])) {
$list[$muid]['mutual'] = $myfollow[$muid]['mutual'] ? 1 : -1;
}
}
}
$specialfollow = C::t('home_follow')->fetch_all_following_by_uid($uid, 1, 10);
}
if($viewself) {
if(!isset($_G['cache']['forums'])) {
loadcache('forums');
}
$fields = C::t('forum_forumfield')->fetch_all_by_fid(array_keys($_G['cache']['forums']));
foreach($fields as $fid => $field) {
if(!empty($field['threadsorts'])) {
unset($_G['cache']['forums'][$fid]);
}
}
require_once libfile('function/forumlist');
$forumlist = forumselect();
$defaultforum = $_G['setting']['followforumid'] ? $_G['cache']['forums'][$_G['setting']['followforumid']] : array();
require_once libfile('function/upload');
$swfconfig = getuploadconfig($_G['uid']);
}
if($do == 'feed') {
$navigation = ' <em>&rsaquo;</em> <a href="home.php?mod=follow&view='.$view.'">'.lang('space', 'follow_view_'.$view).'</a>';
$navtitle = lang('space', 'follow_view_'.$view);
} elseif($do == 'view') {
$navigation = ' <em>&rsaquo;</em> <a href="home.php?mod=space&uid='.$uid.'">'.$space['username'].'</a>';
if($type != 'feed') {
$navigation .= ' <em>&rsaquo;</em> '.lang('space', 'follow_view_type_feed').'</a>';
}
$navtitle = lang('space', 'follow_view_feed', array('who' => $space['username']));
} else {
$navigation = ' <em>&rsaquo;</em> <a href="home.php?mod=space&uid='.$uid.'">'.$space['username'].'</a> <em>&rsaquo;</em> '.lang('space', 'follow_view_'.($viewself?'my':'do').'_'.$do);
$navtitle = lang('space', 'follow_view_'.($viewself?'my':'do').'_'.$do);
}
$metakeywords = $navtitle;
$metadescription = $navtitle;
$navtitle = helper_seo::get_title_page($navtitle, $_G['page']);
include template('diy:home/follow_feed');
?>

View File

@@ -0,0 +1,153 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: home_invite.php 25756 2011-11-22 02:47:45Z zhangguosheng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$id = intval($_GET['id']);
$uid = intval($_GET['u']);
$acceptconfirm = false;
if($_G['setting']['regstatus'] < 2) {
showmessage('not_open_invite', '', array(), array('return' => true));
}
if($_G['uid']) {
if($_GET['accept'] == 'yes') {
$cookies = empty($_G['cookie']['invite_auth'])?array():explode(',', $_G['cookie']['invite_auth']);
if(empty($cookies)) {
showmessage('invite_code_error', '', array(), array('return' => true));
}
if(count($cookies) == 3) {
$uid = intval($cookies[0]);
$_GET['c'] = $cookies[1];
} else {
$id = intval($cookies[0]);
$_GET['c'] = $cookies[1];
}
$acceptconfirm = true;
} elseif($_GET['accept'] == 'no') {
dsetcookie('invite_auth', '');
showmessage('invite_accept_no', 'home.php');
}
}
if($id) {
$invite = C::t('common_invite')->fetch($id);
if(empty($invite) || $invite['code'] != $_GET['c']) {
showmessage('invite_code_error', '', array(), array('return' => true));
}
if($invite['fuid'] && $invite['fuid'] != $_G['uid']) {
showmessage('invite_code_fuid', '', array(), array('return' => true));
}
if($invite['endtime'] && $_G['timestamp'] > $invite['endtime']) {
C::t('common_invite')->delete($id);
showmessage('invite_code_endtime_error', '', array(), array('return' => true));
}
$uid = $invite['uid'];
$cookievar = "$id,{$invite['code']}";
} elseif ($uid) {
$id = 0;
$invite_code = helper_invite::generate_key($uid);
if($_GET['c'] !== $invite_code) {
showmessage('invite_code_error', '', array(), array('return' => true));
}
$inviteuser = getuserbyuid($uid);
loadcache('usergroup_'.$inviteuser['groupid']);
if(!empty($_G['cache']['usergroup_'.$inviteuser['groupid']]) && (!$_G['cache']['usergroup_'.$inviteuser['groupid']]['allowinvite'] || $_G['cache']['usergroup_'.$inviteuser['groupid']]['inviteprice'])) {
showmessage('invite_code_error', '', array(), array('return' => true));
}
$cookievar = "$uid,$invite_code,0";
} else {
showmessage('invite_code_error', '', array(), array('return' => true));
}
$space = getuserbyuid($uid);
if(empty($space)) {
showmessage('space_does_not_exist', '', array(), array('return' => true));
}
$jumpurl = 'home.php?mod=space&uid='.$uid;
if($acceptconfirm) {
dsetcookie('invite_auth', '');
if($_G['uid'] == $uid) {
showmessage('should_not_invite_your_own', '', array(), array('return' => true));
}
require_once libfile('function/friend');
if(friend_check($uid)) {
showmessage('you_have_friends', $jumpurl);
}
$fields = C::t('common_member_field_home')->fetch($uid);
if(!$fields['allowasfriend']) {
showmessage('is_blacklist');
}
require_once libfile('function/spacecp');
if(isblacklist($uid)) {
showmessage('is_blacklist');
}
friend_make($space['uid'], $space['username']);
if($id) {
C::t('common_invite')->update($id, array('fuid'=>$_G['uid'], 'fusername'=>$_G['username'], 'regdateline' => $_G['timestamp'], 'status' => 2));
notification_add($uid, 'friend', 'invite_friend', array('actor' => '<a href="home.php?mod=space&uid='.$_G['uid'].'" target="_blank">'.$_G['username'].'</a>'), 1);
}
space_merge($space, 'field_home');
if(is_array($space['privacy']) && !empty($space['privacy']['feed']['invite'])) {
require_once libfile('function/feed');
$tite_data = array('username' => '<a href="home.php?mod=space&uid='.$_G['uid'].'">'.$_G['username'].'</a>');
feed_add('friend', 'feed_invite', $tite_data, '', array(), '', array(), array(), '', '', '', 0, 0, '', $space['uid'], $space['username']);
}
if($_G['setting']['inviteconfig']['inviteaddcredit']) {
updatemembercount($_G['uid'],
array($_G['setting']['inviteconfig']['inviterewardcredit'] => $_G['setting']['inviteconfig']['inviteaddcredit']));
}
if($_G['setting']['inviteconfig']['invitedaddcredit']) {
updatemembercount($uid,
array($_G['setting']['inviteconfig']['inviterewardcredit'] => $_G['setting']['inviteconfig']['invitedaddcredit']));
}
include_once libfile('function/stat');
updatestat('invite');
showmessage('invite_friend_ok', $jumpurl);
} else {
dsetcookie('invite_auth', $cookievar, 604800);
}
space_merge($space, 'count');
space_merge($space, 'field_home');
space_merge($space, 'profile');
$flist = array();
$query = C::t('home_friend')->fetch_all_by_uid($uid, 0, 12, true);
foreach($query as $value) {
$value['uid'] = $value['fuid'];
$value['username'] = $value['fusername'];
$flist[] = $value;
}
$jumpurl = urlencode($jumpurl);
include_once template('home/invite');
?>

View File

@@ -0,0 +1,524 @@
<?php
/*
[Discuz!] (C)2001-2099 Comsenz Inc111.
This is NOT a freeware, use is subject to license terms
$Id: home_magic.php 33875 2013-08-26 07:33:49Z andyzheng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if(!$_G['uid']) {
showmessage('not_loggedin', NULL, array(), array('login' => 1));
}
if(!$_G['setting']['creditstransextra'][3]) {
showmessage('credits_transaction_disabled');
} elseif(!$_G['setting']['magicstatus']) {
showmessage('magics_close');
}
require_once libfile('function/magic');
loadcache('magics');
$_G['mnid'] = 'mn_common';
$magiclist = array();
$_G['tpp'] = 16;
$page = max(1, intval($_GET['page']));
$action = $_GET['action'];
$operation = $_GET['operation'];
$start_limit = ($page - 1) * $_G['tpp'];
$_GET['idtype'] = dhtmlspecialchars($_GET['idtype']);
$comma = $typeadd = $filteradd = $forumperm = $targetgroupperm = '';
$magicarray = is_array($_G['cache']['magics']) ? $_G['cache']['magics'] : array();
if(!$_G['uid'] && ($operation || $action == 'mybox')) {
showmessage('not_loggedin', NULL, array(), array('login' => 1));
}
if(!$_G['group']['allowmagics']) {
showmessage('magics_nopermission');
}
$totalweight = getmagicweight($_G['uid'], $magicarray);
$allowweight = $_G['group']['maxmagicsweight'] - $totalweight;
$location = 0;
if(empty($action) && !empty($_GET['mid'])) {
$_GET['magicid'] = C::t('common_member_magic')->fetch_magicid_by_identifier($_G['uid'], $_GET['mid']);
if(!$_GET['magicid']) {
$magic = C::t('common_magic')->fetch_by_identifier($_GET['mid']);
if(!$magic['price'] && $magic['num']) {
getmagic($magic['magicid'], 1, $magic['weight'], $totalweight, $_G['uid'], $_G['group']['maxmagicsweight']);
updatemagiclog($magic['magicid'], '1', 1, $magic['price'].'|'.$magic['credit'], $_G['uid']);
C::t('common_magic')->update_salevolume($magic['magicid'], 1);
updatemembercount($_G['uid'], array($magic['credit'] => -0), true, 'BMC', $magic['magicid']);
$_GET['magicid'] = $magic['magicid'];
}
}
if($_GET['magicid']) {
$action = 'mybox';
$operation = 'use';
} else {
$action = 'shop';
$operation = 'buy';
$location = 1;
}
}
$action = empty($action) ? 'shop' : $action;
$actives[$action] = ' class="a"';
if($action == 'shop') {
$operation = empty($operation) ? 'index' : $operation;
if(in_array($operation, array('index', 'hot'))) {
$subactives[$operation] = 'class="a"';
$filteradd = '';
if($operation == 'index') {
$navtitle = lang('core', 'title_magics_shop');
} else {
$navtitle = lang('core', 'title_magics_hot');
}
$magiccount = C::t('common_magic')->count_page($operation);
$multipage = multi($magiccount, $_G['tpp'], $page, "home.php?mod=magic&action=shop&operation=$operation");
foreach(C::t('common_magic')->fetch_all_page($operation, $start_limit, $_G['tpp']) as $magic) {
$magic['discountprice'] = $_G['group']['magicsdiscount'] ? intval($magic['price'] * ($_G['group']['magicsdiscount'] / 10)) : intval($magic['price']);
$eidentifier = explode(':', $magic['identifier']);
if(count($eidentifier) > 1) {
$magic['pic'] = 'source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.gif';
} else {
$magic['pic'] = STATICURL.'image/magic/'.strtolower($magic['identifier']).'.gif';
}
$magiclist[] = $magic;
}
$magiccredits = array();
foreach($magicarray as $magic) {
$magiccredits[$magic['credit']] = $magic['credit'];
}
} elseif($operation == 'buy') {
$magic = C::t('common_magic')->fetch_by_identifier($_GET['mid']);
if(!$magic || !$magic['available']) {
showmessage('magics_nonexistence');
}
$magicperm = dunserialize($magic['magicperm']);
$useperm = (strstr($magicperm['usergroups'], "\t{$_G['groupid']}\t") || empty($magicperm['usergroups'])) ? '1' : '0';
if(!$useperm) {
showmessage('magics_use_nopermission');
}
$querystring = array();
foreach($_GET as $k => $v) {
$querystring[] = rawurlencode($k).'='.rawurlencode($v);
}
$querystring = implode('&', $querystring);
$eidentifier = explode(':', $magic['identifier']);
if(count($eidentifier) > 1) {
$magicfile = './source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.php';
$magicclass = 'magic_'.$eidentifier[1];
} else {
$magicfile = './source/class/magic/magic_'.$magic['identifier'].'.php';
$magicclass = 'magic_'.$magic['identifier'];
}
if(!@include_once DISCUZ_ROOT.$magicfile) {
showmessage('magics_filename_nonexistence', '', array('file' => $magicfile));
}
$magicclass = new $magicclass;
$magicclass->magic = $magic;
$magicclass->parameters = $magicperm;
if(method_exists($magicclass, 'buy')) {
$magicclass->buy();
}
$magic['discountprice'] = $_G['group']['magicsdiscount'] ? intval($magic['price'] * ($_G['group']['magicsdiscount'] / 10)) : intval($magic['price']);
if(count($eidentifier) > 1) {
$magic['pic'] = 'source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.gif';
} else {
$magic['pic'] = STATICURL.'image/magic/'.strtolower($magic['identifier']).'.gif';
}
$magic['credit'] = $magic['credit'] ? $magic['credit'] : $_G['setting']['creditstransextra'][3];
$useperoid = magic_peroid($magic, $_G['uid']);
if(!submitcheck('operatesubmit')) {
if($magicperm['targetgroups']) {
loadcache('usergroups');
foreach(explode("\t", $magicperm['targetgroups']) as $_G['groupid']) {
if(isset($_G['cache']['usergroups'][$_G['groupid']])) {
$targetgroupperm .= $comma.$_G['cache']['usergroups'][$_G['groupid']]['grouptitle'];
$comma = '&nbsp;';
}
}
}
if($magicperm['forum']) {
loadcache('forums');
foreach(explode("\t", $magicperm['forum']) as $fid) {
if(isset($_G['cache']['forums'][$fid])) {
$forumperm .= $comma.'<a href="forum.php?mod=forumdisplay&fid='.$fid.'" target="_blank">'.$_G['cache']['forums'][$fid]['name'].'</a>';
$comma = '&nbsp;';
}
}
}
include template('home/space_magic_shop_opreation');
dexit();
} else {
$magicnum = intval($_GET['magicnum']);
$magic['weight'] = $magic['weight'] * $magicnum;
$totalprice = $magic['discountprice'] * $magicnum;
if(getuserprofile('extcredits'.$magic['credit']) < $totalprice) {
if($_G['setting']['ec_ratio'] && $_G['setting']['creditstrans'][0] == $magic['credit']) {
showmessage('magics_credits_no_enough_and_charge', '', array('credit' => $_G['setting']['extcredits'][$magic['credit']]['title']));
} else {
showmessage('magics_credits_no_enough', '', array('credit' => $_G['setting']['extcredits'][$magic['credit']]['title']));
}
} elseif($magic['num'] < $magicnum) {
showmessage('magics_num_no_enough');
} elseif(!$magicnum || $magicnum < 0) {
showmessage('magics_num_invalid');
}
getmagic($magic['magicid'], $magicnum, $magic['weight'], $totalweight, $_G['uid'], $_G['group']['maxmagicsweight']);
updatemagiclog($magic['magicid'], '1', $magicnum, $magic['price'].'|'.$magic['credit'], $_G['uid']);
C::t('common_magic')->update_salevolume($magic['magicid'], $magicnum);
updatemembercount($_G['uid'], array($magic['credit'] => -$totalprice), true, 'BMC', $magic['magicid']);
showmessage('magics_buy_succeed', 'home.php?mod=magic&action=mybox', array('magicname' => $magic['name'], 'num' => $magicnum, 'credit' => $totalprice.' '.$_G['setting']['extcredits'][$magic['credit']]['unit'].$_G['setting']['extcredits'][$magic['credit']]['title']));
}
} elseif($operation == 'give') {
if($_G['group']['allowmagics'] < 2) {
showmessage('magics_nopermission');
}
$magic = C::t('common_magic')->fetch_by_identifier($_GET['mid']);
if(!$magic || !$magic['available']) {
showmessage('magics_nonexistence');
}
$magic['discountprice'] = $_G['group']['magicsdiscount'] ? intval($magic['price'] * ($_G['group']['magicsdiscount'] / 10)) : intval($magic['price']);
$eidentifier = explode(':', $magic['identifier']);
if(count($eidentifier) > 1) {
$magic['pic'] = 'source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.gif';
} else {
$magic['pic'] = STATICURL.'image/magic/'.strtolower($magic['identifier']).'.gif';
}
if(!submitcheck('operatesubmit')) {
include libfile('function/friend');
$buddyarray = friend_list($_G['uid'], 20);
include template('home/space_magic_shop_opreation');
dexit();
} else {
$magicnum = intval($_GET['magicnum']);
$totalprice = $magic['price'] * $magicnum;
if(getuserprofile('extcredits'.$magic['credit']) < $totalprice) {
if($_G['setting']['ec_ratio'] && $_G['setting']['creditstrans'][0] == $magic['credit']) {
showmessage('magics_credits_no_enough_and_charge', '', array('credit' => $_G['setting']['extcredits'][$magic['credit']]['title']));
} else {
showmessage('magics_credits_no_enough', '', array('credit' => $_G['setting']['extcredits'][$magic['credit']]['title']));
}
} elseif($magic['num'] < $magicnum) {
showmessage('magics_num_no_enough');
} elseif(!$magicnum || $magicnum < 0) {
showmessage('magics_num_invalid');
}
$toname = dhtmlspecialchars(trim($_GET['tousername']));
if(!$toname) {
showmessage('magics_username_nonexistence');
}
$givemessage = dhtmlspecialchars(trim($_GET['givemessage']));
givemagic($toname, $magic['magicid'], $magicnum, $magic['num'], $totalprice, $givemessage, $magicarray);
C::t('common_magic')->update_salevolume($magic['magicid'], $magicnum);
updatemembercount($_G['uid'], array($magic['credit'] => -$totalprice), true, 'BMC', $magicid);
showmessage('magics_buygive_succeed', 'home.php?mod=magic&action=shop', array('magicname' => $magic['name'], 'toname' => $toname, 'num' => $magicnum, 'credit' => $_G['setting']['extcredits'][$magic['credit']]['title'].' '.$totalprice.' '.$_G['setting']['extcredits'][$magic['credit']]['unit']), array('locationtime' => true));
}
} else {
showmessage('undefined_action');
}
} elseif($action == 'mybox') {
if(empty($operation)) {
$pid = !empty($_GET['pid']) ? intval($_GET['pid']) : 0;
$magiccount = C::t('common_member_magic')->count_by_uid($_G['uid']);
$multipage = multi($magiccount, $_G['tpp'], $page, "home.php?mod=magic&action=mybox&pid=$pid$typeadd");
$query = C::t('common_member_magic')->fetch_all_magic($_G['uid'], null, $start_limit, $_G['tpp']);
foreach($query as $value) {
$magicids[] = $value['magicid'];
}
$magicm = C::t('common_magic')->fetch_all($magicids);
foreach($query as $curmagicid => $mymagic) {
$mymagic = $mymagic + $magicm[$mymagic['magicid']];
$eidentifier = explode(':', $mymagic['identifier']);
if(count($eidentifier) > 1) {
$mymagic['pic'] = 'source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.gif';
} else {
$mymagic['pic'] = STATICURL.'image/magic/'.strtolower($mymagic['identifier']).'.gif';
}
$mymagic['weight'] = intval($mymagic['weight'] * $mymagic['num']);
$mymagic['type'] = $mymagic['type'];
$mymagiclist[] = $mymagic;
}
$navtitle = lang('core', 'title_magics_user');
} else {
$magicid = intval($_GET['magicid']);
$membermagic = C::t('common_member_magic')->fetch_magic($_G['uid'], $magicid);
$magic = $membermagic + C::t('common_magic')->fetch($magicid);
if(!$membermagic) {
showmessage('magics_nonexistence');
} elseif(!$magic['num']) {
C::t('common_member_magic')->delete_magic($_G['uid'], $magic['magicid']);
showmessage('magics_nonexistence');
}
$magicperm = dunserialize($magic['magicperm']);
$eidentifier = explode(':', $magic['identifier']);
if(count($eidentifier) > 1) {
$magic['pic'] = 'source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.gif';
} else {
$magic['pic'] = STATICURL.'image/magic/'.strtolower($magic['identifier']).'.gif';
}
if($operation == 'use') {
$useperm = (strstr($magicperm['usergroups'], "\t{$_G['groupid']}\t") || empty($magicperm['usergroups'])) ? '1' : '0';
if(!$useperm) {
showmessage('magics_use_nopermission');
}
if($magic['num'] <= 0) {
C::t('common_member_magic')->delete_magic($_G['uid'], $magic['magicid']);
showmessage('magics_nopermission');
}
$magic['weight'] = intval($magicarray[$magic['magicid']]['weight'] * $magic['num']);
if(count($eidentifier) > 1) {
$magicfile = './source/plugin/'.$eidentifier[0].'/magic/magic_'.$eidentifier[1].'.php';
$magicclass = 'magic_'.$eidentifier[1];
} else {
$magicfile = './source/class/magic/magic_'.$magic['identifier'].'.php';
$magicclass = 'magic_'.$magic['identifier'];
}
if(!@include_once DISCUZ_ROOT.$magicfile) {
showmessage('magics_filename_nonexistence', '', array('file' => $magicfile));
}
$magicclass = new $magicclass;
$magicclass->magic = $magic;
$magicclass->parameters = $magicperm;
$useperoid = magic_peroid($magic, $_G['uid']);
if(submitcheck('usesubmit')) {
if(discuz_process::islocked('magiclock_'.$_G['uid'].'_'.$magicid, 0, 1)) {
showmessage('magics_locked');
}
if($useperoid !== true && $useperoid <= 0) {
showmessage('magics_outofperoid_'.$magic['useperoid'], '', array('usenum' => $magic['usenum']));
}
if(method_exists($magicclass, 'usesubmit')) {
$magicclass->usesubmit();
}
dexit();
}
include template('home/space_magic_mybox_opreation');
dexit();
} elseif($operation == 'sell') {
$magic['price'] = $_G['group']['magicsdiscount'] ? intval($magic['price'] * ($_G['group']['magicsdiscount'] / 10)) : intval($magic['price']);
$discountprice = floor($magic['price'] * $_G['setting']['magicdiscount'] / 100);
if(!submitcheck('operatesubmit')) {
include template('home/space_magic_mybox_opreation');
dexit();
} else {
if(discuz_process::islocked('magiclock_'.$_G['uid'].'_'.$magicid, 0, 1)) {
showmessage('magics_locked');
}
$magicnum = intval($_GET['magicnum']);
if(!$magicnum || $magicnum < 0) {
showmessage('magics_num_invalid');
} elseif($magicnum > $magic['num']) {
showmessage('magics_amount_no_enough');
}
usemagic($magic['magicid'], $magic['num'], $magicnum);
updatemagiclog($magic['magicid'], '2', $magicnum, '0', 0, 'sell');
$totalprice = $discountprice * $magicnum;
updatemembercount($_G['uid'], array($magic['credit'] => $totalprice));
showmessage('magics_sell_succeed', 'home.php?mod=magic&action=mybox', array('magicname' => $magic['name'], 'num' => $magicnum, 'credit' => $totalprice.' '.$_G['setting']['extcredits'][$magic['credit']]['unit'].$_G['setting']['extcredits'][$magic['credit']]['title']));
}
} elseif($operation == 'drop') {
if(!submitcheck('operatesubmit')) {
include template('home/space_magic_mybox_opreation');
dexit();
} else {
$magicnum = intval($_GET['magicnum']);
if(!$magicnum || $magicnum < 0) {
showmessage('magics_num_invalid');
} elseif($magicnum > $magic['num']) {
showmessage('magics_amount_no_enough');
}
usemagic($magic['magicid'], $magic['num'], $magicnum);
updatemagiclog($magic['magicid'], '2', $magicnum, '0', 0, 'drop');
showmessage('magics_drop_succeed', 'home.php?mod=magic&action=mybox', array('magicname' => $magic['name'], 'num' => $magicnum), array('locationtime' => true));
}
} elseif($operation == 'give') {
if($_G['group']['allowmagics'] < 2) {
showmessage('magics_nopermission');
}
if(!submitcheck('operatesubmit')) {
include libfile('function/friend');
$buddyarray = friend_list($_G['uid'], 20);
include template('home/space_magic_mybox_opreation');
dexit();
} else {
if($_G['setting']['submitlock'] && discuz_process::islocked('magiclock_'.$_G['uid'].'_'.$magicid, 0, 1)) {
showmessage('magics_locked');
}
$magicnum = intval($_GET['magicnum']);
$toname = dhtmlspecialchars(trim($_GET['tousername']));
if(!$toname) {
showmessage('magics_username_nonexistence');
} elseif($magicnum < 0 || $magic['num'] < $magicnum) {
showmessage('magics_num_invalid');
}
$givemessage = dhtmlspecialchars(trim($_GET['givemessage']));
givemagic($toname, $magic['magicid'], $magicnum, $magic['num'], '0', $givemessage, $magicarray);
}
} else {
showmessage('undefined_action');
}
}
} elseif($action == 'log') {
$subactives[$operation] = 'class="a"';
$loglist = array();
if($operation == 'uselog') {
$count = C::t('common_magiclog')->count_by_uid_action($_G['uid'], 2);
if($count) {
$multipage = multi($count, $_G['tpp'], $page, 'home.php?mod=magic&action=log&amp;operation=uselog');
$logs = C::t('common_magiclog')->fetch_all_by_uid_action($_G['uid'], 2, $start_limit, $_G['tpp']);
$luids=array();
foreach($luids as $log) {
$luids[$log['uid']] = $log['uid'];
}
foreach($logs as $log) {
$log['dateline'] = dgmdate($log['dateline'], 'u');
$log['name'] = $magicarray[$log['magicid']]['name'];
$loglist[] = $log;
}
}
} elseif($operation == 'buylog') {
$count = C::t('common_magiclog')->count_by_uid_action($_G['uid'], 1);
if($count) {
$multipage = multi($count, $_G['tpp'], $page, 'home.php?mod=magic&action=log&amp;operation=buylog');
foreach(C::t('common_magiclog')->fetch_all_by_uid_action($_G['uid'], 1, $start_limit, $_G['tpp']) as $log) {
$log['credit'] = $log['credit'] ? $log['credit'] : $_G['setting']['creditstransextra'][3];
$log['dateline'] = dgmdate($log['dateline'], 'u');
$log['name'] = $magicarray[$log['magicid']]['name'];
$loglist[] = $log;
}
}
} elseif($operation == 'givelog') {
$count = C::t('common_magiclog')->count_by_uid_action($_G['uid'], 3);
if($count) {
$multipage = multi($count, $_G['tpp'], $page, 'home.php?mod=magic&action=log&amp;operation=givelog');
$uids = null;
$query = C::t('common_magiclog')->fetch_all_by_uid_action($_G['uid'], 3, $start_limit, $_G['tpp']);
foreach($query as $log) {
$uids[] = $log['targetuid'];
}
if($uids != null) {
$memberdata = C::t('common_member')->fetch_all_username_by_uid($uids);
}
foreach($query as $log) {
$log['username'] = $memberdata[$log['targetuid']];
$log['dateline'] = dgmdate($log['dateline'], 'u');
$log['name'] = $magicarray[$log['magicid']]['name'];
$loglist[] = $log;
}
}
} elseif($operation == 'receivelog') {
$count = C::t('common_magiclog')->count_by_targetuid_action($_G['uid'], 3);
if($count) {
$multipage = multi($count, $_G['tpp'], $page, 'home.php?mod=magic&action=log&amp;operation=receivelog');
$logs = C::t('common_magiclog')->fetch_all_by_targetuid_action($_G['uid'], 3, $start_limit, $_G['tpp']);
$luids = array();
foreach($logs as $log) {
$luids[$log['uid']] = $log['uid'];
}
$members = C::t('common_member')->fetch_all_username_by_uid($luids);
foreach($logs as $log) {
$log['username'] = $members[$log['uid']];
$log['dateline'] = dgmdate($log['dateline'], 'u');
$log['name'] = $magicarray[$log['magicid']]['name'];
$loglist[] = $log;
}
}
}
$navtitle = lang('core', 'title_magics_log');
} else {
showmessage('undefined_action');
}
include template('home/space_magic');
?>

View File

@@ -0,0 +1,186 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: home_medal.php 28887 2012-03-16 10:17:38Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if(!$_G['setting']['medalstatus']) {
showmessage('medal_status_off');
}
loadcache('medals');
if(!$_G['uid'] && $_GET['action']) {
showmessage('not_loggedin', NULL, array(), array('login' => 1));
}
$_G['mnid'] = 'mn_common';
$medallist = $medallogs = array();
$tpp = 10;
$page = max(1, intval($_GET['page']));
$start_limit = ($page - 1) * $tpp;
if(empty($_GET['action'])) {
include libfile('function/forum');
$medalcredits = array();
foreach(C::t('forum_medal')->fetch_all_data(1) as $medal) {
$medal['permission'] = medalformulaperm(serialize(array('medal' => dunserialize($medal['permission']))), $medal['type']);
$medal['image'] = preg_match('/^https?:\/\//is', $medal['image']) ? $medal['image'] : STATICURL.'image/common/'.$medal['image'];
if($medal['price']) {
$medal['credit'] = $medal['credit'] ? $medal['credit'] : $_G['setting']['creditstransextra'][3];
$medalcredits[$medal['credit']] = $medal['credit'];
}
$medallist[$medal['medalid']] = $medal;
}
$memberfieldforum = C::t('common_member_field_forum')->fetch($_G['uid']);
$membermedal = $memberfieldforum['medals'] ? explode("\t", $memberfieldforum['medals']) : array();
$membermedal = array_map('intval', $membermedal);
$lastmedals = $uids = array();
foreach(C::t('forum_medallog')->fetch_all_lastmedal(10) as $id => $lastmedal) {
$lastmedal['dateline'] = dgmdate($lastmedal['dateline'], 'u');
$lastmedals[$id] = $lastmedal;
$uids[] = $lastmedal['uid'];
}
$lastmedalusers = C::t('common_member')->fetch_all($uids);
$mymedals = C::t('common_member_medal')->fetch_all_by_uid($_G['uid']);
$mymedals = array_keys($mymedals);
$applylogs = C::t('forum_medallog')->fetch_all_by_type(2);
foreach ($applylogs as $id => $log) {
$log['uid'] == $_G['uid'] && $mymedals[$log['medalid']] = $log['medalid'];
}
} elseif($_GET['action'] == 'confirm') {
include libfile('function/forum');
$medal = C::t('forum_medal')->fetch($_GET['medalid']);
$medal['permission'] = medalformulaperm(serialize(array('medal' => dunserialize($medal['permission']))), $medal['type']);
$medal['image'] = preg_match('/^https?:\/\//is', $medal['image']) ? $medal['image'] : STATICURL.'image/common/'.$medal['image'];
if($medal['price']) {
$medal['credit'] = $medal['credit'] ? $medal['credit'] : $_G['setting']['creditstransextra'][3];
$medalcredits[$medal['credit']] = $medal['credit'];
}
include template('home/space_medal_float');
} elseif($_GET['action'] == 'apply' && submitcheck('medalsubmit')) {
$medalid = intval($_GET['medalid']);
$_G['forum_formulamessage'] = $_G['forum_usermsg'] = $medalnew = '';
$medal = C::t('forum_medal')->fetch($medalid);
if(!$medal['type']) {
showmessage('medal_apply_invalid');
}
if(C::t('common_member_medal')->count_by_uid_medalid($_G['uid'], $medalid)) {
showmessage('medal_apply_existence', 'home.php?mod=medal');
}
$applysucceed = FALSE;
$medalpermission = $medal['permission'] ? dunserialize($medal['permission']) : array();
if($medalpermission[0] || $medalpermission['usergroupallow']) {
include libfile('function/forum');
medalformulaperm(serialize(array('medal' => $medalpermission)), $medal['type']);
if($_G['forum_formulamessage']) {
showmessage('medal_permforum_nopermission', 'home.php?mod=medal', array('formulamessage' => $_G['forum_formulamessage'], 'usermsg' => $_G['forum_usermsg']));
} else {
$applysucceed = TRUE;
}
} else {
$applysucceed = TRUE;
}
if($applysucceed) {
$expiration = empty($medal['expiration'])? 0 : TIMESTAMP + $medal['expiration'] * 86400;
if($medal['type'] == 1) {
if($medal['price']) {
$medal['credit'] = $medal['credit'] ? $medal['credit'] : $_G['setting']['creditstransextra'][3];
if($medal['price'] > getuserprofile('extcredits'.$medal['credit'])) {
showmessage('medal_not_get_credit', '', array('credit' => $_G['setting']['extcredits'][$medal['credit']]['title']));
}
updatemembercount($_G['uid'], array($medal['credit'] => -$medal['price']), true, 'BME', $medal['medalid']);
}
$memberfieldforum = C::t('common_member_field_forum')->fetch($_G['uid']);
$usermedal = $memberfieldforum;
unset($memberfieldforum);
$medal['medalid'] = $medal['medalid'].(empty($expiration) ? '' : '|'.$expiration);
$medalnew = $usermedal['medals'] ? $usermedal['medals']."\t".$medal['medalid'] : $medal['medalid'];
C::t('common_member_field_forum')->update($_G['uid'], array('medals' => $medalnew));
C::t('common_member_medal')->insert(array('uid' => $_G['uid'], 'medalid' => $medal['medalid']), 0, 1);
$medalmessage = 'medal_get_succeed';
} else {
if(C::t('forum_medallog')->count_by_verify_medalid($_G['uid'], $medal['medalid'])) {
showmessage('medal_apply_existence', 'home.php?mod=medal');
}
$medalmessage = 'medal_apply_succeed';
manage_addnotify('verifymedal');
}
C::t('forum_medallog')->insert(array(
'uid' => $_G['uid'],
'medalid' => $medalid,
'type' => $medal['type'],
'dateline' => TIMESTAMP,
'expiration' => $expiration,
'status' => ($expiration ? 1 : 0),
));
showmessage($medalmessage, 'home.php?mod=medal', array('medalname' => $medal['name']));
}
} elseif($_GET['action'] == 'log') {
include libfile('function/forum');
foreach(C::t('forum_medal')->fetch_all_data(1) as $medal) {
$medal['image'] = preg_match('/^https?:\/\//is', $medal['image']) ? $medal['image'] : STATICURL.'image/common/'.$medal['image'];
$medallist[$medal['medalid']] = $medal;
}
$memberfieldforum = C::t('common_member_field_forum')->fetch($_G['uid']);
$membermedal = $memberfieldforum['medals'] ? explode("\t", $memberfieldforum['medals']) : array();
foreach($membermedal as $k => $medal) {
if(!in_array($medal, array_keys($medallist))) {
unset($membermedal[$k]);
}
}
$medalcount = count($membermedal);
if(!empty($membermedal)) {
$mymedal = array();
foreach($membermedal as $medalid) {
if($medalpos = strpos($medalid, '|')) {
$medalid = substr($medalid, 0, $medalpos);
}
$mymedal['name'] = $_G['cache']['medals'][$medalid]['name'];
$mymedal['image'] = $medallist[$medalid]['image'];
$mymedals[] = $mymedal;
}
}
$medallognum = C::t('forum_medallog')->count_by_uid($_G['uid']);
$multipage = multi($medallognum, $tpp, $page, "home.php?mod=medal&action=log");
foreach(C::t('forum_medallog')->fetch_all_by_uid($_G['uid'], $start_limit, $tpp) as $medallog) {
$medallog['name'] = $_G['cache']['medals'][$medallog['medalid']]['name'];
$medallog['dateline'] = dgmdate($medallog['dateline']);
$medallog['expiration'] = !empty($medallog['expiration']) ? dgmdate($medallog['expiration']) : '';
$medallogs[] = $medallog;
}
} else {
showmessage('undefined_action');
}
$navtitle = lang('core', 'title_medals_list');
include template('home/space_medal');
?>

View File

@@ -0,0 +1,24 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: home_misc.php 25246 2011-11-02 03:34:53Z zhangguosheng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$ac = empty($_GET['ac']) ? '' : $_GET['ac'];
$acs = isset($_G['group']['allowvisit']) && $_G['group']['allowvisit'] ? array('swfupload', 'inputpwd', 'ajax', 'sendmail', 'emailcheck') : array('swfupload', 'sendmail', 'emailcheck');
if(empty($ac) || !in_array($ac, $acs)) {
showmessage('enter_the_space', 'home.php?mod=space');
}
$theurl = 'home.php?mod=misc&ac='.$ac;
require_once libfile('misc/'.$ac, 'include');
?>

View File

@@ -0,0 +1,78 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: home_rss.php 25756 2011-11-22 02:47:45Z zhangguosheng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if (!$_G['setting']['blogstatus']) {
showmessage('blog_status_off');
}
$pagenum = 20;
$siteurl = getsiteurl();
$uid = empty($_GET['uid'])?0:intval($_GET['uid']);
$list = array();
if(!empty($uid)) {
$space = getuserbyuid($uid, 1);
}
if(empty($space)) {
$space['username'] = $_G['setting']['sitename'];
$space['name'] = $_G['setting']['sitename'];
$space['email'] = $_G['setting']['adminemail'];
$space['space_url'] = $siteurl;
} else {
$space['username'] = $space['username'].'@'.$_G['setting']['sitename'];
$space['space_url'] = $siteurl."home.php?mod=space&amp;uid={$space['uid']}";
}
$uidsql = empty($space['uid'])?'':" AND b.uid='{$space['uid']}'";
$data_blog = C::t('home_blog')->range_blog(0, $pagenum, 'DESC', 'dateline', 0, null, $uid);
$blogids = array_keys($data_blog);
$data_blogfield = C::t('home_blogfield')->fetch_all($blogids);
$charset = $_G['config']['output']['charset'];
dheader("Content-type: application/xml");
echo "<?xml version=\"1.0\" encoding=\"".$charset."\"?>\n".
"<rss version=\"2.0\">\n".
" <channel>\n".
" <title>{$space['username']}</title>\n".
" <link>{$space['space_url']}</link>\n".
" <description>{$_G['setting']['bbname']}</description>\n".
" <copyright>Copyright(C) {$_G['setting']['bbname']}</copyright>\n".
" <generator>Discuz! Board by Comsenz Inc.</generator>\n".
" <lastBuildDate>".gmdate('r', TIMESTAMP)."</lastBuildDate>\n".
" <image>\n".
" <url>{$_G['siteurl']}static/image/common/logo_88_31.gif</url>\n".
" <title>{$_G['setting']['bbname']}</title>\n".
" <link>{$_G['siteurl']}</link>\n".
" </image>\n";
foreach($data_blog as $curblogid => $value) {
$value = array_merge($value, (array)$data_blogfield[$curblogid]);
$value['message'] = getstr($value['message'], 300, 0, 0, 0, -1);
if($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
$value['message'] .= "<br /><img src=\"{$value['pic']}\">";
}
echo " <item>\n".
" <title>".$value['subject']."</title>\n".
" <link>{$_G['siteurl']}home.php?mod=space&amp;uid={$value['uid']}&amp;do=blog&amp;id={$value['blogid']}</link>\n".
" <description><![CDATA[".dhtmlspecialchars($value['message'])."]]></description>\n".
" <author>".dhtmlspecialchars($value['username'])."</author>\n".
" <pubDate>".gmdate('r', $value['dateline'])."</pubDate>\n".
" </item>\n";
}
echo " </channel>\n".
"</rss>";
?>

View File

@@ -0,0 +1,123 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: home_space.php 36337 2017-01-05 06:34:27Z nemohou $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$dos = array('index', 'doing', 'blog', 'album', 'friend', 'wall',
'notice', 'share', 'home', 'pm', 'favorite',
'thread', 'trade', 'poll', 'activity', 'debate', 'reward', 'profile', 'plugin', 'follow');
$do = (!empty($_GET['do']) && in_array($_GET['do'], $dos)) ? $_GET['do'] : 'index';
if(!in_array($do, array('home', 'doing', 'blog', 'album', 'share', 'wall'))) {
$_G['mnid'] = 'mn_common';
}
if(empty($_G['uid']) && in_array(getgpc('do'), array('thread', 'trade', 'poll', 'activity', 'debate', 'reward'))) {
showmessage('login_before_enter_home', null, array(), array('showmsg' => true, 'login' => 1));
}
$uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']);
$member = array();
if(getgpc('username')) {
$member = C::t('common_member')->fetch_by_username($_GET['username']);
if(empty($member) && !($member = C::t('common_member_archive')->fetch_by_username($_GET['username']))) {
showmessage('space_does_not_exist');
}
$uid = $member['uid'];
$member['self'] = $uid == $_G['uid'] ? 1 : 0;
}
if(getgpc('view') == 'admin') {
$_GET['do'] = $do;
}
if(empty($uid) || in_array($do, array('notice', 'pm'))) $uid = $_G['uid'];
if(empty($_GET['do']) && !isset($_GET['diy'])) {
if($_G['adminid'] == 1) {
if($_G['setting']['allowquickviewprofile']) {
if(!$_G['inajax']) dheader("Location:home.php?mod=space&uid=$uid&do=profile");
}
}
if(helper_access::check_module('follow')) {
$do = $_GET['do'] = 'follow';
} else {
$do = $_GET['do'] = !$_G['setting']['homepagestyle'] ? 'profile' : 'index';
}
} elseif(empty($_GET['do']) && isset($_GET['diy']) && !empty($_G['setting']['homepagestyle'])) {
$_GET['do'] = 'index';
}
if($_GET['do'] == 'follow') {
if($uid != $_G['uid']) {
$_GET['do'] = 'view';
$_GET['uid'] = $uid;
}
require_once libfile('home/follow', 'module');
exit;
} elseif(empty($_GET['do']) && !$_G['inajax'] && !helper_access::check_module('follow')) {
$do = 'profile';
}
if($uid && empty($member)) {
$space = getuserbyuid($uid, 1);
if(empty($space)) {
showmessage('space_does_not_exist');
}
} else {
$space = &$member;
}
if(empty($space)) {
if(in_array($do, array('doing', 'blog', 'album', 'share', 'home', 'trade', 'poll', 'activity', 'debate', 'reward', 'group'))) {
if(empty($_GET['view']) || $_GET['view'] == 'all') {
$_GET['view'] = 'all';
$space['uid'] = 0;
$space['self'] = 0;
} else {
showmessage('login_before_enter_home', null, array(), array('showmsg' => true, 'login' => 1));
}
} else {
showmessage('login_before_enter_home', null, array(), array('showmsg' => true, 'login' => 1));
}
} else {
$navtitle = $space['username'];
if($space['status'] == -1 && $_G['adminid'] != 1) {
showmessage('space_has_been_locked');
}
if(in_array($space['groupid'], array(4, 5, 6)) && ($_G['adminid'] != 1 && $space['uid'] != $_G['uid'])) {
$_GET['do'] = $do = 'profile';
}
$encodeusername = rawurlencode($space['username']);
if($do != 'profile' && $do != 'index' && !ckprivacy($do, 'view')) {
$_G['privacy'] = 1;
require_once libfile('space/profile', 'include');
include template('home/space_privacy');
exit();
}
if(!$space['self'] && getgpc('view') != 'eccredit' && getgpc('view') != 'admin') $_GET['view'] = 'me';
}
$diymode = 0;
list($seccodecheck, $secqaacheck) = seccheck('publish');
if($do != 'index') {
$_G['disabledwidthauto'] = 0;
}
require_once libfile('function/friend');
$isfriend = friend_check($space['uid']);
require_once libfile('space/'.$do, 'include');
?>

View File

@@ -0,0 +1,63 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: home_spacecp.php 33660 2013-07-29 07:51:05Z nemohou $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
require_once libfile('function/spacecp');
require_once libfile('function/magic');
$acs = array('doing', 'upload', 'comment', 'blog', 'album', 'common', 'class',
'swfupload', 'poke', 'friend', 'eccredit', 'favorite', 'follow',
'avatar', 'profile', 'theme', 'feed', 'privacy', 'pm', 'share', 'invite','sendmail',
'credit', 'payment', 'usergroup', 'domain', 'click','magic', 'top', 'index', 'plugin', 'search', 'promotion');
$_GET['ac'] = $ac = (empty($_GET['ac']) || !in_array($_GET['ac'], $acs))?'profile':$_GET['ac'];
$op = empty($_GET['op'])?'':$_GET['op'];
if(!in_array($ac, array('doing', 'upload', 'blog', 'album'))) {
$_G['mnid'] = 'mn_common';
}
if($ac != 'comment' || !$_G['group']['allowcomment']) {
if($_G['uid'] || $ac.$op != 'paymentpay') {
if(empty($_G['uid'])) {
if($_SERVER['REQUEST_METHOD'] == 'GET') {
dsetcookie('_refer', rawurlencode($_SERVER['REQUEST_URI']));
} else {
dsetcookie('_refer', rawurlencode('home.php?mod=spacecp&ac='.$ac));
}
showmessage('to_login', '', array(), array('showmsg' => true, 'login' => 1));
}
$space = getuserbyuid($_G['uid']);
if(empty($space)) {
showmessage('space_does_not_exist');
}
space_merge($space, 'field_home');
if(($space['status'] == -1 || in_array($space['groupid'], array(4, 5, 6))) && $ac != 'usergroup') {
showmessage('space_has_been_locked');
}
}
}
$actives = array($ac => ' class="a"');
list($seccodecheck, $secqaacheck) = seccheck('publish');
$navtitle = lang('core', 'title_setup');
if(lang('core', 'title_memcp_'.$ac)) {
$navtitle = lang('core', 'title_memcp_'.$ac);
}
$_G['disabledwidthauto'] = 0;
require_once libfile('spacecp/'.$ac, 'include');
?>

View File

@@ -0,0 +1,125 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: home_task.php 27146 2012-01-06 09:34:49Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$_G['disabledwidthauto'] = 0;
require_once libfile('function/spacecp');
if(!$_G['setting']['taskstatus']) {
showmessage('task_close');
}
require_once libfile('class/task');
$tasklib = & task::instance();
$tasklib->update_available();
$_G['mnid'] = 'mn_common';
$id = intval($_GET['id']);
$do = empty($_GET['do']) ? '' : $_GET['do'];
if(empty($_G['uid'])) {
showmessage('to_login', null, array(), array('showmsg' => true, 'login' => 1));
}
$navtitle = lang('core', 'title_task');
if(empty($do)) {
$_GET['item'] = empty($_GET['item']) ? 'new' : $_GET['item'];
$actives = array($_GET['item'] => ' class="a"');
$tasklist = $tasklib->tasklist($_GET['item']);
$listdata = $tasklib->listdata;
if($_GET['item'] == 'doing' && empty($tasklist)) {
dsetcookie('taskdoing_'.$_G['uid']);
}
} elseif($do == 'view' && $id) {
cleartaskstatus();
$allowapply = $tasklib->view($id);
$task = & $tasklib->task;
$taskvars = & $tasklib->taskvars;
} elseif($do == 'apply' && $id) {
if(!$_G['uid']) {
showmessage('not_loggedin', NULL, array(), array('login' => 1));
}
$result = $tasklib->apply($id);
if($result === -1) {
showmessage('task_relatedtask', 'home.php?mod=task&do=view&id='.$tasklib->task['relatedtaskid']);
} elseif($result === -2) {
showmessage('task_grouplimit', 'home.php?mod=task&item=new');
} elseif($result === -3) {
showmessage('task_duplicate', 'home.php?mod=task&item=new');
} elseif($result === -4) {
showmessage('task_nextperiod', 'home.php?mod=task&item=new');
} elseif($result === -5) {
showmessage('task_exclusivetask', 'home.php?mod=task&item=new');
} else {
dsetcookie('taskdoing_'.$_G['uid'], 1, 7776000);
showmessage('task_applied', 'home.php?mod=task&do=view&id='.$id);
}
} elseif($do == 'delete' && $id) {
$result = $tasklib->delete($id);
showmessage('task_deleted', 'home.php?mod=task&item=doing');
} elseif($do == 'draw' && $id) {
if(!$_G['uid']) {
showmessage('not_loggedin', NULL, array(), array('login' => 1));
}
$result = $tasklib->draw($id);
if($result === -1) {
showmessage('task_up_to_limit', 'home.php?mod=task', array('tasklimits' => $tasklib->task['tasklimits']));
} elseif($result === -2) {
showmessage('task_failed', 'home.php?mod=task&item=failed');
} elseif($result === -3) {
showmessage($tasklib->messagevalues['msg'], 'home.php?mod=task&do=view&id='.$id, $tasklib->messagevalues['values']);
} elseif($result === -4) {
showmessage('task_exclusivetask', 'home.php?mod=task&item=new');
} else {
cleartaskstatus();
showmessage('task_completed', 'home.php?mod=task&item=done');
}
} elseif($do == 'giveup' && $id) {
$tasklib->giveup($id);
showmessage('task_giveup', 'home.php?mod=task&item=view&id='.$id);
} elseif($do == 'parter' && $id) {
$parterlist = $tasklib->parter($id);
include template('home/space_task_parter');
dexit();
} else {
showmessage('undefined_action');
}
include template('home/space_task');
function cleartaskstatus() {
global $_G;
if(!C::t('common_mytask')->count_mytask($_G['uid'], false, 0)) {
dsetcookie('taskdoing_'.$_G['uid']);
}
}
?>

View File