Seite 1 von 1

Catagory Problem -- Found the Solution!

Verfasst: So 16.Nov, 2003 04:59
von Anonymous
[ ÜBERSETZEN SIE DIESES MIT GOOGLE ]

FYI: Category ID's start at "1" and a "Cat=0" will only show a list of the categories.

The Problem:
When "download.php" refreshes itself, the $cat variable is not retrieved from the URL! This means, $Cat will always = 0 (ie: no category selected), despite what is seen in the URL.

:arrow: So, (because the script isn't getting the $cat variable off from the URL), it has no idea what category to show!

Why didn't this happen to everyone?
As I've read, this doesn't usually occur on LINUX / UNIX based servers. Well, I really don't know why!

The Fix!

Code: Alles auswählen

##
##-- [ OPEN ] -------------
##
/downloads.php

##
##-- [ FIND ] -------------
##
//
// Generate page
//

##
##-- [ BEFORE, ADD ] ------------- 
##
$cat = $_GET["cat"];

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
That’s it, Enjoy!


NOTE:
IMO, Hotschi's code is BUTT UGLY! It works ok enough (far from perfect), but man is it un-organized! I really don't know how talented this person is, but if the code and this mods 'ease-of-use' is any indication, Hotschi still has a long ways to go. But then again, don't we all. :roll:

LEARN CODING STANDARDS!

Verfasst: Mi 03.Mär, 2004 16:09
von Anonymous
Thank you man. I sat here and tried everythign I could think of to get this thing to work. After a while I figured I would see if there was any kind of support for this. Only to find out that there is but mostly in German. It was by luck that I have clicked on this topic. All works well man! Thank you for sharing with us.

I also think that if people are going to do mods and things alike that they make their help or support multilingual all they gotta do is go to google and use their language tools if needed. lol

Wow

Verfasst: Di 23.Mär, 2004 18:42
von Anonymous
Ey dude you RULE :)
That's it !!!
Thanks a lot. :) :D

Problems with category/ Probleme beim Öffnen der Kategorie

Verfasst: Do 24.Jun, 2004 09:50
von Anonymous
Hi,

Here's a little explanation why this fault does not happen to every user:

It seems to be a problem of the register_globals, which is set to "off" in newer apache versions, because of security issues. If you have switched your "register globals" to off, then the variable could not been transfered with post/get/cookie as used in early versions.

It use the following system:
Whenever a query parameter is specified in the script's URL, PHP will create a global array called $HTTP_GET_VARS.
  • Example: PHP will automatically create $HTTP_GET_VARS = array ('var' => 'value', 'foo' => 'bar');
Since PHP 4.1.0, a global variable called $_GET will contain the same array as $HTTP_GET_VARS.

In fact, if you want to get a variable, and you have set the "register_globals" to OFF in your httpd.conf (Apache-Config-File :wink:), then you have to get your variable "cat" with:

Code: Alles auswählen

$cat=$_GET['cat'];
or if the variable "cat" is posted, then read it with:

Code: Alles auswählen

$cat=$_POST['cat'];
If you are not shure, then use both:

Code: Alles auswählen

$cat = ( isset($HTTP_GET_VARS['cat']) ) ? $HTTP_GET_VARS['cat'] : $HTTP_POST_VARS['cat'];
If you don't want to change your habit and change every GET/POST, then set the following at the beginning of your script:
  • foreach($_GET as $key=>$value) {
    eval("$$key = \"$value\";");
    }
What means this for the Download-Mod from Hotschi:

It seems, that Hotschi had his register_globals turned to ON during his development of his Mod. So this script does his work on every apache with register_globals=on, but NOT on apache's with register_global=off.
The variable "cat" in download.php is the only one which have to be readen. So, change it like >Odo324< had it describen above.

Hotschi: This is only MY error guessing. Don't be angry if it's not true. :wink:

I hope this helped somebody...

...english is not my native language!

Verfasst: Fr 16.Jul, 2004 19:08
von Anonymous
So Categorie Listening is ok, but when i try to load a File with the Download button the script could not load the File.

Verfasst: Sa 02.Okt, 2004 16:22
von Anonymous
Yeah same problem here.... the script cant start DL

Re: Catagory Problem -- Found the Solution!

Verfasst: Do 14.Okt, 2004 14:45
von Anonymous
Odo324 hat geschrieben:[
The Fix!

Code: Alles auswählen

##
[/quote]

Dude, you solved my problem  :D   Thanks!

Remco

Re: Problems with category/ Probleme beim Öffnen der Kategor

Verfasst: Di 16.Nov, 2004 13:42
von Anonymous
mosaic hat geschrieben:Hi,

Here's a little explanation why this fault does not happen to every user:

It seems to be a problem of the register_globals, which is set to "off" in newer apache versions, because of security issues. If you have switched your "register globals" to off, then the variable could not been transfered with post/get/cookie as used in early versions.

It use the following system:
Whenever a query parameter is specified in the script's URL, PHP will create a global array called $HTTP_GET_VARS.
  • Example: PHP will automatically create $HTTP_GET_VARS = array ('var' => 'value', 'foo' => 'bar');
Since PHP 4.1.0, a global variable called $_GET will contain the same array as $HTTP_GET_VARS.

In fact, if you want to get a variable, and you have set the "register_globals" to OFF in your httpd.conf (Apache-Config-File :wink:), then you have to get your variable "cat" with:

Code: Alles auswählen

$cat=$_GET['cat'];
or if the variable "cat" is posted, then read it with:

Code: Alles auswählen

$cat=$_POST['cat'];
If you are not shure, then use both:

Code: Alles auswählen

$cat = ( isset($HTTP_GET_VARS['cat']) ) ? $HTTP_GET_VARS['cat'] : $HTTP_POST_VARS['cat'];
If you don't want to change your habit and change every GET/POST, then set the following at the beginning of your script:
  • foreach($_GET as $key=>$value) {
    eval("$$key = "$value";");
    }
What means this for the Download-Mod from Hotschi:

It seems, that Hotschi had his register_globals turned to ON during his development of his Mod. So this script does his work on every apache with register_globals=on, but NOT on apache's with register_global=off.
The variable "cat" in download.php is the only one which have to be readen. So, change it like >Odo324< had it describen above.

Hotschi: This is only MY error guessing. Don't be angry if it's not true. :wink:

I hope this helped somebody...

...english is not my native language!



Hi

I fixed de "cat" problem, but my apache server have register_globals=on.

Now, when try to download a file, i dont download the files, but download a file named "load"

Help me please


www.picmicroword.net/foro ==> try in "descargas"

Tnahk you

Verfasst: Do 09.Dez, 2004 11:19
von Anonymous
Hi there

I use phpBB 2.0.11 and did all the implementing of dl_mod 2.1.2 by Hotschi as described, also the latest fix for phpBB versions 2.0.9+.

But still, there are 2 problems, I don't get solved:

1. I can't sort the DL-Cat. When I push up or down, nothing happens. In "Downloads" the Cats are also not sorted as I want it.

2. In "Downloads" I can't download the files. Instead I receive an empty file "load.php".

My forum is: speerforum.f-site.ch

If someone can help me, I'd be very happy.

Kind regards
Martin Fischer
alias spediteur