vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Trying to fetch forumid unsuccessful (https://vborg.vbsupport.ru/showthread.php?t=223345)

paul41598 09-16-2009 04:15 PM

Trying to fetch forumid unsuccessful
 
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.

PHP Code:

$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...

PHP Code:

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.

PHP Code:

$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!


All times are GMT. The time now is 05:55 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01032 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete