Source for file rate.php
Documentation is available at rate.php
* date created 2006/02/10
* @author xing <xing@synapse.plus.com>
require_once( "../kernel/setup_inc.php" );
$gBitSystem->verifyPackage( 'stars' );
if( @BitBase::verifyId( $_REQUEST['content_id'] ) && @BitBase::verifyId( $_REQUEST['stars_rating'] ) ) {
// check if this feature allows rating
if( $gBitSystem->isFeatureActive( 'stars_rate_'. $tmpObject->getContentType() ) ) {
if( !$gBitUser->isRegistered() ) {
$starsfeed['error'] = tra( "You need to log in to rate." );
if( $stars->store( $_REQUEST ) ) {
//$starsfeed['success'] = tra( "Thank you for rating." );
$starsfeed['error'] = $stars->mErrors;
// get up to date reading
$serviceHash = array_merge( $tmpObject->mInfo, $stars->mInfo, $stars->getUserRating( $tmpObject->mContentId ) );
$gBitSmarty->assign( 'serviceHash', $serviceHash );
$starsfeed['warning'] = tra( "There was a problem trying to apply your rating" );
$gBitSmarty->assign( "starsfeed", $starsfeed );
if( $gBitThemes->isAjaxRequest() ) {
if( !empty( $_REQUEST['type'] ) ) {
$gBitSmarty->assign( 'type', $_REQUEST['type'] );
print $gBitSmarty->fetch( 'bitpackage:stars/stars_inline_service.tpl' );
} elseif( !empty( $tmpObject ) && method_exists( $tmpObject, 'getDisplayUrl' )) {
|