![]() |
MySQL query in Template
Hi all,
I'm in the progress of making a product to stop leeching from attachments (I found a member who hot-linked to three attachments, and was leeching bandwidth) - so I've used the hook system to create a referrer check to check the url is from the forum, if not - show a message. I'm debating whether it's worth adding a DB query to find out which post the attachment is in - so I can put a link in to it (in a way forcing you to view the forum). My question is : Can you execute a MySQL query inside a template? How do I make the code required to associate the clicked attachment link with the post, then output the link for that post? Hope that makes sense..... Thanks! Jason |
- do not allow GUESTS (unregistered) to view/download attachments
- you can prevent hotlinking via htaccess |
Quote:
I tried the .htaccess version but didn't have much success so have put together a quick plugin that does the trick - and works well. Cheers Jason |
All times are GMT. The time now is 08:07 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|