Tag Archives: tagging

Saturday, 27 October, 2007

Python Script to Import Simple Tagging tags to Wordpress 2.3

Wordpress 2.3 database now supports tags. For some reason, the Wordpress importer for Simple Tagging doesn't work for me, it imports only halfway.

I wrote this python script stp-import.py to import the tags to Wordpress 2.3 database.

[~]$ python stp-import.py

The script will ask for the Wordpress database name, the database user and password, and the Wordpress database tables prefix (default is wp) to import the tags. Tested on my database.

Database: dbname

Database user: dbuser

dbuser Password:

Wordpress table prefix [wp]: wp

215 tags imported.

Tags: WordPress, Python, tagging


Posted in Python , WordPress


Thursday, 10 May, 2007

Adding Html Title for Tag Pages

This is done by modifying the function wp_title in general-template.php (add the below code).

if ( empty($title) ) {

$tag = get_query_var('tag'); // assume

if ( !empty($tag) )

$title = "Browse by ".$tag;

}

Tags: Php, tagging, WordPress


Posted in WordPress


Saturday, 14 April, 2007

Related Tags Navigation added

I am using plugin Simple Tagging. I made a slight modification to STP_RelatedTags and outputRelatedTags functions and uses STP_RelatedTags to show the related tags to the current tag being viewed. Basically, if a post is tagged with A and B, then tag A and B are related.

I also use the below to generate the browse tags path.

Eg. navigate_tags('php+Wordpress') will produce >> php >> Wordpress

The tag navigation is equivalent to the one I used in Sky Explorer for application menu. :)

function get_tags($tag) {

return explode("+", $tag);

}

function navigate_tags($tag) {

$tags = get_tags($tag);

$tagUri = '/tag/';

$link = '';

$tagfmt = '>> <a href="%link%">%name%</a> ';

$tagvars = array("%link%", "%name%");

$nav = '';

foreach ($tags as $t) {

$link .= (($link != '')? '+' : '') . $t;

$nav .= str_replace($tagvars, array($tagUri.$link, $t), $tagfmt);

}

return $nav;

}

Tags: tagging, Php, WordPress


Posted in WordPress , Php


Thursday, 15 March, 2007

Application menu and tagging

What is this? It is like the Nokia application menu, except that it is built within the program itself. The menus in the program is equivalent to the tags that you have tagged to an application.

Initially, none of the application is tagged, when you navigate to the Apps folder, you should see a list of applications. Now, you may not recognize them because what is shown is really the application filename. (The program doesn't know the name itself, it just gather from the file system all the available applications) You can launch the application either using the right arrow key or the selection key.

You will be able to find this program itself within the Apps list, it is listed as SkyExplorer. (Note: you won't be able to launch another instance of SkyExplorer) Let say, I tag SkyExplorer with Python,Utils (2 tags), each tag will now appear as a subfolder within the Apps folder, and if you navigate into each tag Python (or Utils), you will be able to see SkyExplorer listed within it and you can also see the other tag (as a subfolder). (Display is not refreshed immediately after tagging, you may need to navigate somewhere and then back again) Easier to understand with a diagram below, name with a * behind is displayed as a folder.

Basically, this gives you a way to organize your applications through tagging.

Apps*

|__Python*

| |___Utils*

| | |___SkyExplorer

| |___SkyExplorer

|__Utils*

| |___Python*

| | |___SkyExplorer

| |___SkyExplorer

|

..

|__SkyExplorer

Python apps

You can also search for application or tag name at any level in the application menu, the search is performed within the current tag (or folder). For eg. below, I search for Exp. It simply tries to search Exp within the application or tag names. (Yes, this is a bit different from the actual file searching and the display text is the same which is not right!)

Search for Exp

Search for Exp

 

Apps *Exp*

Apps *Exp*

And there is an Uninstall menu which will not immediately uninstall the selected applications. (The program doesn't know how, yet) But, it will just launch the Application manager. In fact, it is now hardcoded to run this \system\Apps\AppMngr\AppMngr.app if it exists in one of your phone's drive. You can inform me if your phone uses a different one or just don't use Uninstall at all.

For developers, the applications tags are saved into a python file named explorertag.py and is imported into the program when it starts. You can see my explorertag.py.

Tags: tagging, user-guide, Sky-Explorer


Posted in Sky-Explorer , Python , Mobile