Author Archive for Zz85

School Started Updates

Hi all,

Timetable
First of all, for those who are interested in my timetable.
Semester 2 Timetable

Previous Next Close
My Timetable Year 1 Semester 2

Here’s this semester, compared to last semester.
Semester 2 Timetable
Previous Next Close
Previous Timetable- Year 1 Semester 1

Hislide Flash Issue Fixed
Hislide popup images usually get covered by flash objects, and the fix to it is to add wmode=”transparent” to the embed tag. Photos taken for my last concert Miniatures can be viewed.

Fotobook Problem Solved
I was running into some problems important facebook albums. I was getting
Fatal error: Allowed memory size of 15728640 bytes exhausted (tried to allocate 71 bytes) in [...] /wp-content/plugins/fotobook/facebook-platform/simpleXML/IsterXmlNode.php on line 234. I fixed this problem by replacing the php4 facebook client library with php5 client. I’ve also added jquery chilli plugin and scripturizer on this blog, but I’ll skip the elaboration.

Facebook Hello World (with Flash, Fbjs, Fbml, css, ajax and ElizaBot)
Random Beautiful Flash Text

Previous Next Close
Random Beautiful Flash Text Generation on Canvas Page

View my application page here or visit the canvas page here.
Previous Next Close
Hello Alice World Profile - Chat Dialog

Actually a challenging part of this was setting up and configurating a Solaris 10 Zone. I thought of trying rails, but with some restrictions I didn’t carry on that idea.

InnoFusion
I’ll be leading a project- a epublishing business, with nextfusion.

Things are getting busy and stressful but I hope I’ll be able to manage.

Juicing Up Photo Viewing Experience: Part I

on this blog, on your wordpress site, or anywhere else. This series is a result of my recent craze with scripting/programming and photo ideas.

Screenshot of Fotobook Highslide

Previous Next Close
Fotobook Highslide - Mash up of Wordpress, Facebook Photos & Highslide JS

1. Photo Gallery
I tried a couple of wordpress plugins in the past: Gallery2, Simple Extended Gallery, Flickr….

They were perhaps good, but perhaps complex, lacking and I didn’t seem to like it. Then I created PhotoZip and even though Photozip plugin had its short comings (eg. perhaps a little slow due to batch processing), I’m glad Tim have the interest to improve it so much better than I would.

It is only recently I found out about Aaron Harp’s Fotobook, an integration/mashups of Facebook’s photos into your blog. So I tried it, and it works.

The integration is good (since I use facebook too), the layout neat, the configuration all done with much ease. It seems like it was something I tried looking so hard before, now that I found it, I love it. My photo gallery can be viewed by clicking on the Photos tab.

2. Highslide
Tim’s improved PhotoZip supports LightBox, so does Fotobook. No doubt it gives great effect and I like it too when used appropriately. Even my cousin’s portfolio uses it to enhance viewing experiences.

However, a reason why I don’t use it? Perhaps it was due to some negativity when I experienced it on some sites. But when I come across the Highslide javascript library, I thought I would use it for the following reason
1. At the first impression it reminds of LightBox- to expand an image in the same window.
2. However, unlike Lightbox, it is less obstructive. The background is not grayed out, and window can still scroll, and the expanded image can be dragged around.
3. It seems more reactive.

Not only it good to find the right tool for the right job, it good to find the best package available. So I’m using Highslide Wordpress plugin. Since fotobook was written in a way it was simple to customise it, I created a style/theme similar to Aaron’s lightbox style, except it works with highslide. Check out one of my gallery for example.

(Tip: You can use arrow buttons on your keyboard to navigate through the photos. You can also click/expand more than one photo at a time too.)

Click here to download Highlight Style for Fotobook.

Instructions:
Ensure you have Fotobook and Highslide plugin working.
Copy the highslide folder into fotobook styles folder
(eg. /wordpress/wp-content/plugins/fotobook/styles)
Select the highslide style under fotobook options.
View your photo gallery, test and enjoy!

2008 New Year Updates

well nothing much has change. Things are moving on at a constant (or maybe pretty fast) pace that I do not feel a full reset. I still feel some new year symptoms for example when noticing the heavy congestion on the roads after work- due to fact adults are getting back to work and students back to school.

Modules Bidding. School reopening in 2 weeks time and I’m torn to which path to take. The technicality of the Computer Science stream seems to entice me, but my Diploma in Business Informatics seems to set the path for Information Systems. Anyway I bidded for 5 modules, which seem quite pro-IS :

  • CS1231 - Discrete Structures
  • MA1505 - Mathematics I (aka Horror Maths)
  • CS2261 - Enterprise Systems Development
  • CS2250 - Fundamental of IS
  • CS3216 - Software Development on Evolving Platforms (aka Facebook Module)

