Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 05-16-2006, 03:00 PM
Zowners Zowners is offline
 
Join Date: Dec 2005
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Small bit of coding and database help

Ok, I installed this onto my forum. After a bit of thought I added 3 radio buttons that appear after the message area. Each of them has a name of "GNU", and they have values of "1", "2" and "3" .

Basically I want to know how I set it up so that this information is stored the database (I know nothing about sql and don't want to screw with it and find out something the hard way), and how I can make an if-conditional work with this database entry when someone views a tutorial or edit's it?
Reply With Quote
  #2  
Old 05-16-2006, 03:19 PM
hambil's Avatar
hambil hambil is offline
 
Join Date: Jun 2004
Location: Seattle
Posts: 1,719
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zowners
Ok, I installed this onto my forum. After a bit of thought I added 3 radio buttons that appear after the message area. Each of them has a name of "GNU", and they have values of "1", "2" and "3" .

Basically I want to know how I set it up so that this information is stored the database (I know nothing about sql and don't want to screw with it and find out something the hard way), and how I can make an if-conditional work with this database entry when someone views a tutorial or edit's it?
Could you explain in a little more detail what you are trying to do?
Reply With Quote
  #3  
Old 05-17-2006, 03:43 AM
Zowners Zowners is offline
 
Join Date: Dec 2005
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well basically its a tutorial system where users can post their own. When they post their own, right below the message box I have made 3 radio buttons as per this image:


Just in case its needed, here's the template code (Of the neccessary part):
HTML Code:
			<br />
			<input type="radio" name="GNU" value="1" /> <b>Full Release</b> - Any site/person may use <b>and</b> edit your tutorial.
			<br />
			<input type="radio" name="GNU" value="2" /> <b>Partial Release</b> - Any site/person may use yout tutorial.
			<br />
			<input type="radio" name="GNU" value="3" /> <b>Not Released</b> - You only authorise The HMCS to use and make neccessary edits to this tutorial.
What I want is the choice the user makes to be saved along with the tutorial and its title, etc.

When they click the edit button, the choice they made should show up again, and when a user views the tutorial, I want an if-conditional to make one of three images show depending on the choice the author made.

For those last two all I need to know what it would be in the if... like <if condition="$gnu=1"> sorta thing. If I know that I can make the templates.
Reply With Quote
  #4  
Old 05-17-2006, 03:47 AM
Guest190829
Guest
 
Posts: n/a
Default

You would have to add a column to the tutorial table, and then edit the query retrieving the information, and then you will need to display the information by editing the tutorial page accordingly.

(As I've never used this system, I have to be somewhat vague on it)
Reply With Quote
  #5  
Old 05-17-2006, 04:20 AM
Zowners Zowners is offline
 
Join Date: Dec 2005
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't want to be messing around with the database unless I have an idea of how to do what I want to. (Command wise)

Nobody knows?.. Like I know I can open up mysql and type in something like create blah or delete blah... I just need to know what do do with that, and how to reference it in the tutorials templates using an if.
Reply With Quote
  #6  
Old 05-18-2006, 04:23 AM
Zowners Zowners is offline
 
Join Date: Dec 2005
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone?
Reply With Quote
  #7  
Old 05-19-2006, 05:16 PM
Zowners Zowners is offline
 
Join Date: Dec 2005
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would I also need to change the query for submitting the information?
Reply With Quote
Reply

Thread Tools
Display Modes

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 05:55 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.04470 seconds
  • Memory Usage 2,211KB
  • 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
  • (1)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (6)postbit_onlinestatus
  • (7)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete