Source for file mosvote.php
Documentation is available at mosvote.php
* @author Mambo Foundation Inc see README.php
* @copyright Mambo Foundation Inc.
* See COPYRIGHT.php for copyright notices and details.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
* Mambo is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$this->registerFunction( 'onBeforeDisplayContent', 'botVoting' );
function botVoting( &$row, &$params, $page=
0 ) {
global $mosConfig_live_site, $mosConfig_absolute_path, $cur_template;
if (is_callable(array($row,'getId'))) $id =
$row->getId();
if ($params->get( 'rating' ) &&
!$params->get( 'popup' )){
if (is_callable(array($row,'getRating'))) $rating =
$row->getRating();
else $rating =
$row->rating;
if (is_callable(array($row,'getRatingCount'))) $rating_count =
$row->getRatingCount();
else $rating_count =
$row->rating_count;
$html .=
'<form method="post" action="' .
sefRelToAbs( 'index.php' ) .
'">';
// look for images in template if available
$starImageOn =
$mainframe->ImageCheck( 'rating_star.png', '/images/M_images/' );
$starImageOff =
$mainframe->ImageCheck( 'rating_star_blank.png', '/images/M_images/' );
for ($i=
0; $i <
$rating; $i++
) {
for ($i=
$rating; $i <
5; $i++
) {
$html .=
'<span class="content_rating">';
$html .=
T_('User Rating') .
':' .
$img .
' / ';
$html .=
intval( $rating_count );
$html .=
"</span>\n<br />\n";
$url =
@$_SERVER['REQUEST_URI'];
require_once(mamboCore::get('mosConfig_absolute_path').
'/includes/phpInputFilter/class.inputfilter.php');
$url =
trim( $iFilter->process( $url ) );
if (!$params->get( 'intro_only' ) &&
$task !=
"blogsection") {
$html .=
'<span class="content_vote">';
$html .=
'<input type="radio" alt="'.
T_('vote 1 star').
'" name="user_rating" value="1" />';
$html .=
'<input type="radio" alt="'.
T_('vote 2 star').
'" name="user_rating" value="2" />';
$html .=
'<input type="radio" alt="'.
T_('vote 3 star').
'" name="user_rating" value="3" />';
$html .=
'<input type="radio" alt="'.
T_('vote 4 star').
'" name="user_rating" value="4" />';
$html .=
'<input type="radio" alt="'.
T_('vote 5 star').
'" name="user_rating" value="5" checked="checked" />';
$html .=
' <input class="button" type="submit" name="submit_vote" value="'.
T_('Rate') .
'" />';
$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 .
'" />';
Documentation generated on Mon, 05 May 2008 16:21:34 +0400 by phpDocumentor 1.4.0