Gossamer Forum
Home : Products : Gossamer Links : PHP Front End :

Getting a hashed file

Quote Reply
Getting a hashed file
Hi all,
i show some stuff from the links table with an ordinary php, but stuck with getting a file while using the hash method to solve.
I have tried to understand the perl code and translate into php to show this, but i dont do it.
So i ask if someone has done this before; the alternative is to save the pics without hashing, but while i have to save thousands of files for this it makes sense.

Somewhat closer: With the data from the different tables i could get almost everything what i need.
Say the file is saved in /home/.../pics/6/filename.jpg

Then i could get everything from /home/.../pics/ and the filename.
But i have no more clue how to get the /6/ beetween that.

Quote Reply
Re: [Robert] Getting a hashed file In reply to
Ok, here we go:

if ($row = $DB_site->query_first("SELECT ID, File_Name FROM Links_Files
WHERE (ForeignColName = 'Logo' AND ForeignColKey = $ID) LIMIT 1") ) {
$laenge = strlen($row[0]);
$laenge = $laenge-1;
$x = substr($row[0],$laenge,1);
$fileurl = "/img0/$x/".$row[0]."-".$row[1];

If you wonder about $DB_site->query_first,
you have to know that i use some funktions from my forum-software.

BTW: It seems this forum has some problems with the <c>