Closed Thread Icon

Preserved Topic: Anyone Else Using Gallery? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=13079" title="Pages that link to Preserved Topic: Anyone Else Using Gallery? (Page 1 of 1)" rel="nofollow" >Preserved Topic: Anyone Else Using Gallery? <span class="small">(Page 1 of 1)</span>\

 
Wes
Paranoid (IV) Mad Scientist

From: Inside THE BOX
Insane since: May 2000

posted posted 03-04-2004 19:32

This is really a Server-Side Scripting question, but I'm hoping to reach the largest audience I can since it pertains to a particular, and popular, bit of software. (Someone who doesn't frequent SSS, like me, may have found a patch somewhere else that I can't come up with.)

I'm trying to display an image's file name on the view_photo page and can't seem to do it. And no one over at the Gallery forum is much help at all.

Gracias ...


Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 03-04-2004 20:21

Well, you can always go tracing back through the program to find where it stores them. Ultimatly, it has to store the filenames in a variable somewhere, because the functions that automate the layout would require an array of filenames. Find out what that array is called, and find the loop that creates the page, and just add in:

echo array_name[loop_incrememter_variable];

The 'loop_incrementer_variable' is the variable defined as part of the for loop declaration (if they're using that) that is used to count the number of times the array has run.

Wes
Paranoid (IV) Mad Scientist

From: Inside THE BOX
Insane since: May 2000

posted posted 03-07-2004 02:39

The page that displays the image is just so complicated to me, that attempts to track down the name of the correct variable got me lost in a jungle of code.

However, a fresh attempt just now helped me notice a little thing called simple $id. Tried echoing that just for the hell of it and voila! Coudln't believe it was that easy.

Now, what I would like to do is truncate the file name. Currently, echo $id; will output something like 2004_01_09_137_3748_P01_G, a file name containing certain codes relevant to my personal image-management system.

If I wanted to chop any characters after the first 20, how might I go about that?


Wes
Paranoid (IV) Mad Scientist

From: Inside THE BOX
Insane since: May 2000

posted posted 03-07-2004 03:40

I hate when I ask a question then stumble on the answer by accident.

echo substr($id, 0, 19);

(Note: I realized I needed the first 19 characters, not the first 20.)

Woohoo!


bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 03-10-2004 00:41

nah you needed the first 20, just till the 19th index





.:[ Never resist a perfect moment ]:.

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 03-10-2004 08:58

nah, the third parameter of substr() is length, not 'till index. Therefore this get's him characters 0 through 18.

Wes
Paranoid (IV) Mad Scientist

From: Inside THE BOX
Insane since: May 2000

posted posted 03-10-2004 14:25

Right. Anyway, it worked. Have a look ...

I believe I have everything working pretty much the way I want it. (At least until Gallery 2 comes out and I can do some serious customizing.)

Just have to spend a lot of time now processing and adding photos.


« BackwardsOnwards »

Show Forum Drop Down Menu