[ Index ] |
|
Code source de Joomla 1.0.13 |
1 <?php 2 /** 3 * @version $Id: mosvote.php 3502 2006-05-15 04:31:11Z stingrey $ 4 * @package Joomla 5 * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. 6 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php 7 * Joomla! is free software. This version may have been modified pursuant 8 * to the GNU General Public License, and as distributed it includes or 9 * is derivative of works licensed under the GNU General Public License or 10 * other free or open source software licenses. 11 * See COPYRIGHT.php for copyright notices and details. 12 */ 13 14 // no direct access 15 defined( '_VALID_MOS' ) or die( 'Restricted access' ); 16 17 $_MAMBOTS->registerFunction( 'onBeforeDisplayContent', 'botVoting' ); 18 19 function botVoting( &$row, &$params, $page=0 ) { 20 global $Itemid, $task; 21 22 $id = $row->id; 23 $option = 'com_content'; 24 25 $html = ''; 26 if ($params->get( 'rating' ) && !$params->get( 'popup' )){ 27 $html .= '<form method="post" action="' . sefRelToAbs( 'index.php' ) . '">'; 28 $img = ''; 29 30 // look for images in template if available 31 $starImageOn = mosAdminMenus::ImageCheck( 'rating_star.png', '/images/M_images/' ); 32 $starImageOff = mosAdminMenus::ImageCheck( 'rating_star_blank.png', '/images/M_images/' ); 33 34 for ($i=0; $i < $row->rating; $i++) { 35 $img .= $starImageOn; 36 } 37 for ($i=$row->rating; $i < 5; $i++) { 38 $img .= $starImageOff; 39 } 40 $html .= '<span class="content_rating">'; 41 $html .= _USER_RATING . ':' . $img . ' / '; 42 $html .= intval( $row->rating_count ); 43 $html .= "</span>\n<br />\n"; 44 $url = @$_SERVER['REQUEST_URI']; 45 $url = ampReplace( $url ); 46 47 if (!$params->get( 'intro_only' ) && $task != "blogsection") { 48 $html .= '<span class="content_vote">'; 49 $html .= _VOTE_POOR; 50 $html .= '<input type="radio" alt="vote 1 star" name="user_rating" value="1" />'; 51 $html .= '<input type="radio" alt="vote 2 star" name="user_rating" value="2" />'; 52 $html .= '<input type="radio" alt="vote 3 star" name="user_rating" value="3" />'; 53 $html .= '<input type="radio" alt="vote 4 star" name="user_rating" value="4" />'; 54 $html .= '<input type="radio" alt="vote 5 star" name="user_rating" value="5" checked="checked" />'; 55 $html .= _VOTE_BEST; 56 $html .= ' <input class="button" type="submit" name="submit_vote" value="'. _RATE_BUTTON .'" />'; 57 $html .= '<input type="hidden" name="task" value="vote" />'; 58 $html .= '<input type="hidden" name="pop" value="0" />'; 59 $html .= '<input type="hidden" name="option" value="com_content" />'; 60 $html .= '<input type="hidden" name="Itemid" value="'. $Itemid .'" />'; 61 $html .= '<input type="hidden" name="cid" value="'. $id .'" />'; 62 $html .= '<input type="hidden" name="url" value="'. $url .'" />'; 63 $html .= '</span>'; 64 } 65 $html .= '</form>'; 66 } 67 return $html; 68 } 69 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Wed Nov 21 14:43:32 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |