getreidemuehlen
-


Hinweise


Antwort
 
LinkBack Themen-Optionen Thema durchsuchen Thema bewerten
Alt 04.07.2005, 11:38   #1
TP-Insider
 
Registriert seit: Jul 2003
Ort: München
Fexxx ist auf einem guten Weg

Wordpress & Lazy Gallery


Hallo,

vielleicht kennt der ein oder andere das Plugin für Wordpress? Mein Problem ist, ich möchte diese Gallery in die Seite als einen Menüpunkt einbauen. (Normalerweise ist die Gallery eine eigene Seite.) Das Einbauen habe ich soweit hinbekommen und auch die Bilder werden als Thumbnail angezeigt, nur wenn man auf eins klickt landet man immer auf der Startseite (index.php). Was muss ich hier im Script ändern?

Meine Seite hat die ID ?page_id=4

Das Script:

PHP-Code:
<?php
// Globals - Do not tamper with these
global $gallery_root$gallery_address$file$excluded_folders$pictwidth$pictheight$thumbwidth$thumbheight$gallery_width$gallery_sidebar;

// ---------- Settings ----------
// Configure these settings, to use the gallery.
 
// Your gallery folder (this is where your pictures and picture folders are located).
$gallery_address '/daniel/wp-gallery/';

// Sidebar position
$gallery_sidebar 'right'// left or right

// Add foldernames to exclude. (add more lines like this on more excludes.)
$excluded_folders[] = 'cgi-bin';

// Picture size
$pictwidth 400;
$pictheight 400;

// Thumbnail size
$thumbwidth 110;
$thumbheight 110;
// ---------- Settings end ----------

// Do not edit below this line 
$gallery_root $_SERVER['DOCUMENT_ROOT'].$gallery_address;
$gallery_address 'http://'.$_SERVER['HTTP_HOST'].$gallery_address;

function 
showGallery() {
    global 
$file;
    
    if (!
validateFile())
    {
        echo 
'Invalid folder or file';
        return;
    }
    
createNavigation();

    
$path pathinfo($file);
    if (
$path['extension'] == '')
    {
    
//Display Dir(s) (if any)
    
showDirs();

    
//Display Thumb(s) (if any)
    
showThumbs();

    } else {
    
showSlide($file);

    }
}

function 
setCurrentdir()
{
    global 
$currentdir$file;
    
$path pathinfo($file);
    if (
$path['extension'] != '')
        
$currentdir $path['dirname'].'/';
    else
        
$currentdir $file;
}

function 
showDirs() {

    global 
$gallery_root$currentdir$file$excluded_folders;
    
$runonce false;
    if (
$dir_content opendir($gallery_root.$currentdir)) {
        
        while ( 
false !== ($dir readdir($dir_content)) ) {
            if (
is_dir($gallery_root.$currentdir.$dir) && !in_array($dir$excluded_folders) && $dir!='.' && $dir!='..' ) {
                if ( !
$runonce ){
                    echo 
'<div class="folders"><br/>Bilderordner:<br/>';
                    
$runonce true;
                }
                echo 
'<a href="'.$_SERVER['PHP_SELF'].'?file='.$currentdir.$dir.'/">&raquo; '.$dir.'</a><br>';
            }
        }
       }
    if ( 
$runonce )
        echo 
'</div><br/>';
}

