Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Adding fields, need help finishing.... Details »»
Adding fields, need help finishing....
Version: , by SuperG SuperG is offline
Developer Last Online: Feb 2005 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 10-09-2002 Last Update: Never Installs: 0
 
No support by the author.

Ok, I'm needing to add a few fields to New Threads.

This is what I've done thus far:
I've added the fields I need in the thread table in the vb database.

In showthread.php, I added this:
PHP Code:
$trader_price $thread['trader_price'];
    
$trader_shipping $thread['trader_shipping'];
    
$trader_payment $thread['trader_payment'];
    
$trader_man $thread['trader_man'];
    
$trader_trade $thread['trader_trade'];
    
$trader_condition $thread['trader_condition'];
    
$trader_age $thread['trader_age']; 
and added the fields to newthread.php, which would look like this:
PHP Code:
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,
postusername,postuserid,lastposter,dateline,iconid,
visible,attach,trader_price,trader_shipping,trader_payment,
trader_man,trader_trade,trader_condition,trader_age) VALUES (NULL,'"
.addslashes(htmlspecialchars($subject))."','".time()."','$forumid','1','0','".addslashes($postusername)."',
'
$bbuserinfo[userid]','".addslashes($postusername)."','".time()."','$iconid','$visible','$attachcount','$trader_price','$trader_shipping','$trader_payment','$trader_man','$trader_trade',
'
$trader_condition','$trader_age'"); 

Now, when I submit this stuff, its not writing to the database, so I really don't know if the other parts are working correctly. So, if anyone has any suggestions, please me know. Thanks in advance!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 10-09-2002, 01:20 AM
SuperG SuperG is offline
 
Join Date: Dec 2001
Location: Cookeville, TN
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

UPDATE:
I get this error:
PHP Code:
Database error in vBulletin 2.2.7:

Invalid SQLINSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach,trader_price,trader_shipping,trader_payment,trader_man,trader_trade,trader_condition,trader_ageVALUES (NULL,'You can\'t see this either','1034129905','14','1','0','SuperG','1','SuperG','1034129905','1','1','1','1200.00','00.00','Check','WDP','Yes','Brand New','1-3 Months'
mysql errorYou have an error in your SQL syntax near '' at line 1

mysql error number
1064

Date
Tuesday 08th of October 2002 08:18:25 PM
Script
: [url]http://www.southernpaintball.com/forums/forums/newthread.php[/url]
Referer: [url]http://www.southernpaintball.com/forums/newthread.php?action=newthread&forumid=14[/url] 
Reply With Quote
  #3  
Old 10-09-2002, 02:00 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Easy fix:

Change this:

'You can't see this either'

To this:

'You cannot see this either'

You had 2 ' symbols in the wrong place!

You cannot use "can't" because the ' symbol conflicts with the query line.
Reply With Quote
  #4  
Old 10-09-2002, 02:10 AM
SuperG SuperG is offline
 
Join Date: Dec 2001
Location: Cookeville, TN
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok then, that was the subject of the post so it shouldn't matter, i mean, regular posts have apostrophe's in them.

Any other suggestions?
Reply With Quote
  #5  
Old 10-09-2002, 02:18 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know regular posts have apostrophe's in them, but you are putting that in a query - each query variable has a ' around them to delineate them, but you have a ' inside 2 ' within a variable which will cause a mysql syntax error. PHP thinks your variable is 'You can' because the ' in can't has ended that variable, but there is no comma so the syntax error occurs.
Reply With Quote
  #6  
Old 10-09-2002, 02:18 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just make the changes, and the syntax error should be resolved.
Reply With Quote
  #7  
Old 10-09-2002, 02:27 AM
SuperG SuperG is offline
 
Join Date: Dec 2001
Location: Cookeville, TN
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lemme try dat..i'll post again.....
Reply With Quote
  #8  
Old 10-09-2002, 02:39 AM
SuperG SuperG is offline
 
Join Date: Dec 2001
Location: Cookeville, TN
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I went back to the original newthread.php file and everything worked. THAT has the subject in it, so its not what you suggested. I added my other values back, and it again does not work. So, its something with the new stuff I'm adding which, but I can't find a problem with it. Any other suggestions?
Reply With Quote
  #9  
Old 10-09-2002, 02:52 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahhh... I see what you mean... you're right... I thought you had that statement in a query in a PHP file... Should have read your posts better...

Try this:

Find:

PHP Code:
'$trader_age'"); 
Change to:

PHP Code:
'$trader_age')"); 
I think you may be missing a bracket ) symbol there.
Reply With Quote
  #10  
Old 10-09-2002, 03:06 AM
SuperG SuperG is offline
 
Join Date: Dec 2001
Location: Cookeville, TN
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, that fixed the problem with writing it to the database.

Now, with what I have posted above, its not calling it up from the database. Any suggestions there?
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 10:54 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.04686 seconds
  • Memory Usage 2,312KB
  • Queries Executed 23 (?)
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
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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
  • (9)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