Annotation of /mambo/branches/4.6/mambots/content/mosvote.php
Parent Directory
|
Revision Log
Revision 1 -
(view)
(download)
Original Path: mambo/trunk/mambots/content/mosvote.php
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | * @version $Id: mosvote.php,v 1.1 2005/07/22 01:57:49 eddieajau Exp $ | ||
| 4 : | * @package Mambo | ||
| 5 : | * @copyright (C) 2000 - 2005 Miro International Pty Ltd | ||
| 6 : | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||
| 7 : | * Mambo is Free Software | ||
| 8 : | */ | ||
| 9 : | |||
| 10 : | /** ensure this file is being included by a parent file */ | ||
| 11 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 12 : | |||
| 13 : | $_MAMBOTS->registerFunction( 'onBeforeDisplayContent', 'botVoting' ); | ||
| 14 : | |||
| 15 : | function botVoting( &$row, &$params, $page=0 ) { | ||
| 16 : | global $mosConfig_live_site, $mosConfig_absolute_path, $cur_template; | ||
| 17 : | global $Itemid; | ||
| 18 : | $id = $row->id; | ||
| 19 : | $option = 'com_content'; | ||
| 20 : | $task = mosGetParam( $_REQUEST, 'task', '' ); | ||
| 21 : | |||
| 22 : | $html = ''; | ||
| 23 : | if ($params->get( 'rating' ) && !$params->get( 'popup' )){ | ||
| 24 : | $html .= '<form method="post" action="' . sefRelToAbs( 'index.php' ) . '">'; | ||
| 25 : | $img = ''; | ||
| 26 : | |||
| 27 : | // look for images in template if available | ||
| 28 : | $starImageOn = mosAdminMenus::ImageCheck( 'rating_star.png', '/images/M_images/' ); | ||
| 29 : | $starImageOff = mosAdminMenus::ImageCheck( 'rating_star_blank.png', '/images/M_images/' ); | ||
| 30 : | |||
| 31 : | for ($i=0; $i < $row->rating; $i++) { | ||
| 32 : | $img .= $starImageOn; | ||
| 33 : | } | ||
| 34 : | for ($i=$row->rating; $i < 5; $i++) { | ||
| 35 : | $img .= $starImageOff; | ||
| 36 : | } | ||
| 37 : | $html .= '<span class="content_rating">'; | ||
| 38 : | $html .= _USER_RATING . ':' . $img . ' / '; | ||
| 39 : | $html .= intval( $row->rating_count ); | ||
| 40 : | $html .= "</span>\n<br />\n"; | ||
| 41 : | $url = @$_SERVER['REQUEST_URI']; | ||
| 42 : | $url = ampReplace( $url ); | ||
| 43 : | |||
| 44 : | if (!$params->get( 'intro_only' ) && $task != "blogsection") { | ||
| 45 : | $html .= '<span class="content_vote">'; | ||
| 46 : | $html .= _VOTE_POOR; | ||
| 47 : | $html .= '<input type="radio" alt="vote 1 star" name="user_rating" value="1" />'; | ||
| 48 : | $html .= '<input type="radio" alt="vote 2 star" name="user_rating" value="2" />'; | ||
| 49 : | $html .= '<input type="radio" alt="vote 3 star" name="user_rating" value="3" />'; | ||
| 50 : | $html .= '<input type="radio" alt="vote 4 star" name="user_rating" value="4" />'; | ||
| 51 : | $html .= '<input type="radio" alt="vote 5 star" name="user_rating" value="5" checked="checked" />'; | ||
| 52 : | $html .= _VOTE_BEST; | ||
| 53 : | $html .= ' <input class="button" type="submit" name="submit_vote" value="'. _RATE_BUTTON .'" />'; | ||
| 54 : | $html .= '<input type="hidden" name="task" value="vote" />'; | ||
| 55 : | $html .= '<input type="hidden" name="pop" value="0" />'; | ||
| 56 : | $html .= '<input type="hidden" name="option" value="com_content" />'; | ||
| 57 : | $html .= '<input type="hidden" name="Itemid" value="'. $Itemid .'" />'; | ||
| 58 : | $html .= '<input type="hidden" name="cid" value="'. $id .'" />'; | ||
| 59 : | $html .= '<input type="hidden" name="url" value="'. $url .'" />'; | ||
| 60 : | $html .= '</span>'; | ||
| 61 : | } | ||
| 62 : | $html .= "</form>\n"; | ||
| 63 : | } | ||
| 64 : | return $html; | ||
| 65 : | } | ||
| 66 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

