vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Small bit of coding and database help (https://vborg.vbsupport.ru/showthread.php?t=115765)

Zowners 05-16-2006 03:00 PM

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?

hambil 05-16-2006 03:19 PM

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?

Zowners 05-17-2006 03:43 AM

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:
http://www.thehmcs.com/idea.jpg

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.

Guest190829 05-17-2006 03:47 AM

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)

Zowners 05-17-2006 04:20 AM

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.

Zowners 05-18-2006 04:23 AM

Anyone?

Zowners 05-19-2006 05:16 PM

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


All times are GMT. The time now is 06:43 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.01052 seconds
  • Memory Usage 1,731KB
  • 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
  • (1)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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