~ where coding happens ~
25 Nov
In order to check if an existing view is a page or a block:
$views = views_get_view('viewnamehere');
if($views->display_handler->display->display_plugin=="page"){
// A page
}
24 Sep
Today, something reminded me of an idea I conceptualized months back while working with ClassifiedPost Singapore. Then, I realized that I need to keep track of all these ideas at one place and that’s why I decided to write a blog about it.
There are tons of jobs website out there that caters to a jobseeker’s needs— ClassifiedPost, JobsDB, Monster, JobStreet, Recruit.net to name a few. But most of these job sites offered the same type of service and most have identical business model. With this, I thought of an idea on how a job site can leverage on competitors and make the job site more useful to both jobseekers and recruiters.
Up to this moment, nobody has ever thought of having a service-driven jobs board application (take note i used the term “application” instead of “website”). Here I will discuss how the structure of this idea should be like:
The idea is to build a “Software as a Service (SaaS)” platform that bridges the gap between jobseekers, employers, and recruitment agencies. Problem: Because there are tons of jobs websites out there, the jobseeker cannot track his/her account on these websites and updating of information is harder. As more and more accounts are created by the user on every jobs site, the harder it gets for the users to update of their information. In this concept, jobseekers, recruiters and agencies are enticed to use the service as each of them will benefit from it.
Advantages for the Recruiters/Agencies:
1. Flexibility – Since you have developed an application instead of a website, you have the full flexibility to be creative on what you can do with it. You have the freedom to create a desktop application, a mobile application, integrate it with your existing legacy system, import jobseeker’s profile to your HR system, and so on.
2. Easier implementation and distribution of contents — Recruiters can update their job vacancies on one platform and push all the updates to all clients (twitter, website, mobile application, desktop application, widgets).
3. Low maintenance — As the idea is based on SaaS concept, the application will be maintained by the service provider. Recruiters/Employers/Agencies can just log in on the service provider’s website to search for candidates, update contents and change settings. There is no need for an in-house infrastructure to implement the system.
4. Better Workflow — with a centralized system, workflow between the employer, recruitment agency, and jobseeker will be smoother as all of them will be relying on a single source of data.
Advantages for the Jobseeker
1. Centralized profile information — All of the recruiters/agencies that are affiliated or using the service can search on the centralized jobseekers database. The jobseeker doesn’t need to sign up with each of the recruiter’s websites. Employers’ can also fetch the jobseeker’s information directly from the database so jobseeker don’t need to worry about filling up another form.
The business model
I don’t have to explain in details the business model or how this idea will earn bucks for your company. Go figure! =)
You may contact me for the more detailed specifications of this idea.
18 Jun
As more and more users are getting into the Facebook (FB for brevity), it is becoming the most common communication platform or online social media. I won’t be surprised if the day comes that the term “facebook” will the first word that comes to a person’s mind when asked about online communication (rather than the word “email”).
Recently, Facebook launched its “Facebook Connect” platform where third-party websites can seamlessy integrate facebook authentication into their existing websites. Some companies are confused with the overall idea of “Facebook Connect” and are hesitant in implementing the technology and evasively sees it as a threat to legacy systems and a potential security breach on their existing clientèle or users database. Well, they are wrong because Facebook Connect doesn’t care about their existing system and information.
Here’s how Facebook Connect works. Let’s say we have ‘Company A’. Members/Subscribers of the ‘Company A’s website will be presented with two (2) options before they can login into the website. They can either:
a. Login using their account in a normal login process. Normal login process of course will just cross reference the credentials to the database, pretty straighforward.
b. ‘Facebook Connect’ login on the other hand, checks the cookie of the browser if there is an existing Facebook login (even if they are in other windows or tabs of your browser) and use this information to login to ‘Company A’s website. On the first run, the user will still be prompted if they want to allow ‘Company A’s website to access the Facebook Application. Upon confirmation, the user will automatically be redirected to ‘Company A’s website with some credentials or information about the current logged in user in Facebook. This logged in user can then be associated with the native account on ‘Company A’s website so succeeding Facebook Connect logins will be much faster with just a click of a button (as long as you are logged-in in facebook).
What then is the importance of having a Facebook Connect on your website? Below are some points I can think of:
- avatars will be directly loaded from the user’s primary photo in facebook. This will save you from the pain of uploading, cropping, and image processing of your user’s avatar. This also means free disk space and bandwidth utilization from your website.
- increase membership since there will be an ‘invite your facebook friends’ to sign up with your website
- easier registration since facebook connect can pull out basic information from facebook like birthday, location, gender, country, etc.
- expect more frequent logins since facebook and your website will share the same cookie for login. (Who doesn’t login to facebook these days?)
- promote actions to facebook updates. (e.g “Efren promotes his profile @ Company A’s page. Click here to promote yourself. “). This will bring traffic to your website and a FREE marketing tool as well.
- etc…
Based on what I understand, I don’t see any other reason why companies will not take advantage of having a “Facebook Connect”-enabled website. The only things needed are courage to take risks, a web developer, cups of coffee, and a backup of your existing database (in case something went wrong). Go try and see its worth.
9 Jun
To solve the problem of unable to play MP3 files on Ubuntu Jaunty Jackalope:
sudo aptitude install libxine1-ffmpeg
5 Apr
Recently, I was asked by my colleagues to burn a video file to a DVD. Here are the steps how I managed to accomplish this task using my Ubuntu box.
1. Create the folders and the file structure:
dvdauthor -o newdvd -t /path/to/your/movie.mpg
2. FInalize the structure:
dvdauthor -o dvd -T
3. Create the ISO file from the folder created:
mkisofs -dvd-video -o newdvd.iso newdvd/
4. Use a DVD burning software like GnomeBaker (using sudo apt-get install gnomebaker)
5. Get some popcorn and sodas. Enjoy your movie!
4 Apr
Using the SphinxBehavior, you can filter out the search query based on the record owner. Imagine you have a ‘Clients’ table that belongs to an ‘Account’. In cakePHP, this requires you to have a field ‘account_id’ in the ‘clients’ table. In order to perform a query to Sphinx to return the records only owned by the current user, you need to do this:
$this->userinfo = $this->Auth->user(); //assuming you are using Auth component
$sphinx = array( 'index' => array('clients'), 'filter' => array( array( 'account_id', $this->userinfo['Account']['id'])), 'matchMode' => 'SPH_MATCH_ALL', 'sortMode' => array( 'SPH_SORT_EXTENDED' => '@weight DESC, @id DESC' ));
3 Apr
Recently, I discovered the power of using Google’s AJAX libraries API. This is a content delivery network that delivers popular open source javascript frameworks using Google’s “stable, reliable, high speed, and globally available access“. Inside my CakePHP application, i simple added this on the header:
echo $javascript->link('http://www.google.com/jsapi');
echo $javascript->codeBlock("google.load('mootools', '1.2.1');");
It sure loads the mootools ‘core’ faster. Downside is that I need to manually include the ‘more’ library from mootools. I sure hope my hosting loads as fast as Google’s servers. LMAO
2 Apr
I was using SphinxBehavior and I ran into a situation where i need to search from a specific index only. My sphinx installation currently has 3 indexes — clients, loans, and companies. By default, the SphinxBehavior searches across these 3. In order to search from 1 index only, you need to do this:
$sphinx = array('index'=>array('clients'),'matchMode' => 'SPH_MATCH_ANY', 'sortMode' => array('SPH_SORT_EXTENDED' => '@weight DESC, @id DESC'));
This makes the bahavior search for the record inside the index ‘clients’ only.
Hope this is helpful.
4 Mar
Creating a website nowadays has become painless that almost any internet savvy person can do one. With the existence of open source content management systems (CMS) like wordpress, drupal, and joomla to the free ecommerce applications like oscommerce, zen-cart, and magento, the implementation can be as fast as 5 minutes. You just need to know the basics of FTP, web servers and setting up of a database.
Basic website development is out. API and services is the new IN. More and more companies are investing on creating (or reinventing) their own flexible “service” where end-users and developers can take advantage of.
Designing your system to act as an API-driven service will give your clients the benefit of flexibility. It simply lets your end-users, clients, and fellow developers be creative in using your service. They can do a lot of things like developing another website to interact with your service, create a desktop application using adobe AIR, a Google gadget, mobile application for iPhone, a JAVA application, or they can simply interface their existing system with your service. The possibilities are endless.
15 May
Since cake 1.2, there is already an implementation to dynamically add (or include) a javascript file in the header. This is done in case you need to include a new js file in the header on one of your modules. This will prevent putting the code in the default layout and loading unnecessary javascript files in the header.
<?php echo $javascript->link('nameofjstoadd',false); ?>
This is called in the default.ctp using ‘$scripts_for_layout’ directive inside the header.
Posting tweet...