function 
showSlide($slidefile) {
    
    global 
$gallery_root$gallery_address$currentdir$file;
    if (
$dir_content opendir($gallery_root.$currentdir)) {
        while ( 
false !== ($img readdir($dir_content)) ) {
            if ( 
is_file($gallery_root.$currentdir.$img) && eregi(".*(\.jpg|\.gif|\.png|\.jpeg)"$img))
                    
$imgfiles[] = $img;
        }
    }

    
$prev '';
    
$slide '';
    
$next '';

    
$arraysize count($imgfiles);
    
    for (
$i=0$i $arraysize$i++) 
    {
    
        if(
$currentdir.$imgfiles[$i] == $slidefile)    
        {
            
$slide $imgfiles[$i];
            
// Set prev
            
if($i==0)
                
$prev $imgfiles[$arraysize-1];
            else
                
$prev $imgfiles[$i-1];
            
// Set Next
            
if($i+== $arraysize)
                
$next $imgfiles[0];
            else
                
$next $imgfiles[$i+1];                
        }
    }
    
    
// Get picture info
    
$img $gallery_root.$currentdir.$slide;
    
$path pathinfo($img);
    switch(
strtolower($path["extension"])){
        case 
"jpeg":
        case 
"jpg":
            
$img=imagecreatefromjpeg($img);
            break;
        case 
"gif":
            
$img=imagecreatefromgif($img);
            break;
        case 
"png":
            
$img=imagecreatefrompng($img);
            break;
        default:
            break;            
    }
    
$xsize = (imagesx($img));
    
$ysize = (imagesy($img));
    
imagedestroy($img);
    
    echo 
'<div id="nav">
        <a href="'
.$_SERVER['PHP_SELF'].'?file='.$currentdir.$prev.'" class="alignleft">&laquo; Prev</a>
        <a href="'
.$_SERVER['PHP_SELF'].'?file='.$currentdir.$next.'" class="alignright">Next &raquo;</a>
        </div>
        <br/>
        <div class="image"><a href="'
.$gallery_address.$currentdir.$slide.'" target="_new"><img src="./wp-content/plugins/lazy-gallery/lazy-img.php?file='.$currentdir.$slide.'&thumb=0"></a>
        </div>
        <br/>
        <div class="imgdata">
        Image data<br/>
        Actual size: '
.$xsize.' x '.$ysize.'<br/>
        </div>'
;
}

function 
showThumbs() {
    
    global 
$gallery_root$currentdir$file$thumbwidth$thumbheight;
    
    if (
$dir_content opendir($gallery_root.$currentdir)) {
        while ( 
false !== ($file readdir($dir_content)) ) {
            if ( 
is_file($gallery_root.$currentdir.$file) )
                if(
eregi(".*(\.jpg|\.gif|\.png|\.jpeg)"$file))
                    
$imgfiles[] = $file;
        }
    }
    echo 
'<div class="image">';
    if(isset(
$imgfiles))
    {
        foreach (
$imgfiles as $img)
        {
            
//echo '<div style="position: relative; width: '.($thumbwidth+16).'px; height: '.($thumbheight+16).'px; border: 1px solid #a9a9a9;">';
            
echo '<a href="'.$_SERVER['PHP_SELF'].'?file='.$currentdir.$img.'"><img src="./wp-content/plugins/lazy-gallery/lazy-img.php?file='.$currentdir.$img.'&thumb=1"></a>';
            
//echo '</div>';
        
}
    }
    echo 
'</div>';
}

// Validates file variable
function validateFile() {

    global 
$excluded_folders$file;
    
$file $_GET['file'];
    
    
// validate dir
    
if ( strstr($file'..') || strstr($file'%2e%2e') )
        return 
false;
        
    foreach (
$excluded_folders as $folder)
    {
        if ( 
strstr($file$folder) )
        return 
false;
    }
    
setCurrentdir();
    return 
true;
}

function 
createNavigation()
{
    global 
$currentdir$file;

    if (
$currentdir == './')
    
$currentdir '';
    
$nav split('/'$currentdir);
    
array_pop($nav);
    
$path pathinfo($file);
    
    echo 
'<div>Aktuelles: &raquo; <a href="'.$_SERVER['PHP_SELF'].'">Gallery</a> ';
    foreach (
$nav as $n)
    {
        
$current .= $n.'/';
        echo 
'&raquo; <a href="'.$_SERVER['PHP_SELF'].'?file='.$current.'">'.$n.'</a> ';
    }
    if (
$path['extension']!='')
        echo 
'&raquo; <a href="'.$_SERVER['PHP_SELF'].'?file='.$current.$path['basename'].'">'.$path['basename'].'</a>';
    echo 
'</div>';
}
?>
__________________
Spitzen Hoster: All-Inkl
Fexxx ist offline   Mit Zitat antworten


Antwort

  Aktuelles Thema
  TP Hilfe Forum > Web-Editoren & Coding > Traum-Dynamik
Wordpress & Lazy Gallery Wordpress & Lazy Gallery
« Spieler erkennung auf Server | kann sql script nicht aufspielen »

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 23:25 Uhr.

Powered by: vBulletin Version 3.7 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd. / Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Traum-Projekt.com | Suchen | Archiv | Impressum | Kontakt | | | Nach oben |



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67