效果就是当前本站文章标题的效果: 在标题前面出现一个可以进行投票的顶 "Digg" !
将 content.html.php 489行左右的 :
if ( !$params->get( 'intro_only' ) ) {
$results = $_MAMBOTS->trigger( 'onAfterDisplayTitle', array( &$row, &$params, $page ) );
echo trim( implode( "\n", $results ) );
}
$results = $_MAMBOTS->trigger( 'onBeforeDisplayContent', array( &$row, &$params, $page ) );
echo trim( implode( "\n", $results ) );移动到:
// displays Item Title 上行的 <?php 的下面.
将 /mambots/content/mosvote.php 替换为下面内容.
<?php
/**
* @version $Id: mosvote.php 85 2005-09-15 23:12:03Z eddieajau $
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
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 .= '<td><form method="post" action="' . sefRelToAbs( 'index.php' ) . '">';
$html .= '<input src="./images/up.gif" class="button1" type="image" name="submit_vote" ';
$html .= 'alt="'. _RATE_BUTTON .'" />';
$html .= '<input type="radio" alt="vote 1 star" name="user_rating" value="1" ';
$html .= '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></td>';
}
return $html;
}
?>保存个小图片 up.gif 放你你的 images目录下.
至于在标题下面和上一篇一样要显示出来顶的次数, 可以 在上次修改的地方:
View: <?php echo $row->hits; ?>
后面增加:
| <img src="./images/vote.gif" align="top" alt="Digg"/> Digg:
<?php echo intval( $row->rating_count ); ?>
就ok了.
当然, 要使用这个,你的投票 bot 是要发布的! 
| 15 | 访客 @ 2007-08-15 06:43:34 : 那个up.gif在哪里啊? |
问个弱智的问题:up.gif在哪里啊?  |
| 14 | Autoit @ 2007-02-13 02:03:39 : to zhou123 |
你的和我文章里写的出现效果是一样的,见这里使用的: http://www.fisherzone.com/index.php?option=com_content&task=view&id=27&Itemid=2 而我现在用的, 是又改了好多不属于php 的东西. 思路是, 把下面行增加个单元格,然后把两行开始的单元格合并后给这个 Digg 使用. |
| 13 | zhou123 @ 2007-02-12 22:42:57 : |
如下: 顶我图片 标 题 -------------------------- Author: zhou123 | Date:2006-11-16 | View: 11 | Digg:1 就像: http://mygeneral.com/content/view/1433/ 与您上面的 让文章标题处显示的活泼些 [续] Vote's hack --------差别很大! 您如何改的?????? |
| 12 | Autoit @ 2007-02-12 14:32:50 : to zhou123 |
早早忘了呀.... 你现在什么样子? 帖来看看? |
| 11 | zhou123 @ 2007-02-12 13:00:12 : |
4 by Autoit - 2006-11-17 23:11:06 - to Jourdan Sorry. 因为版面问题,我改了下,而未测试...出现了低级错误. 现在已经改正, 不过见你站上也已经好了. ------------------------------- 我的版面:标题前面出现一个顶 "Digg" 的图片也走样了。。。您如何改了下?????? |
| 10 | 访客 @ 2007-01-25 19:50:24 : |
| auyoit,就是行 |
| 9 | oss @ 2007-01-10 22:21:54 : |
| 感谢 |
| 8 | 访客 @ 2006-11-22 18:00:23 : GOOGLE搜索能看到吗? |
是自动生成的图片. txt2png bot而已. 此在下载区可以下载.  |
| 7 | 访客 @ 2006-11-21 22:41:25 : |
thank you!! |
| 6 | Autoit @ 2006-11-19 18:15:21 : to alex |
是自动生成的图片. txt2png bot而已. 此在下载区可以下载. |
Only registered users can write comments.
Please login or register.
效果就是当前本站文章标题的效果: 在标题前面出现一个可以进行投票的顶 "Digg" !
将 content.html.php 489行左右的 :
if ( !$params->get( 'intro_only' ) ) {
$results = $_MAMBOTS->trigger( 'onAfterDisplayTitle', array( &$row, &$params, $page ) );
echo trim( implode( "\n", $results ) );
}
$results = $_MAMBOTS->trigger( 'onBeforeDisplayContent', array( &$row, &$params, $page ) );
echo trim( implode( "\n", $results ) );移动到:
// displays Item Title 上行的 <?php 的下面.
将 /mambots/content/mosvote.php 替换为下面内容.
<?php
/**
* @version $Id: mosvote.php 85 2005-09-15 23:12:03Z eddieajau $
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
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 .= '<td><form method="post" action="' . sefRelToAbs( 'index.php' ) . '">';
$html .= '<input src="./images/up.gif" class="button1" type="image" name="submit_vote" ';
$html .= 'alt="'. _RATE_BUTTON .'" />';
$html .= '<input type="radio" alt="vote 1 star" name="user_rating" value="1" ';
$html .= '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></td>';
}
return $html;
}
?>保存个小图片 up.gif 放你你的 images目录下.
至于在标题下面和上一篇一样要显示出来顶的次数, 可以 在上次修改的地方:
View: <?php echo $row->hits; ?>
后面增加:
| <img src="./images/vote.gif" align="top" alt="Digg"/> Digg:
<?php echo intval( $row->rating_count ); ?>
就ok了.
当然, 要使用这个,你的投票 bot 是要发布的! 
Permanent URL:
http://www.autoit.cn/index.php/content/view/85/25.html
| 5 | alex @ 2006-11-19 15:09:21 : |
老大文中第一句是用的图片吗? 还是其他? 谢谢告知. |
| 4 | Autoit @ 2006-11-17 23:11:06 : to Jourdan |
Sorry. 因为版面问题,我改了下,而未测试...出现了低级错误. 现在已经改正, 不过见你站上也已经好了.  |
| 3 | Jourdan @ 2006-11-17 12:16:30 : |
但我改了后文章的标题前变得这样了。 请看。。 http://www.fisherzone.com/index.php?option=com_content&task=view&id=27&Itemid=2 |
| 2 | Jourdan @ 2006-11-17 11:58:34 : nice man! |
| 谢谢你了,AutoIT大哥! you're a nice man! ^_^ |
| 1 | wow @ 2006-11-17 11:20:23 : 好喜欢呀 |
比自己带的那个要好多了. 谢谢!!!!!! |
Only registered users can write comments.
Please login or register.