Gallery

Marik

Registered
Искам да попитам виждали сте сайтове като forumer.com примерно на които се инсталират форуми и нямат никакво ограничение в мястото и форума се подържа е нещо такова ми трябва и за галерия някои да знае такива сайтове.

Ето примерно дата.бг имат същата функция са ама като си платиш де.
:roll: Благодаря
 
Ами има такива сайтове които можеш да си инсталираш като модул phpbb-то и към него галерия да си сложиш.

Ето как можеш да си нарпавиш форум безплатно за няколко минути:

http://forumi.bg
http://forumi.us
 
Ставаше на въпрос само за галерия ма дадох пример с форум.

Ще попитам имали някаква галерия или Plugin в Coompare Gallery да може да дава картинки от URL без да ги качва на сървъра примерно да им прави там някакъв thumbel resize и така :?
 
Ммм.. едвали.. ама имаше една тема на скоро това се питаше.. пишеш url-то (качва се в базата данни урл-то) след това се препраща към страничка с индексираните картинки и там ти я визуализира.. само от url-та.. без да се качва нищо. :?:
 
Ще се поровя.. добре...

Код:
<?php 
/************************************************* 
 * Micro Photo Gallery 
 * 
 * Version: 1.0 
 * Date: 2007-04-05 
 * 
 * Usage: 
 * Just copy these files into your image folder 
 * 
 ****************************************************/ 

 $columns     = 5; 
 $thmb_width  = 120; 
 $thmb_height = 80; 

function resizeImage($originalImage,$toWidth,$toHeight){ 
    
    // Get the original geometry and calculate scales 
    list($width, $height) = getimagesize($originalImage); 
    $xscale=$width/$toWidth; 
    $yscale=$height/$toHeight; 
    
    // Recalculate new size with default ratio 
    if ($yscale>$xscale){ 
        $new_width = round($width * (1/$yscale)); 
        $new_height = round($height * (1/$yscale)); 
    } 
    else { 
        $new_width = round($width * (1/$xscale)); 
        $new_height = round($height * (1/$xscale)); 
    } 
    // Resize the original image 
    $imageResized = imagecreatetruecolor($new_width, $new_height); 
    $imageTmp     = imagecreatefromjpeg ($originalImage); 
    imagecopyresampled($imageResized, $imageTmp, 0, 0, 0, 0, $new_width, $new_height, $width, $height); 

    return $imageResized; 
} 

function generateThumbnails(){ 
   global $thmb_width,$thmb_height; 
    
   // Open the actual directory 
   if ($handle = opendir(".")) { 
      // Read all file from the actual directory 
      while ($file = readdir($handle))  { 
         // Check whether tha actual item is a valid file 
         if (is_file($file)){ 
            // Check whether the actual image is a thumbnail 
               if (strpos($file,'_th.jpg')){ 
                  $isThumb = true; 
               } else { 
                  $isThumb = false; 
               } 
             
               if (!$isThumb) { 
                  // Process the file string 
                  $dirName  = substr($file,0,strpos($file,basename($file))); 
                  if (strlen($dirName) < 1) $dirName = '.'; 
                  $fileName = basename($file); 
                  $fileMain = substr($fileName,0,strrpos($fileName,'.')); 
                  $extName  = substr($fileName,strrpos($fileName,'.'), 
                                 strlen($fileName)-strrpos($fileName,'.')); 
                  
                  // Check if the actual file is a jpeg image 
                  if (($extName == '.jpg') || ($extName == '.jpeg')){ 
                   $thmbFile = $dirName.'/'.$fileMain.'_th.jpg'; 
                   // If a thumbnail dosn't exists tahn create a new one 
                   if (!file_exists($thmbFile)){ 
                      imagejpeg(resizeImage($file,$thmb_width,$thmb_height),$thmbFile,80); 
                   } 
               } 
               } 
            } 
         } 
   } 
    
} 

