- Dolph Lundgren boards zombies vs. robots epic BATTLE OF THE DAMNED
- Serving up something different: Review of Noriko's Dinner Table
- New on Blu-ray and DVD: Drive! The Thing! In Time!
- PERFECT SENSE movie review
- Moon Nazis be trippin' in new theatrical trailer for IRON SKY
- Stake Land's Jim Mickle to remake Mexican cannibal flick WE ARE WHAT WE ARE
- Review of the Eric Bilodeau's cyberpunk zombie flick HUNTING GROUNDS
- Maria has a death wish in Marcel Grant’s MONSIEUR FRANCOIS trailer
- PUSHER pushes forward with new poster and first images
- Promo video for steampunk animation UN MONDE TRUQUE (A FAKE WORLD)
- Re: PA Film Archive
- Prepare yourself for the apocalypse
- Female Prisoner No. 701: Sasori
- Re: Japanese zombie movies (2011-12 round-up)
- Re: Life Is Dead
- Balkans war revenge movie - Nicolas Cage?
- PA Film Archive
- i kill
- Re: Life Is Dead
- Monster Killer
- Retro Slave: LOGAN'S RUN series box coming in April
- APOCALYPSE PIZZA VIDEO delivers during the zombie apocalypse!
- Concept art for Enki Bilal's next is PA animation ANIMAL'Z
- Trailer for ZOMBIE MURDER EXPLOSION DIE! All 4 of these in every episode!
- Wandering madly in the remnants of civilization in Greece's HIGUITA (teaser)
- THE HOST director's English language debut SNOW PIERCER adds cast
- Argentina invaded by NEWMEDIA aliens
- THE DIVIDE movie review
- THE RIDER still rides! New teaser reveals stunning final animation style
- EXCLUSIVE: Trailer for RAMPAGE IN HEAVEN sees The Monkey King and mech in a nightmarish dying world
- Sony could back Seth Rogan's THE APOCALYPSE (Jay and Seth vs. The Apocalypse)
- PERFECT SENSE movie review
- SLAMDANCE 2012: Review of SUNDOWNING
- SLAMDANCE 2012: Review of killer tattoo thriller COMFORTING SKIN
- DVD Review: Style overshadows heart in spunky comedy SPORK
- DVD Review: Daniel Craig loses his mind in mediocre DREAM HOUSE
- SUNDANCE 2012: Review of EXCISION
- SUNDANCE 2012: Review of THE PACT
- SUNDANCE 2012: Review of GRABBERS
- SUNDANCE 2012: Review of SAFETY NOT GUARANTEED
- SUNDANCE 2012: Review of the visionary BEASTS OF THE SOUTHERN WILD
- SXSW 2012: Foul mouthed, immature and packing heat in FUNERAL KINGS [trailer]
- A life out of order in Twilight Zone styled SHUFFLE
- SXSW 2012: Full lineup includes world premiere of CABIN IN THE WOODS
- Stills for Korean android omnibus DOOMSDAY BOOK
- Trailer for muse EDDIE THE SLEEPWALKING CANNIBAL
- New on Blu-ray and DVD: Drive! The Thing! In Time!
- EXCLUSIVE: Trailer for 70s poltergeist flick WHEN THE LIGHTS WENT OUT
- SLAMDANCE 2012: Review of killer tattoo thriller COMFORTING SKIN
- Trailer for ZOMBIE MURDER EXPLOSION DIE! All 4 of these in every episode!
- Trailer for DEAD SHADOWS - Is there some Lovecraft influence?
- Jim Jarmusch making vampire flick ONLY LOVERS LEFT ALIVE
- Will you see this film? Teaser poster for RESIDENT EVIL: RETRIBUTION
- DVD Review: Style overshadows heart in spunky comedy SPORK
- DVD Review: Daniel Craig loses his mind in mediocre DREAM HOUSE
- Zombie bigots abound in DAVE OF THE DEAD
- Douche bags are target practice in GOD BLESS AMERICA trailer
- SUNDANCE 2012: Review of EXCISION
- SUNDANCE 2012: Review of THE PACT
- SUNDANCE 2012: Review of GRABBERS
- EXCLUSIVE: Researching life after death in random data patterns in APOPHENIA (APOFANIA) (trailer)
Jack In
Latest Comments
Latest Forum Posts
PA News
Latest Reviews
Older News
Film Festivals
Berlin International Film Festival (Berlinale)
Feb 09 - Feb 19
Berlin, Germany
Boston Underground Film Festival
Mar 24 - Mar 31
Boston, Massacheusets
Yubari International Fantastic Film Festival
Feb 23 - Feb 27
Yūbari, Hokkaidō, Japan
Cinequest Film Festival
Feb 28 - Mar 11
San Jose, California
South by Southwest (SXSW)
Mar 09 - Mar 17
Austin, Texas
Crew
Don Neumann aka quietearth
Editor in Chief
Fort Collins/Denver, Colorado
agentorange
Managing Editor
Edmonton, Alberta
Marina Antunes
Assistant Managing Editor
Vancouver, British Columbia
projectcyclops
UK Correspondent
Edinburgh, Scotland
Rick McGrath
Toronto Correspondent
Toronto, Ontario
The Crystal Ferret
France Correspondent
Paris, France
rochefort
Austin Correspondent
Austin, Texas
kilowog
LA Correspondent
Los Angeles, California
Joao Fleck
South American Correspondent
Porto Alegre, Brazil
quietearth [General News 03.30.07]
This is a simple guide on how to set up tags for your posts, but it goes beyond just that. It will work with any table with integer id's, and multi-user systems. Freetag is pretty flexible, and has calls to make tag clouds (with autosize based on tag count) as well as related tags. It's very useful, and easy to setup.
First off let's grab the latest source code for freetag from google:
http://code.google.com/p/freetag/
Then gunzip/untar the package, and I'm assuming you have your database already setup, so let's import the freetag table. Change into the freetag root dir:
# mysql -p databasename < freetag.sqlThis creates two tables, freetags, and freetagged_objects.
The freetags table are the actual tags we create. The tags are in "normalized form" and "raw" form". If we created a tag such as "post apocalyptic", this would be the raw tag, and it would add a normalized form "postapocalyptic".
The freetags_objects table is where items are actually tagged. Now we have the option here of having a specific "user id" tagging objects, so we can break things down by user, or you can just use the default so it doesn't split into different taggers. The latter is what you would use for your blog, since your the only one doing the tagging, but if you wanted to build a site where users could create their own tags, freetag can do it.
Now I create a mytags.php file to include in other php for easy access to the freetag objects:
require_once("/path/to/freetag-version/freetag.class.php");
function freetagnew() {
$freetag_options = array (
'debug' => FALSE,
'db_user' => 'testuser',
'db_pass' => 'testpassword',
'db_host' => 'localhost',
'db_name' => 'testdb');
$freetag = new freetag($freetag_options);
return($freetag);
}Now from here it's simple, to add tags:
include("mytags.php");
$ft = freetagnew();
$ft->tag_object(1, $id, $tags);1 is the user id, we will use the same id on all objects since we aren't splitting tags up between different users. $id is the id of the object from whatever table your tagging. $tags is a raw string of tags, we could even get this from a $POST, it can be in this form:
"post apocalyptic" movie reviewand it will put 3 tags on the object.
To delete all the tags on an object:
$ft->delete_all_object_tags($id);To get the tags on an object:
$tags = $ft->get_tags_on_object($id, 0, 0);
if (count($tags) > 0) {
foreach ($tags as $tag) {
print $tag['raw_tag'] . "\n";
print $tag['tag'] . "\n";
}
}To get the object id's with the same tag:
$tagarray = $ft->get_objects_with_tag($tag);
$num = count($tagarray);
for ($i = 0; $i < $num; $i++) {
print "tag id ".$tagarray[$i]."\n";
}And last but not least, lets make a tag cloud:
$taghtml = $ft->get_tag_cloud_html(40, 9, 20, "px", "cloudtag", "/tag/");The first param is the number of tags to return.
The second param is the min font size.
The third param is the max font size.
The fourth param is the units (eg px or em).
The fifth param is tag page url to prepend.
Now just print $taghtml, and you've got your cloud.
If there are any questions, please feel free to post them.
Leave a comment
Related articles



