Comment #11 on issue 144 by kukrapoke: Easy C++ Wrapper for Embedding
http://code.google.com/p/v8/issues/detail?id=144

<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// SimpleViewer
// ---------------------------------------------------------------------
// Access your SimpleViewer gallery right through this page by getting
// a summary of your currently installed albums first. After your choice
// the requested album will be loaded from the according directory.
//
// Note:
// This file contains the summary, the albums and the installation link.
// This file is embedded in the index.php.
// ---------------------------------------------------------------------
// Copyright (c) 2004,2005 Christian Machmeier
// ---------------------------------------------------------------------
//
// $Id: SimpleViewer.php,v 1.2 2004/06/06 20:52:35 grisu Exp $
//

// Load the SimpleViewer configuration.
require_once 'SimpleViewerConfig.php';

// Load the SimpleViewer functions library.
require_once 'SimpleViewerFunctions.php';

?>

<div id="content">
   <div id="overview">
     <?php
                                        // Get the current number of albums.
                                        $dirList = getPublishedAlbums();
                                        natcasesort($dirList['List']);
                                        
                                        // SimpleViewer is not installed yet.
                                        if ($dirList['Number'] == 0) {
                                                echo '
                                                        <h2>SimpleViewer is not 
set up!</h2>
                                                        <p><a 
href="SimpleViewerAdmin.php">Please log in!</a></p>
                                                ';
                                        // SimpleViewer is installed, show the 
list of albums.
                                        } else {
                                                // My SimpleViewerAdmin Gallery
                                                echo '<h2>' . 
(!empty($simpleViewer['title']) ?  
$simpleViewer['title'] :
$simpleViewer['defaultTitle']) . '</h2>
                                                        <p>' . 
(!empty($simpleViewer['welcomeText']) ?  
$simpleViewer['welcomeText'] :
'') . '</p>
                                                ';
                                                
                                                // Extende display of the list 
as a table featuring
                                                // random thumbnails.
                                                if 
($simpleViewer['showThumbnailsOnIndex'] == 'true') {
                                                
                                                        echo "<ul 
id=\"extended\">\n";
                                                        foreach 
($dirList['List'] as $k => $v) {
                                                                // Get the real 
name of the current album.
                                                                $xmlData        
   = getConfig('./' . $v . '/imageData.xml');
                                                                $albumRealName 
= ((isPhpOfVersion(5) == -1) ?  
utf8_encode($xmlData['title'])
: $xmlData['title']);
                                                                
                                                                // Get the list 
of thumbnail files in the current album.
                                                                $fileList = 
getDirList('./' . $v . '/thumbs/', '', false, 'files');
                                                                
srand(makeSeed());
                                                                
                                                                $next = 
($k+1)%count($dirList['List']);
                                                                
                                                                echo "<li>\n";
                                                                if 
($fileList['Number'] == 0) {
                                                                        echo 
'<div>';
                                                                } else {
                                                                        echo 
'<a href="?album=' . $v . '" title="' . $albumRealName . '"
style="background-image: url(' . $v . '/thumbs/' . $fileList['List'][rand(0,
$fileList['Number']-1)] . '); background-position: 3px 50%;  
background-repeat:
no-repeat;">';
                                                                }
                                                                echo 
$albumRealName . '<br /><span>(' . $fileList['Number'] . '  
images)</span>';
                                                                if 
($fileList['Number'] == 0) {
                                                                        echo 
'</div>';
                                                                } else {
                                                                        echo 
'</a>';
                                                                }
                                                                echo 
"\n</li>\n";
                                                        }
                                                        echo "</ul>\n";
                                                        
                                                // Display the albums as a list.
                                                } else {                        
                        
                                                        echo "<ul>\n";
                                                        foreach 
($dirList['List'] as $k => $v) {
                                                                // Get the real 
name of the current album.
                                                                $xmlData        
   = getConfig('./' . $v . '/imageData.xml');
                                                                $albumRealName 
= ((isPhpOfVersion(5) == -1) ?  
utf8_encode($xmlData['title'])
: $xmlData['title']);
                                                                
                                                                // Get the list 
of thumbnail files in the current album.
                                                                $fileList = 
getDirList('./' . $v . '/thumbs/', '', false, 'files');
                                                                
                                                                if 
($fileList['Number'] == 0) {
                                                                        echo 
'<li>' . $albumRealName . " <span>(" . $fileList['Number'] . "
images)</span></li>\n";
                                                                } else {
                                                                        echo 
'<li><a href="?album=' . $v . '" title="' .  
$albumRealName . '">' .
$albumRealName . " <span>(" . $fileList['Number'] . "  
images)</span></a></li>\n";
                                                                }
                                                        }
                                                        echo "</ul>\n";
                                                }
                                                
                                                echo '<p style="clear: both; 
