vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   My bad coding. (https://vborg.vbsupport.ru/showthread.php?t=66471)

dstruct2k 06-24-2004 04:50 AM

My bad coding.
 
1 Attachment(s)
I guess I need sleep... This code looks right to me, but PHP isn't liking it.



Note: The list I'm altering is SPACE delimited. List looks like this:
Code:

1 15 51 68 91

assassingod 06-24-2004 04:56 AM

What the problem you are receiving?

Xenon 06-24-2004 11:19 AM

instead of:
PHP Code:

        $data str_replace("$userid"" ""$data");
        
$data str_replace("  "" ""$data"); 

you might want to use that (as userid's can have more than just one number ;)

PHP Code:

        $data str_replace($userid "' '$data ");
        
$data trim(str_replace('  '' '$data)); 


dstruct2k 06-25-2004 04:38 AM

Thanks, Xenon, but the first and last ID won't be surrounded by spaces, will this be able to use those too?


Plus -- My queries aren't working. Returning:
Code:

Fatal error: Call to a member function on a non-object in /forums/includes/functions_vbevents.php on line 17

dstruct2k 06-25-2004 04:52 AM

Nevermind... Forgot to global $DB_site. ;)

Xenon 06-25-2004 10:45 AM

Yes, as you can see i added spaces around the $data in the replace function, so it will work :)


All times are GMT. The time now is 06:09 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.01423 seconds
  • Memory Usage 1,719KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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