Beispiel #1
0
     if (eregi("\\.jpe?g\$", $filename) || eregi("\\.gif\$", $filename) || eregi("\\.png\$", $filename)) {
         $filearray[$img_count] = $filename;
         if (!file_exists($mythumbdir . '/' . $filename)) {
             slideshow_thumbnail($course_dir, $showdir, $filename);
         }
         $img_count++;
     }
 }
 sort($filearray);
 //
 // display caption form:
 $img_count = 0;
 foreach ($filearray as $filename) {
     //$piclist[$img_count] = $filename;
     if (!file_exists($my_thumbdir . '/' . $filename)) {
         slideshow_thumbnail($course_dir, $slideshow->location, $filename);
     }
     $currentimage = slideshow_filetidy($filename);
     if ($caption_array[$currentimage]['image'] != '') {
         $captionstring = $caption_array[$currentimage]['caption'];
         $titlestring = $caption_array[$currentimage]['title'];
     } else {
         $captionstring = $currentimage;
         $titlestring = '';
     }
     echo '<tr><td align = "right"><img src="' . $urlroot . '/moddata/' . $slideshow_thumbdir . '/' . $slideshow->location . '/' . $filename . '" alt="' . htmlentities($captionstring) . '"></td>' . "\n";
     echo '<td>';
     if (isteacher($course->id)) {
         echo '<input type = "hidden" name="image' . ++$img_count . '" value="' . slideshow_filetidy($filename) . '"> ' . "\n";
         echo 'Title: <input type = "text" name="title' . $img_count . '" value="' . str_replace("\"", "&quot;", $titlestring) . '" size="40">';
         echo '<br>Caption: <input type = "text" name="caption' . $img_count . '" value="' . str_replace("\"", "&quot;", $captionstring) . '" size="80">';
Beispiel #2
0
     $toobig = array();
     $caption_array = caption_array($cm->id);
     //  iterate and process images in directory $filearray
     while ($filename = readdir($dh)) {
         if (eregi("\\.jpe?g\$", $filename) || eregi("\\.gif\$", $filename) || eregi("\\.png\$", $filename)) {
             $filearray[$img_count] = $filename;
             //
             // if userlevel >= teacher compare pre-existence of thumbnail and store if too big
             if (isteacher($course->id)) {
                 if (filesize($course_dir . '/' . $showdir . '/' . $filename) / 1024 > $maxk && (!file_exists($mythumbdir . '/' . $filename) || $recompress)) {
                     $toobig[] = $filename;
                 }
             }
             // ensure existence of thumbnail
             if (!file_exists($mythumbdir . '/' . $filename)) {
                 slideshow_thumbnail($course_dir, $showdir, $filename);
             }
             $img_count++;
         }
     }
     //echo '<br>count '.$img_count.' imgs: caption:'.$slideshow->filename.' - layout '.$slideshow->layout.'<br>';
     if ($img_count > 0) {
         sort($filearray);
     }
 } else {
     // NO GD ////////////////////////////////////////
     //
     //  Get a less pikey server ...
     error('Sorry, You need to enable GD to use this module');
 }
 ////////////////////////////////////////////////