vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   what function replaces... (https://vborg.vbsupport.ru/showthread.php?t=144958)

wolfe 04-15-2007 07:42 PM

what function replaces...
 
what function replaced globalize() it was in vb3.0 i am upgrading a mod to 3.6.x but cant get around this.


this was the old function

Quote:

// ###################### Start globalize #######################
function globalize(&$var_array, $var_names)
{
global $_FILES;
// takes variables from a $_REQUEST, $_POST style array
// and makes them into global variables

foreach ($var_names AS $varname => $type)
{
if (is_numeric($varname)) // This handles the case where you send a variable in without giving its type, i..e. 'foo' => INT
{
$varname = $type;
$type = '';
}
if (isset($var_array["$varname"]) OR $type == 'INT' OR $type == 'FILE')
{
switch ($type)
{
// integer value - run intval() on data
case 'INT':
$var_array["$varname"] = intval($var_array["$varname"]);
break;

// html-safe string - trim and htmlspecialchars data
case 'STR_NOHTML':
$var_array["$varname"] = htmlspecialchars_uni(trim($var_array["$varname"]));
break;

// string - trim data
case 'STR':
$var_array["$varname"] = trim($var_array["$varname"]);
break;

// file - get data from $_FILES array
case 'FILE':
if (isset($_FILES["$varname"]))
{
$var_array["$varname"] = $_FILES["$varname"];
}
break;

// Do nothing, i.e. arrays, etc.
default:
}
$GLOBALS["$varname"] = &$var_array["$varname"];
}
}
}

Marco van Herwaarden 04-16-2007 06:27 AM

This has been depreciated and are now replaced by the GPC functions.

You will find some threads on migrating 3.0 code to 3.5 in our articles section with more information.


All times are GMT. The time now is 01:03 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.01248 seconds
  • Memory Usage 1,714KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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