The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Prevent a plugin from running bassed on url/script
I've been working with a plugin that runs on attachment.php at the attachment_start hook.
I'm looking for a way to prevent this plugin from executing when a user is viewing showthread.php or showpost.php. For example, a user embeds a attachment image in a post using "" I don't want the plugin to run. I've tried using a this_script conditional to check for showthread or showpost, however that isn't working. I'm not an expert at this, but my assumption is this_script won't work because even though they are viewing showthread, attachment.php is still called in the link which makes this_script = attachment. Can anyone suggest another way to prevent the plugin from running in this situation? Thanks in advance! |
#2
|
||||
|
||||
Check the referrer - although this can be forged, I don't think you really care for this purpose.
|
#3
|
|||
|
|||
Checking the referrer won't work in this case since that would disable the plugin any time they clicked a link to view a full size of the attached image as well as disabling it when embedded with the image tag.
|
#4
|
||||
|
||||
If this_script doesnt work then how about defining your own constant in the showthread and showpost start hooks, and then checking for that in the attachment start hook.
|
#5
|
|||
|
|||
I didn't think a constant defined in showthread would get passed though to the attachment script..I'll have to give that a try.
--------------- Added [DATE]1212703778[/DATE] at [TIME]1212703778[/TIME] --------------- Gave the define a try, and as I suspected same problem as this_script The define made in showthread start hook, isn't passed on to the attachment start hook back to the drawing bored |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|