e107Hacks.org

Home | Forum | Downloads | Upload | Hack | Members | Links | Add | Search

e107Hacks.org :: Forums :: Hack Request & Discussion - Public :: Completed Hacks

The following are modifications to the existing shortcodes. It allows members to download as normal but sends non members to forbidden.php which you should place in your e107 root directory. Just replace the existing shortcodes in e107_files/shortcodes/ batch/ download_shortcodes.php file with theses and you will be all set.

DOWNLOAD LIST LINK SHORTCODE

 

SC_BEGIN DOWNLOAD_LIST_LI NK
global $tp,$row,$pref;

If (USER){
    $downloadlistlink = " <a href='".e_BASE." request.php?".$row[' download_id']."' >";
}else{
    $downloadlistlink = " <a href='".e_BASE." forbidden.php>";
}
$agreetext = $tp- >toJS($tp->toHTML($pref[' agree_text'],FALSE," parse_sc, defs"));
    if($row[' download_mirror_type']){
        return ($pref[' agree_flag'] ? "<a href=' ".e_BASE."download.php? mirror.".$row[' download_id']."'  onclick= \" return confirm(' {$agreetext}');\">" : " <a href='".e_BASE." download.php?mirror." .$row['download_id']."'  >");
    }else{
        return ($pref[' agree_flag'] ? "<a href=' ".e_BASE."request.php?" .$row['download_id']."'  onclick= \" return confirm(' {$agreetext}');\">" :  $downloadlistlink);
    }
SC_END
 


DOWNLOAD VIEW LINK SHORTCODE

 

SC_BEGIN DOWNLOAD_VIEW_LI NK
global $pref,$dl,$tp;

if ($pref['agree_flag']  == 1) {
    $dnld_link = " <a href='".e_BASE." request.php?".$dl[' download_id']."'  onclick= \" return confirm('".$tp- >toJS($tp->toHTML($pref[' agree_text'],FALSE," parse_sc, defs"))."');\" >";
} else {
    if (USER){
        $dnld_link = " <a href='".e_BASE." request.php?".$dl[' download_id']."'>";
    }else{
        $dnld_link = " <a href='".e_BASE." forbidden.php'>";
    }
}

if($dl['download_mirror'] )
{
    if($dl[' download_mirror_type'])
    {
        return "<a href=' ".e_BASE."download.php? mirror.".$dl[' download_id']."'>" .LAN_dl_66."</a>";
    }
    else
    {
        return $dnld_link ." <img src='" .IMAGE_DOWNLOAD."' alt=''  style='border:0' /></a>" ;
    }
}
else
{
    return $dnld_link."  <img src='" .IMAGE_DOWNLOAD."' alt=''  style='border:0' /></a>" ;
}
SC_END