Example #1
0
	function d3download_ratefile_check( $mydirname )
	{
		require_once dirname( dirname(__FILE__) ).'/class/rate_download.php' ;
		$rate_download = new rate_download( $mydirname, 'Rate' ) ;
		$lid = intval( $_GET['lid'] ) ;
		if( ! empty( $lid ) ) {
			$check_result = $rate_download->Ratefile_check( $lid ) ;
			echo ( ! empty( $check_result ) ) ? str_replace( '<br />', '', $check_result ) : '' ;
		}
	}
Example #2
0
	function d3download_get_guest_vote( $mydirname, $lid )
	{
		require_once dirname( dirname(__FILE__) ).'/class/rate_download.php' ;
		$rate_download = new rate_download( $mydirname ) ;
		return $rate_download->Get_Guest_vote( $lid ) ;
	}
Example #3
0
$user_access = new user_access( $mydirname ) ;
$whr_cat = "cid IN (".implode(",", $user_access->can_read() ).")" ;
$whr_cat4read = "d.".$whr_cat ;

$cid = empty( $_GET['cid'] ) ? 0 : intval( $_GET['cid'] ) ;
$bc[0] = d3download_breadcrumbs( $mydirname ) ;
$breadcrumbs = array_merge( $bc ,d3download_breadcrumbs_tree( $mydirname, $cid, $whr_cat, '', 1 ) ) ;
$lid = empty( $_GET['lid'] ) ? 0 : intval( $_GET['lid'] ) ;
$download4assign = d3download_get_title( $mydirname, $lid, $whr_cat4read );
$title4assign = $download4assign['title'] ;
$breadcrumbs[] = array( 'name' => $title4assign ) ;

if( ! empty( $_POST['rate_submit'] ) ) {
	require_once dirname( dirname(__FILE__) ).'/class/rate_download.php' ;
	$rate_download = new rate_download( $mydirname, 'Rate' ) ;
	$rate_download->Ratefile_Execution( $cid, $lid );
}

// store the referer
if( empty( $_SESSION["{$mydirname}_uri4return"] ) && ! empty( $_SERVER['HTTP_REFERER'] ) ) {
	$_SESSION["{$mydirname}_uri4return"] = $_SERVER['HTTP_REFERER'] ;
}

$xoops_module_header = d3download_dbmoduleheader( $mydirname, array( 'jquery.js' , 'd3downloads.js' ) );
$xoopsTpl->assign('xoops_module_header', $xoops_module_header . "\n" . $xoopsTpl->get_template_vars('xoops_module_header'));

$xoopsTpl->assign( array(
	'mydirname' => $mydirname ,
	'mod_url' => XOOPS_URL.'/modules/'.$mydirname ,
	'page' => 'ratefile' ,
Example #4
0
$mid = $module->getVar('mid') ;
if( ! is_object( @$xoopsUser ) || ! $moduleperm_handler->checkRight( 'module_admin' , $mid , $xoopsUser->getGroups() ) ) {
	die( 'Only administrator can use this feature.' ) ;
}

if( ! empty( $_POST['delvote']) ){
	if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) {
		redirect_header( XOOPS_URL."/modules/$mydirname/" , 3 , $xoopsGTicket->getErrors() );
	}

	$cid = isset( $_POST['cid'] ) ? intval( $_POST['cid'] ) : 0 ;
	$lid = isset( $_POST['lid'] ) ? intval( $_POST['lid'] ) : 0 ;
	$errors = array();
	foreach( $_POST['delvote'] as $id => $value ) {
		if( empty( $value ) ) continue ;
		$ratingid = intval( $id ) ;
		$sql = "DELETE FROM ".$db->prefix( $mydirname."_votedata" )." WHERE ratingid='".$ratingid."'";
		$result = $db->query( $sql );
		if( ! $result ) $errors[] = $ratingid ;
		$rate_download = new rate_download( $mydirname ) ;
		$rate_download->UpdateRating( $lid ) ;
	}
	d3download_delete_cache_of_categories( $mydirname ) ;
	redirect_header( XOOPS_URL."/modules/$mydirname/index.php?page=modfile&amp;cid=$cid&amp;lid=$lid" , 2 , $errors ? sprintf( _MD_D3DOWNLOADS_ERROR_MESSEAGE ,  implode( ',' , $errors ) ) : _MD_D3DOWNLOADS_DELETED ) ;
	exit();
} else {
	redirect_header( XOOPS_URL."/modules/$mydirname/index.php?page=modfile&amp;cid=$cid&amp;lid=$lid" , 2 , _MD_D3DOWNLOADS_NONDELETED ) ;
	exit();
}

?>