Blog maintenances. This blog has been advertisement-free since it started (>2.5 years?). Since there were suggestions of getting a little pocket money due to a steady amount of visitors here, I compared Google Adsense, and some regional advertisers- Adverlets, Nufflets, Nuffnang. Since Google is more reputable, I’m trying it. I customised the ads not to be too obvious, and can be found in a small section/widget in the right sidebar of the page.

You might notice I’ve have been playing with some other widgets in the sidebars. I’ll be adding scripturizer (js version), some interesting stuff (get hints from my next post) and trying to clean up stuff which is not working.

Also, I’m involved with OpsFly (Operation: Financial Literacy for Youths), in the IT team and its site will be at http://opsfly.com Not much content is up for now and work will have to be done.

Next month would be my piano exams, and I’m involved with a concert this month- I ought to spend less time with computers and more time practicing music.

Blog Posts on a Timeline

Its 2008, so wishing all readers here a very happy new year!

Yesterday, I touched about glancing back at a previous year (2007) , and one good way is to retrieve all the posts on your blog and place visualise it on a timeline. Of course there are other ways, say looking and sharing photo albums with friends could be a better way to bring back memories.

My Blog on the Timeline

I revisited Dandelife (A Social Biography Network?), and found that they have made more features and progress, compared to the last time I tried using it. Some features include importing “life streams” from flickr, facebook, blogs, feeds etc… anyway I didn’t manage to import my blog so I moved on.

Next I tired SIMILE Timeline plugin for Wordpress. Pretty good it seems, but I encountered couple of problems which i didn’t bother to troubleshoot and fix much. I considered implementing my own wordpress plugin when I got the idea to create a client which uses MetaWeblog API, so that it can work not only for my blog, but any wordpress blogs, blogger sites etc.

I will use the metaWeblog.getRecentPosts method to retrieve the post from the webservice. Since metaweblogapi is based on xmlrpc, I used the library phpxmlrpc. The data returned is then formatted as timeline xml to be used the timeline api (in my case I chose to truncate blog contents too). Pretty simple right?

Here’s my source code which I glued together quickly, isn’t too pretty, but works dandy for me. I’ve placed the script online, so you may want to try it.


<?php
/* by http://zz85.is-a-geek.com/ 31 December 2007 */
session_start();
if ($_POST['login']) {
	$reponse = blogconnect ($_POST['blogaddr'],1, $_POST['username'],$_POST['password']);
	if ($reponse->errno=="0") {
		$_SESSION['blogaddr'] = $_POST['blogaddr'];
		$_SESSION['posts'] = $_POST['posts'];
		$_SESSION['username'] = $_POST['username'];
		$_SESSION['password'] = $_POST['password'];
		showhtml();
	} else {
		echo "login failed";
		showform();
	}
} elseif ($_GET['js']) {
	$_SESSION['username'].$_SESSION['password'];
	printxml(blogconnect($_SESSION['blogaddr'],$_SESSION['posts'], $_SESSION['username'],$_SESSION['password']));
	exit;
}else {
	showform();
}

function blogconnect($link, $posts, $username, $password) {
	//requires xmlrpc.inc from http://phpxmlrpc.sourceforge.net/
	require_once('lib/xmlrpc.inc');

	// Using metaWeblogApi http://www.xmlrpc.com/metaWeblogApi
	$client = new xmlrpc_client($link);
	 $client->return_type = 'phpvals';
	 //$client->setDebug(1);

	 $params[] = new xmlrpcval("n/a");
	$params[] = new xmlrpcval($username);            //your wordpress login
	$params[] = new xmlrpcval($password);
	$params[] = new xmlrpcval($posts);
	 $msg    = new xmlrpcmsg("metaWeblog.getRecentPosts",$params);
	$response = $client->send($msg);
	return $response;
}
function printxml($response) {
	header('Content-type: text/xml; charset=utf-8');
	echo "<data date-time-format=\"iso8601\">";
	foreach ($response->val as $entry) {
		/*
		['dateCreated']
		['userid']
		['postid']
		['description']
		['title']
		['link']
		['permaLink']
		['categories']
		['mt_keywords']
		['wp_author_display_name']
		['date_created_gmt'] -8
		*/

		$description = htmlentities (substr($entry['description'],0,255)."...");
		?>
<event
        start="<?=$entry['dateCreated'];?>"
        end="<?=$entry['dateCreated'];?>"
	link="<?=$entry['link'];?>"
        title="<?=htmlentities($entry['title']);?>"
        >
	<?=htmlentities ($description);?>
        <?=htmlentities('<br/>by '.$entry['wp_author_display_name'].'');?>
</event>
		<?php
	}
	echo "</data>";
}

