PDA

View Full Version : How to get forumid in plugin


Andy
01-04-2010, 07:49 PM
I would like to get the forumid from the upload_accept plugin hook. In vB3 I used:

$this->foruminfo['forumid']

but that no longer works in vB4.

Does anyone know the proper variable that one could use to obtain the forumid from this hook?

Thank you.

Seven Skins
01-04-2010, 08:28 PM
<a href="https://vborg.vbsupport.ru/showpost.php?p=1939297&postcount=81" target="_blank">https://vborg.vbsupport.ru/showp...7&postcount=81</a>

Have a look here. Once you get the variable, register it, then use it in your template.

.

Andy
01-04-2010, 09:54 PM
https://vborg.vbsupport.ru/showpost.php?p=1939297&postcount=81

Have a look here. Once you get the variable, register it, then use it in your template.

.

Thank you Seven.

Unfortunately a registered variable is only useful in the template you register it for.

I need to be able to get the forumid when using the attachment manager.

Looks like I'll need to set a cookie and do it that way.

Lynne
01-04-2010, 10:11 PM
Not every attachment has a forumid associated with it, so be careful to think through what you are trying to do.

Andy
01-05-2010, 12:41 AM
Not every attachment has a forumid associated with it, so be careful to think through what you are trying to do.

Hi Lynne,

I've come to the conclusion that vB4 has disassociated the forumid from the attachment and that is why I can't verify the forumid which makes perfect sense.

My goal is to reject any uploads via the Attachment Manager that have a certain extension unless the upload is going to be in a certain forum.

I think my only hope is to parse the post once it's been submitted and if there are any attachments that are of the wrong in the wrong forum I can then delete them.

framer
01-17-2010, 12:07 PM
to replace $this->foruminfo['forumid']

try this $this->$GLOBALS['forumid']

Good luck

framer