Archive for category Wordpress

Enabling HTML5 for Blipblip.tv in WordPress plugin Video Sidebar Widgets

English Begin E

The problem

Visiting my blog from a tablet I noticed that theBlip.Tv videos I set in Video Sidebar Widgets were not shown. Doing a research I realized the plugin loaded the old flash-based player  instead of the HTML5 version, so videos coudn’t be played from mobile devices with not flash support, which are the majority of the handheld systems nowadays.

The solution

I just had to add some conditionals in files helper-functions.php and class-videosidebarwidget.php to consider the Blipblip.tv case and thus I added the HTM5 player. In particular, I added the following lines to helper-functions.php:

elseif($admin=="true"){
 if($source == "Blip"){
 echo "\n<iframe src=\"$value.html?p=1\" width=\"250\" height=\"250\" 
 frameborder=\"0\" allowfullscreen>
 </iframe> 
 
 <embed type=\"application/x-shockwave-flash\" src=\"http://a.blip.tv/api.swf#$v_id2\" 
 style=\"display:none\">
 </embed>\n\n"; 
 }else{ 
 // echo video in admin
 echo "\n<object width=\"212\" height=\"172\">\n";
 echo $flashvar;
 echo "<param name=\"allowfullscreen\" value=\"true\" />\n";
 echo "<param name=\"allowscriptaccess\" value=\"always\" />\n";
 echo "<param name=\"movie\" value=\"$value\" />\n";
 echo "<param name=\"wmode\" value=\"transparent\">\n";
 echo "<embed src=\"$value\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" ";
 echo "allowfullscreen=\"true\" allowscriptaccess=\"always\" ";
 echo $flashvar2;
 echo "width=\"212\" height=\"172\">\n";
 echo "</embed>\n";
 echo "</object>\n\n";
 }
}else{

And in file class-videosidebarwidget.php I edited the below code:


case 'Blip': $rv_value = "http://blip.tv/play/$Embed_id"; $rv_flashvar = ""; $rv_flashvar2 = ""; $rv_cap = $Embed_cap;

And I added the following lines:

if($select_source == "Blip"){ 
 echo "\n<iframe align=\"left\" src=\"$rv_value.html?p=1\" width=\"$RV_width\" height=\"$RV_height\" 
 frameborder=\"0\" allowfullscreen>
 </iframe>
 
 <embed type=\"application/x-shockwave-flash\" src=\"http://a.blip.tv/api.swf#$Embed_id\" 
 style=\"display:none\">
 </embed>\n\n";
}else{
 echo "\n<object width=\"$RV_width\" height=\"$RV_height\">\n";
 echo $rv_flashvar;
 echo "<param name=\"allowfullscreen\" value=\"true\" />\n";
 echo "<param name=\"allowscriptaccess\" value=\"always\" />\n";
 echo "<param name=\"movie\" value=\"$rv_value\" />\n";
 echo "<param name=\"wmode\" value=\"transparent\">\n";
 echo "<embed src=\"$rv_value\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" ";
 echo "allowfullscreen=\"true\" allowscriptaccess=\"always\" ";
 echo $rv_flashvar2;
 echo "width=\"$RV_width\" height=\"$RV_height\">\n";
 echo "</embed>\n";
 echo "</object>\n\n";
 }
 if(!empty($rv_cap)){echo "<p class=\"VideoCaption\">$rv_cap</p>\n\n";};
 
 
 echo $after_widget;
 }

After these changes random HTM5 videos are loaded without problems.

Plugin support

By the way, I tried to contact the plugin developer to include these changes and he said he had not time for doing it. It a shame it’s not open-sourced so somebody else can maintain the code.


,

No Comments

How to exclude files on cPanel’s backups

 

cPanel Backups

When the falling down of Megaupload, all files I had hosted there (by the way, all legal) I had to start serving them from my hosting. This brought me a additional problem, because my blog’s backups increased from 60 MB to 3 GB. Due to I automated the backups with cPanel, and due to I didn’t see any option to exclude files and folders, so I was ready to do all the backup work, I mean, to use the MySQL client to make the database backups, generate the compressed file by my own only with the important files, make a cron job, etc…but seeing the files on my home directory I came across a files named cpbackup-exclude.conf. Doing a little research, indeed this file allows to exclude files an folders when doing a full backup on cPanel. Just create the file in the user’s home directory and add the path to be excluded. But bear in mind its format is a litlle tricky, so let’s see how I edited it for my blog:

public_html/wp-content/uploads/*
backup-*
tmp/*

 

First line indicates not to make backups of files under public_html/wp-content/uploads, relative to my user account. Notice that it ends with * wildcard, otherwise it will be misinterpreted, even though you put a directory path. Second line states not to make backups of files beginning with “backup-“, this way backups of backups are avoided. Finally, last line says not to make a backup of temp files of my user account.

After doing all this, my backup decreased from 3 GB to50 20 MB of disk space…much better!!

2 Comments

Luis’ Blog now supports smartphones (Android, Apple, Others)

WPTouch OK

Due to I’m writing some post related to Android, and browsing some sites on Internet, I decided to do a research to offer the mobile version for smartphones. Just install the WPtouch plugin at the plugin manager and you will have the support enabled.

WPtouch and qTranslate

If your site has more than one language and you uses qTranslate, since version 1.9.10 WPtouch integrates with this plugin but in a very basic level, I mean, just with post links. If you have set other aspect on your site, then you have edit the scripts.

WPTouch mal

For example, I have set my site title in two languages, to make it parse it right I had to edit this file../wptouch/themes/core/core-functions.php, at line 122 as follow:

function wptouch_core_body_sitetitle() {
 $str = bnc_get_header_title();
 echo __(stripslashes($str));

 }

In other words, I had to add the __( ) invocation as explained at qTranslate’s forum

References

,

2 Comments

Multilingual WordPress posts

Translating WordPress

As you can, see some of my posts have an English and Spanish version that is loaded according to your browser’s default language or by clicking on your language flag from the right sidebar. You might think it’s some kind of auto-translate function provided by Google or Yahoo’s Babel Fish, but it’s not.

Read the rest of this entry »

,

No Comments