Page 1 of 1

Nice Site Vilkacis.

Posted: Wed Sep 07, 2005 10:56 pm
by Baphnedia
I was just over browsing your site... I didn't realize you'd made one until you changed your signature. How is it that you have your 'latest article' and other 'latest' tags in your signature?

Re: Nice Site Vilkacis.

Posted: Wed Sep 07, 2005 11:09 pm
by Vilkacis
Originally I made a php script that polled the database for the latest article/gallery item and output an image. I then linked to the script in my sig using a trick to fool phpBB into thinking it was an image (just stick /fake.png on the end, or whatever filetype is appropriate).

However, this was causing too many connections to my database (one connection every time someone saw my sig. Ouch). So, what I did instead was make an update script that saved the images to a folder. I then linked directly to the images. All I have to do is run the update script everytime I make a new article or gallery item.

It's not a complicated script. It's a bit messy (no comments, inefficient, etc.), but you can take a look (Note: I deleted some sensitive database connection information at the top). You'll also have to make sure you have permissions set correctly on the image files you are writing if you wish to output them correctly.

If you want more detail or for me to explain any part of the script, just ask.

-- Vilkacis

Posted: Wed Sep 07, 2005 11:39 pm
by Baphnedia
That time may come... I have so many things I could use something like that for...ewww....

*thinks*
Latest Article
Latest/Random Picture
Latest Review
etc etc etc...
Random CD Market entry... hrm...

Re: Nice Site Vilkacis.

Posted: Thu Sep 08, 2005 1:53 am
by Lupin
Vilkacis wrote:However, this was causing too many connections to my database (one connection every time someone saw my sig. Ouch). So, what I did instead was make an update script that saved the images to a folder. I then linked directly to the images. All I have to do is run the update script everytime I make a new article or gallery item.
That's pretty much how the counter in my sig works, but since I have control of server and the db, the connection it makes is persistant (don't do this on shared hosting or you run the risk of making too many connections.)

Posted: Thu Sep 08, 2005 9:21 am
by Baphnedia
Sounds good - simple answer.... I won't. Hehe. I'm on a shared server, and I only piss off the other webmasters on it infrequently. I'd like to keep it that way.

Thanks for the help!