Vincent Reniers | From PHP Guru to Designer!

Archive for April 2009

Apr/09

22

Making a Template

I’m kinda skipping the CMS project right now. Because I’m too busy with the rest of my life hehe. So I decided to aim myself on making templates for other CMS’s right now. Right now I’m designing this layout for probably Wordpress or Joomla. So far it’s looking really good.

UPDATE: The layout is coming very soon as I only need to finish the body in PSD. Slicing it up in HTML & CSS doesn’t require that much time. Next I will need to take a look at proper CMS and how-to create the code for the template. Anyways stay tuned for some more videos maybe and extra web graphics! :D .

, Hide

Apr/09

20

Freshly grabbed from the net!

I present you some vids i ROFL-ed at! Please do keep in mind these videos are ment for an 18+ audience. Anyways enjoy! =D

Dildocorn Pony

Nike Naked Running Camp

, , , Hide

Apr/09

19

PHP Tutorial : Log Visitors

Today we’re going to make a simple script that logs all of your visitors and puts it into a database. I will comment every step so you will understand how it works. For newbies who don’t understand PHP yet check out the first tutorial.

<?php

$mysql_connect = mysql_connect('host', 'user', 'password') or die("We could not connect to the MySQL server.");

// This is simple a connection to the database.
// I'll provide some details on how to construct the table inside the DB later.

$mysql_database = mysql_select('database') or die("We could not select the database.");
// Just pick a database where u made your 'visitor' table
// Note: or die(mysql_error()); Is very handy in most cases. It returns a very specific error.
// So now we have the database connection

$user = array();
$user['ip'] = $_SERVER['REMOTE_ADDR'];
$user['browser'] = $_SERVER['HTTP_USER_AGENT'];
$user['page'] = $_SERVER['PHP_SELF'];

// We now create an array and we fill in keys that contain values.
// These values are generated by PHP when a user runs your script (opens a page)
// These values then get put in the $_SERVER array and you can simply fetch them from there.

$insert = mysql_query("INSERT INTO `visitors` (`ip`,`browser`,`page`)VALUES($user['ip'], $user['browser'], $user['page']) ") or die(mysql_error());
// This query inserts all the information we just gathered into our table.

?>

Now some info on how to create this table
The table name : visitors
Fields: 4
First field is the : visitor_id it is the Primary field and it auto increments and an Integer
This means that it simply starts from 0 and always goes up , its a unique id for each field
It helps a lot when you need to select one of these to set an ip to banned for example if you have such a column

Second field : visitor_ip VARCHAR 255 or something
Third field : browser VARCHAR 355
Fourth field : page VARCHAR 35

You can easily set up tables and databases using PHPMyAdmin

, , , Hide

Apr/09

19

My CMS

Here is a quick picture of the CMS i am currently developping. You can see the default layout and a part of the template code wich is not yet finished. I still need to implent a way to import modules and widgets. The template class can get quiet complicated. I’m having this idea on how to load in the modules by assign a type to modules. First type is the passive one that is always loaded in and runs in on the back. The second is the type that is permanent and remains like on the sidebar. And the third one comes occasionally. Like a page or a box on the homepage. I’m not sure how this will operate. So i’m figuring the how-to part out first before getting to the coding part because if I don’t think this through it could get fucked up in the mid hehe. ;) Anyways tell me what you think about the default layout so far wich i’m going to use to construct the system on.

Nexus CMS

, , Hide

Apr/09

19

New layout

I hope you guys like the new layout ^^, looks clean and tidy. And it is compatible with IE7 as far as I know. If somebody has some problem with IE6 please let me know ASAP =D. Anyways i’m going to upload some pictures of Nexus CMS right now. So stay tuned for my next post ;) .

, Hide

Apr/09

14

Blog layout

I changed the layout back to the WP default because the previous one showed some compability problems with Internet Explorer. I normally fix those in my own layouts but I got that one from someone else. And since 39.2% of my visitors use IE6 this really was an issue hehe. Probaly most of those were just spiders though but yea i like this one too.

, , Hide

Apr/09

14

Nexus CMS

Hello lads, it´s been a while since my last post but of course I have a good reason to explain my absence ^^. Right now im writing this post in Tenerife ( Canarian Islands ).  And i´ve been working at my new CMS.

So far i´ve got the basic structure finished it has some nice features. I didn´t really base myself on some other system but I did try to create a template system. It works like this :

First action i define a Constant “In_Site”,  all my scripts are written in an IF statement to see if it is defined otherwise it wont run. Its to prevent messy errors when u go to the script directly. What happends next is I load in the config and functions wich are static and no operation occurs. Next we establish the database connection with the help of my DB class. Im still working on it tough and trying to figure out if there is a way to rollback DB events when an error occurs. I know this is possible with MySQLite so now I have to do some digging in the MySQL documentation because thats the DB im using. If the rollback function exists im going to let occur within custom error handling. The try and catch statement. After the DB class comes the settings wich require the DB connection to fetch the settings. And then we get to the templating part.

The template part loads in the default template if it exists and it then processs the variables it finds inside the tpl. Such as {SITETITLE}. Then the module gets processed for example ´News´ and while this happends u can still make changes to the template and at the end the entire part gets printed.

Or well that´s at least what I will be trying to achieve. Right now I have got the a part of the Template and Database class finished. Ill be figuring out the module part and how it loads into the template part out later.

But so far it already looks nice, I even made a custom layout for the CMS.
Ill upload some screenies soon ^^.

Greets,
Vincent

, , Hide

Find it!

Theme Design by devolux.org