Category archive

web development

General Posting

82 articles

ffmpeg

create video thumbnail using ffmpeg

You can use the open source ffmpeg program to extract a frame to use as a thumbnail for a video. Below is an exmple: [shellprompt]# /fullpath/to/ffmpeglibrary/ffmpeg -i InputFile.FLV -vframes 1 -an -s 400×222 -ss 30 OutputFile.jpg -i = Inputfile name -vframes 1 = Output one frame -an = Disable audio -s 400×222 = Output

Nov 23, 2013

Read article

CMS

Set widget label from action file in symfony 1.4

In Action File ========================================================== $this->form = new youFormclassname(); To set individual Label $this->form->getWidget(‘widgetname’)->setLabel(‘widget Custom label’); To set multiple field label $this->form->getWidgetSchema()->setLabels(array( ‘field_name_1’ => ‘Field 1 Custom La

Aug 31, 2012

Read article

HTML

Replace any text from html text by tag name in php

function replace_tag_text($tagName,$subjectStr,$replaceStr) { $tagName = preg_quote($tagName); preg_match_all(‘{<‘.$tagName.'[^>]*>(.*?)</’.$tagName.’>}’,$subjectStr,$matches,PREG_PATTERN_ORDER); $result = str_replace($matches[1],$replaceStr,$subjectStr); return $result; } Usage : Say for Example $ActualStr : ‘<div><sp

Aug 2, 2012

Read article

CMS

Create template specific to node in drupal 6

If you want to have custom templates for your node. You can create templates specific to node ID as follows. Add the below function in your template.php if its not exists. function yourcurrentthemename_preprocess_node(&$vars, $hook) { $node = $vars[‘node’]; $vars[‘template_file’] = ‘node-‘. $node->nid; } If the functio

Mar 9, 2012

Read article

HTML

How to fix flash object z-index

If any of your html element is getting hide behind the flash object such as youtube video player, or any flash player/object Then you should call this function on body load. function fix_flash_z_index() { // loop through every embed tag on the site var embeds = document.getElementsByTagName(’embed’); for (i = 0; i

Feb 26, 2012

Read article

PHP

Replace multiple space with single space in PHP

If you want to replace multiple space with single space from a string you can use preg_replace function for this. Refer the below example preg_replace(“!\s+!”,” “,$yourstring); For example $yourstring = “This contain space”; $modifiedString = preg_replace(“!\s+!”,” “,$yourstring); echo $modifiedString; // This contain

Dec 14, 2011

Read article