function getNormalImage($file){ 
   $base = substr($file,0,strrpos($file,'_th.jpg')); 
   if (file_exists($base.'.jpg')) return $base.'.jpg'; 
   elseif (file_exists($base.'.jpeg')) return $base.'.jpeg'; 
   else return ""; 
} 

function displayPhotos(){ 
   global $columns; 
    
   generateThumbnails(); 
   $act = 0; 
   // Open the actual directory 
   if ($handle = opendir(".")) { 
      // Read all file from the actual directory 
      while ($file = readdir($handle))  { 
         // Check whether tha actual item is a valid file 
         if (is_file($file)){ 
            // Check whether the actual image is a thumbnail 
               if (strpos($file,'_th.jpg')){ 
               ++$act; 
               if ($act > $columns) { 
                  echo '</tr><tr><td class="photo"><a href="'.getNormalImage($file).'"><img src="'.$file.'" alt="'.$file.'"/></a></td>';    
                  $act = 1; 
               } else { 
                  echo '<td class="photo"><a href="'.getNormalImage($file).'"><img src="'.$file.'" alt="'.$file.'"/></a></td>';    
               } 
                   
               } 
            } 
      } 
   }    
} 

?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> 
<html> 
<head> 
   <title>Micro Photo Gallery</title> 
   <link href="style/style.css" rel="stylesheet" type="text/css" /> 
</head> 
<body> 
  <div id="main"> 
    <div class="caption">Micro Photo Gallery</div> 
      <table align="center"><tr>      
          <?php displayPhotos(); ?> 
      </table>       
           
   <div id="source">Micro Photo Gallery 1.0</div> 
  </div> 
</body>


Това е за галерията ти :?:
Автоматик създава нова галерия..
 
Ето това: http://web-tourist.net/forum/viewtopic.php?t=9666

Може да го преработиш малко и да направиш така че да визуализира като <img> линка !

Ейсега ще ти дам супер по-малко скриптче с няколко реда :?:
 
index.php
Код:
<form method="post" action="save.php"> 
<br>Снимка url: <input type="text" name="text1"> <font color=red>*</font>
<br>Снимка url: <input type="text" name="text2"><font color=red>*</font>
<br>Снимка url: <input type="text" name="text3">
<br>Снимка url: <input type="text" name="text4">
<br>Снимка url: <input type="text" name="text5">
<br>Снимка url: <input type="text" name="text6">
<p<input type="submit" value="Подай заявката">
</form>

save.php
Код:
<?php 

$f_ime = "zaqvki.php"; 
//Приетите линкове 
//text1 отговаря на първата форма 
$text1 = $_POST['text1']; 
$text2 = $_POST['text2']; 
$text3 = $_POST['text3'];
$text4 = $_POST['text4'];
$text5 = $_POST['text5'];
$text6 = $_POST['text6'];
//А ето и начина по който се записват данните 
$sydyrjanie = "Снимка <img src="http://$text1"> <br>"; 
$sydyrjanie2 = Снимка <img src="http://$text2"> <br>"; 
$sydyrjanie3 = "Снимка <img src="http://$text3"><br>"; 
$sydyrjanie4 = "Снимка <img src="http://$text4"> <br>";
$sydyrjanie5 = "Снимка <img src="http://$text5"><br>";
$sydyrjanie6 = "Снимка <img src="http://$text6"> <p><hr align=left width=200>";


$fp = fopen($f_ime, "a");
fwrite($fp, $sydyrjanie);
fwrite($fp, $sydyrjanie2);
fwrite($fp, $sydyrjanie3);
fwrite($fp, $sydyrjanie4);
fwrite($fp, $sydyrjanie5);
fwrite($fp, $sydyrjanie6);
fclose($fp); 
echo ( "Заявката е изпратена <i>успешно</i> "); 
?>

zaqvki.php
Код:
просто съзадаш файла


Снимките могат да се вадят и с include в някоя друга страница..

Както и да се инклудне някъде файла дето се пишат заявките за url-тата и ще стане красиво. :?:
 

Back
Горе