Kuwait Linux User Group

Welcome to the Kuwait Linux User Group, thats dedicated to talk about Linux, BSD, and the use of open source
specially for Kuwait community & others as well -- beside encouraging them to use it.
Follow Us:

April 09, 2007 04:24 AM EDT

كيف تجعل الزوار يشاهدون التحميل ولاكن لايمكنهم التحميل الا بعد التسجيل في مجلة النيوك.

this allows you to protect/restrict download module to registered users only in phpnuke.

Author: . 4038 Reads
  Print this page   Export to PDF format   Mail to a friend


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");
}



meshal @ q8linux

Copyright © by Kuwait Linux User Group
All rights reserved.


Category: Hints & Tips
Tags: None
Bookmark: Share/Save/Bookmark

[ Go Back ]
Content ©

Survey

What's your Favorite Mail Server(smtp)?

Sendmail
Qmail
Postfix
Exchange
Lotus Notes



Results
Polls

Votes: 102
Comments: 67