Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-22-2008, 04:46 PM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Escaping

I usually don't have a problem escaping, but for some reason I can't escape this to use in a php file. A little help?

PHP Code:
$tume = array('$vbulletin->options['tum']'); 
Reply With Quote
  #2  
Old 08-22-2008, 04:51 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why don't you use PHP tags in your post?

*hint hint*
Reply With Quote
  #3  
Old 08-22-2008, 04:58 PM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Opserty View Post
Why don't you use PHP tags in your post?

*hint hint*
Lol, I'm still lost. Sorry for being so difficult. I am good at things, but when it comes to escaping, I suck.
Reply With Quote
  #4  
Old 08-22-2008, 05:06 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Read the instruction manual then. http://uk2.php.net/types.string
Reply With Quote
  #5  
Old 08-22-2008, 05:11 PM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Opserty View Post
Read the instruction manual then. http://uk2.php.net/types.string
Lol, I'm trying everything, some things don't give me errors, but the script still won't work. What am I suppose to use in my tume.php file:

Code:
$vbulletin->options['tum']
or

Code:
$vboptions[tume]
Reply With Quote
  #6  
Old 08-22-2008, 05:15 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What exactly are you trying to do? Are you trying to get the value or the actual name?

(Read the previous link and see how variables differ in single/double quotes. Note: If you want the value, there is no need to use quotes at all)
Reply With Quote
  #7  
Old 08-22-2008, 05:27 PM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Opserty View Post
What exactly are you trying to do? Are you trying to get the value or the actual name?

(Read the previous link and see how variables differ in single/double quotes. Note: If you want the value, there is no need to use quotes at all)
Ok to explain. I have a setting in my vbulletin called tum. I wish to retrieve this setting from the database and input it in place of tum. So if tum equaled 28:

$tume = array('$vbulletin->options['tum']');

Would become:

$tume = 28

So how would I go about this?

P.S. This code is going in the admin area and it's the first time I have messed around with the admin area for modifications. So I was kind of looking for a straight up answer, so I could fiddle around in the file and figure out EXACTLY where the script needs to execute. Sorry for being impatient, but if it's not in the right area to begin with the script won't work anyway so I have no idea if escaping worked. Get my drift?
Reply With Quote
  #8  
Old 08-22-2008, 07:34 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I really don't get what you mean but i am going to try.
PHP Code:
$db->query_write("UPDATE setting SET value = '" $db->escape_string($vbulletin->options['tum']) . "' WHERE varname = 'tum'");

require_once(
DIR '/includes/adminfunctions_options.php');
$vbulletin->options build_options(); 
Or

PHP Code:
$tume $vbulletin->option['tum']; 
You don't need quotes around the vbulletin options part and if you want it in a array.

PHP Code:
$tume = array($vbulletin->options['tum']); 
Reply With Quote
  #9  
Old 08-23-2008, 12:36 AM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MoT3rror View Post
I really don't get what you mean but i am going to try.
PHP Code:
$db->query_write("UPDATE setting SET value = '" $db->escape_string($vbulletin->options['tum']) . "' WHERE varname = 'tum'");

require_once(
DIR '/includes/adminfunctions_options.php');
$vbulletin->options build_options(); 
Or

PHP Code:
$tume $vbulletin->option['tum']; 
You don't need quotes around the vbulletin options part and if you want it in a array.

PHP Code:
$tume = array($vbulletin->options['tum']); 
I might try that if I need it later. For now I just used what I did in my previous modification and made it separate my info using |.
Reply With Quote
  #10  
Old 08-23-2008, 05:23 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TheInsaneManiac View Post
I might try that if I need it later. For now I just used what I did in my previous modification and made it separate my info using |.
Wait...So is $vbulletin->option['tum'] a list of values separated by a pipe? If so:
PHP Code:
$tume explode('|'$vbulletin->option['tum']); 
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:37 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.04264 seconds
  • Memory Usage 2,268KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (8)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete