View Single Post
  #9  
Old 05-22-2011, 12:40 AM
ZERO <ibis> ZERO <ibis> is offline
 
Join Date: Dec 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could this be the problem:

PHP Code:
foreach($sbusergroups as $sbgroup)
    {
        
$sbgroupint intval($sbgroup); 
Once again the code will run fine it it is fed
PHP Code:
$userdata->fetch_field('membergroupids'
from useradmin_update_save which suggests that the problem is not in this part but in the sql of getting membergroupids directly from the database.

--------------- Added [DATE]1306036694[/DATE] at [TIME]1306036694[/TIME] ---------------

I have even tried:

Code:
$membergroupids = fetch_membergroupids_array($user, false);
still not working correctly... no errors I am making the changes directly in the function directly without using the hook to avoid any complications. I know the above function should be working as it is used as part of the default vb code within the same function.

but then doing:

PHP Code:
$sbusergroups $sbmemgroups;

foreach(
$sbusergroups as $sbgroup)
    {
        
$sbgroupint intval($sbgroup); 
does nothing

however from useradmin_update_save I can do:

PHP Code:
$sbmemgroups $userdata->fetch_field('membergroupids');

$sbusergroups explode(","$sbmemgroups);

foreach(
$sbusergroups as $sbgroup)
    {
        
$sbgroupint intval($sbgroup); 
and that works without any problem... all I want is to be able to get the member groups of the user in paidsub_build and process it though:
PHP Code:
foreach($sbusergroups as $sbgroup)
    {
        
$sbgroupint intval($sbgroup); 
just as I am able to do from useradmin_update_save

--------------- Added [DATE]1306050752[/DATE] at [TIME]1306050752[/TIME] ---------------

I think there may be a way to get the output I want via the fetch_membergroupids_array function but I do not know how to use it.

As stated above as long as I can get something that works as the below does but for paidsub_buid I am good:
PHP Code:
$sbmemgroups $userdata->fetch_field('membergroupids');

$sbusergroups explode(","$sbmemgroups);

foreach(
$sbusergroups as $sbgroup)
    {
        
$sbgroupint intval($sbgroup); 
--------------- Added [DATE]1306057439[/DATE] at [TIME]1306057439[/TIME] ---------------

Ok so here is what I did to test this out:

I fed the data directly from txt files so that I could see that the functions run correctly. The program grabs no data externally just runs identical code on the paidsub_build hook and the useradmin_update_save hook.

When run from the paidsub_build it never runs completely but useradmin_update_save works. They both use exactly the same code. Example:

PHP Code:
$sbmemgroups2 file_get_contents('data2.txt');
    
$sbusergroups explode(","$sbmemgroups2);

foreach(
$sbusergroups as $sbgroup)
    {
        
$sbgroupint intval($sbgroup);

if (
$sbgroupint == 16)
        {
            
$sbpaid true;
        }

The contents of data2.txt are not changed. When run via useradmin_update_save returns true and when run via paidsub_build returns false...
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01246 seconds
  • Memory Usage 1,805KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (7)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete