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)

tamarian 06-14-2005 03:10 PM

Quote:

Originally Posted by tmhall
Thanks for the info, tamarian. I'll just use $post[userid] in the postbit instead. :)

Do you have any idea how I can solve this problem? Is there a replacement for $GLOBALS?

How about this?

$vbulletin->userinfo['buddyarray'] = $buddyarray

zetetic 06-15-2005 05:11 AM

Quote:

Originally Posted by tamarian
How about this?

$vbulletin->userinfo['buddyarray'] = $buddyarray

Hm... Actually I think I goofed up somewhere else before. $GLOBALS is working fine now.

deathemperor 06-21-2005 10:01 AM

function construct_page_nav now accepts 5 params, not just 3 as the legacy one

but I don't really know why the phpdoc only states for 3 params:

PHP Code:

// #############################################################################
/**
* Returns the HTML for multi-page navigation - based on code from 3dfrontier.com
*
* @param    integer    Total number of items found
* @param    string    Base address for links eg: showthread.php?t=99{&page=4}
* @param    string    Ending portion of address for links
*
* @return    string    Page navigation HTML
*/
function construct_page_nav($pagenumber$perpage$results$address$address2 ''

1st param: current page number
2st param: number of items per page.
the last 3 params are defined in the phpdoc above, they're just like before.


Please update all the info that users submit so that others only have to look at the fist post so that they can check for what has been changed.

Brad 06-21-2005 10:19 AM

Quote:

Originally Posted by tmhall
Yeah, I mentioned that u=$userinfo[userid] wasn't working in the postbit a few posts ago. I think we might have to wait for the documentation to find out all the new conditionals.

$userinfo did not change, it is still built in member.php take a look. The reason it didn't work in the postbit is it's not defined there, what your looking for is.

PHP Code:

$post[userid


deathemperor 06-21-2005 01:10 PM

$url => $vbulletin->url

-----------------------------------------

I can't use $vbulletin->input->clean_array_gpc as globalize()

with globalize()

globalize($_POST, array('e' => INT, 'do' => STR_NOHTML, 'iconid' => INT));

gives value to varibles $e, $do, $iconid

but with

$vbulletin->input->clean_array_gpc('p', array('e' => TYPE_UINT, 'do' => TYPE_STR, 'iconid' => TYPE_UINT));

I can't get $e, $do, $iconid

any suggestion to use $vbulletin->input->clean_array_gpc properly ?

EDIT: I figured out it turns to be $vbulletin->GPC['e'], $vbulletin->GPC['do'], $vbulletin->GPC['iconid'], am I correct ? how complex.

------------------------------------------

print_standard_error(...)
is now redundant. Instead, use
standard_error(fetch_error(...))

scotsmist 06-25-2005 06:39 PM

While looking at the changes needed for vbportal, I wanted to share what I found.

I see you have $bbuserinfo is now $vbulletin->userinfo listed, you may want to add $session is now $vbulletin->session

$session[sessionurl] for example is now $vbulletin->session->vars[sessionurl]
$session[sessionurl_js] is now $vbulletin->session->vars[sessionurl_js]

another is with the datastore caches which are unserialised in init.php

$forumcache is now $vbulletin->forumcache
$iconcache is now $vbulletin->iconcache
etc

another is $url is now $vbulletin->url
also $nozip is now $vbulletin->nozip
plus $scipt is now $vbulletin->script
and $scriptpath is now $vbulletin->scriptpath

in addition to $vbulletin->input->clean_array_gpc you can also use $vbulletin->input->clean_gpc when there is only one variable. you may wish to use something like $perpage = $vbulletin->input->clean_gpc('r', 'perpage', TYPE_UINT); so you can use $perpage in a template

the bitwise $_FORUMOPTIONS and $_USEROPTIONS have been replaced by $vbulletin->bf_ugp_forumoptions and $vbulletin->bf_ugp_useroptions

notice that HTML_SELECTED and HTML_CHECKED are not defined now

function iif() is marked as obsolete to ! (one of my personal favourites)

function bbcode_parse is now $bbcode_parser->parse

the print_standard_redirect function has changed a little and it doesn't pass the $url anymore, so you need to set $vbulletin->url first. the function also supports forceredirect, so there's no need to set $GLOBALS['forceredirect'] anymore.

mute 06-30-2005 01:29 AM

Big-board here, with the annoying questions nobody wants to answer.

I read all about the 3.5 changes on vb.com, but I didn't see anything about the query_write query_read abstraction until just now. Color me floored!

My question is, for us large sites that use MySQL replication functionality, is there anything in place currently to distribute reads among a group of servers which are replicating? I'd love to be able to easily spread reads to our slave server(s) for queries, and have the ability to pseudo load balance queries, or at least have some type of "failover", that is, if our slave server is unresponsive to remove it from the pool of available query_read capable servers.

Obviously this would be a very rudimentary form of clustering, but I'll take what I can get at this point (It's more MySQL's fault than anything else, not having master<->master replication sucks).

Ratchet 06-30-2005 03:41 PM

Does anyone know how the style vars are stored now? $style["imgdir_misc"] still works as before, but $style["title"] and some others do not.

sv1cec 07-02-2005 02:55 PM

Quote:

Originally Posted by Brad.loo
$_GET/$_REQUEST/$_POST/$_COOKIE => $vbulletin->GPC[]

I read the above, but still in the code, there are instances that vBulletin uses $_REQUEST.

Can someone shed some light on this? Based on the above, I changed a program to use $vbulletin->GPC instead of $_REQUEST and the program no longer works. Switched back to $_REQUEST and everything works fine.

I am puzzled.

I think I need to elaborate:

In the past, I was using this part of code:

PHP Code:

// ########################## REDIRECT ###############################
if ($_REQUEST['do'] == 'nextstep')
{
    
globalize($_REQUEST, array(
        
'action' => STR,
        
'done' => STR
    
));
    if (empty(
$action))
    {
        
define('CP_REDIRECT'THIS_SCRIPT '.php');
    }
    else
    {
        
define('CP_REDIRECT'THIS_SCRIPT '.php?step=' $action);
    }
    
print_stop_message('redirecting_please_wait');


Now, the code has to be changed to:

PHP Code:

if ($_REQUEST['do'] == 'nextstep')
{

    
$vbulletin->input->clean_array_gpc('r', array(
        
'action'=> TYPE_STR,
        
'done'=> TYPE_STR,
    ));

    if (empty(
$vbulletin->GPC['action']))
    {
        
define('CP_REDIRECT'THIS_SCRIPT '.php');
    }
    else
    {
        
define('CP_REDIRECT'THIS_SCRIPT '.php?step=' $vbulletin->GPC['action']);
    }
    
print_stop_message('redirecting_please_wait');


I found this after a lot of trials and errors. What's the reason for having to check for $_REQUEST['do'] in the first if, and then use $vbulletin->GPC in the next parts? Where do I use $_REQUEST and where $vbulletin->GPC????

Cloudrunner 07-02-2005 05:21 PM

Quote:

Originally Posted by sv1cec
I read the above, but still in the code, there are instances that vBulletin uses $_REQUEST.

Can someone shed some light on this? Based on the above, I changed a program to use $vbulletin->GPC instead of $_REQUEST and the program no longer works. Switched back to $_REQUEST and everything works fine.

I am puzzled.

I think I need to elaborate:

In the past, I was using this part of code:

PHP Code:

// ########################## REDIRECT ###############################
if ($_REQUEST['do'] == 'nextstep')
{
    
globalize($_REQUEST, array(
        
'action' => STR,
        
'done' => STR
    
));
    if (empty(
$action))
    {
        
define('CP_REDIRECT'THIS_SCRIPT '.php');
    }
    else
    {
        
define('CP_REDIRECT'THIS_SCRIPT '.php?step=' $action);
    }
    
print_stop_message('redirecting_please_wait');


Now, the code has to be changed to:

PHP Code:

if ($_REQUEST['do'] == 'nextstep')
{

    
$vbulletin->input->clean_array_gpc('r', array(
        
'action'=> TYPE_STR,
        
'done'=> TYPE_STR,
    ));

    if (empty(
$vbulletin->GPC['action']))
    {
        
define('CP_REDIRECT'THIS_SCRIPT '.php');
    }
    else
    {
        
define('CP_REDIRECT'THIS_SCRIPT '.php?step=' $vbulletin->GPC['action']);
    }
    
print_stop_message('redirecting_please_wait');


I found this after a lot of trials and errors. What's the reason for having to check for $_REQUEST['do'] in the first if, and then use $vbulletin->GPC in the next parts? Where do I use $_REQUEST and where $vbulletin->GPC????

Do this instead to avoid that situation:
PHP Code:

$vbulletin->input->clean_array_gpc('r', array(
    
'do' => TYPE_STR,
    
'action'=> TYPE_STR,
    
'done'=> TYPE_STR)
);

if (
$vbulletin->GPC['do'] == 'nextstep'){
    if (empty(
$vbulletin->GPC['action'])){
       
define('CP_REDIRECT'THIS_SCRIPT '.php');
    } else {
       
define('CP_REDIRECT'THIS_SCRIPT '.php?step=' $vbulletin->GPC['action']);
    }
    
print_stop_message('redirecting_please_wait');


This effectively puts the $_REQUEST['do'] into the GPC, thus removing the need for the call to any $_REQUESTs. Of course, if you are only using the $_REQUEST['do'] to navigate through your script and not calling anything else, then you can leave the $_REQUEST calls and it will remove some overhead according to KirbyDE when I asked basically the same question.

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

Marco van Herwaarden 07-30-2005 05:59 AM

I think the shorthand notations get converted to longnames: u->userid, p->post(id)

RaidenDAWG2 07-30-2005 09:32 PM

Quote:

Originally Posted by MarcoH64
I think the shorthand notations get converted to longnames: u->userid, p->post(id)

So I should modify my template/code to pass in variables with the longnames (i.e. convert u->userid) instead of the current ?u=x&t=y&p=z format I've got now on the URL?

-RD

Marco van Herwaarden 07-31-2005 09:26 AM

No, if you pass a 'u=..' on the url, i think you will end up with the userid variable, instead of just 'u' in the target script.

akanevsky 10-09-2005 01:50 PM

This should be sticky, plz tyvm.

Cap'n Steve 10-10-2005 07:03 AM

Agreed. This is really the best place to start getting familiar with 3.5.

Neutral Singh 10-10-2005 07:25 AM

Quote:

Global

$vboptions[] => $vbulletin->options[]

$vboptions[] works in vB3.5.0 too.

akanevsky 10-10-2005 01:07 PM

Quote:

Originally Posted by MrNase
Thank you :)

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

One is going to do that today, in a new thread, and the new thread will contain 15x more useful information than that of this thread's first post :)

akanevsky 10-28-2005 11:30 PM

Posted, and I think this threads should be deleted as obsolete. :)

scotsmist 10-31-2005 05:27 PM

A link to the new thread please :)

akanevsky 10-31-2005 07:49 PM

Quote:

Originally Posted by scotsmist
A link to the new thread please :)

https://vborg.vbsupport.ru/showthread.php?t=98047

FamilyCorner 11-13-2005 07:47 PM

I think I've finally found the thread that can solve my problem! :)

I have already made the change for "db" from "DB_site", but this page seems to still be having a problem:
http://www.familycorner.com/forums/contest.php3

You will see if you scroll down to where it says "Posts Today" in a purple box that the total number of posts are missing. This is what the post count is calling from:

PHP Code:

<?php
while ($user $db->fetch_array($users))
{
$username $user["username"];
echo (
"$username<br>");
}
echo (
"<br>");
while (
$user $db->fetch_array($admin))
{
$username $user["username"];
echo (
"$username<br>");
}
?>
<br>
</font>
</td>
<td align="center">
<FONT face="verdana,verdana" size="2">
<br>
<?php
$db
->data_seek(0,$users);
while (
$user $db->fetch_array($users))
{
$count $user["count"];
echo (
"$count<br>");
}
echo (
"<br>");
$db->data_seek(0,$admin);
while (
$user $db->fetch_array($admin))
{
$count $user["count"];
echo (
"$count<br>");
}
?>

What else do I need to change from the old version code to update it to work on 3.5.1?

THANK YOU!


All times are GMT. The time now is 11:21 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.01614 seconds
  • Memory Usage 1,893KB
  • 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
  • (17)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (31)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