Nice Site Vilkacis.

The place for anything at all...
Post Reply
User avatar
Baphnedia
Moderator
Moderator
Posts: 2326
Joined: Sun Dec 26, 2004 11:23 pm
Gender: Male
Location: Portland, OR

Nice Site Vilkacis.

Post 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?
Everyday should be Towel Day.
Sekrit Identity: What?
Paradice Games: .com, Forums & Facebook
User avatar
Vilkacis
Legendary
Legendary
Posts: 1974
Joined: Sun Mar 27, 2005 10:08 pm
Location: Washington

Re: Nice Site Vilkacis.

Post 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
User avatar
Baphnedia
Moderator
Moderator
Posts: 2326
Joined: Sun Dec 26, 2004 11:23 pm
Gender: Male
Location: Portland, OR

Post 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...
Everyday should be Towel Day.
Sekrit Identity: What?
Paradice Games: .com, Forums & Facebook
User avatar
Lupin
Legendary
Legendary
Posts: 6129
Joined: Sun Jun 19, 2005 11:26 pm
Custom Title: Ninja BOFH
Gender: Male
Location: 29°30.727'N 98°35.949'W
Contact:

Re: Nice Site Vilkacis.

Post 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.)
I don't suffer from lycanthropy, I enjoy every minute of it! Image
User avatar
Baphnedia
Moderator
Moderator
Posts: 2326
Joined: Sun Dec 26, 2004 11:23 pm
Gender: Male
Location: Portland, OR

Post 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!
Everyday should be Towel Day.
Sekrit Identity: What?
Paradice Games: .com, Forums & Facebook
Post Reply