Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of ben  >  Button Maker Lite  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: example of use
Class: Button Maker Lite
Generate button images with text dynamically
Author: By
Last change: added language
Date: 2007-02-25 09:02
Size: 4,026 bytes
 

Contents

Class file image Download
<?
/*
 Author:     Ben Heesen (De Bron Digital Solutions)
 Email:        b.heesen@dbds.nl
 Date:         24-8-2006 9:31
 File:        index.php
 Version:    0.1a
  © D.B.D.S.™ 2006
*/

$lang "en";            //language: en or nl
$fontpath "fonts";        //path to fonts without trailing slash
$imagepath "images";    //path to images without trailing slash
switch($lang){
    case 
"en":
        require(
"lang.en.php");
    break;
    case 
"nl":
        require(
"lang.nl.php");
    break;
        case 
"de":
                require(
"lang.ge.php");
        break;
        case 
"it":
                require(
"lang.it.php");
        break;
    default:
        require(
"lang.en.php");
    break;
}

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="php,button,gif,jpg,png">
<meta name="author" content="Ben Heesen (b.heesen@dbds.nl) © D.B.D.S.™">
<meta name="description" content="button maker; highly flexible webbased creator for buttons">
<title>The Buttonmaker Powered by De Bron Digital Solutions</title>
<style>
body{font-family:verdana;font-size:10pt;}
td{font-family:verdana;font-size:10pt;}
</style>
<link rel=stylesheet href="color_select.css" type="text/css">
<script  language="JavaScript" type="text/javascript" src="color_select.js"></script>
</head>
<body onload=cs_init();>
<script language="JavaScript" type="text/javascript">
<!--
function cs_init()
{
cs1 = new color_select('cs1');
cs2 = new color_select('cs2');
cs1.attach_to_element(document.getElementById("bgcolor_select"));
cs2.attach_to_element(document.getElementById("fgcolor_select"));
}
var menu0_custom_color="";
function cs2_change_update(new_color){
    document.forms[0].but_fgcolor.value = new_color;
}
function cs1_change_update(new_color){
    document.forms[0].but_bgcolor.value = new_color;
}
-->
</script>
<div style="border:1px solid;width:600px;">
<table>
<form action="btn-lite.php" name="btn" method="post">
<tr>
    <td>
        <?=_TEXT_?>
    </td>
    <td>
        <input type="text" name="but_text">
    </td>
    <td>
        <?=_BORDER_;?>
    </td>
    <td>
        <select name=but_border>
            <option value="">
            <option value="in"><?=_IN_;?>
            <option value="out"><?=_OUT_;?>
            <option value="flat"><?=_FLAT_;?>
        </select>
    </td>
</tr>
<tr>
    <td>
        <?=_BGCOLOR_;?>
    </td>
    <td>
        <input type="text" name="but_bgcolor" value="">
        <input type=button id="bgcolor_select" onClick="cs1.toggle_color_select();">
    </td>
    <td>
        <?=_TEXTCOLOR_;?>
    </td>
    <td>
        <input type="text" name="but_fgcolor">
        <input type="button" id="fgcolor_select" onClick="cs2.toggle_color_select();">
    </td>
</tr>
<tr>
    <td>
        <?=_WIDTH_;?>
    </td>
    <td>
        <input type="text" name="but_width">
    </td>
    <td>
        <?=_HEIGHT_;?>
    </td>
    <td>
        <input type="text" name="but_height">
    </td>
</tr>
<tr>
    <td>
        <?=_TEXT_Y_;?>
    </td>
    <td>
        <input type="text" name="but_texty">
    </td>
    <td>
        <?=_TEXT_X_;?>
    </td>
    <td>
        <input type="text" name="but_textx">
    </td>
</tr>
<tr>
    <td>
        <?=_FONTSIZE_;?>
    </td>
    <td>
        <input type="text" name="but_fsize">
    </td>
    <td>
        <?=_FONT_;?>
    </td>
    <td>
        <select name="but_font">
<?
if(is_array($error)){
    while(list(
$key$val) = each($error)){
        echo 
$val;
        echo 
"<br>\n";
    }
}else{
    
$handle = @opendir("fonts");
    if(!empty(
$handle)){
        while(
false !== ($file readdir($handle))){
            if(
is_file("fonts/" $file))
            echo 
'<option value="fonts/' $file '">'.$file;
        }
    }
closedir($handle);
}
?>
        </select>
    </td>
</tr>
<tr>
    <td>
        <?=_FILE_TYPE_;?>
    </td>    
    <td colspan=3>
        <select name="but_img_type">
            <option selected></option>
            <option value="png">png</option>
            <option value="jpg">jpg</option>
            <option value="gif">gif</option>
        </select>
    </td>
</tr>

</table>
<input type="submit" value="<?=_SEND_;?>">
</form>
<div align="left">
  <a href="http://www.dbds.nl" target="_blank">
  <img src="dbds.gif" border="0">
  </a>
</div>
</div>
</body>
</html>