View Full Version : Trying to fetch forumid unsuccessful
paul41598
09-16-2009, 04:15 PM
So I have this php page I'm working on... a mod. I've included global.php... everything works on my mod except I'm trying to redirect back to forumdisplay after a database insertion happens.
$vbulletin->url = "forumdisplay.php?" .$vbulletin->session->vars['sessionurl']."f=" .$foruminfo['forumid'];
However it always says "Invalid Forum specified. If you followed a valid link, please notify the administrator" and the address bar says f= but doesnt have the ID after it...
I've also tried:
- $forum['forumid']
- $threadinfo['forumid']
- $thread['forumid']
None of which give me results. Any ideas?
Lynne
09-16-2009, 04:38 PM
Well, exactly what forumid is being passed, if any? Where do you define the forumid and what do you call it? A php page that you create doesn't 'belong' to a forum, so you need to pass the variable or define it.
paul41598
09-16-2009, 04:40 PM
i guess nothing then... I basically want it to redirect to whatever forum I was in currently.
How can I pass it?
Lynne
09-16-2009, 05:17 PM
That depends. How are you going from the forum to this page? If it's by a form, you can pass it as a hidden variable in the form. If just by a link, you can pass it in the url.
paul41598
09-16-2009, 05:37 PM
I see what your saying I think... ok so I appended this to my button I'm clicking on..
&forumid=$foruminfo[forumid] and I can see the ID reflect now when u hover over the button/link.
So that part works. I'm stuck in the .php page tho. Using $vbulletin->GPC['forumid'] in the redirect doesnt work. What am I missing here...
if ($_REQUEST['do'] == 'add')
{
// retrieve gpc data
$vbulletin->input->clean_array_gpc('r', array(
'entry_id' => TYPE_UINT,
'type' => TYPE_STR,
'forumid' => TYPE_INT,
));
switch ($vbulletin->GPC['type'])
{
case 'thread':
{
if (!$vbulletin->options['vbfvs_enabled'])
{
print_no_permission();
}
$vbulletin->url = "forumdisplay.php?" .$vbulletin->session->vars['sessionurl']."f=" . $vbulletin->GPC['forumid'];
}
break;
Gio~Logist
09-16-2009, 05:39 PM
The following are the globally used variables for forumid.
$threadinfo[forumid] $foruminfo[forumid] $_REQUEST['f']
paul41598
09-16-2009, 06:04 PM
I got it finally, was missing the input hidden part of it... thanks everyone!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.