Jump to content

ferozsho

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

About ferozsho

  • Birthday 05/29/1976

Profile Information

  • Gender
    Male
  • Location
    Hyderabad - India

ferozsho's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi! try this...Hope its work for you.
  2. hi, just change this [ " ] => [ \" ] in your $message... Its work and tested...
  3. Hi I'm new to PHP and just discovering how useful it is. What i am trying to do is each time a visitor comes to the site they see a different image, and the image are in [1,2,3,4,5] and with random image script its work fine. I want to display images depend on there Priority like ex: 4th Image has [High Priority] and its has to display every 3rd image , 4 time's on each refresh. ex:[ 1,2,3,4,4,4,4,5] like this same as 2 having [Medium] so the seq: will be [1,2,2,4,4,4,4,5]... so on Thanks in advance. The Code:: include("../admin/config.php"); $folder = '../admin/ramdamimg/'; $exts = 'jpg jpeg png gif'; $files = array(); $i = -1; // Initialize some variables if ('' == $folder) $folder = './'; $handle = opendir($folder); $exts = explode(' ', $exts); while (false !== ($file = readdir($handle))) { foreach($exts as $ext) { // for each extension check the extension if (preg_match('/\.'.$ext.'$/i', $file, $test)) { // faster than ereg, case insensitive //check the status of file if($oRan->isActive($file)=='Show'){ $files[] = $file; // it’s good ++$i; } } } } closedir($handle); // We’re not using it anymore if($files[0]==''){ $imagename=$path["webroot"].'common/theme/Default/image/default.jpg'; } else { srand((double)microtime()*1000000); // seed for PHP < 4.2 $rand = mt_rand(0, $i); // $i was incremented as we went along $filename = $files[$rand]; $src_file = $folder.$filename; setcookie("f_na",$oRan->getLink($filename),time()+300); $fixside = 223; $fixside_h = 181; $dest_file= $path["docroot"]."_files/random/".$filename; $image_info = getimagesize($src_file); if (($image_info[0] > $fixside) || ($image_info[1] > $fixside_h)){ if(!is_dir($path["docroot"]."_files/random")){ mkdir($path["docroot"]."_files/random"); } if(!file_exists($dest_file)) { $oMMenu->resizeImage($src_file,$dest_file,$fixside,$fixside_h,"100","#ffffff"); } $imagename=$path["webroot"]."_files/random/$filename"; } else { $imagename=$path["webroot"]."ramdamimg/$filename"; } } header('Location: '.$imagename); Great site by the way.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.