(#1)
c0rrupt Offline
Administrator
 
Posts: 201
Join Date: Mar 2010
Location: Canada
Download Ratings (1-10) - 04-27-2010, 11:56 AM

open modules/wcddl_dlratings.php

Find:
Code:
<?php
if(!defined("WCDDL_GUTS"))
	exit;
/*BEGIN_INFO
Download Ratings Module.
END_INFO*/
function downloadRating() {
	global $core;
	if(isset($_POST['rate']))
		$ratePost = $_POST['rate'];
	if(!isset($ratePost) || !in_array($ratePost,array(1,2,3,4,5))) {
		$rateHTML = '<form action="" method="post">
		Rate this Download:
		<select name="rate">';
		for($i=1;$i<=5;$i++) {
			$rateHTML .= '<option value="'.$i.'">'.$i.'</option>';
		}
		$rateHTML .= '</select>
		<input type="submit" value="Rate!" />
		</form>';
	} else {
		$currentRate = mysql_query("SELECT rating FROM wcddl_downloads WHERE id = '".$core->id."'");
		$currentRate = mysql_result($currentRate,0);
		$newRate = ($currentRate+$ratePost)/2;
		mysql_query("UPDATE wcddl_downloads SET rating = '".mysql_real_escape_string($newRate)."' WHERE id = '".$core->id."'");
		$rateHTML = 'Download rated!';
	}
	$core->setTemplateVar("downloadRating",$rateHTML);
}
$core->attachHook("endFetchDownload","downloadRating");
?>

Replace With:

Code:
<?php
if(!defined("WCDDL_GUTS"))
	exit;
function downloadRating() {
	global $core;
	if(isset($_POST['rate']))
		$ratePost = $_POST['rate'];
	if(!isset($ratePost) || !in_array($ratePost,array(1,2,3,4,5,6,7,8,9,10))) {
		$rateHTML = '<form action="" method="post">
		Rate this style:
		<select name="rate">';
		for($i=1;$i<=10;$i++) {
			$rateHTML .= '<option value="'.$i.'">'.$i.'</option>';
		}
		$rateHTML .= '</select>
		<input type="submit" value="Rate!" />
		</form>';
	} else {
		$currentRate = mysql_query("SELECT rating FROM wcddl_downloads WHERE id = '".$core->id."'");
		$currentRate = mysql_result($currentRate,0);
		$newRate = ($currentRate+$ratePost)/2;
		mysql_query("UPDATE wcddl_downloads SET rating = '".mysql_real_escape_string($newRate)."' WHERE id = '".$core->id."'");
		$rateHTML = 'style has been rated!
thank you.';
	}
	$core->setTemplateVar("downloadRating",$rateHTML);
}
$core->attachHook("endFetchDownload","downloadRating");
?>
Quote:

Change These Lines For Your Own Rating's

Find:
for($i=1;$i<=10;$i++)
Change 10 To Your Number.

And:
Find:
array(1,2,3,4,5,6,7,8,9,10)
Change 1,2,3,4,5,6,7,8,9,10 To Your Numbers.
Upload Done!


Before doing any edits to your DDL Site always make a BACKUP first.

Bookmarks

Tags
110, download, ratings

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Powered by vBulletin


Content Relevant URLs by vBSEO