RSS

Monthly Archives: August 2009

Backup Amazon S3 with PHP

This is the source code to backup/download Amazon S3 Bucket’s multimedia files to other server by PHP…

here $bucketurl is XML url of Amazon S3 bucket with full ACL.
$folder is path of the server where S3 files to store.

This script will download all files in Amazon bucket to other server

<?php
/* url for Amazon Bucket */
$bucketurl = “http://BUCKETNAME.s3.amazonaws.com/&#8221;;
$xml = file_get_contents($bucketurl);

/* folder name for server */
$folder = “/var/www/html/BUCKETNAME/”;

$content = getTag( ‘Key’, $xml );

foreach($content as $file)
{
exec( “wget -O “.$folder.$file.” “.$bucketurl.$file );
}

/* function to get node from Amazon Bucket XML */
function getTag( $tag, $xml )
{
$tag = preg_quote($tag);
preg_match_all(‘{<‘.$tag.'[^>]*>(.*?)</’.$tag.’>}’, $xml, $matches, PREG_PATTERN_ORDER);
return $matches[1];
}

?>

 

Tags: , , , , , ,

amcharts – dynamic data generated with PHP

AmCharts is a set of Flash charts for your websites and Web-based products. AmCharts can extract data from simple CSV or XML files, or they can read dynamic data generated with PHP, .NET, Java, Ruby on Rails, Perl, ColdFusion, and many other programming languages.

Source:

http://www.amcharts.com/
http://www.amcharts.com/download

Help:

http://www.appfire.com/appfire-flashcharts-plugin/FusionChartsFree/Contents/ChartSS/XML_Col2DLineDY.html

 
Leave a comment

Posted by on August 16, 2009 in javascript, LAMP, Tips, Tricks, Web Services

 

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Design lookup

http://www.sohtanaka.com/
http://preloaders.net/
http://www.noupe.com/
http://antsmagzine.com/

Sticky (Fixed) SideNav Layout with CSS


http://www.learningjquery.com/
http://www.pierrebertet.net/projects/jquery_superbox/
http://usejquery.com/

Home


http://roshanbh.com.np/
http://www.templatemo.com/
http://www.webtemplates.webfirstcreations.com/
http://hambodevelopment.com/
http://www.osvaldas.info/
http://www.veboolabs.com/
http://www.sourcebits.com/
http://twipho.net/
http://jquerystyle.com/

1stWebDesigner


http://www.1stwebdesigner.com/tutorials/53-jquery-tutorials-resources-tips-and-tricks-ultimate-collection/

Home


http://www.mplusz.com/
http://marcgrabanski.com/article/jquery-google-maps-tutorial-basics
http://marcgrabanski.com/webroot/resources/jquery-ui-google-maps/tutorial-part1.html
http://jqueryfordesigners.com/
http://www.templates.com/
http://www.proclipart.com/
http://www.queness.com/post/456/16-impressive-flash-like-javascript-animation-inspirations-tutorials-and-plugins
http://www.k4lab.info/eng/indexeng.htm
http://www.clubclub.fr/
http://abduzeedo.com/web-design-awesome-magazine-style-sites
http://www.creative-outsourcing.com/
http://www.studio7designs.com/blog/101-design-resource-links/
http://www.templamatic.com/
http://bestwebgallery.com/
http://www.css-website.com/
http://www.cssclip.com/
http://csscollection.com/
http://cssdrive.com/
http://www.csselite.com/
http://www.cssflavor.com/
http://cssmania.com/
http://cssremix.com/
http://www.designmeltdown.com/
http://www.designshack.co.uk/
http://www.mostinspired.com/
http://www.professionalontheweb.com/
http://www.dailyslurp.com/
http://www.w3csites.com/
http://www.cssheaven.com/
http://www.cssbeauty.com/

 
Leave a comment

Posted by on August 16, 2009 in Tips, Tricks

 

Tags: , , , , , , , , , , , , ,

Decrypt \x3d

How to decrypt string html like below:

<br /> [“/imgres?imgurl\x3dhttp://crshare.com/wp-content/uploads/auto_save_image/2009/01/232021vkV.jpg\x26imgrefurl\x3dhttp://crshare.com/tag/joomla-templates/\x26usg\x3d__2r0BoANxQQ1IhXj0-dAyU-HVVYI\x3d\x26h\x3d350\x26w\x3d500\x26sz\x3d30\x26hl\x3den\x26start\x3d81\x26sig2\x3d1MTsUlM1eoJ_j8K6hvLdRQ\x26um\x3d1″,””,”c8m2Qp_jYzo4UM:”,”http://crshare.com/wp-content/uploads/auto_save_image/2009/01/232021vkV.jpg&#8221;,”130″,”91″,”Although the \x3cb\x3eJoomla\x3c/b\x3e community”,””,””,”500 x 350 – 30k”,”jpg”,”crshare.com”,””,””,”http://tbn2.google.com/images&#8221;,”1″,[],””]<br />

$html=html_entity_decode(urldecode(str_replace(‘\x’, ‘%’, $html)),ENT_QUOTES, “UTF-8”);

 
Leave a comment

Posted by on August 15, 2009 in LAMP, php, Tips, Tricks

 

Tags:

Get popup center

function get_popup_center(popurl)
{

var top = (screen.availHeight/2)-61;
var left = (screen.availWidth/2)-150;
var width = 300;
var height = 150;
//var popurl = ‘http://www.svnlabs.com&#8217;;

var oWin = popUp(popurl, top, left, width, height);

}

function popUp(URL, top, left, width, height)
{
day = new Date();
id = day.getTime();

eval(“page” + id + ” = window.open(‘”+URL+”‘, ‘” + id + “‘,’toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=”+width+”,
height=”+height+”,top=”+top+”,left=”+left+”‘);”);
return “page” + id;
}

 
5 Comments

Posted by on August 6, 2009 in javascript, LAMP, php, Tips, Tricks

 

Tags: , ,

focus password element from password to ********

/**
*  <form>
*  <input type=”text” name=”password” value=”Password” onfocus=”get_password_focus(this)”>
*  </form>
*  This function can be used for focus password element from password to ********
*/

function password_focus(obj)
{
var newO=document.createElement(‘input’);
newO.setAttribute(‘type’,’password’);
newO.setAttribute(‘name’,obj.getAttribute(‘name’));
obj.parentNode.replaceChild(newO,obj);
newO.focus();
}

 
Leave a comment

Posted by on August 6, 2009 in javascript, LAMP, php, Tips, Tricks

 

Tags: ,

Get page size

function get_page_size() {

var de = document.documentElement;
var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
arrayPageSize = new Array(w,h);
return arrayPageSize;

}

 
Leave a comment

Posted by on August 6, 2009 in javascript, LAMP, php, Tips, Tricks

 

Tags: ,

Change Images

/*
change image on mouseover and click
*/
function mEvent(id,img1,img2,img3) {
var i = new String();
i = document.images[id].src;
document.images[id].src = i.replace(img2,img1);
//for click condition
if(document.images[id].src.indexOf(img3)!=-1)
document.images[id].src = i.replace(img3,img1);
}

 
Leave a comment

Posted by on August 6, 2009 in javascript, LAMP, php, Tips, Tricks

 

Tags: , ,

Protect website folders by .htaccess

<IfModule dir_module>
DirectoryIndex index.html index.php index.php4 index.php3 index.cgi index.pl index.htm index.shtml index.phtml
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteBase /

RewriteCond %{REQUEST_URI} !(css)
RewriteCond %{REQUEST_URI} !(js)
RewriteCond %{REQUEST_URI} !(images)
RewriteCond %{REQUEST_URI} !(videos)
RewriteCond %{REQUEST_URI} !(cache)

</IfModule>

 
2 Comments

Posted by on August 6, 2009 in LAMP, php, Tips, Tricks

 

Tags: , , , ,