⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 topic.php

📁 简介:IceBB是一个强大
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?phpif(!class_exists('skin_global')) require('global.php');class skin_topic{	function skin_topic()	{		global $icebb,$global;			$global				= new skin_global;	}			function display($html)	{		global $icebb,$global;				$code				= $global->header();		$code			   .= $html;		$code			   .= $global->footer();				return $code;	}function poll($t,$question,$choices){global $icebb;$code .= <<<EOF<div class='borderwrap' style='margin-bottom:10px'>	<h2>{$icebb->lang['poll']}: {$question}</h2>	<form action='index.php' method='post'>	<input type='hidden' name='topic' value='{$t['tid']}' />	<table width='100%' cellpadding='6' cellspacing='1'>{$choices}		<tr>			<td colspan='2' class='buttonrow'>				<input type='submit' name='vote' value='{$icebb->lang['vote_button']}' class='form_button' />			</td>		</tr>	</table>	</form></div>EOF;return $code;}function poll_choice($c){global $icebb;$code .= <<<EOF		<tr>			<td width='2%' class='row1' style='text-align:right'>				<input type='radio' name='poll' value='{$c['cid']}' />			</td>			<td class='row2'>				{$c['ctext']}			</td>		</tr>EOF;return $code;}function poll_choice_multi($c){global $icebb;$code .= <<<EOF		<tr>			<td width='2%' class='row1' style='text-align:right'>				<input type='checkbox' name='poll[{$c['cid']}]' value='{$c['cid']}' />			</td>			<td class='row2'>				{$c['ctext']}			</td>		</tr>EOF;return $code;}function poll_results($t,$question,$results){global $icebb;$code .= <<<EOF<div class='borderwrap' style='margin-bottom:10px'>	<h2>{$icebb->lang['poll']}: {$question}</h2>	<table width='100%' cellpadding='6' cellspacing='1'>{$results}	</table></div>EOF;return $code;}function poll_result($c){global $icebb;$code .= <<<EOF		<tr>			<td class='row2' width='40%'>				{$c['ctext']}			</td>			<td class='row1'>				<img src='skins/<#SKIN#>/images/pip.png' height='12' width='{$c['percent']}%' alt='{$c['percent']}%' />				<div style='font-size:80%'>{$c['votes']} votes</div>			</td>		</tr>EOF;return $code;}function topic_view($topic,$posts,$pagelinks='',$is_fav=0,$flood_control_remain=0){global $icebb;$code .= <<<EOF<script type='text/javascript' src='jscripts/topic.js'></script><script type='text/javascript'>// <![CDATA[topic_rating	= {$topic['rating']};curr_rating		= {$topic['rating']};star_on			= "<macro:star />";star_off		= "<macro:star_off />";function update_stars(curr_rate){	if(curr_rate			== 1)	{		_getbyid('star1').innerHTML= star_on;		_getbyid('star2').innerHTML= star_off;		_getbyid('star3').innerHTML= star_off;		_getbyid('star4').innerHTML= star_off;		_getbyid('star5').innerHTML= star_off;	}	else if(curr_rate		== 2)	{		_getbyid('star1').innerHTML= star_on;		_getbyid('star2').innerHTML= star_on;		_getbyid('star3').innerHTML= star_off;		_getbyid('star4').innerHTML= star_off;		_getbyid('star5').innerHTML= star_off;	}	else if(curr_rate		== 3)	{		_getbyid('star1').innerHTML= star_on;		_getbyid('star2').innerHTML= star_on;		_getbyid('star3').innerHTML= star_on;		_getbyid('star4').innerHTML= star_off;		_getbyid('star5').innerHTML= star_off;	}	else if(curr_rate		== 4)	{		_getbyid('star1').innerHTML= star_on;		_getbyid('star2').innerHTML= star_on;		_getbyid('star3').innerHTML= star_on;		_getbyid('star4').innerHTML= star_on;		_getbyid('star5').innerHTML= star_off;	}	else if(curr_rate		== 5)	{		_getbyid('star1').innerHTML= star_on;		_getbyid('star2').innerHTML= star_on;		_getbyid('star3').innerHTML= star_on;		_getbyid('star4').innerHTML= star_on;		_getbyid('star5').innerHTML= star_on;	}	else {		_getbyid('star1').innerHTML= star_off;		_getbyid('star2').innerHTML= star_off;		_getbyid('star3').innerHTML= star_off;		_getbyid('star4').innerHTML= star_off;		_getbyid('star5').innerHTML= star_off;	}		curr_rating				= curr_rate;}function topic_rate(tid,rate){	if(!http.req)	{		return true;	}			rate						= curr_rating;		http.request_func			= function()	{		curr_rating				= parseInt(http.req.responseText);		topic_rating			= parseInt(http.req.responseText);		update_stars(curr_rating);	}		http.open(icebb_base_url+"topic="+tid+"&rate="+rate);		return false;}function before_reply(tid){	checked_pids				= new Array();	for(i=1;i<={$this->tick_count};i++)	{		frmelement				= document.topicfrm.elements["checkedpids["+i+"]"];		if(frmelement.checked)		{			val					= frmelement.value;			checked_pids[checked_pids.length]= val;		}	}		checked_pids_joined			= checked_pids.join(',');		window.location				= icebb_base_url+'act=post&reply='+tid+'&checkedpids='+checked_pids_joined;		return false;}// ]]></script><div class='Topicname' id='topic-{$topic['tid']}'>		<h1>{$topic['title']}  <a href='rss.php?topic={$topic['tid']}' title="{$this->lang['rss_feed_topic']}"><{RSS_ICON}></a></h1>	<div class="t_opt">EOF;if($is_fav){	$code .= <<<EOF<a href='{$icebb->base_url}act=ucp&amp;func=favorites&amp;opt=delete&amp;type=topic&amp;id={$topic['tid']}'>{$icebb->lang['fav_remove']}</a>EOF;}else {	$code .= <<<EOF<a href='{$icebb->base_url}topic={$topic['tid']}&amp;func=favorite'>{$icebb->lang['fav_add']}</a>EOF;}$code .= <<<EOF | <a href='{$icebb->base_url}topic={$topic['tid']}&amp;func=email' title="{$icebb->lang['email_desc']}">{$icebb->lang['email']}</a> | <a href='{$icebb->base_url}topic={$topic['tid']}&amp;func=print' title="{$icebb->lang['print']}">{$icebb->lang['print']}</a></div></div><div>{$pagelinks}</div><!--POLL--><form action='index.php' name='topicfrm' method='post'>{$posts}	<div class='subtitle'>		<span style='float:right;font-weight:normal;margin:-2px 0px -3px 0px'>			<!--MODERATOR.OPTIONS-->		</span>				<span>			<a href='{$icebb->base_url}topic={$topic['tid']}&amp;go=prev'>&laquo; {$icebb->lang['prev_topic']}</a> 			&middot; <a href='{$icebb->base_url}topic={$topic['tid']}&amp;go=next'>{$icebb->lang['next_topic']} &raquo;</a>		</span>	</div></form>			{$pagelinks}		<span style='font-weight:normal'>			<a name='search_topic'></a>			<!--form action='index.php' method='post' name='searcht_frm'>				<input type='hidden' name='act' value='search' />				<input type='hidden' name='func' value='results' />				<input type='hidden' name='topic' value='{$topic['tid']}' />				<input type='text' id='searchy' name='q' value="{$icebb->lang['search_topic']}" onclick="if(this.value=='{$icebb->lang['search_topic']}') this.value=''" class='form_textbox' />				<input type='submit' value="{$icebb->lang['go']}" class='form_button' />			</form-->		</span><br /><div class='borderwrap'><div class="row2">{$icebb->lang['tags']} {$topic['tag_html']}</div></div><br /><a href='#' onclick="_toggle_view('qreply_box');return false"><{QUICK_REPLY}></a> <a href="{$icebb->base_url}act=post&amp;reply={$topic['tid']}" onclick="return before_reply('{$topic['tid']}')"><{ADD_REPLY}></a> <a href='{$icebb->base_url}act=post&amp;forum={$topic['forum']}'><{NEW_TOPIC}></a><div class='borderwrap' id='qreply_box' style='display:none'>    <h2>{$icebb->lang['quick_reply']}</h2>    <div class="row2" style='text-align:center'>EOF;if($flood_control_remain > 0){	$fcontrol = sprintf($icebb->lang['flood_control'],$flood_control_remain);	$code .= "<strong>{$fcontrol}</strong>";}else {$code .= <<<EOF    <form action='index.php' method='post' name='postFrm' style='text-align:center'>        <input type='hidden' name='act' value='post' />        <input type='hidden' name='reply' value='{$topic['tid']}' />        <input type='hidden' name='security_key' value='{$icebb->security_key}' />        <textarea name='post' rows='5' cols='50' style='width:80%' class='form_textarea'></textarea>        <div class='buttonrow'>            <input type='submit' name='submit' value='{$icebb->lang['add_reply']}' class='form_button default' />            <input type='submit' value='{$icebb->lang['advanced']}' class='form_button' />            <input type='button' value='{$icebb->lang['smilies']}' class='form_button' onclick="window.open(icebb_base_url+'act=post&amp;func=smilies','smiliesBox','height=400,width=350,scrollbars=yes');return false" />        </div>        <script type='text/javascript'>		ta_obj=document.postFrm.post;		</script>		<script type='text/javascript' src='jscripts/editor.js'></script>    </form>EOF;}$code .= <<<EOF</div></div><!--USERS_VIEWING-->EOF;return $code;}function post_row($r){global $icebb;$wh						= ($r['avsize'][0] > 0 && $r['avsize'][1] > 0) ? "width='{$r['avsize'][0]}' height='{$r['avsize'][1]}' " : "";$avatar					= !empty($r['avatar']) ? "\n\t\t\t<img src='{$r['avatar']}' {$wh}alt='' class='avatar' />" : "";$code .= <<<EOF<!-- Post #{$r['postnum']} --><a name='post-{$r['pid']}'></a><div class='borderwrap post' style="margin-bottom: 10px;">	<h2>		<span style="display:inline;float:right">			<a href='#' title="{$icebb->lang['top_desc']}">{$icebb->lang['top']}</a>			<{MOD_OPTION_MULTI_SELECT}>		</span>		<a href='{$icebb->settings['board_url']}index.php?topic={$r['ptopicid']}&amp;pid={$r['pid']}' onclick="prompt('{$icebb->lang['use_this_url']}',this.href);return false">#{$r['postnum']}</a>	</h2>	<div class='post-content row2'>		<div class='post-left row1' id='post-left-{$r['pid']}'>			{$r['uauthor_username']} <span style="font-size: 8px"><!--IP--></span><br />			{$r['title']}<br />{$avatar}			<div title='{$r['rank']}'>{$r['pips']}</div>			{$r['uposts']}			{$r['ujoindate']}			{$r['ugroup']}			{$r['uaway']}		</div>		<div class='post-right row2' id='post-right-{$r['pid']}'>			<div class="t_bar">{$r['pdate_formatted']}</div>			<div id='ptext-{$r['pid']}'>{$r['ptext']}</div>					<div style='float:right'>				<a href='{$icebb->base_url}act=post&amp;reply={$r['ptopicid']}&amp;quote={$r['pid']}'><{P_REPLY}></a><{POST_EDIT}><{POST_DELETE}>			</div>					{$r['siggie']}		</div>		<div class='clear'></div>	</div></div><!-- workaround to make the left post bit fill the full height --><script type='text/javascript'>if($('post-left-{$r['pid']}').offsetHeight < $('post-right-{$r['pid']}').offsetHeight){	$('post-left-{$r['pid']}').style.height=$('post-right-{$r['pid']}').offsetHeight+'px';}</script><!-- END of Post #{$r['postnum']} -->EOF;return $code;}function post_row_blocked($r){global $icebb;$mah	= $this->post_row($r);$b		= $icebb->lang['post_blocked'];$b		= str_replace('<#id#>',$r['postnum'],$b);$b		= str_replace('<#user#>',$r['uauthor_username'],$b);$code .= <<<EOF<!-- Post #{$r['postnum']} HIDDEN --><a name='post-{$r['pid']}'></a><div class='borderwrap' style='text-align:center;margin-bottom:10px' id='post-{$r['postnum']}-msg'>	<div class='row2'>		{$b}<br />		<a href='#post-{$r['pid']}' onclick="$('post-{$r['postnum']}-msg').style.display='none';$('post-{$r['postnum']}-content').style.display='block';return false">{$icebb->lang['view_anyway']}</a>	</div></div><div id='post-{$r['postnum']}-content' style='display:none'>{$mah}</div><!-- END of Post #{$r['postnum']} -->EOF;return $code;}function uauthor($r){global $icebb;$code .= <<<EOF<a href='index.php?profile={$r['pauthor_id']}' class='username_uim'>{$r['g_prefix']}{$r['pauthor']}{$r['g_suffix']}</a>EOF;return $code;}function uauthor_guest($r){global $icebb;$code .= <<<EOF{$r['pauthor']}EOF;return $code;}function uposts($posts){global $icebb;$code .= <<<EOF{$icebb->lang['posts']} {$posts}<br />EOF;return $code;}function ujoindate($joindate){global $icebb;$code .= <<<EOF{$icebb->lang['joined']} {$joindate}<br />EOF;return $code;}function ugroup($group,$icon=""){global $icebb;$icon					= !empty($icon) ? "<img src='skins/<#SKIN#>/images/icons/{$icon}' alt='' />" : "";$code .= <<<EOF{$icebb->lang['group']} {$group}<br />{$icon}<br />EOF;return $code;}function uaway($away){global $icebb;$code .= <<<EOF<strong>{$icebb->lang['user_is_away']}</strong><br />EOF;return $code;}function uip($ip,$dnslookup=''){global $icebb;$code .= <<<EOF<em>(<a href='{$icebb->base_url}act=ucp&amp;func=iptools&amp;ip={$ip}' class='ip_wanna_dns' style='cursor:help'>{$ip}</a>)</em>EOF;return $code;}function post_edit($pid,$quick_edit){global $icebb;if($quick_edit){	$e	= " onclick='return !quick_edit_start({$pid})'";}$code .= <<<EOF<a href='{$icebb->base_url}act=post&amp;edit={$pid}'{$e}><{P_EDIT}></a>EOF;return $code;}function post_delete($pid){global $icebb;$code .= <<<EOF  <a href='{$icebb->base_url}act=post&amp;edit={$pid}&amp;del=1'><{P_DELETE}></a>EOF;return $code;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -