Výsledky 1 až 3 z 3

Téma: autogallery plugin do wordpressu 2.0.2

  1. #1
    Senior Member Avatar uživatele sAd
    Založen
    20.04.2004
    Bydliště
    FM & HK
    Příspěvky
    538
    Vliv
    270

    Standardní autogallery plugin do wordpressu 2.0.2

    zdravím. chtěl bych použít tenhle plugin do wordpressu, abych nemusel ručně linkovat obrázky, ale na mojem hostingu to nefunguje.

    hosting je na pipni.cz . upload je na http://myistri.net/uploads/Image . hostname je http://myistri.net .

    zkoušel jsem to na phphome s register_globals = OFF a funguje mi to dobře, takže globálníma proměnnýma to nebude. přístupové práva jsou pro všechny složky na 777.

    v php jsem celkem lama, tak nevím, kde by mohla být chyba.

    Kód:
    function autogallery($text) {
      global $id;
    
      // Settings start
    
      $usehostname = "yes"; // If You want to use the hostname in image-URLs set to yes.
      $image_root = "/uploads/Image/"; // Set this to Your image-root.
      $thumbnail_prefix = "^(150|thumbs|thumb)\-"; // Your thumbnail-prefixes as "regexp"
      $allowed_files = "(jpg|png|gif)"; // Allowed files as "regexp".
    	
      // Settings end
    	
      if ($usehostname == "yes") {
      $usehost = "http://".$_SERVER["HTTP_HOST"];
        }
        $filedir = $image_root.$id."/";
        $searchdir = $_SERVER["DOCUMENT_ROOT"].$filedir;
    
        if (is_readable($searchdir)) {
          if ($handle = opendir($searchdir)) {
            while (false !== ($file = readdir($handle))) { 
              if (eregi($allowed_files, $file) && eregi($thumbnail_prefix, $file) && !eregi($file, $text)) {
                $imagename = $searchdir."".$file; 
                if (is_readable($imagename)) {
                  $countup++;
                  clearstatcache();
    							
                  $size = @getimagesize($searchdir.$file);
                  $thumbnail = $usehost . $filedir . eregi_replace($thumbnail_prefix, "", $file);
                  $gallery_image = $usehost . $filedir . $file;
    
                  $alt_title = eregi_replace($thumbnail_prefix, "", $file);
                  $alt_title = eregi_replace($allowed_files, " ", $alt_title);
                  $alt_title = eregi_replace("([^a-zA-Z0-9_\-])", "", $alt_title);
                  $alt_title = eregi_replace("_|\-", " ", $alt_title);
    
                  $gallery .= "<a href=\"".$thumbnail."\" target=_blank><img class=\"center\" src=\"".$gallery_image."\" alt=\"".ucwords($alt_title)."\" title=\"".ucwords($alt_title)."\" ".$size[3]." /></a> ";
                }
              } 
            }
    	closedir($handle);
          }
        }
    
        if (eregi("<!--gallery-->", $text)) {
          if ($countup == 0) {
            $gallery = eregi_replace("<!--gallery-->", "", $text);
          } else {
            $gallery = eregi_replace("<!--gallery-->", $gallery, $text);
          }
        } else {
          $gallery = $text;
        }
    
        return $gallery;
      }
    
      add_filter('the_content', 'autogallery', 4);
    YUKI > HP 6710b > Intel Core 2 Duo Mobile T7250 2 GHz > 2×1024 MB Nanya DDR2, 667 MHz > intel X25-M G2 80 GB SSD > dokovací stanice HP 2008 120W > LCD HP LP2275w
    SORA > Intel Little Falls 2 > Intel Atom 330 1,6 GHz > 1×2048 MB Corsair DDR2, 667 MHz > Samsung SpinPoint F1 HD322HJ 320 GB
    ERI > Nokia 700 > Belle FP1

  2. #2
    Senior Member Avatar uživatele sAd
    Založen
    20.04.2004
    Bydliště
    FM & HK
    Příspěvky
    538
    Vliv
    270

    Standardní Re: autogallery plugin do wordpressu 2.0.2

    tak už jsem na to přišel. má to něco do souvislosti s nastavením pipni.cz a proto je to třeba nastavit takhle:
    Kód:
      // Settings start
    
      $usehostname = "yes"; // If You want to use the hostname in image-URLs set to yes.
      $image_root = "/uploads/Image/"; // Set this to Your image-root.
      $thumbnail_prefix = "^(150|thumbs|thumb)\-"; // Your thumbnail-prefixes as "regexp"
      $allowed_files = "(jpg|png|gif)"; // Allowed files as "regexp".
    	
      // Settings end
    	
      if ($usehostname == "yes") {
      $usehost = "http://".$_SERVER["HTTP_HOST"];
        }
        $filedir = $image_root.$id."/";
        $searchdir = $searchdir = "/DISK2/WWW/myistri.net/www/uploads/Image/".$id."/";
    vzhledem k tomu, že tenhle thread nemůžu smazat, tak prosím mody, aby to udělali za mně. pokud ovšem nedojdou k závěru, že je důležitý.
    YUKI > HP 6710b > Intel Core 2 Duo Mobile T7250 2 GHz > 2×1024 MB Nanya DDR2, 667 MHz > intel X25-M G2 80 GB SSD > dokovací stanice HP 2008 120W > LCD HP LP2275w
    SORA > Intel Little Falls 2 > Intel Atom 330 1,6 GHz > 1×2048 MB Corsair DDR2, 667 MHz > Samsung SpinPoint F1 HD322HJ 320 GB
    ERI > Nokia 700 > Belle FP1

  3. #3
    Member Avatar uživatele ..::Ozzy::..
    Založen
    27.05.2004
    Bydliště
    Vlašim@Benešov
    Věk
    43
    Příspěvky
    176
    Vliv
    260

    Standardní Re: autogallery plugin do wordpressu 2.0.2

    OT: známá chyba na pipni a nikde o tom ve svem FAQ nemaj napsano. Po nekolika hodinove mailove prestrelce sem to z jijich podpory vymlatil
    Software is like SEX,
    it's better, when it's FREE!

    by Linus Torvalds
    PC:AMD Barton 2500+@3200+ 1,75V locked|ACC rev2|Soltek SL-K600-C|2x512MB DDR433 CL2.5|Saegate80GB 2MB cache ATA/133 + Samsung250GB 8MB cache ATA/133|ATi Saphire R9600XT 537/640|Acer LCD 20" AL2016W 16:10|DVD LG4120|Genius Home Theatre 5.1|Logitech Click@Mouse|dolby keyboard|3R-System case soft moded|TV Tuner Leadtek Winfast DTV1000T|Gentoo 2005.1|KDE 3.5 sometimes switch to WinXP
    Work NB: HP nw8000 + Qtek8310

Informace o tématu

Users Browsing this Thread

Toto téma si právě prohlíží 1 uživatelů. (0 registrovaných a 1 anonymních)

Podobná témata

  1. Plugin Getright do FF - jak se ho zbavit?
    Založil Levisek v sekci fóra Programy a problémy s nimi
    Odpovědí: 11
    Poslední příspěvek: 25.07.2005, 02:03

Pravidla přispívání

  • Nemůžete zakládat nová témata
  • Nemůžete zasílat odpovědi
  • Nemůžete přikládat přílohy
  • Nemůžete upravovat své příspěvky
  •