كيف تجعل الزوار يشاهدون التحميل ولاكن لايمكنهم التحميل الا بعد التسجيل في مجلة النيوك.
this allows you to protect/restrict download module to registered users only in phpnuke.
If you want to allow all visitors to see the downloads but only registered users to actually download them follow this:
كيف تجعل الزوار يشاهدون التحميل ولاكن
لايمكنهم التحميل الا بعد التسجيل في مجلة النيوك.
-1 اعمل نسخه احتياط من الملف و ثم افتح:
modules/Downloads/index.php
ابحث عن الصطر :look for these lines
function getit($lid) {
global $prefix, $dbi;
sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 WHERE
lid=$lid", $dbi);
$result = sql_query("SELECT url FROM ".$prefix."_downloads_downloads WHERE
lid=$lid", $dbi);
list($url) = sql_fetch_row($result, $dbi);
Header("Location: $url");
}
و غيره الي :Modify it to this :
function getit($lid) {
global $prefix, $dbi, $user, $admin;
if (!is_admin($admin)&&!is_user($user)) {
$pagetitle = "- "._ACCESSDENIED."";
include("header.php");
title("$sitename: "._ACCESSDENIED."");
OpenTable();
echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
.""._MODULEUSERS.""
.""._GOBACK."";
CloseTable();
include("footer.php");
die();
}
sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 WHERE
lid=$lid", $dbi);
$result = sql_query("SELECT url FROM ".$prefix."_downloads_downloads WHERE
lid=$lid", $dbi);
list($url) = sql_fetch_row($result, $dbi);
Header("Location: $url");
}
Copyright © by Kuwait Linux User Group - OpenSource free stuff All Rights Reserved.