position: relative; top: 1em;">' .
(!empty($simpleViewer['extraText']) ?  
$simpleViewer['extraText'] : '') . '</p>';
                                                echo '<div>'. 
include("navigation1.php");'</div>';
                                        }
                                        
                                        ?>

     <?php

// An album name was specified.
if (!empty($_GET['album']) && is_dir($_GET['album']) &&  
isPublished($_GET['album'])) {

        $dirList = getPublishedAlbums();
        natsort($dirList['List']);
        
        foreach ($dirList['List'] as $k => $v) {
                if ($v == $_GET['album']) {
                        // Get the previous album.
                        if (array_key_exists($k-1, $dirList['List']))
                                $previous          = $dirList['List'][$k-1];
                        else  $previous            = 
$dirList['List'][count($dirList['List'])-1];
                        $previousAlbum = getConfig('./' . $previous . 
'/imageData.xml');
                        
                        // Get the current album.
                        $currentAlbum      = getConfig('./' . $v . 
'/imageData.xml');
                        
                        // Get the next album.
                        $next              = 
$dirList['List'][($k+1)%count($dirList['List'])];
                        $nextAlbum         = getConfig('./' . $next . 
'/imageData.xml');
                        break;
                        echo '<div>'. include("navigation1.php");'</div>';
                }
        }

?>
     <script language="javascript" type="text/javascript"  
src="flash_detect.js">
        <!--
                function getFlashVersion() { return null; };
        //-->
        </script>
     <script language="javascript" type="text/javascript">
        <!--
                var flashVersion = getFlashVersion();
                if (flashVersion < 6) {         
                        window.location.replace("upgrade.html");
                }
        //-->
        </script>
     <?php if (!empty($previous)) { echo '<a href="./?album=' .  
$previous . '"
style="font-size: 80%;">&larr; ' . ((isPhpOfVersion(5) == -1) ?
utf8_encode($previousAlbum['title']) : $previousAlbum['title']) . '</a>' ;  
} ?>
     <a href="./" style="font-size: 80%;">Back to "<?php echo
(!empty($simpleViewer['title']) ? $simpleViewer['title'] :
$simpleViewer['defaultTitle']); ?>"</a>
     <?php if (!empty($next)) { echo '<a href="./?album=' . $next . '"
style="font-size: 80%;">' . ((isPhpOfVersion(5) == -1) ?
utf8_encode($nextAlbum['title']) : $nextAlbum['title']) . ' &rarr;</a>' ;  
} ?>
     <a href="SimpleViewerAdmin.php" style="font-size: 80%;">Login</a>  
&bull; <a
href="http://www.redsplash.de/projects/simplevieweradmin/";  
style="font-size: 80%;
margin-right: 5px;">SimpleViewerAdmin <?php echo  
$simpleViewer['version']; ?></a> </div>
   <div id="currentalbum">
     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0";
width="100%" height="<?php echo $simpleViewer['galleryHeight']; ?>">
       <param name="movie" value="viewer.swf" />
       <param name="quality" value="high" />
       <param name="scale" value="NoScale" />
       <param name="wmode" value="opaque" />
       <param name="bgcolor" value="<?php echo str_replace('0x', '#',
$currentAlbum['backgroundColor']); ?>" />
       <param name="FlashVars"
value="xmlDataPath=SimpleViewerImageData.php?album=<?php echo  
$_GET['album'];?>" />
       <param name="FlashVars" value="next=<?php echo $next;?>" />
       <param name="FlashVars" value="prev=<?php echo $previous;?>" />
       <embed src="viewer.swf" quality="high" wmode="opaque" scale="NoScale"
bgcolor="<?php echo str_replace('0x', '#',  
$currentAlbum['backgroundColor']); ?>"
pluginspage="http://www.macromedia.com/go/getflashplayer";
type="application/x-shockwave-flash"
FlashVars="xmlDataPath=SimpleViewerImageData.php?album=<?php echo
$_GET['album'];?>&next=<?php echo $next;?>&prev=<?php echo $previous;?>"  
width="<?php
echo $simpleViewer['galleryWidth']; ?>" height="<?php echo
$simpleViewer['galleryHeight']; ?>"></embed>
     </object>
   </div>
</div>
<?php
}
?>


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to