马上注册,免费下载更多dz插件网资源。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
隐藏空值方法
template/default/forum/viewthread_node_body.htm找到
- function threadsortshow($sortid, $tid) { global $_G; loadcache(array('threadsort_option_'.$sortid, 'threadsort_template_'.$sortid)); $sortoptionarray = $_G['cache']['threadsort_option_'.$sortid]; value $templatearray = $_G['cache']['threadsort_template_'.$sortid]; $threadsortshow = $optiondata = $searchtitle = $searchvalue = $searchunit = $memberinfofield = $_G['forum_option'] = array(); if($sortoptionarray) { foreach(C::t('forum_typeoptionvar')->fetch_all_by_tid_optionid($tid) as $option) { $optiondata[$option['optionid']]['value'] = $option['value']; $optiondata[$option['optionid']]['expiration'] = $option['expiration'] && $option['expiration'] <= TIMESTAMP ? 1 : 0; $sortdataexpiration = $option['expiration']; } foreach($sortoptionarray as $optionid => $option) { $_G['forum_option'][$option['identifier']]['title'] = $option['title']; $_G['forum_option'][$option['identifier']]['unit'] = $option['unit']; $_G['forum_option'][$option['identifier']]['type'] = $option['type']; if(($option['expiration'] && !$optiondata[$optionid]['expiration']) || empty($option['expiration'])) { if(!protectguard($option['protect'])) { if($option['type'] == 'checkbox') { $_G['forum_option'][$option['identifier']]['value'] = ''; foreach(explode("\t", $optiondata[$optionid]['value']) as $choiceid) { $_G['forum_option'][$option['identifier']]['value'] .= $option['choices'][$choiceid].' '; } } elseif($option['type'] == 'radio') { $_G['forum_option'][$option['identifier']]['value'] = $option['choices'][$optiondata[$optionid]['value']]; } elseif($option['type'] == 'select') { $tmpchoiceid = $tmpidentifiervalue = array(); foreach(explode('.', $optiondata[$optionid]['value']) as $choiceid) { $tmpchoiceid[] = $choiceid; $tmpidentifiervalue[] = $option['choices'][implode('.', $tmpchoiceid)]; } $_G['forum_option'][$option['identifier']]['value'] = implode(' » ', $tmpidentifiervalue); unset($tmpchoiceid, $tmpidentifiervalue); } elseif($option['type'] == 'image') { $imgoptiondata = dunserialize($optiondata[$optionid]['value']); $threadsortshow['sortaids'][] = $imgoptiondata['aid']; if(empty($templatearray['viewthread'])) { $maxwidth = $option['maxwidth'] ? 'width="'.$option['maxwidth'].'"' : ''; $maxheight = $option['maxheight'] ? 'height="'.$option['maxheight'].'"' : ''; if(!defined('IN_MOBILE')) { $_G['forum_option'][$option['identifier']]['value'] = $imgoptiondata['url'] ? "<img src="".$imgoptiondata['url']."" onload="thumbImg(this)" $maxwidth $maxheight border="0">" : ''; } else { $_G['forum_option'][$option['identifier']]['value'] = $imgoptiondata['url'] ? "<a href="".$imgoptiondata['url']."" target="_blank">".lang('forum/misc', 'click_view')."</a>" : ''; } } else { $_G['forum_option'][$option['identifier']]['value'] = $imgoptiondata['url'] ? $imgoptiondata['url'] : './static/image/common/nophoto.gif'; } } elseif($option['type'] == 'url') { $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'] ? "<a href="".$optiondata[$optionid]['value']."" target="_blank">".$optiondata[$optionid]['value']."</a>" : ''; } elseif($option['type'] == 'number') { $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value']; } else { if($option['protect']['status'] && $optiondata[$optionid]['value']) { $optiondata[$optionid]['value'] = $option['protect']['mode'] == 1 ? '<image src="'.stringtopic($optiondata[$optionid]['value']).'">' : (!defined('IN_MOBILE') ? '<span id="sortmessage_'.$option['identifier'].'"><a href="###" onclick="ajaxget(\'forum.php?mod=misc&action=protectsort&tid='.$tid.'&optionid='.$optionid.'\', \'sortmessage_'.$option['identifier'].'\');return false;">'.lang('forum/misc', 'click_view').'</a></span>' : $optiondata[$optionid]['value']); $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'] ? $optiondata[$optionid]['value'] : $option['defaultvalue']; } elseif($option['type'] == 'textarea') { $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'] != '' ? nl2br($optiondata[$optionid]['value']) : ''; } else { $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'] != '' ? $optiondata[$optionid]['value'] : $option['defaultvalue']; } } } else { if(empty($option['permprompt'])) { $_G['forum_option'][$option['identifier']]['value'] = lang('forum/misc', 'view_noperm'); } else { $_G['forum_option'][$option['identifier']]['value'] = $option['permprompt']; } } } else { $_G['forum_option'][$option['identifier']]['value'] = lang('forum/misc', 'has_expired'); } } $typetemplate = ''; if($templatearray['viewthread']) { foreach($sortoptionarray as $option) { $searchtitle[] = '/{('.$option['identifier'].')}/'; $searchvalue[] = '/\[('.$option['identifier'].')value\]/'; $searchvalue[] = '/{('.$option['identifier'].')_value}/'; $searchunit[] = '/\[('.$option['identifier'].')unit\]/'; $searchunit[] = '/{('.$option['identifier'].')_unit}/'; } $threadexpiration = $sortdataexpiration ? dgmdate($sortdataexpiration) : lang('forum/misc', 'never_expired'); $typetemplate = preg_replace(array("/\{expiration\}/i"), array($threadexpiration), stripslashes($templatearray['viewthread'])); $typetemplate = preg_replace_callback($searchtitle, "threadsortshow_callback_showoption_title1", $typetemplate); $typetemplate = preg_replace_callback($searchvalue, "threadsortshow_callback_showoption_value1", $typetemplate); $typetemplate = preg_replace_callback($searchunit, "threadsortshow_callback_showoption_unit1", $typetemplate); } } $threadsortshow['optionlist'] = !$optionexpiration ? $_G['forum_option'] : 'expire'; $threadsortshow['typetemplate'] = $typetemplate; $threadsortshow['expiration'] = dgmdate($sortdataexpiration, 'd'); return $threadsortshow;}
复制代码
©DZ插件网所发布的一切资源仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。 网站部分内容来源于网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,得到更好的正版服务。 您在本站任何的赞助购买、下载、查阅、回复等行为等均表示接受并同意签订《DZ插件网免责声明协议》。 如有侵权请邮件与我们联系处理: discuzaddons@vip.qq.com 并出示相关证明以便删除。敬请谅解!
|
|