Current time: 01-28-2013, 11:12 PM    Register | Lost Password?

Contest #1- First member to have 5 referals will get VIP status. You can find your referal link in your UserCP


Post Reply 
Download Ratings (1-10)
Author Message
c0rrupt Offline
Administrator


Posts: 276
Joined: Mar 2010
Post: #1
Download Ratings (1-10)
open modules/wcddl_dlratings.php

Find:
<?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:

<?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! Smile
04-27-2010 06:56 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How 2 Have A Top Download Bar Instead Of Left c0rrupt 1 104 01-05-2013 08:59 AM
Last Post: ddejjavvu



User(s) browsing this thread: 1 Guest(s)

Affiliates
PhazeDDL WarezUNION WarezOrder Free Full Downloads SuppaDDL CafeDDL-Serves Premium Downloads! free porn downloads @ PornDDL.me
This forum uses Lukasz Tkacz MyBB addons.