The vB Geek

Go Back   The vB Geek > vB Geek Modifications > Tutorials

Tutorials Tutorials and articles on using vB Geek stuff.

Advertisement
  Learn how to remove ads

Comment
 
Tutorial Tools Display Modes
GARS: Module making 102
GARS: Module making 102
Published by The Geek
02-22-2006
Default Edit stage


The only real difference to the edit stage is in the way we retieve the values that the admin has set.

first, we grab the values the admin has set:
PHP Code:
$items $settings['my_rating_settings']; 
Then we check that it is indeed an array. Otherwise it means that the admin hasnt set ANY values

PHP Code:
        if (is_array($items))
        { 
Then we start pasting together a select drop down combo box full of the options the admin has created:
PHP Code:
$output .= "Rating: <SELECT name=\"custom1[my_rating]\">"
Note how we APPEND it to the output variable?!?

Now we loop through our items array and create the options:
PHP Code:
            foreach($items as $arraykey => $arrayvalue)
            {
                if (
$values['my_rating'] == $arraykey)
                {
                 
$selected "selected=\"selected\"";
                }
                else
                {
                 
$selected "";
                }
                
$output .= "<OPTION value=\"$arraykey\" $selected >$arrayvalue</OPTION>";
            } 
Notice how we also check the $values['my_rating']? If there IS a value in there, it means that the thread is getting edited. It makes sense to set the drop down box to what the user already had selected

Finally, we end the select HTML
PHP Code:
            $output .="</SELECT>";
        } 
Tutorial for
GARS

Contents

Tutorial Tools
Show Printable Version  Email this Page 

<<  <    Next Page: Persist stage (Page 4 of 7)    >  >>
Comment

Tutorial 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

Similar Threads
Tutorial Tutorial Starter Category Comments Last Post
GARS: Module making 101 The Geek Tutorials 1 08-27-2008 10:01 AM
making a gab block for gars benj Geek Advertising Banner System 12 08-21-2006 08:42 AM
Does anyone have a GARS module that allows an image to be loaded in the module... FRAiD Geek Article and Review System 6 02-11-2006 09:57 AM
If I am using GARS for game reviews, and start making reviews and add new modules... FRAiD Geek Article and Review System 1 02-10-2006 04:57 PM
yes I know....another one making suggestions ;) effectica GeekMart 1 02-08-2006 06:05 PM


All times are GMT. The time now is 09:33 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

Tutorial powered by GARS 2.1.9 ©2005-2006