public function check($id, $idtype) { if ((!isset($_GET['_dsign']) || $_GET['_dsign'] !== ($_dsign = dsign($id . $idtype, 8))) && !self::check_allow($id, $idtype)) { if (!isset($_dsign)) { $_dsign = dsign($id . $idtype, 8); } echo self::make_content($id, $idtype, $_dsign); exit; } }
function showportalprimaltemplate($pritplname, $type) { include_once libfile('function/portalcp'); $tpls = array('./template/default:portal/' . $type => getprimaltplname('portal/' . $type . '.htm')); foreach ($alltemplate = C::t('common_template')->range() as $template) { if ($dir = dir(DISCUZ_ROOT . $template['directory'] . '/portal/')) { while (false !== ($file = $dir->read())) { $file = strtolower($file); if (fileext($file) == 'htm' && substr($file, 0, strlen($type) + 1) == $type . '_') { $key = $template['directory'] . ':portal/' . str_replace('.htm', '', $file); $tpls[$key] = getprimaltplname($template['directory'] . ':portal/' . $file); } } } } foreach ($tpls as $key => $value) { echo "<input name=signs[{$type}][" . dsign($key) . "] value='1' type='hidden' />"; } $pritplvalue = ''; if (empty($pritplname)) { $pritplhide = ''; $pritplvalue = ' style="display:none;"'; } else { $pritplhide = ' style="display:none;"'; } $catetplselect = '<span' . $pritplhide . '><select id="' . $type . 'select" name="' . $type . 'primaltplname">'; $selectedvalue = ''; if ($type == 'view') { $catetplselect .= '<option value="">' . cplang('portalcategory_inheritupsetting') . '</option>'; } foreach ($tpls as $k => $v) { if ($pritplname === $k) { $selectedvalue = $k; $selected = ' selected'; } else { $selected = ''; } $catetplselect .= '<option value="' . $k . '"' . $selected . '>' . $v . '</option>'; } $pritplophide = !empty($pritplname) ? '' : ' style="display:none;"'; $catetplselect .= '</select> <a href="javascript:;"' . $pritplophide . ' onclick="$(\'' . $type . 'select\').value=\'' . $selectedvalue . '\';$(\'' . $type . 'select\').parentNode.style.display=\'none\';$(\'' . $type . 'value\').style.display=\'\';">' . cplang('cancel') . '</a></span>'; if (empty($pritplname)) { showsetting('portalcategory_' . $type . 'primaltplname', '', '', $catetplselect); } else { $tplname = getprimaltplname($pritplname . '.htm'); $html = '<span id="' . $type . 'value" ' . $pritplvalue . '> ' . $tplname . '<a href="javascript:;" onclick="$(\'' . $type . 'select\').parentNode.style.display=\'\';$(\'' . $type . 'value\').style.display=\'none\';"> ' . cplang('modify') . '</a></span>'; showsetting('portalcategory_' . $type . 'primaltplname', '', '', $catetplselect . $html); } }
public static function get_sign($id, $idtype) { return !self::check_allow($id, $idtype) ? dsign($id . $idtype, 8) : ''; }
if (getglobal('setting/ftp/mirror')) { @unlink($attach['target']); @unlink(getimgthumbname($attach['target'])); topic_upload_error($attach, 'diy_remote_upload_failed'); } } } $setarr = array('uid' => $_G['uid'], 'username' => $_G['username'], 'filename' => $attach['name'], 'filepath' => $attach['attachment'], 'size' => $attach['size'], 'thumb' => $attach['thumb'], 'remote' => $attach['remote'], 'dateline' => $_G['timestamp'], 'topicid' => $topicid); $setarr['picid'] = C::t('portal_topic_pic')->insert($setarr, true); topic_upload_show($topicid); } } elseif (submitcheck('diysubmit')) { require_once libfile('function/portalcp'); $tpldirectory = getstr($_POST['tpldirectory'], 80); $template = getstr($_POST['template'], 50); if (dsign($tpldirectory . $template) !== $_POST['diysign']) { showmessage('diy_sign_invalid'); } $tpldirectory = $tpldirectory ? $tpldirectory : $_G['cache']['style_default']['tpldir']; $savemod = getstr($_POST['savemod'], 1); $recover = getstr($_POST['recover'], 1); $optype = getstr($_POST['optype'], 10); tpl_checkperm($template); list($template, $clonefile) = explode(':', $template); list($mod, $file) = explode('/', $template); $targettplname = $template; if ($savemod == '1' && !empty($clonefile)) { $targettplname = $template . '_' . $clonefile; } $istopic = $iscategory = $isarticle = false; if ($template == 'portal/portal_topic_content') {
function updatetopic($topic = '') { global $_G; $topicid = empty($topic) ? '' : $topic['topicid']; include_once libfile('function/home'); $_POST['title'] = getstr(trim($_POST['title']), 255); $_POST['name'] = getstr(trim($_POST['name']), 255); $_POST['domain'] = getstr(trim($_POST['domain']), 255); if (empty($_POST['title'])) { return 'topic_title_cannot_be_empty'; } if (empty($_POST['name'])) { $_POST['name'] = $_POST['title']; } if (!$topicid || $_POST['name'] != $topic['name']) { if ($value = C::t('portal_topic')->fetch_by_name($_POST['name'])) { return 'topic_name_duplicated'; } } if ($topicid && !empty($topic['domain'])) { require_once libfile('function/delete'); deletedomain($topicid, 'topic'); } if (!empty($_POST['domain'])) { require_once libfile('function/domain'); domaincheck($_POST['domain'], $_G['setting']['domain']['root']['topic'], 1); } $setarr = array('title' => $_POST['title'], 'name' => $_POST['name'], 'domain' => $_POST['domain'], 'summary' => getstr($_POST['summary']), 'keyword' => getstr($_POST['keyword']), 'useheader' => $_POST['useheader'] ? '1' : '0', 'usefooter' => $_POST['usefooter'] ? '1' : '0', 'allowcomment' => $_POST['allowcomment'] ? 1 : 0, 'closed' => $_POST['closed'] ? 0 : 1); if ($_POST['deletecover'] && $topic['cover']) { if ($topic['picflag'] != '0') { pic_delete(str_replace('portal/', '', $topic['cover']), 'portal', 0, $topic['picflag'] == '2' ? '1' : '0'); } $setarr['cover'] = ''; } else { if ($_FILES['cover']['tmp_name']) { if ($topic['cover'] && $topic['picflag'] != '0') { pic_delete(str_replace('portal/', '', $topic['cover']), 'portal', 0, $topic['picflag'] == '2' ? '1' : '0'); } $pic = pic_upload($_FILES['cover'], 'portal'); if ($pic) { $setarr['cover'] = 'portal/' . $pic['pic']; $setarr['picflag'] = $pic['remote'] ? '2' : '1'; } } else { if (!empty($_POST['cover']) && $_POST['cover'] != $topic['cover']) { if ($topic['cover'] && $topic['picflag'] != '0') { pic_delete(str_replace('portal/', '', $topic['cover']), 'portal', 0, $topic['picflag'] == '2' ? '1' : '0'); } $setarr['cover'] = $_POST['cover']; $setarr['picflag'] = '0'; } } } $primaltplname = ''; if (empty($topicid) || empty($topic['primaltplname']) || $topic['primaltplname'] && $topic['primaltplname'] != $_POST['primaltplname']) { $primaltplname = $_POST['primaltplname']; if (!isset($_POST['signs'][dsign($primaltplname)])) { return 'diy_sign_invalid'; } $checktpl = checkprimaltpl($primaltplname); if ($checktpl !== true) { return $checktpl; } $setarr['primaltplname'] = $primaltplname; } if ($topicid) { C::t('portal_topic')->update($topicid, $setarr); C::t('common_diy_data')->update('portal/portal_topic_content_' . $topicid, getdiydirectory($topic['primaltplname']), array('name' => $setarr['title'])); } else { $setarr['uid'] = $_G['uid']; $setarr['username'] = $_G['username']; $setarr['dateline'] = $_G['timestamp']; $setarr['closed'] = '1'; $topicid = addtopic($setarr); if (!$topicid) { return 'topic_created_failed'; } } if (!empty($_POST['domain'])) { C::t('common_domain')->insert(array('domain' => $_POST['domain'], 'domainroot' => $_G['setting']['domain']['root']['topic'], 'id' => $topicid, 'idtype' => 'topic')); } $tpldirectory = ''; if ($primaltplname && $topic['primaltplname'] != $primaltplname) { $targettplname = 'portal/portal_topic_content_' . $topicid; if (strpos($primaltplname, ':') !== false) { list($tpldirectory, $primaltplname) = explode(':', $primaltplname); } C::t('common_diy_data')->update($targettplname, getdiydirectory($topic['primaltplname']), array('primaltplname' => $primaltplname, 'tpldirectory' => $tpldirectory)); updatediytemplate($targettplname); } if ($primaltplname && empty($topic['primaltplname'])) { $tpldirectory = $tpldirectory ? $tpldirectory : $_G['cache']['style_default']['tpldir']; $content = file_get_contents(DISCUZ_ROOT . $tpldirectory . '/' . $primaltplname . '.htm'); $tplfile = DISCUZ_ROOT . './data/diy/' . $tpldirectory . '/portal/portal_topic_content_' . $topicid . '.htm'; $tplpath = dirname($tplfile); if (!is_dir($tplpath)) { dmkdir($tplpath); } file_put_contents($tplfile, $content); } include_once libfile('function/cache'); updatecache(array('diytemplatename', 'setting')); return $topicid; }
function make_getpws_sign($uid, $idstring) { global $_G; $link = "{$_G['siteurl']}member.php?mod=getpasswd&uid={$uid}&id={$idstring}"; return dsign($link); }
function getforumimg($aid, $nocache = 0, $w = 140, $h = 140, $type = '') { global $_G; $key = dsign($aid . '|' . $w . '|' . $h); return 'forum.php?mod=image&aid=' . $aid . '&size=' . $w . 'x' . $h . '&key=' . rawurlencode($key) . ($nocache ? '&nocache=yes' : '') . ($type ? '&type=' . $type : ''); }
echo $_G['setting']['pluginhooks']['global_login_text']; } } ?> </p> </div> <span class="atips_close" onclick="this.parentNode.style.display='none'">x</span> </div> <?php } elseif ($post['imagelist'] || $post['attachlist']) { ?> <div class="pattl"> <?php if ($post['imagelist'] && $_G['setting']['imagelistthumb'] && $post['imagelistcount'] >= $_G['setting']['imagelistthumb']) { if (!isset($imagelistkey)) { $imagelistkey = rawurlencode(dsign($_G[tid] . '|100|100')); ?> <script type="text/javascript" reload="1">var imagelistkey = '<?php echo $imagelistkey; ?> ';</script> <?php } $post['imagelistthumb'] = true; ?> <div class="bbda cl mtw mbm pbm"> <strong>更多图片</strong> <a href="javascript:;" onclick="attachimglst('<?php echo $post['pid']; ?> ', 0)" class="xi2 attl_g">小图</a>
<div class="ptg mbm mtn"> <?php if($post['tags']) { $tagi = 0;?><?php if(is_array($post['tags'])) foreach($post['tags'] as $var) { if($tagi) { ?>, <?php } ?><a title="<?php echo $var['1'];?>" href="misc.php?mod=tag&id=<?php echo $var['0'];?>" target="_blank"><?php echo $var['1'];?></a><?php $tagi++;?><?php } } if($relatedkeywords) { ?><span><?php echo $relatedkeywords;?></span><?php } ?> </div> <?php } if(!IS_ROBOT && $post['first'] && !$_G['forum_thread']['archiveid']) { if(!empty($lastmod['modaction'])) { ?><div class="modact"><a href="forum.php?mod=misc&action=viewthreadmod&tid=<?php echo $_G['tid'];?>" title="帖子模式" onclick="showWindow('viewthreadmod', this.href)"><?php if($lastmod['modactiontype'] == 'REB') { ?>本主题由 <?php echo $lastmod['modusername'];?> 于 <?php echo $lastmod['moddateline'];?> <?php echo $lastmod['modaction'];?>到 <?php echo $lastmod['reason'];?><?php } else { ?>本主题由 <?php echo $lastmod['modusername'];?> 于 <?php echo $lastmod['moddateline'];?> <?php echo $lastmod['modaction'];?><?php } ?></a></div><?php } ?> <?php if(!empty($_G['setting']['pluginhooks']['viewthread_modaction'])) echo $_G['setting']['pluginhooks']['viewthread_modaction'];?> <?php } if($post['attachment'] && $_GET['from'] != 'preview') { ?> <div class="attach_nopermission attach_tips"> <div> <h3><strong>本帖子中包含更多资源</strong></h3> <p><?php if($_G['uid']) { ?>您所在的用户组无法下载或查看附件<?php } elseif($_G['connectguest']) { ?>您需要 <a href="member.php?mod=connect" class="xi2">完善帐号信息</a> 或 <a href="member.php?mod=connect&ac=bind" class="xi2">绑定已有帐号</a> 后才可以下载或查看<?php } else { ?>您需要 <a href="member.php?mod=logging&action=login" onclick="showWindow('login', this.href);return false;">登录</a> 才可以下载或查看,没有帐号?<a href="member.php?mod=<?php echo $_G['setting']['regname'];?>" title="注册帐号"><?php echo $_G['setting']['reglinkname'];?></a> <?php if(!empty($_G['setting']['pluginhooks']['global_login_text'])) echo $_G['setting']['pluginhooks']['global_login_text'];?><?php } ?></p> </div> <span class="atips_close" onclick="this.parentNode.style.display='none'">x</span> </div> <?php } elseif($post['imagelist'] || $post['attachlist']) { ?> <div class="pattl"> <?php if($post['imagelist'] && $_G['setting']['imagelistthumb'] && $post['imagelistcount'] >= $_G['setting']['imagelistthumb']) { if(!isset($imagelistkey)) { $imagelistkey = rawurlencode(dsign($_G[tid].'|100|100'))?><script type="text/javascript" reload="1">var imagelistkey = '<?php echo $imagelistkey;?>';</script> <?php } $post['imagelistthumb'] = true;?><div class="bbda cl mtw mbm pbm"> <strong>更多图片</strong> <a href="javascript:;" onclick="attachimglst('<?php echo $post['pid'];?>', 0)" class="xi2 attl_g">小图</a> <a href="javascript:;" onclick="attachimglst('<?php echo $post['pid'];?>', 1, <?php echo intval($_G['setting']['lazyload']); ?>)" class="xi2 attl_m">大图</a> </div> <div id="imagelist_<?php echo $post['pid'];?>" class="cl" style="display:none"><?php echo showattach($post, 1); ?></div> <div id="imagelistthumb_<?php echo $post['pid'];?>" class="pattl_c cl"><img src="<?php echo IMGDIR;?>/loading.gif" width="16" height="16" class="vm" /> 组图打开中,请稍候......</div> <?php } else { echo showattach($post, 1); } if($post['attachlist']) { echo showattach($post); } ?> </div> <?php } if($_G['setting']['allowfastreply'] && $post['first'] && $fastpost && $allowpostreply && !$_G['forum_thread']['archiveid'] && $_GET['from'] != 'preview') { ?> <form method="post" autocomplete="off" id="vfastpostform" action="forum.php?mod=post&action=reply&fid=<?php echo $_G['fid'];?>&tid=<?php echo $_G['tid'];?>&fromvf=1&extra=<?php echo $_G['gp_extra'];?>&replysubmit=yes<?php if($_G['gp_ordertype'] != 1) { ?>&infloat=yes&handlekey=vfastpost<?php } if($_G['gp_from']) { ?>&from=<?php echo $_G['gp_from'];?><?php } ?>" onsubmit="this.message.value = parseurl(this.message.value);ajaxpost('vfastpostform', 'return_reply', 'return_reply', 'onerror');return false;"> <div id="vfastpost" class="fullvfastpost"> <input type="hidden" name="formhash" value="<?php echo FORMHASH;?>" /> <table cellspacing="0" cellpadding="0" id="vfastposttb"> <tr>
echo $selected; ?> ><?php echo $v; ?> </option> <?php } } ?> </select><?php if (is_array($tpls)) { foreach ($tpls as $k => $v) { ?> <input type="hidden" name="signs[<?php echo dsign($k); ?> ]" value="1"/> <?php } } $pritplophide = !empty($topic['primaltplname']) ? '' : ' style="display:none;"'; ?> <a href="javascript:;"<?php echo $pritplophide; ?> onclick="$('pritplselect').style.display='none';$('pritplvalue').style.display='';" class="xi2">取消</a></span><?php $html = '<span id="pritplvalue"' . $pritplshow . '>' . getprimaltplname($topic['primaltplname'] . '.htm') . ' <a href="javascript:;" onclick="$(\'pritplselect\').style.display=\'\';$(\'pritplvalue\').style.display=\'none\';" class="xi2">修改</a></span>'; echo $html; ?> <p class="d">请将模板文件上传到模板目录的portal目录下,如:template/default/portal目录下,文件名必须为portal_topic_*.htm,*为自定义文件名<br />如果要重新选择模板,请确保新模板与原模板中可拖拽区域具有相同的ID,否则将会丢失分部或全部原DIY数据</p></td>
<li><a href="javascript:;" id="frame_3_1" onmousedown="drag.createObj(event,'frame','3-1');" onfocus="this.blur();"><img src="<?php echo STATICURL;?>image/diy/layout-3-1.png" />3:1</a></li> <li><a href="javascript:;" id="frame_1_1_1" onmousedown="drag.createObj(event,'frame','1-1-1');" onfocus="this.blur();" data="<?php echo $widthstr;?>"><img src="<?php echo STATICURL;?>image/diy/layout-1-1-1.png" />1:1:1</a></li> <li><a href="javascript:;" id="frame_tab" onmousedown="drag.createObj(event,'tab');" onfocus="this.blur();" data="<?php echo $widthstr;?>"><img src="<?php echo STATICURL;?>image/diy/layout-tab.png" />tab框架</a></li> </ul> <div id="contentblockclass" class="content"></div> </div> <div id="cpfooter"><table cellpadding="0" cellspacing="0" width="100%"><tr><td class="l"> </td><td class="c"> </td><td class="r"> </td></tr></table></div> </div> <div id="samplepanel" class="hide ptm pbm bbda hm"> <span class="y"><a href="javascript:;" onclick="spaceDiy.cancel();return false;" class="xi2">关闭</a> </span> 当前为<strong>简洁模式</strong>,您可以更新模块,修改模块属性和数据,要使用完整的拖拽功能,<a href="javascript:;" onclick="spaceDiy.init();" class="xw1 xi2">请点击进入高级模式</a> </div> <form method="post" autocomplete="off" name="diyform" id="diyform" action="<?php echo $_G['siteurl'];?>portal.php?mod=portalcp&ac=diy"> <input type="hidden" name="template" value="<?php echo $_G['style']['tplfile'];?>" /> <input type="hidden" name="tpldirectory" value="<?php echo $_G['style']['tpldirectory'];?>" /> <input type="hidden" name="diysign" value="<?php echo dsign($_G['style']['tpldirectory'].$_G['style']['tplfile']); ?>" /> <input type="hidden" name="prefile" id="prefile" value="<?php echo $_G['style']['prefile'];?>" /> <input type="hidden" name="savemod" value="<?php echo $_G['style']['tplsavemod'];?>" /> <input type="hidden" name="spacecss" value="" /> <input type="hidden" name="style" value="" /> <input type="hidden" name="rejs" value="" /> <input type="hidden" name="handlekey" value="" /> <input type="hidden" name="layoutdata" value="" /> <input type="hidden" name="formhash" value="<?php echo FORMHASH;?>" /> <input type="hidden" name="gobackurl" id="gobackurl" value=""/> <input type="hidden" name="recover" value=""/> <input type="hidden" name="optype" value=""/> <input type="hidden" name="diysubmit" value="true"/> </form>
function attachinpost($attach, $post) { global $_G; $firstpost = $post['first']; $attach['refcheck'] = (!$attach['remote'] && $_G['setting']['attachrefcheck']) || ($attach['remote'] && ($_G['setting']['ftp']['hideurl'] || ($attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp'))); $aidencode = packaids($attach); $widthcode = attachwidth($attach['width']); $is_archive = $_G['forum_thread']['is_archived'] ? '&fid='.$_G['fid'].'&archiveid='.$_G[forum_thread][archiveid] : ''; $attachthumb = getimgthumbname($attach['attachment']); $musiccode = getstatus($post[status], 7) && fileext($attach['attachment']) == 'mp3' ? (browserversion('ie') > 8 || browserversion('safari') ? '<audio controls="controls"><source src="'.$attach['url'].$attach['attachment'].'"></audio>' : parseaudio($attach['url'].$attach['attachment'], 400)) : ''; $guestviewthumb = !empty($_G['setting']['guestviewthumb']['flag']) && !$_G['uid']; if($guestviewthumb) { $guestviewthumbcss = guestviewthumbstyle(); } ?><?php $__STATICURL = STATICURL;$return = <<<EOF <ignore_js_op> EOF; if($attach['attachimg'] && $_G['setting']['showimages'] && (((!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid'])) || (($guestviewthumb)))) { if(!IS_ROBOT) { if($guestviewthumb) { $thumbpath = helper_attach::attachpreurl().'image/'.helper_attach::makethumbpath($attach['aid'], $_G['setting']['guestviewthumb']['width'], $_G['setting']['guestviewthumb']['height']); $makefile = 'forum.php?mod=image&aid='.$attach['aid'].'&size='.$_G['setting']['guestviewthumb']['width'].'x'.$_G['setting']['guestviewthumb']['height'].'&key='.dsign($attach['aid'].'|'.$_G['setting']['guestviewthumb']['width'].'|'.$_G['setting']['guestviewthumb']['height']).'&type=1'; $return .= <<<EOF {$guestviewthumbcss} <div class="guestviewthumb"> <div style="margin: 0 auto;"> <img id="aimg_{$attach['aid']}" class="guestviewthumb_cur" aid="{$attach['aid']}" src="{$__STATICURL}image/common/none.gif" onclick="showWindow('login', 'member.php?mod=logging&action=login'+'&referer='+encodeURIComponent(location))" onerror="javascript:if(this.getAttribute('makefile')){this.src=this.getAttribute('makefile'); this.removeAttribute('makefile');}" file="{$thumbpath}" makefile="{$makefile}" inpost="1" alt="{$attach['imgalt']}" title="{$attach['imgalt']}"/> <br> <a href="member.php?mod=logging&action=login" onclick="showWindow('login', this.href+'&referer='+encodeURIComponent(location));">登录/注册后可看大图</a> </div> </div> EOF; } else { if($_G['setting']['thumbstatus'] && $attach['thumb']) { $return .= <<<EOF <img EOF; if($attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']) { $return .= <<<EOF class="attprice" EOF; } $return .= <<<EOF style="cursor:pointer" id="aimg_{$attach['aid']}" aid="{$attach['aid']}" src="{$__STATICURL}image/common/none.gif" onclick="zoom(this, this.getAttribute('zoomfile'), 0, 0, '{$_G['setting']['showexif']}')" zoomfile=" EOF; if($attach['refcheck']) { $return .= <<<EOF forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes¬humb=yes EOF; } else { $return .= <<<EOF {$attach['url']}{$attach['attachment']} EOF; } $return .= <<<EOF " file=" EOF; if($attach['refcheck']) { $return .= <<<EOF forum.php?mod=attachment{$is_archive}&aid={$aidencode} EOF; } else { $return .= <<<EOF {$attach['url']}{$attachthumb} EOF; } $return .= <<<EOF " inpost="1" EOF; if($_GET['from'] != 'preview') { $return .= <<<EOF onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" EOF; } $return .= <<<EOF /> EOF; } else { $return .= <<<EOF <img EOF; if($attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']) { $return .= <<<EOF class="attprice" EOF; } $return .= <<<EOF id="aimg_{$attach['aid']}" aid="{$attach['aid']}" src="{$__STATICURL}image/common/none.gif" zoomfile=" EOF; if($attach['refcheck']) { $return .= <<<EOF forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes¬humb=yes EOF; } else { $return .= <<<EOF {$attach['url']}{$attach['attachment']} EOF; } $return .= <<<EOF " file=" EOF; if($attach['refcheck']) { $return .= <<<EOF forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes EOF; } else { $return .= <<<EOF {$attach['url']}{$attach['attachment']} EOF; } $return .= <<<EOF " {$widthcode} id="aimg_{$attach['aid']}" inpost="1" EOF; if($_GET['from'] != 'preview') { $return .= <<<EOF onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" EOF; } $return .= <<<EOF /> EOF; } } $return .= <<<EOF <div class="tip tip_4 aimg_tip" id="aimg_{$attach['aid']}_menu" style="position: absolute; display: none" disautofocus="true"> <div class="xs0"> <p><strong>{$attach['filename']}</strong> <em class="xg1">({$attach['attachsize']}, 下载次数: {$attach['downloads']})</em></p> <p> <a href="forum.php?mod=attachment{$is_archive}&aid={$aidencode}&nothumb=yes" target="_blank">下载附件</a> EOF; if(helper_access::check_module('album')) { $return .= <<<EOF <a href="javascript:;" onclick="showWindow(this.id, this.getAttribute('url'), 'get', 0);" id="savephoto_{$attach['aid']}" url="home.php?mod=spacecp&ac=album&op=saveforumphoto&aid={$attach['aid']}&handlekey=savephoto_{$attach['aid']}">保存到相册</a> EOF; } if($firstpost && $_G['fid'] && $_G['forum']['picstyle'] && ($_G['forum']['ismoderator'] || $_G['uid'] == $attach['uid'])) { $return .= <<<EOF <a href="forum.php?mod=ajax&action=setthreadcover&aid={$attach['aid']}&fid={$_G['fid']}" onclick="showWindow('setcover{$attach['aid']}', this.href)">设为封面</a> EOF; } $return .= <<<EOF </p> EOF; if($attach['description']) { $return .= <<<EOF <p>{$attach['description']}</p> EOF; } $return .= <<<EOF <p class="xg1 y">{$attach['dateline']} 上传</p> EOF; } else { if($attach['description']) { $return .= <<<EOF <p>{$attach['description']}</p> EOF; } $return .= <<<EOF <img src=" EOF; if($attach['refcheck']) { $return .= <<<EOF forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes EOF; } else { $return .= <<<EOF {$attach['url']}{$attach['attachment']} EOF; } $return .= <<<EOF " alt="{$attach['imgalt']}" title="{$attach['imgalt']}" /> EOF; } } else { if($musiccode) { $return .= <<<EOF <div>{$musiccode}</div> EOF; } $return .= <<<EOF {$attach['attachicon']} <span style="white-space: nowrap" id="attach_{$attach['aid']}" EOF; if($_GET['from'] != 'preview') { $return .= <<<EOF onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" EOF; } $return .= <<<EOF > EOF; if(!$attach['price'] || $attach['payed']) { $return .= <<<EOF <a href="forum.php?mod=attachment{$is_archive}&aid={$aidencode}" target="_blank">{$attach['filename']}</a> EOF; } else { $return .= <<<EOF <a href="forum.php?mod=misc&action=attachpay&aid={$attach['aid']}&tid={$attach['tid']}" onclick="showWindow('attachpay', this.href)">{$attach['filename']}</a> EOF; } $return .= <<<EOF <em class="xg1">({$attach['attachsize']}, 下载次数: {$attach['downloads']} EOF; if($attach['price']) { $return .= <<<EOF , 售价: {$attach['price']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra']['1']]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra']['1']]['title']} EOF; } $return .= <<<EOF )</em> </span> <div class="tip tip_4" id="attach_{$attach['aid']}_menu" style="position: absolute; display: none" disautofocus="true"> <div class="tip_c xs0"> <div class="y">{$attach['dateline']} 上传</div> 点击文件名下载附件 EOF; if($attach['description']) { $return .= <<<EOF <br />{$attach['description']} EOF; } if($attach['readperm']) { $return .= <<<EOF <br />阅读权限: {$attach['readperm']} EOF; } } if(!IS_ROBOT && !$guestviewthumb) { if($attach['price']) { $return .= <<<EOF <br />售价: {$attach['price']} {$_G['setting']['extcredits'][$_G['setting']['creditstransextra']['1']]['unit']}{$_G['setting']['extcredits'][$_G['setting']['creditstransextra']['1']]['title']} <a href="forum.php?mod=misc&action=viewattachpayments&aid={$attach['aid']}" onclick="showWindow('attachpay', this.href)" target="_blank">[记录]</a> EOF; if(!$attach['payed']) { $return .= <<<EOF [<a href="forum.php?mod=misc&action=attachpay&aid={$attach['aid']}&tid={$attach['tid']}" onclick="showWindow('attachpay', this.href)" target="_blank">购买</a>] EOF; } } if(!$attach['attachimg'] && $_G['getattachcredits']) { $return .= <<<EOF <br />下载积分: {$_G['getattachcredits']} EOF; } $return .= <<<EOF </div> <div class="tip_horn"></div> </div> EOF; if($musiccode) { $return .= <<<EOF <br /> EOF; } } $return .= <<<EOF </ignore_js_op> EOF; ?><?php return $return; }
$nocache = !empty($_GET['nocache']) ? 1 : 0; $daid = intval($_GET['aid']); $type = !empty($_GET['type']) ? $_GET['type'] : 'fixwr'; list($w, $h) = explode('x', $_GET['size']); $dw = intval($w); $dh = intval($h); $thumbfile = 'image/' . helper_attach::makethumbpath($daid, $dw, $dh); $attachurl = helper_attach::attachpreurl(); if (!$nocache) { if (file_exists($_G['setting']['attachdir'] . $thumbfile)) { dheader('location: ' . $attachurl . $thumbfile); } } define('NOROBOT', TRUE); $id = !empty($_GET['atid']) ? $_GET['atid'] : $daid; if (dsign($id . '|' . $dw . '|' . $dh) != $_GET['key']) { dheader('location: ' . $_G['siteurl'] . 'static/image/common/none.gif'); } if ($attach = C::t('forum_attachment_n')->fetch('aid:' . $daid, $daid, array(1, -1))) { if (!$dw && !$dh && $attach['tid'] != $id) { dheader('location: ' . $_G['siteurl'] . 'static/image/common/none.gif'); } dheader('Expires: ' . gmdate('D, d M Y H:i:s', TIMESTAMP + 3600) . ' GMT'); if ($attach['remote']) { $filename = $_G['setting']['ftp']['attachurl'] . 'forum/' . $attach['attachment']; } else { $filename = $_G['setting']['attachdir'] . 'forum/' . $attach['attachment']; } require_once libfile('class/image'); $img = new image(); if ($img->Thumb($filename, $thumbfile, $w, $h, $type)) {
</div> <form method="post" autocomplete="off" name="diyform" id="diyform" action="<?php echo $_G['siteurl']; ?> portal.php?mod=portalcp&ac=diy"> <input type="hidden" name="template" value="<?php echo $_G['style']['tplfile']; ?> " /> <input type="hidden" name="tpldirectory" value="<?php echo $_G['style']['tpldirectory']; ?> " /> <input type="hidden" name="diysign" value="<?php echo dsign($_G['style']['tpldirectory'] . $_G['style']['tplfile']); ?> " /> <input type="hidden" name="prefile" id="prefile" value="<?php echo $_G['style']['prefile']; ?> " /> <input type="hidden" name="savemod" value="<?php echo $_G['style']['tplsavemod']; ?> " /> <input type="hidden" name="spacecss" value="" /> <input type="hidden" name="style" value="" /> <input type="hidden" name="rejs" value="" /> <input type="hidden" name="handlekey" value="" /> <input type="hidden" name="layoutdata" value="" />
function sanree_brand_index_toper_output($param) { global $_G; $config = $_G['cache']['plugin']['sanree_brand']; if (!$config['isopen']) { return ''; } if ($_G['isopendiy'] == 1 && $_GET['diy'] == 'yes' && $_G['uid'] == 1) { $appver = strtolower($_G['setting']['version']); if ($appver == 'x2.5') { $diysign = dsign('tpl/' . $_G['template'] . 'index'); return '<div style="height:60px;line-height:60px;font-size:20px;text-align:center;background-color:#F5F7F9;" id="sanreediy"></div> <script language="javascript">if ($(\'diyform\')){$(\'diyform\').action=\'plugin.php?id=sanree_brand&mod=portalcp&ac=diy\';}if ($(\'sanreediy\')) {$(\'sanreediy\').innerHTML=\'DIY is loaded.\';}</script>'; } elseif ($appver == 'x2') { return '<div style="height:60px;line-height:60px;font-size:20px;text-align:center;background-color:#F5F7F9;" id="sanreediy"></div> <script language="javascript">if ($(\'diyform\')) {$(\'diyform\').action=\'plugin.php?id=sanree_brand&mod=portalcp&ac=diy\'; $(\'sanreediy\').innerHTML=\'DIY is loaded.\';}</script>'; } } return ''; }