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 101
GARS: Module making 101
Published by The Geek
02-22-2006
Default Introduction

Module creation in GARS is actually VERY simple once you get your head around the framework. If you know a tad bit of HTML and a tad bit of PHP, obs your uncle and GARS is your friend.

In this Tutorial, Ill introduce you to making your own modules that allow you to easily grab extra data and display it. Please note that this is a bare bones example with little fluff designed to show you a BARE minimal approach.

It is also to try and help a user that was asking for this functionality

What Ill do is create a module that will allow users to select a rating for the imaginary 'movie' they are rating. In essence, all we will be doing is providing a combo box at edit/new thread time, capturing the input and then displaying the results when someone reads the entry.

Make sure you clean the input!

Here is the code in its entirety:
PHP Code:
<?php
if ($stage == "edit")
{
$output .= "Rating: <SELECT name=\"custom1[my_rating]\">
<OPTION value=\"G\">G - General Audiences</OPTION>
<OPTION value=\"PG\">PG - Parental Guidance</OPTION>
<OPTION value=\"PG13\">PG13 - Children under 13 are too cute for this movie</OPTION>
<OPTION value=\"R\">R - Under 17's not admitted without parents</OPTION>
<OPTION value=\"X\">X - It marks the spot</OPTION>
</SELECT>"
;
}
elseif(
$stage == "persist")
{
$my_rating $this->vb->GPC['custom1']['my_rating'];
$values['my_rating'] = $my_rating;
}
elseif(
$stage == "display")
{
$title "Rating";
$bits "<tr><td class=\"alt1\" align=\"center\">" $values['my_rating'] . "</td></tr>";
eval(
'$output.="' fetch_template('GARS_mod_container') . '";');
}
 
?>
Now lets take it apart

Tutorial for
GARS

Contents

Tutorial Tools
Show Printable Version  Email this Page 

<< <    Next Page: Stages (Page 1 of 6)    >  >>
  #1  
By Origin2 on 08-27-2008, 10:01 AM
Default

wow thanks useful stuff ^^
Reply With Quote
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
making a gab block for gars benj Geek Advertising Banner System 12 08-21-2006 08:42 AM
Problem with the module from the Tutorial 101 trana Geek Article and Review System 4 03-28-2006 06:37 AM
GARS: Module making 102 The Geek Tutorials 0 02-22-2006 08:00 PM
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


All times are GMT. The time now is 12:41 PM.


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

Tutorial powered by GARS 2.1.9 ©2005-2006