Here lie the ramblings of the MaxGen Media team. These things are all the rage and we want to be one of the cool kids, so now you can read about what goes on in our sick little minds.

Grab the RSS feed

Follow us on twitter

Recent Posts

    Tags

    Archives

    Archive for tag "CMS"


    Email (contact) form class: make sending emails easier!

    Tags CMS,Code,Dan,Website Development - posted by Daniel on 15 May, 2009 05:18 pm

    As a PHP developer, I’m always having to create functions to send email forms to both customer and website administrator so that everyone can keep track of what’s going on. A basic example would be your standard web contact form.

    Sometimes it can be a big job if I’m dealing with lots of fields, (we once had a project with over 100 fields – big form!!!) as each one needs to be built individually and maintained manually.

    What I’ve done to speed up the process is written a small class which works with the most popular PHP email library – PHP Mailer. This small class will generate email form automatically according the $_POST information, and I’m gonna share it with you lucky web cats.

    Step 1: Create your email template database

    First we need create a table to store your email form, this table can be defined by yourself to suit the project you’re working on

    Example:

    1
    2
    3
    4
    5
    6
    7
    8
    
    CREATE tblEmail (
    	code varchar(10)
            from_Email varchar(60),
    	from_Name varchar(60),
    	subject varchar(80),
    	content Text,
            Primary key (Code)
    }

    In the content field, you can store your email template with tag you’ve defined. In my example, the tag will be formatted like this: [tagname].

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    
    <h1>My Contact Form</h1>
    <table>
       <tr>
          <td>Name</td>
          <td>[name]</td>
       </tr>
       <tr>
          <td>Phone</td>
          <td>[phone]</td>
       </tr>	
       <tr>
          <td>Email</td>
          <td>[email]</td>
       </tr>	
    </table>

    Step 2: Update the HTML form on your website

    You don’t need change your form too much, simply update the name of each field and make sure it comes with the same name of your tag. This class works with text, select, checkbox, option and textarea.

    Sample form:

    1
    2
    3
    4
    5
    6
    
    <form action=”send.php” method=”post”>
    <p>Enter your name: <input type=”text” name=”name”></p>
    <p>Enter your phone number: <input type=”text” name=”phone”></p>
    <p>Enter your email: <input type=”text” name=”email”></p>
    <input type=”submit” value=”submit”>
    </form>

    Step 3: Use the class to send email

    Remember to download PHPMailer and include it in your script with the email form class.

    The rest is simple:

    1
    2
    3
    4
    5
    6
    
    Include (“phpmailer.php”)
    Include (“emailform.class.php”)
     
    Form=new EmailForm(“code”);  ← The key to loading up the correct email template from database
    Form.generate_email($_POST);
    Form.send(“MaxGen Media”,info@maxgen.co.nz”);

    And that’s it!! You can use this class to generate big forms that get sent out to your customer and web admin.

    You can also customise the constructor

    You can modify this EmailForm class to load up an email template:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    
    function __construct($id=0) { 
       $this->id = $id;
       // Place your query to load your email template here.
       $rs=mysql_query(“select * from table where code=$id);
       row=mysql_fetch_row($rs)) 
       // Fetch data and store email information
       $this->subject = $row['subject'];	
       $this->from_name = $row[‘from_name’];	
       $this->from_email = $row['from_email'];	
       $this->content = $row['content'];
    }

    Download the files

    Enjoy. If you need a hand be sure to leave a comment.

    We’ve been busy little bees

    Tags CMS,Dan,General,SEO,Website Design,Website Development - posted by Court on 14 Aug, 2008 01:48 pm

    Long time no see, with good reason though.

    Catch up time:
    Last month, both Dan and myself were fortunate enough to be invited to speak to a couple of very different groups of people.

    First was a conference held by Tristan Nickless of Word by Mouth and the collective crew of Speech Pathology Australia and the New Zealand Speech-language Therapists’ Association. It was great to speak to a bunch of interested owners of private speech therapy practices about the pros (no cons here) of getting a Website.

    A week or so later, we met up with the emerging talent out of Botany Downs Secondary College. First off, what a sweet complex. The school has only been around a few years and has already been labelled as the ‘learning institution of the future’, surely thanks in part to the progressive teachings of Mr. Enda McKenna (head of IT). During the hour or so we spoke we covered a few topics including working with clients, design principles, SEO and general traps for young players.

    Couple of pics below:

    Dan @ BDSC

    Court @ BDSC

    Big thanks to both groups, was our pleasure to bore you all to tears.

    Stay tuned this week and next for some updates to the blog as we:

    - Unveil the big projcet that’s been keeping us from posting regularly
    - Introduce a new weekly feature
    - Spew miscellaneous trite

    Pretty up your Website with stock

    Tags CMS,Website Design,XSIS - posted by Court on 26 Sep, 2007 11:06 pm

    In this post, Court is going to help you find stock imagery.

    As Website designers we’re aware of the vast resources available to us on the Internet that we can use to make great looking sites for our clients. But once we’ve done our part, people using our XSIS Content Management System sometimes get stuck when it comes to adding stuff in, especially images. A couple of posts back, Danilo explained how you can use Picasa to organise and manipulate your photos. But often the questions stands – where does one find good quality stock images in the first place? You could spend hours searching Google for what you’re looking for, but its tough to narrow down the best sites.

    Never fear, here is a compiled list of some great *free* stock photo Websites. I’m pointing out these sites because of their selection, ease-of-use and quality.

    Stockvault – Really nicely categorised stock. The site has a friendly, Web 2.0 feel and they have a massive database of shots totaling over 8,000.

    stock.xchng – Over 300,000 completely free images. This site is legendary and according to them gets over 3 million hits a day.

    KAVEWALL – This one’s a little different. If you want something with a bit of texture,or a detail shot, check out KAVEWALL.

    A Digital Dreamer – This one doesn’t have heaps of photos, but they’re all really good quality. You can tell that these have all been hand-picked.

    FreePhotosBank – Neatly categorised with lots of options and info about all the shots. Not a massive selection like stock.xchng, but the shots are usable and interesting.

    More good sites – Free Pixels, open stock photography, Photogen.

    So have a peruse and hopefully you find what you’re after. Wouldn’t hurt to say cheers to the Website owner if his site has what you want. If you’re still finding it tough you can always give us a call here at MaxGen Media. We have a few secret stashes which are bound to have the specific photo you need.

    Have a topic that you want covered?

    Send us an email and we'll try to write a blog post about it. Only if it's a good topic of course.