Wednesday, November 5, 2008

Re: [coldfusion-howto] convert code from PHP to CFM

Thank you very much.

Mandy

--- On Tue, 11/4/08, Shajahan Hameed <shajahanhameed2001@gmail.com> wrote:
From: Shajahan Hameed <shajahanhameed2001@gmail.com>
Subject: Re: [coldfusion-howto] convert code from PHP to CFM
To: coldfusion-howto@yahoogroups.com
Date: Tuesday, November 4, 2008, 11:58 PM



for displaying the images of specified extension from a folder.

On Tue, Nov 4, 2008 at 10:05 PM, mandy_li_1998 <mandy_li_1998@ yahoo.com>wrote:

> Anybody here know PHP? Can you convert the following code to CFM? At

> least give me some ideas on what the PHP code trying to do?

>

> Thanks

>

> <?php

> $allowed_formats = array("jpg", "jpeg", "JPG", "JPEG", "png", "PNG");

> $exclude_files = array(

> "_derived",

> "_private",

> "_vti_cnf",

> "_vti_pvt",

> "vti_script" ,

> "_vti_txt"

> ); // add any other folders or files you wish to exclude from the gallery.

>

> $path = array();

>

> if(isset($_GET[ 'file_dir' ])){

> $file_dir = $_GET['file_ dir'];

> $dir=opendir( $file_dir) ;

> while ($file=readdir( $dir))

> {

> $ext = substr($file, strpos($file, ".")+1);

>

> if(array_search( $file, $exclude_files) ===false &&

> array_search( $ext, $allowed_formats) !==false) {

>

> $f=$file_dir. '/'.$file;

>

> $path []=$f;

>

> }

> }

>

> closedir($dir) ;

> }

> natcasesort( $path);

>

> print '<?xml version="1.0" encoding="iso- 8859-1"?> ';

> print '<pics';

> print '>';

>

> $directory= $_SERVER['HTTP_ HOST'] .$_SERVER['PHP_ SELF'];

> $directory=dirname( $directory) ;

>

> foreach ($path as $val) print '<pic

> src="'.'http: //'.$directory. '/'.$val. '" title="'.$val. '" />';;

> print "</pics>";

> ?>

>

>

>

[Non-text portions of this message have been removed]











[Non-text portions of this message have been removed]


------------------------------------

~~~~~~~~~
*** Yahoo's No. 1 and the biggest group of ColdFusion Developers

ColdFusion MX Hosting - 250 MB Space/5 GB monthly Bandwidth for just $19.99/year. Free Setup, ASP.NET, HELM Control Panel. http://www.hostingatoz.com. We also offer ColdFusion Reseller Hosting Plans.

Post message: coldfusion-howto@yahoogroups.com
Subscribe: coldfusion-howto-subscribe@yahoogroups.com
Un-Subscribe: coldfusion-howto-unsubscribe@yahoogroups.com


...
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/coldfusion-howto/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/coldfusion-howto/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:coldfusion-howto-digest@yahoogroups.com
mailto:coldfusion-howto-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
coldfusion-howto-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/