RSS
 

PHP Shared Session Encoding Solution

06 Feb

I came up against a really baffling problem the other day. I was tasked with adding a Wiki for VideoSift. Rather than just dumping MediaWiki onto the primary VideoSift web server, we wanted to keep it self-contained for security and load reasons, so we installed into one of our other back-end servers which was being used as a MySQL Slave and not hosting any web content. To start with I just did a quick, basic install of Apache2 and PHP5 (I would prefer and attempted to use Nginx with PHP5-FPM, but MediaWiki complains about implementation bugs in the packaged versions available to me and I don’t want to recompile from source).

Read the rest of this entry »

 
9 Comments

Posted in PHP

 

Solution for Facebook Error “FB.login() called before calling FB.init().”

01 Feb

Just thought I’d share this in case anyone comes googling, as I could not find a satisfactory search result, but was fortunate that it was obvious enough that I realized the issue.

I had a page that has had a FB “like” button forever with this code:

<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script> 
<fb:like layout="button_count" show_faces="true" width="80" font="verdana"></fb:like>

I just finished using a bit of the new Facebook API to add some Facebook Connect functionality Read the rest of this entry »

 
 

Dynamic Drop-Down Navigation Menu Like Wired.com’s

24 Apr

A friend recently asked me for a tip on how to create a dynamic pop-up menu like the one used on the main navigation bar of Wired.com. It’s a pretty typical implementation of a menu that pops open when the user hovers over a navigation tab, but I thought I’d share the solution I came up with.

This is a screenshot of what the menu currently looks like at Wired.com:

Read the rest of this entry »

 
 

Dynamic Facebook and Tweetmeme Widgets

09 Apr

We just made a change on YouTube videos so that at the end of playback a Facebook “share” button and a Tweetmeme “retweet” button appear as part of an effort to encourage users to spread videos in their personal social networks.


Read the rest of this entry »

 

JavaScript Video Embed Widget

06 Apr

Overview | Inserting the Widget | Name Collision | Dynamic <script> Loading
Cross-Domain Scripting and XMLHttpRequest | In Conclusion

Overview

At VideoSift we have always made available the embed code for every video on the site. Until now, the provided code has just been the raw <object> and <embed> tags as you would acquire directly from the video host, but we wanted to provide a much more attractive embed.

We opted to achieve such a thing by providing users with a <script> tag that builds the fancy new widget into the DOM of the host page. Initially, the plan was to just generate a pretty simple DOM structure wrapped around a video, but it evolved from there to include:

  • the ability to optionally start out as a thumbnail image that when clicked will expand into the full widget
  • a functional vote button that would remotely cast an up-vote for logged in members
  • a brief, scrollable listing of comments on the video

There were a few interesting issues that needed to be resolved along the way:

  • Where on the host page should the widget be inserted?
  • What happens if the host page contains multiple widget <script> tags?
  • How should we dynamically load the widget in comments on VideoSift?
  • How should we cast votes on remote host pages that need to be posted to VideoSift?

Read the rest of this entry »