Public feed #603372

devil

public php v1 · immutable
Raw Edit
·published 2007-07-04 18:55 UTC
rendered paste body
<?php/*** @version $Id: mosvote-xtd.php, v1.00 Juli 2007* @copyright (C) 2007 rudis-cms-design.de* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL* @Author: Markus Rouenhoff - http://www.rudis-cms-design.de***//** Ensure this file is being included by a parent file */defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );$_MAMBOTS->registerFunction( 'onPrepareContent', 'botRating' );function botRating( $published, &$row, &$params, $page=0 ) {	global $Itemid, $id, $ispopup;    $html1 = '';    $html2 = '';    	if(!$ispopup) {		$html1 .= '<form method="post" action="' . sefRelToAbs( 'index.php' ) . '">';		$img = '';	}		// look for images in template if available		$starImageOn = mosAdminMenus::ImageCheck( 'rating_star.png', '/images/M_images/' );		$starImageOff = mosAdminMenus::ImageCheck( 'rating_star_blank.png', '/images/M_images/' );		for ($i=0; $i < $row->rating; $i++) {			$img .= $starImageOn;		}		for ($i=$row->rating; $i < 5; $i++) {			$img .= $starImageOff;		}		$html2 .= '<span class="content_rating">';		$html2 .= _USER_RATING . ':' . $img . '&nbsp;/&nbsp;';		$html2 .= intval( $row->rating_count );				$html2 .= "</span>\n<br />\n";		$html2 .= '<!-- mosvote-xtd written by Markus Rouenhoff aka Devil. http://www.rudis-cms-design.de -->';						$url = @$_SERVER['REQUEST_URI'];		$url = str_replace( '&', '&amp;', $url );				$html1 .= '<span class="content_vote">';		$html1 .= _VOTE_POOR;		$html1 .= '<input type="radio" alt="vote 1 star" name="user_rating" value="1" />';		$html1 .= '<input type="radio" alt="vote 2 star" name="user_rating" value="2" />';		$html1 .= '<input type="radio" alt="vote 3 star" name="user_rating" value="3" />';		$html1 .= '<input type="radio" alt="vote 4 star" name="user_rating" value="4" />';		$html1 .= '<input type="radio" alt="vote 5 star" name="user_rating" value="5" checked="checked" />';		$html1 .= _VOTE_BEST;		$html1 .= '&nbsp;<input class="button" type="submit" name="submit_vote" value="'. _RATE_BUTTON .'" />';		$html1 .= '<input type="hidden" name="task" value="vote" />';		$html1 .= '<input type="hidden" name="pop" value="0" />';		$html1 .= '<input type="hidden" name="option" value="com_content" />';		$html1 .= '<input type="hidden" name="Itemid" value="'. $Itemid .'" />';		$html1 .= '<input type="hidden" name="cid" value="'. $id .'" />';		$html1 .= '<input type="hidden" name="url" value="'. $url .'" />';		$html1 .= '</span>';		$html1 .= '<!-- mosvote-xtd written by Markus Rouenhoff aka Devil. http://www.rudis-cms-design.de -->';		$html1 .= "</form>\n";    $html3 = '';    $html3 .= $html2;    $html3 .= $html1;    		$row->text = str_replace( "{vote-ergebniss}", $html2, $row->text );						$row->text = str_replace( "{vote-abstimmen}", $html1, $row->text );		$row->text = str_replace( "{vote}", $html3, $row->text );    return true;}?>