Support jOOmla! Autoit!
 
将评分投票bot改造成现在流行用的 “顶” 输出PDF 打印 E-mail
Author Author: Autoit | Date Date:2006-06-25 | View Count View: 18509 | Digg Count Digg: 160

mambots/content/mosvote.php [先备份] 里的内容为以下代码,其实主要是只要他的 “评分” 按钮而已。[适合版本:joomla 1.0.x]

<?php
defined( '_VALID_MOS' ) or die( 'Restricted access' );
$_MAMBOTS->registerFunction( 'onBeforeDisplayContent', 'botVoting' );
function botVoting( &$row, &$params, $page=0 ) {
 global $Itemid;
 $id  = $row->id;
 $option = 'com_content';
 $task  = mosGetParam( $_REQUEST, 'task', '' );
 $html = '';
 $url = @$_SERVER['REQUEST_URI'];
 $url = ampReplace( $url );
  if (!$params->get( 'intro_only' ) && $task != "blogsection") {
   $html .= '<form method="post" action="' . sefRelToAbs( 'index.php' ) . '">';
   $html .= '<input class="button" type="submit" name="submit_vote" ';
   $html .= 'value="'. _RATE_BUTTON .'_'. intval( $row->rating_count ).'" />';
   $html .= '<input type="radio" alt="vote 1 star" name="user_rating"';
   $html .= 'value="1" checked="checked"  style="display:none"/>';
   $html .= '<input type="hidden" name="task" value="vote" />';
   $html .= '<input type="hidden" name="pop" value="0" />';
   $html .= '<input type="hidden" name="option" value="com_content" />';
   $html .= '<input type="hidden" name="Itemid" value="'. $Itemid .'" />';
   $html .= '<input type="hidden" name="cid" value="'. $id .'" />';
   $html .= '<input type="hidden" name="url" value="'. $url .'" />';
  $html .= '</form>';
  }
 return $html;
}
?>

然后上传覆盖。从上面代码看,其实几乎去掉了一半左右。 然后有一行移动。一个radio 的input 被设置displau:none属性,默认用1票来顶。另外就是一个统计总数被我放到了评分的按钮上。

剩下的就是到你的语言包里[language/simplified_chinese.php]改“评分”为“这篇不错,顶!”, 到此完工。

如果需要你也用吧。效果可以看本站。 现在都有这样的专门站点呢,如果可能,你可以将上面的

 if (!$params->get( 'intro_only' ) && $task != "blogsection") {


}

去掉。代码为了输出整洁有点点改动,如果需要可以直接点这里下载我所使用的。

如果需要显示他的排行,请到下载里找对应mod_toprating模块。

# End #


Permanent URL: http://www.autoit.cn/index.php/content/view/42/25.html

Shares: Google书签 Yahoo书签 雅虎收藏夹 365Key网摘 新浪ViVi 百度收藏 天极网摘 diglog 和讯网摘 POCO网摘 YouNote网摘 博拉网 天下图摘 spurl blogmarks BlinkList reddit digg Del.icio.us   |  Tags: 评分  投票  

3 venson @ 2006-10-25 20:13:35 :
我怎么用了你的文件覆盖后跟你网站的效果不一样? 
数字在按钮上显示了,不像你的站上的显示在按钮旁边??
2 访客 @ 2006-10-25 20:06:39 :
能不能把这个显示在首页每个标题前面或后面? 
看上去就更像个digg站了,嘎嘎
1 gbloog @ 2006-06-27 10:34:06 : 有看到过专门的顶的站点
不错的功能哈 ! flashmp3 bot 很不错! 都是精品呀! :0d:) :0d:)

Only registered users can write comments.
Please login or register.

« First « 1 2 » Last »
 
改造mod_latestnews的输出样式之一   在joomla中加入上下篇的标题