改 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 #
Only registered users can write comments.
Please login or register.