10种自定义参数标题醒目高亮 by lu5266
[quote]说明:[color=green]A:功能说明
1: 任意颜色高亮,霓虹闪烁,跳跃心情,突然惊现,色框包揽,分割高亮,光晕高亮,投影高亮,彩虹高亮;
2: 完全囊括了d4本身的高亮的功能,还增加到任意颜色的高亮;
3: 除彩虹高亮外,其他的都有自定义的参数,从而可以实现N种高亮的功能;
4: 采用插件形式,减少文件修改,增加灵活性;
5: 设置积分来买,可以对不同的用户组进行具体优惠,可以限制使用,当然可以免费;
6: 可以设置不使用的版块;
7:增加批量操作功能;
8: 对所有脚本和参数输入进行更人性化优化,可以方便用户使用;
9: 提供两个拾色器,写了颜色代码自动输入函数,极度方便颜色代码的输入;
10: 对于输入的变量做了我能做到的检查和限制,不必担心输入错误.(有错误难免,请指出);
11: 写了一个效果预览函数,可以在提交前,预览你设置的参数的效果,方便你准确的高亮.[/color]
[color=blue]B: 比原来的(dz2.5的时候)增加功能
Ⅰ: 采用插件形式,减少文件修改,增加灵活性;
Ⅱ: 设置积分来买,可以对不同的用户组进行具体优惠,可以限制使用,当然可以免费;
Ⅲ: 可以设置不使用的版块;
Ⅳ:增加批量操作功能;
Ⅴ: 对所有脚本和参数输入进行更人性化优化,可以方便用户使用;[/color]
[color=brown]C: 参数说明
Ⅰ: 括号内的参数就是演示的参数(可以在输入框单击右键获取默认参数);
Ⅱ: [高亮颜色]和[后面字体颜色]的值,如果不用的话,就留空,
加粗等3个参数用的话就是1,不用就是0,其他的就是必填,
只要是非法的参数,都无法输入,所以你可以放心;
Ⅲ: 由于参数很多,由于时间关系,我无法一一说明,但你可以利用效果预览来了解;
Ⅳ: 因为颜色的输入是用6位代码的,所以提供两个拾色器(可以在输入框单击左键获取设置参数),哪个好用,你就用哪个吧;
Ⅴ: 为了你更好的设置,我弄了效果预览的区域,你可以预览到你设置的参数的效果;[/color]
[color=purple]D: 版权
Ⅰ: 所有的htc组件均来自网上,我只是做了修改,版权为原作者;
Ⅱ: 摸版和文件的代码均为原创;
Ⅲ: 转贴,请保留必要信息.
Ⅳ: copyright @ [url=http://www.discuzplus.com/]http://www.discuzplus.com[/color][/url], [url=http://www.5466.ik8.com/][color=#003366]http://www.5466.ik8.com[/color][/url][/quote]
【插件名称】十种自定义参数标题醒目(包括任意颜色高亮)
【适用版本】4.00
【插件作者】lu5266
【安装难易】易
【修改文件】forumdisplay.php (另外增加 8个文件)
【修改模板】viewthread.htm forumdisplay.htm modactions.lang.php(另外增加3个模板)
【数据库】有升级
【演示地址】http://www.5466.ik8.com
1:升级数据库:
代码:
[code]ALTER TABLE `cdb_threads` ADD `xm_hl` VARCHAR( 42 ) AFTER `highlight` ;
[/code]
2: 修改forumdisplay.php(文件)
查找:
[code]$thread['moved'] = 0;[/code]
在其上面加上:
[code] //=====十种自定义参数标题醒目(包括任意颜色高亮)==start==By www.5466.ik8.com==============
$xm_hl=0;
if($thread['xm_hl']){
$xm_hl_string=explode(',',$thread['xm_hl']);
$xm_hl=($xm_hl_string[1]*3600+$xm_hl_string[0]-$timestamp)/3600;
if($xm_hl<0){
$db->query("UPDATE {$tablepre}threads SET xm_hl='' WHERE tid='$thread[tid]' AND fid='$fid'");
$db->query("UPDATE {$tablepre}threadsmod SET uid='0',username='系统',dateline='$timestamp',action='AXM' WHERE tid='$thread[tid]'");
}
}
if($xm_hl>0){
switch($xm_hl_string[2]){
case 1:
$xm_hl_style = '<font style="';
$xm_hl_style .= $xm_hl_string[3] ? 'color: #'.$xm_hl_string[3].'; ' : '';
$xm_hl_style .= $xm_hl_string[4] ? 'font-weight: bold;' : '';
$xm_hl_style .= $xm_hl_string[5] ? 'font-style: italic;' : '';
$xm_hl_style .= $xm_hl_string[6] ? 'text-decoration: underline;' : '';
$xm_hl_style .= '">';
$thread[subject]=$xm_hl_style.$thread[subject].'</font>';
break;
case 2:
$xm_hl_style = '<font textcolor1="#'.$xm_hl_string[3].'" textbkcolor1="transparent" textcolor2="#'.$xm_hl_string[4];
$xm_hl_style .='" textbkcolor2="transparent" speed="'.$xm_hl_string[5].'" letters1="1" letters2="1" pause="'.$xm_hl_string[6];
$xm_hl_style .='" style="behavior:url(include/z_FlashText.htc);color:#c000c0;background-color:transparent">';
$thread[subject]=$xm_hl_style.$thread[subject].'</font>';
break;
case 3:
$xm_hl_style = '<font textoffset1="'.$xm_hl_string[3].'" textoffset2="'.$xm_hl_string[4];
$xm_hl_style .='" speed="'.$xm_hl_string[5].'" letters1="1" letters2="1" pause="'.$xm_hl_string[6];
$xm_hl_style .='" style="behavior:url(include/z_WaveText.htc);color:#FF5500;background-color:transparent">';
$thread[subject]=$xm_hl_style.$thread[subject].'</font>';
break;
case 4:
$xm_hl_style = '<font textcolor="#'.$xm_hl_string[3].'" basesize="12" textsize1="'.$xm_hl_string[4];
$xm_hl_style .='" textsize2="14" speed="'.$xm_hl_string[5].'" letters1="1" letters2="1" pause="'.$xm_hl_string[6];
$xm_hl_style .='" style="behavior:url(include/z_ResizeText.htc);color:#993300;background-color:transparent;">';
$thread[subject]=$xm_hl_style.$thread[subject].'</font>';
break;
case 5:
$xm_hl_style = '<span style=\'border:solid 1px #'.$xm_hl_string[3].';border-left-width:5px;border-left-color:#'.$xm_hl_string[3];
$xm_hl_style .=';background:#ffffff;padding:1px 5px 2px 5px;font-size: 8pt\'><font color="#'.$xm_hl_string[4];
$xm_hl_style .='">';
$thread[subject]=$xm_hl_style.$thread[subject].'</font></span>';
break;
case 6:
$start_str=substr($thread[subject],0,$xm_hl_string[4]);
$end_str=substr($thread[subject],$xm_hl_string[4]);
if($xm_hl_string[5])
$thread[subject] = '<font color="'.$xm_hl_string[3].'">'.$start_str.'</font><font color="'.$xm_hl_string[5].'">'.$end_str.'</font>';
else
$thread[subject] = '<font color="'.$xm_hl_string[3].'">'.$start_str.'</font>'.$end_str;
break;
case 7:
$xm_hl_style = '<font style="filter: glow(color=#'.$xm_hl_string[3].',strength='.$xm_hl_string[4];
$xm_hl_style .='); height:20px; color: #'.$xm_hl_string[5];
$xm_hl_style .='">';
$thread[subject]=$xm_hl_style.$thread[subject].'</font>';
break;
case 8:
$xm_hl_style = '<font style="filter: shadow(color=#'.$xm_hl_string[3].',direction='.$xm_hl_string[4];
$xm_hl_style .='); height:20px; color: #'.$xm_hl_string[5];
$xm_hl_style .='">';
$thread[subject]=$xm_hl_style.$thread[subject].'</font>';
break;
case 9:
$xm_hl_style = '<font style="background-color: #'.$xm_hl_string[3].';" color="#'.$xm_hl_string[4].'"><b>';
$thread[subject]=$xm_hl_style.$thread[subject].'</b></font>';
break;
case 10:
$thread[subject]='<span style="behavior:url(./include/rainbow.htc)">'.$thread[subject].'</span>';
break;
default: $thread[subject]=$thread[subject];
}
$thread[subject].=' - [剩 <b>'.substr($xm_hl,0,5).' </b>时高亮]';
}
//=====十种自定义参数标题醒目(包括任意颜色高亮)==end==By lu5266=====================
[/code]
3: 修改viewthread.htm(模板)
查找:
[code]<!--{if $thread['modaction'] || $thread['blog'] || $thread['readperm'] || $thread['price'] > 0}-->
[/code]
替换为:
[code]<!--{if $discuz_user || $thread['modaction'] || $thread['blog'] || $thread['readperm'] || $thread['price'] > 0}-->[/code]
查找:
[code]<!--{if $thread['price'] > 0}--> <a href="misc.php?action=viewpayments&tid=$tid">{lang price_thread} {$extcredits[$creditstrans][title]} <span class=\"bold\">$thread[price]</span> {$extcredits[$creditstrans][unit]}</a> <!--{/if}-->
[/code]
在下面加上:
[code]<!--{if $discuz_user}--> <a href="./plugin.php?identifier=xmhl&module=xmhl&fid=$fid&moderate[]=$tid" >购买/设置 醒目高亮</a> <!--{/if}-->[/code]
4:修改:forumdisplay.htm(模板)
查找:
[code]<!--{if $forum['ismoderator']}--><!--{if $thread['fid'] == $fid}-->
[/code]
替换为:
[code]<!--{if $discuz_user}--><!--{if $thread['fid'] == $fid}-->
[/code]
查找:
[code]<!--{if $forum['ismoderator'] && $threadcount}-->
<tr><td colspan="7" class="altbg1" align="center">
<span class="bold">{lang admin_moderate}</span>
<input type="checkbox" name="chkall" onclick="checkall(this.form, 'moderate')"> {lang checkall}
[/code]
替换为:
[code] <!--{if ($discuz_user || $forum['ismoderator']) && $threadcount}-->
<tr><td colspan="7" class="altbg1" align="center">
<!--{/if}-->
<!--{if !$forum['ismoderator'] && $threadcount && $discuz_user}-->
<span class="bold">批量购买>>主题醒目高亮</span>
<input type="checkbox" name="chkall" onclick="checkall(this.form, 'moderate')"> {lang checkall}
<a href="###" onclick="javascript: document.moderate.action='./plugin.php?identifier=xmhl&module=xmhl&fid=$fid';document.moderate.submit();" class="bold">[{lang submit}]</a>
<!--{/if}-->
<!--{if $forum['ismoderator'] && $threadcount}-->
<span class="bold">{lang admin_moderate}</span>
<input type="checkbox" name="chkall" onclick="checkall(this.form, 'moderate')"> {lang checkall}
<a href="###" onclick="javascript: document.moderate.action='./plugin.php?identifier=xmhl&module=xmhl&fid=$fid';document.moderate.submit();" >[<b>醒目高亮</b>]</a>
[/code]
5: 修改modactions.lang.php(语言包)
查找:
[code]$modactioncode = array
[/code]
上面加上:
[code]$xm_hl_string=$thread['xm_hl'] ? explode(',',$thread['xm_hl']) : ''; //this And XMH UXM AXM add by lu5266
[/code]
查找:
[code]'UHL' => '解除高亮',[/code]
在下面加上:
[code]
'XMH' => '为 作者 购买/设置了<font color=red> ' .$xm_hl_string[1].' </font>小时醒目高亮',
'UXM' => '解除醒目高亮',
'AXM' => '<font color=red>自动</font> 解除(时限已过)醒目高亮',
[/code]
6: 导入插件
<1>. 下载附件,并按目录结构上传所有文件;
<2>. 以管理员身份进入后台,
添加插件, 导入 discuz_plugin_xmhl.txt 并开启插件.
[img]http://www.discuz.net/attachments/month_0509/sample_hcmGWxsKK6lH.jpg[/img]
[img]http://www.discuz.net/attachments/month_0602/01_qE8zOmezfku1.jpg[/img]
[img]http://www.discuz.net/attachments/month_0602/002_A4EGtsk35k52.jpg[/img]
[img]http://www.discuz.net/attachments/month_0602/003_O8smp2VmMgZ2.jpg[/img]
[img]http://www.discuz.net/attachments/month_0602/005_vo4Cdz6nUCrM.jpg[/img]
[img]http://www.discuz.net/attachments/month_0602/006_VATfPhiSUJto.jpg[/img]
[img]http://www.discuz.net/attachments/month_0602/007_wvHH4ctR0ab2.jpg[/img]
[img]http://www.discuz.net/attachments/month_0602/008_9kxiVScuLeZl.jpg[/img]
[img]http://www.discuz.net/attachments/month_0602/009_2p1bxk5pcXel.jpg[/img]
[img]http://www.discuz.net/attachments/month_0602/10_MtcbeMJ89bCI.jpg[/img]
[img]http://www.discuz.net/attachments/month_0602/11_pMcM3XDNWQB9.jpg[/img]
[img]http://www.discuz.net/attachments/month_0602/12_25PhZERM2XIm.jpg[/img]
[img]http://www.discuz.net/attachments/month_0602/13_Y74MZazDrrCV.jpg[/img] 挺PL的 - 不错~是否可以将档案繁化吗? 偶要回去试试看了`` 不错,看上去很有意思
过几天装一下看 安装成功,很不错!
哈哈。。。。
页:
[1]