The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
$GLOBALS['forumid']
i'm trying to use $GLOBALS['forumid'] at hook attachment_start and not working .
any idea ? |
#2
|
||||
|
||||
$GLOBALS[] is a "superglobal" so it should be available everywhere.
What is it you are trying to do, you did not explain to much, also the full code you are using might help. |
#3
|
|||
|
|||
code at attachment_start to check attachments forumid before download
PHP Code:
|
#4
|
||||
|
||||
That still does not show what it is you are trying to do, what is the full code?
|
#5
|
|||
|
|||
the full code
PHP Code:
|
#6
|
|||
|
|||
The forumid global will only be available if there is a -f or -forum parameter, and there isn't for an attachment. There doesn't seem to be any way to do what you want to do in a plugin unless you do your own query to find out what forum the postid or attachmentid is related to (if you look at attachment.php and search for 'attachment_start' you can see what's going on there).
Of course if you don't mind modifying the php files you could insert your code in attachment.php somewhere after the query has been done. Then you would use $attachmentinfo['forumid'] instead of the global. |
#7
|
|||
|
|||
maybe query is the best way
so, what query will look like ? |
#8
|
|||
|
|||
Well, I haven't tried it but I guess it would look like the one that's in attachment.php, but you don't need to read everything since you only need the forumid. So maybe:
PHP Code:
|
#9
|
|||
|
|||
Let me try and feed you back
--------------- Added [DATE]1391811107[/DATE] at [TIME]1391811107[/TIME] --------------- you forget to add ")" at the end of forumid array That's work exactly, thank you ! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|