vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   List of changed var/array/function names (https://vborg.vbsupport.ru/showthread.php?t=82632)

Kadence 07-07-2005 01:51 AM

The parameters for the print_forum_chooser() function in /includes/adminfunctions.php have changed.

Old (vB 3.0.7):
PHP Code:

function print_forum_chooser($name 'forumid'$selectedid = -1$topname NULL$title NULL$displaytop 1$multiple 0$displayselectforum 0

New (vB 3.5 Beta 3):
PHP Code:

function print_forum_chooser($title$name$selectedid = -1$topname null$displayselectforum false$multiple false

The $title parameter has moved from the 4th parameter to the 1st, $displayselectforum and $multiple have swapped places, and the $displaytop parameter has been deleted.

MrNase 07-26-2005 07:00 PM

It took me a while to figure out:

PHP Code:

$id intval($_REQUEST['id']); 

has become:

PHP Code:

    $vbulletin->input->clean_array_gpc('r', array(
        
'id'=> TYPE_UINT
    
));
    
$id $vbulletin->GPC['id']; 


Andreas 07-26-2005 07:02 PM

$id is empty because you must use $vbulletin->GPC['id'] :)

Btw: For just one variable, it doesn't make too much sense to use clean_array_gpc().

MrNase 07-26-2005 07:09 PM

I edited my above post to add another example so that someone who's as stupid as me understands it :)


vBulletin provides this functions so I'll use them ;)

Andreas 07-26-2005 07:14 PM

Easier approach & less overhead:
PHP Code:

$id $vbulletin->input->clean_gpc('r''id'TYPE_UINT); 


MrNase 07-26-2005 07:27 PM

Thank you :)

One should edit the first post of this thread and add all usefull information :)

MrNase 07-27-2005 09:10 PM

What happened to $_FILES ?

What would this code look like:
PHP Code:

$imagesize getimagesize($_FILES['src']['tmp_name']); 


Marco van Herwaarden 07-28-2005 03:15 AM

You would be using clean_gpc with a 'f' as the first parameter.

Erwin 07-29-2005 11:51 AM

Quote:

Originally Posted by KirbyDE
Easier approach & less overhead:
PHP Code:

$id $vbulletin->input->clean_gpc('r''id'TYPE_UINT); 


Interesting. :)

RaidenDAWG2 07-30-2005 04:35 AM

These new globalize things are driving me nuts here.

I used to have something that looked like this in 3.0.x...

PHP Code:

if(isset($_POST['do']))
{
    
$do=$_POST['do'];
}
if(isset(
$_GET['u']))
{
    
$spammerid=$_GET['u'];
}
elseif(isset(
$_POST['u']))
{
    
$spammerid=$_POST['u'];
}
if(isset(
$_GET['t']))
{
    
$threadid=$_GET['t'];
}
elseif(isset(
$_POST['t']))
{
    
$threadid=$_POST['t'];
}
if(isset(
$_GET['p']))
{
    
$postid=$_GET['p'];
}
elseif(isset(
$_POST['p']))
{
    
$postid=$_POST['p'];


Pretty standard $_GET/$_POST structure that reads in either the get or post based on which step it is (it's a spam killing type thing, pops up a window with some options to confirm, then submits and does its thing).

So in trying to convert it over to 3.5 RC1, I tried this...

PHP Code:

$vbulletin->input->clean_array_gpc('g', array(
    
'do' => TYPE_STR,
    
'u'=> TYPE_INT,
    
't'=> TYPE_INT,
    
'p'=> TYPE_INT)
);
if(isset(
$vbulletin->GPC['do']))
{
    
$do $vbulletin->GPC['do'];
}

if(isset(
$vbulletin->GPC['u']));
{
    
$spammeruserid $vbulletin->GPC['u'];
}

if(isset(
$vbulletin->GPC['p']));
{
    
$spammerpostid $vbulletin->GPC['p'];
}

if(isset(
$vbulletin->GPC['t']));
{
    
$spammerthreadid $vbulletin->GPC['t'];


So...yeah...where am I going wrong here? Any help you guys can give me would be much appreciated :D

Thanks,
-RD


All times are GMT. The time now is 04:35 PM.

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.01204 seconds
  • Memory Usage 1,766KB
  • 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
  • (9)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete