PDA

View Full Version : singod_'s Module Generator v1.0.0. Beta!


Ff7Cloud0 99
02-02-2009, 09:42 PM
This system will save some people time by generating a module based upon the values you enter in the generation form.

A picture of the generator:
http://i39.tinypic.com/2iax7at.jpg

The values I have entered as a preview will be generated as a Cascade Style Sheet "CSS" code like so:
#Module {
border: 1px solid #CCC;
width: 150;
height: 200;
background-color: red;
text-align: center;
}

.Content {
border-top: 1px solid #CCC;
height: 200;
background-color: green;
text-align: left;
}

The following code above can be used like this on your webpage:

<style type="text/css">
#Module {
border: 1px solid #CCC;
width: 150;
height: 200;
background-color: red;
text-align: center;
}

.Content {
border-top: 1px solid #CCC;
height: 200;
background-color: green;
text-align: left;
}
</style>
<body>
<div id="Module">
Module Name (Top)
<div class="Content">
Content inside the module!
</div>
</div>
</body>


Which would create the following module:
http://i44.tinypic.com/orulfr.jpg

How can you use this? Simple.
Make a file in your root directory named "build.php" and save this in it:

<?php
$div = $_POST['div'];
$border = $_POST['border'];
$width = $_POST['width'];
$height = $_POST['height'];
$bg = $_POST['bgcolor'];
$text = $_POST['talign'];
$diva = $_POST['diva'];
$bordera = $_POST['bordera'];
$heighta = $_POST['heighta'];
$bga = $_POST['bgcolora'];
$texta = $_POST['taligna'];

echo "#$div {<br>";
echo " border: 1px solid $border;<br>";
echo " width: $width; <br>";
echo " height: $height; <br>";
echo " background-color: $bg; <br>";
echo " text-align: $text; <br>";
echo "} <br>";
echo "<br>";
echo ".$diva {<br>";
echo " border-top: 1px solid $bordera;<br>";
echo " height: $heighta; <br>";
echo " background-color: $bga; <br>";
echo " text-align: $texta; <br>";
echo "} <br>";

?>


Then make either a .php or a .html, .htm file and place this in it and save (doesnt matter what u name it as long as it has the above extensions):

<html>
<head>
<title>Module Builder v1.0.0. by singod_</title>
<style type="text/css">
* {
font-family:arial;font-size:15px;margin:0 auto;
}
p.notice {
background:#CCC;border:1px solid black;
}
table {
background:#CCC;border:1px solid black;
width: 400px;
}
input:hover {
background:yellow;
}
</style>
</head>
<body>
<p class="notice" align="center">This module generator is used for quick generation of styled modules to place on your webpage! <font color="yellow"><br>Beta! by singod_</font></p>
<br><br>
<table border="0" cellspacing="0" cellpadding="0">
<form action="build.php" method="post">
<tr>
<td align="center">
<font color="blue">Div Name:</font><br> <input type="text" name="div"></input>
</td>
</tr>
<tr>
<td align="center">
Border Color:<br><input type="text" name="border"></input>
</td>
</tr>
<tr>
<td align="center">
Width:<br> <input type="text" name="width"></input>
</td>
</tr>
<tr>
<td align="center">
Height:<br> <input type="text" name="height"></input>
</td>
</tr>
<tr>
<td align="center">
Background Color:<br> <input type="text" name="bgcolor"></input>
</td>
</tr>
<tr>
<td align="center">
Text-Align:<br> <input type="text" name="talign"></input>
</td>
</tr>
<tr>
<td align="center">
<font color="red">Div Class:</font><br> <input type="text" name="diva"></input>
</td>
</tr>
<tr>
<td align="center">
Border-Top Color:<br><input type="text" name="bordera"></input>
</td>
</tr>
<tr>
<td align="center">
Height:<br> <input type="text" name="heighta"></input>
</td>
</tr>
<tr>
<td align="center">
Background Color:<br> <input type="text" name="bgcolora"></input>
</td>
</tr>
<tr>
<td align="center">
Text-Align:<br> <input type="text" name="taligna"></input>
</td>
</tr>
<tr>
<td align="right">
<input type="submit" value="Generate Module" />
</td>
</tr>
</form>
</table>
</body>
</html>


Note:
If you are familiar with CSS and HTML as well as PHP. Please feel free to customize the system to your likings, I made this for fun and to help some beginning web designers.

Thanks,
Cloud

Sherpa
05-28-2009, 06:22 PM
So this is pretty much like "Build a module for dummies"? I know pretty much nothing about coding so if I were to try to make a web page, this could help me out. :D

Good job on this!