function showform(){
?>
<form method="post">
Blog Address: <input name="blogaddr" value="http://yoursite/blog/xmlrpc.php" size="40"/><br/>
No. of posts: <input name="posts" value="100" /><br/>
Username: <input name="username" /><br/>
Password: <input name="password" type="password" /><br/>
<input name="login" type="hidden" value="1"/>
<input type="submit"/>
</form>
<a href="http://zz85.is-a-geek.com/">http://zz85.is-a-geek.com/</a>
<?php } 

function showhtml() {
?>
<html>
  <head>
  <title>Wordpress (MetaWeblog) API and Timeline API Integration</title>
   <link rel='stylesheet' href='http://simile.mit.edu/timeline/docs/styles.css' type='text/css' />
    <script src="http://simile.mit.edu/timeline/api/timeline-api.js" type="text/javascript"></script>
    <script>
    	var tl;
	var eventSource = new Timeline.DefaultEventSource();

	function onLoad() {
		createTimeline();
	}

function createTimeline() {
  var bandInfos = [

   Timeline.createBandInfo({
        width:          "25%",
	//timeZone: 8,
	eventSource:    eventSource,
        intervalUnit:   Timeline.DateTime.DAY,
        intervalPixels: 50
    }),
    Timeline.createBandInfo({
	showEventText:  true,
	eventSource:    eventSource,
	width:          "60%",
        intervalUnit:   Timeline.DateTime.WEEK,
        intervalPixels: 100
    }),
    Timeline.createBandInfo({
        width:          "15%",
	eventSource:    eventSource,
	showEventText:  false,
        intervalUnit:   Timeline.DateTime.MONTH,
        intervalPixels: 95
    }),

  ];

  // sync bands
  bandInfos[1].syncWith = 0;
  bandInfos[1].highlight = true;
  bandInfos[2].syncWith = 1;
  bandInfos[2].highlight = true;

  tl = Timeline.create(document.getElementById("my-timeline"), bandInfos);

  Timeline.loadXML("<?php echo $PHP_SELF; ?>?js=1", function(xml, url) { eventSource.loadXML(xml, url); });
}

var resizeTimerID = null;
function onResize() {
    if (resizeTimerID == null) {
        resizeTimerID = window.setTimeout(function() {
            resizeTimerID = null;
            tl.layout();
        }, 500);
    }
}

  </script>
  </head>
  <body onload="onLoad();" onresize="onResize();">
  	<h2>Laying Out a Year (2007) Full of Blog Posts on the Timeline</h2>
	Using Simile Timeline Library, Wordpress API/MetaWeblog API, and PHP to translate that into Timeline XML. <br/>
	<div id="my-timeline" style="height:450px; border: 1px solid #aaa"></div>
	<a href="http://zz85.is-a-geek.com/">http://zz85.is-a-geek.com/</a>
  </body>
</html>
<?php } ?>

So now, I can have twitter and blog posts displayed on the timeline. If I have the time, calendars and metadata would be next. But there’s also too many other data sources around. Emails- run a search on gmail. On handphone, view the calendar data and smses for a year. Photos: Run time view in Picasa. Diary: read. Gps: Color tag them on googlemaps? Too many! so I’ll be satisfied with the blogs posts on the timeline for now.

Happy revisiting your posts!

Updates & Thanksgiving

As year 2007 comes to a close, just a quick look back and some updates.

I’m having internship, as mentioned before, and so far its a nice, fun and learning experience. The environment at work, feels more like my final project in poly than my industrial attachment I had.

Who whould imagine going on Facebook is my job?

My 1st year 1st semester results released on boxing day. I must say I’ve been satisfied, that my grades is satisfactory, of a very average CAP, that would be a yardstick for my performance keep me, and hopefully to keep me humble and work harder. Now what is left is to reconsider what path to major on, and to decide the modules for next year.

Psalms 47:4 Delight thyself also in the LORD; and he shall give thee the desires of thine heart.

I’ve coded an integration that laid out my blog posts in 2007 on Timeline using MetaWeblogApi last night, but time is running tight so the post on it might just have to wait to the new year. Both using that and K2’s ajax archive navigation makes it easy to recap what have been done this year.

Although it seemed not much is done in the year, time passes faster than that I feel, one single important event is that I’ve stepped through quickly from my army stage into my study stage.