Categories

Meta

Sticky Sidebar

Ok, as for my first post after my away time I’ll be showing you how to make a… Yes you figured it out, a TagCloud.

A TagCloud is as you know a Cloud… with Tags… hum, for some reason I think you already knew that. Anyway, jokes aside, a TagCloud is one of the most powerful visual information display nowadays. It’s not a complex module, by the opposite, it’s very simple.

A normal TagCloud displays all tags, in alphabetic order and the font size varies in according to the amount of times that tag has been found in use. Imagine that you have “hello”, “this”, “is”, “jose”,”blog” as your tags. You would get something like:

hellothisisjoseblog

You would know that “jose” is the tag with most views (when we say views we can say records in a database).

The installation of the module is very easy and all the required information can be found on the files that i provide.

Extra info:

// This will create a TagCloud with default max font size and minimum font size. The default values can be set on file tagcloud.php in function create_tag_cloud($array,$limit_top_size = 38,$limit_low_size = 18)
$tag_size = create_tag_cloud($tags_array);

Or with specific values

$tag_size = create_tag_cloud($tags_array,40,10);

Max font size will be 40 and minimum font size 10. (these are the max and min values allowed for TagCloud font fluctuation.

And there you go. Just style the code as you like.

PS: Yes, i know what you’re thinking, you can change the code as you please

I had the idea of creating this style effect after seeing a similar one in other website, only it was pullup and not pulldown.

We’ll be using JQuery Framework to produce the desired effect. JQuery by itself only enables the dropdown of one element, to make the desired output we need to do some modifications, and that’s what we’re gonna go over on this post.

“handle: ‘#hand_drag’” tells JQuery that only this element will activate the dropdown effect

we are going to lock it to the Y axis using “axis: ‘y’”

“containment: [0,0,'100%',380]” is where we specify the limits of movement of our dropdown, in this case we confine it to top 0, left 0, width 100% and height 380 from the top of the page

Finally we go over to the drag function, this is where we specify what will happen during the drag effect. The default drag function has 2 parameters; event and ui. Event has all event related information during the drag and ui has all changes that happen to the dragged element, so, in this case, we’re going to use that to update the rest of he page as the dragged element comes down.

For this to happen we first need to put all <body> content inside a <div> element with the id “page”

We still haven’t add the content of our dropdown element. Before <div id=”page”> and after <body> type

And that’s it. Everything should be working. If not, go over the steps once again and check that everything has been added properly.
If you still can’t get it to work send me an email or comment this post in order, for me, to help.

With the introduction of PHP5 we now get the opportunity to use PHP as an Object Oriented Programming Language. What this means is, and in a very short way, that we can now have a more reliable, faster and safer way to program in PHP.

Abstraction – Allows the programmer to declare abstract methods that can be instantiated in a class and declared by an object.

Encapsulation – Gives us the ability to protect which ever data, inside a class, by using protected methods like private classes ou functions.

Inheritance – We can now create tree like class structure where the lower levels on the tree are childes of the level above. (in this Logging example we’re going to be using this methodology)

Polymorphism – Using this feature we’re able to declare a given class and use his children methods even tho we have declared parent class without the need to redeclare them.

First of all we’re going to go over the basic structure of our Log class.

interface iLogs
{
public function insereLog($entrada,$tipo);
}

We declared an interface. This way the application that will be calling this class is able to read its available content without the need to directly access the class internally.

Note: Methods that are declared on the interface need to be equal to the ones declared inside the class itself (either method name or number of arguments required). Otherwise you’ll get a fatal error from PHP.

__construct and __destruct use “__” since they are native to PHP5 and are automatically called when a class is instantiated.

When the class is built we want to create some constants used throughout the class and we want to check if everything is according to the file structure required.
We also use self to address the actual instantiated class and :: in place of -> because we’ll be calling them in static mode (no data can be changed).

Our destruct class is empty since there is nothing to be done when the class is destroyed.

Note: Normally you can use this function for a DB connection and destruct can close the connection.

Originally created for Mac OSX (MAMP – Mac ApacheMySQL and PHP) this was, for me, the best application I’ve tried.
It does 3 in 1 one-click-support for a complete web server directly on your Mac. No need to do hard configurations. Just set the port to be used by Apache and MySQL and you’re set. (I used 8888 for apache and 8889 for MySQL)

Above all other functionalities it really shines when you need to continue working and you are not able to get an Internet connection (Yes it did happen to me a couple of times), just use MAMP widget, start your servers and access your own server by going to “http://localhost:8888“.
As simple as that!

WAMP as you probably figured out by now is the same application but this time for Windows.
WAMP is not as simples to set up as MAMP, but nether less, it keeps the do-it-simple.

Sequel Pro is the perfect tool for quick and easy management of a database (MySQL one).

Very simple and easy to use.
It allows all normal views, Table, Content and SQL, it has SQL code verification and support for various databases.

As for windows, from what I’ve seen, there aren’t many applications that can surpass MySQL Administrator.
Created by MySQL development team this is The tool for MySQL management, and the good thing about it, it’s free

This is my first attempt at creating my own Blog. (yes i know, please bare with me)

So that you know a little about myself, I’m a 22 year old lad from Portugal, Vila Nova de Gaia.
I’m a student at ISEP (Instituto Superior de Engenharia do Porto) and at the moment finishing my Computer Engineering degree. I also created a WebDesign and Development company with three other partners called CoreCreations® (feel free to give us some feedback).
I can be found on LinkedIn at my profile

I’m a nice person (hope so), a workaholic (when it’s needed) and tech geek that’s always searching for more and more information.

As posts are made I’ll keep talking a bit more about myself, and hopefully you’ll learn bit by bit about myself.

The main purpose of this Blog is to give you tips&tricks regarding web programming. From PHP, MySQL to CSS and HTML, going trough JavaScript and AJAXand ending (maybe not) in WebDesign.
I know there are a lot of other Blogs (Chris Shiflett, Chris Coyier, etc) and those are way better than mine, but the main reason I’m doing this is also to learn by helping.
Everyone knows the basic of programming learning, good old try&error. He’s our best friend for good and for worst (yep… he does sometimes drive you nuts). I’m basically seeing this Blogs like that. By helping you I’m also learning, and hey, guess what, that’s the fun of it!

I’m still trying stuff out with this new Blog layout. For now I’ll be using a free template I’ve grown fond of and soon, if everything goes good, a new one will be created from scratch.