I was using gallery2 with the collection of 400000 pictures and really it was a nice script and have all the features i want. But i decided to move to the ZenPhoto for some reasons. and when i deleted my whole gallery and installed the ZenPhoto. it is giving me a very slow perfomance.
So Guys i need help in making of the world's largest picture gallery with ZenPhoto.
here is the list of my problems.
1.) when i first open a album it is showing me randomize folders not in the alphanatically order. (if i manual sorf the front page)
actually i want to manual sort the front page of gallery and else i want to auto sort by name and the picture by date added descending.
and i cant access further folder in Admin >>> EDIT when i click on it firefox start a endless loading and after some time it stop the process. so i cant sort the folders manually. *** I think ZenPhoto cant handle my collection of 400000 Photos ***
2.) i want to show the total number (size) of albums and pictures with the album name (front Page). Subalbums too
3.) I want to show how many times image or album is viewed in the front page with the name of album.
4.) how can i use the print menu with AJAX. like if anyone click on a female celebrities album then it will show all the sub albums of this category. i want to show only one sub album at the time.
Pls Frnds Try solve my problems
Thanks
Comments
http://photoz.in/wallpapers/
#1. By default Zenphoto will load image thumbnails into its album thumbnail selector. With so many images in an album you might wish to disable this feature. There is an option, `visual thumb selection`, to do so on the gallery configuration tab.
The sort options for the main gallery are in the gallery & image configuration pages, so you can select the sort direction and type there. If you wish a different sort type and direction for some albums then you would have to go to that album's edit page.
#2, 3. There are functions that will return these numbers that you can add to your theme. The most commonly used functions are described in this document http://www.zenphoto.org/documentation/functions/_template-functions.php.html. Zenphoto is a object based implementation so you can also directly access attributes of the album and image objects. If you explore the object documentation you will see what capabilities they expose.
#4. Ajax is used to support some zenphoto capabilities so you can add to those as you see fit.
i disable the visual thumb but still getting the same problem when i go to edit a albums it is loading loading and loading
in my weapons and ammo category there are only 15 pictures and no subalbum. when i press the edit button. it shows me the property of that album bat the loading cant stop i wait for 10 minutes but the loading still is in processing
i m upload a screen shot of that plss check it and tell me what is the problem y it is not showing me the full loaded page
http://img71.imageshack.us/my.php?image=shot9220080000le1.jpg
Please solve my problem brother
Thanks
The only other suggestion is to install the current nightly build to see if the problem may have been corrected.
i tried the nightly build but its not working. got the same problem
after all this i remove some code frome the admin-functions.php
genAlbumUploadList($mcr_albumlist);
function genAlbumUploadList(&$list, $curAlbum=NULL) {
global $gallery;
$albums = array();
if (is_null($curAlbum)) {
$albumsprime = $gallery->getAlbums(0);
foreach ($albumsprime as $album) { // check for rights
if (isMyAlbum($album, UPLOAD_RIGHTS)) {
$albums[] = $album;
}
}
} else {
$albums = $curAlbum->getSubAlbums(0);
}
if (is_array($albums)) {
foreach ($albums as $folder) {
$album = new Album($gallery, $folder);
if (!$album->isDynamic()) {
$list[$album->getFolder()] = $album->getTitle();
genAlbumUploadList($list, $album); /* generate for subalbums */
}
}
}
}
-------------------------------------------
echo gettext("Tags:");
$tagsort = getTagOrder();
tagSelector($album, 'tags_'.$prefix, false, $tagsort);
<label for="a-<?php echo $prefix; ?>move" style="padding-right: .5em">
<input type="radio" id="a-<?php echo $prefix; ?>move" name="a-<?php echo $prefix; ?>MoveCopyRename" value="move"
onclick="toggleAlbumMoveCopyRename('<?php echo $prefix; ?>', 'movecopy');"/>
<?php echo gettext("Move");?>
</label>
<label for="a-<?php echo $prefix; ?>copy" style="padding-right: .5em">
<input type="radio" id="a-<?php echo $prefix; ?>copy" name="a-<?php echo $prefix; ?>MoveCopyRename" value="copy"
onclick="toggleAlbumMoveCopyRename('<?php echo $prefix; ?>', 'movecopy');"/>
<?php echo gettext("Copy");?>
</label>
<label for="a-<?php echo $prefix; ?>rename" style="padding-right: .5em">
<input type="radio" id="a-<?php echo $prefix; ?>rename" name="a-<?php echo $prefix; ?>MoveCopyRename" value="rename"
onclick="toggleAlbumMoveCopyRename('<?php echo $prefix; ?>', 'rename');"/>
<?php echo gettext("Rename Folder");?>
</label>
<div id="a-<?php echo $prefix; ?>movecopydiv" style="padding-top: .5em; padding-left: .5em; display: none;">
<?php echo gettext("to"); ?>: <select id="a-<?php echo $prefix; ?>albumselectmenu" name="a-<?php echo $prefix; ?>albumselect" onChange="">
<option value="" selected="selected">/</option>
<?php
foreach ($mcr_albumlist as $fullfolder => $albumtitle) {
$singlefolder = $fullfolder;
$saprefix = "";
$salevel = 0;
$selected = "";
if ($album->name == $fullfolder) {
continue;
}
// Get rid of the slashes in the subalbum, while also making a subalbum prefix for the menu.
while (strstr($singlefolder, '/') !== false) {
$singlefolder = substr(strstr($singlefolder, '/'), 1);
$saprefix = " " . $saprefix;
$salevel++;
}
echo '<option value="' . $fullfolder . '"' . ($salevel > 0 ? ' style="background-color: '.$bglevels[$salevel].';"' : '')
. "$selected>". $saprefix . $singlefolder ."</option>\n";
}
?>
</select>
<p style="text-align: right;">
', '');"><?php echo gettext("Cancel");?>
</p>
</div>
<div id="a-<?php echo $prefix; ?>renamediv" style="padding-top: .5em; padding-left: .5em; display: none;">
<?php echo gettext("to"); ?>: <input name="a-<?php echo $prefix; ?>renameto" type="text" size="35" value="<?php echo basename($album->name);?>"/>
<p style="text-align: right; padding: .25em 0px;">
', '');"><?php echo gettext("Cancel");?>
</p>
</div>
-------------------------------------------
echo "\n<select id=\"album_theme\" class=\"album_theme\" name=\"".$prefix."album_theme\" ";
if (!($_zp_loggedin & (ADMIN_RIGHTS | THEMES_RIGHTS))) echo "DISABLED ";
echo ">";
$themes = $gallery->getThemes();
$oldtheme = $album->getAlbumTheme();
if (empty($oldtheme)) {
echo "<option value = \"\" selected=\"SELECTED\" />";
} else {
echo "<option value = \"\" />";
}
echo "</option>";
foreach ($themes as $theme=>$themeinfo) {
echo "<option value = \"$theme\"";
if ($oldtheme == $theme) {
echo "selected = \"SELECTED\"";
}
echo " />";
echo $themeinfo['name'];
echo "</option>";
}
echo "\n</select>";
-------------------------------------------
$showThumb = getOption('thumb_select_images');
if ($showThumb) echo "\n<script type=\"text/javascript\">updateThumbPreview(document.getElementById('thumbselect'));</script>";
echo "\n<select id=\"thumbselect\"";
if ($showThumb) echo " class=\"thumbselect\" onChange=\"updateThumbPreview(this)\"";
echo " name=\"".$prefix."thumb\">";
if ($album->isDynamic()) {
$params = $album->getSearchParams();
$search = new SearchEngine();
$search->setSearchParams($params);
$images = $search->getImages(0);
$thumb = $album->get('thumb');
$imagelist = array();
foreach ($images as $imagerow) {
$folder = $imagerow['folder'];
$filename = $imagerow['filename'];
$imagelist[] = '/'.$folder.'/'.$filename;
}
$subalbums = $search->getAlbums(0);
foreach ($subalbums as $folder) {
$newalbum = new Album($gallery, $folder);
if (!$newalbum->isDynamic()) {
$images = $newalbum->getImages(0);
foreach ($images as $filename) {
$imagelist[] = '/'.$folder.'/'.$filename;
}
}
}
foreach ($imagelist as $imagepath) {
$list = explode('/', $imagepath);
$filename = $list[count($list)-1];
unset($list[count($list)-1]);
$folder = implode('/', $list);
$albumx = new Album($gallery, $folder);
$image = new Image($albumx, $filename);
$selected = ($imagepath == $thumb);
echo "\n<option";
if ($showThumb) {
echo " class=\"thumboption\"";
echo " style=\"background-image: url(" . $image->getThumb() . "); background-repeat: no-repeat;\"";
}
echo " value=\"".$imagepath."\"";
if ($selected) {
echo " selected=\"selected\"";
}
echo ">" . $image->getTitle();
echo " ($imagepath)";
echo "</option>";
}
} else {
$thumb = $album->get('thumb');
echo "\n<option";
if ($showThumb) echo " class=\"thumboption\" value=\"\" style=\"background-color:#B1F7B6\"";
if (empty($thumb)) {
echo " selected=\"selected\"";
}
echo '>'.gettext('randomly selected');
echo '</option>';
if (count($album->getSubalbums()) > 0) {
$imagearray = array();
$albumnames = array();
$strip = strlen($album->name) + 1;
$subIDs = getAllSubAlbumIDs($album->name);
if(!is_null($subIDs)) {
foreach ($subIDs as $ID) {
$albumnames[$ID['id']] = $ID['folder'];
$query = 'SELECT `id` , `albumid` , `filename` , `title` FROM '.prefix('images').' WHERE `albumid` = "'.
$ID['id'] .'"';
$imagearray = array_merge($imagearray, query_full_array($query));
}
foreach ($imagearray as $imagerow) {
$filename = $imagerow['filename'];
$folder = $albumnames[$imagerow['albumid']];
$imagepath = substr($folder, $strip).'/'.$filename;
if (substr($imagepath, 0, 1) == '/') { $imagepath = substr($imagepath, 1); }
$albumx = new Album($gallery, $folder);
$image = new Image($albumx, $filename);
if (is_valid_image($filename)) {
$selected = ($imagepath == $thumb);
echo "\n<option";
if (getOption('thumb_select_images')) {
echo " class=\"thumboption\"";
echo " style=\"background-image: url(" . $image->getThumb() . "); background-repeat: no-repeat;\"";
}
echo " value=\"".$imagepath."\"";
if ($selected) {
echo " selected=\"selected\"";
}
echo ">" . $image->getTitle();
echo " ($imagepath)";
echo "</option>";
}
}
}
} else {
$images = $album->getImages();
foreach ($images as $filename) {
$image = new Image($album, $filename);
$selected = ($filename == $album->get('thumb'));
if (is_valid_image($filename)) {
echo "\n<option";
if (getOption('thumb_select_images')) {
echo " class=\"thumboption\"";
echo " style=\"background-image: url(" . $image->getThumb() . "); background-repeat: no-repeat;\"";
}
echo " value=\"" . $filename . "\"";
if ($selected) {
echo " selected=\"selected\"";
}
echo ">" . $image->getTitle();
if ($filename != $image->getTitle()) {
echo " ($filename)";
}
echo "</option>";
}
}
}
}
-------------------------------------------
echo "\n<td valign=\"top\" width=30% style=\"padding: 0px 30px 0px 30px;\">";
echo "<form name=\"cache_images\" action=\"admin-cache-images.php\" method=\"post\">";
echo "<input type=\"hidden\" name=\"album\" value=" . urlencode($album->name) . ">";
echo "<input type=\"hidden\" name=\"return\" value=" . urlencode($album->name) . ">";
echo "<button type=\"submit\" class=\"tooltip\" id='edit_cache' title=\"".gettext("Cache newly uploaded images.")."\"><img src=\"images/cache.png\" style=\"border: 0px;\" />";
echo " ".gettext("Pre-Cache Images")."</Button>";
echo "<input type=\"checkbox\" name=\"clear\" checked=\"checked\" /> ".gettext("Clear");
echo "</form>\n</td>";
echo "\n<td valign=\"top\" width = 30% style=\"padding: 0px 30px 0px 30px;\">";
echo "<form name=\"refresh_metadata\" action=\"admin-refresh-metadata.php\"?album=" . urlencode($album->name) . "\" method=\"post\">";
echo "<input type=\"hidden\" name=\"album\" value=" . urlencode($album->name) . ">";
echo "<input type=\"hidden\" name=\"return\" value=" . urlencode($album->name) . ">";
echo "<button type=\"submit\" class=\"tooltip\" id='edit_refresh' title=\"".gettext("Forces a refresh of the EXIF and IPTC data for all images in the album.")."\"><img src=\"images/warn.png\" style=\"border: 0px;\" /> ".gettext("Refresh Metadata")."</button>";
echo "</form>";
echo "\n</td>";
echo "\n<td valign=\"top\" width = 30% style=\"padding: 0px 30px 0px 30px;\">";
echo "</form>";
echo "<form name=\"reset_hitcounters\" action=\"?action=reset_hitcounters\"" . " method=\"post\">";
echo "<input type=\"hidden\" name=\"action\" value=\"reset_hitcounters\">";
echo "<input type=\"hidden\" name=\"albumid\" value=" . $album->getAlbumID() . ">";
echo "<input type=\"hidden\" name=\"return\" value=" . urlencode($album->name) . ">";
echo "<button type=\"submit\" class=\"tooltip\" id='edit_hitcounter' title=\"".gettext("Resets all hitcounters in the album.")."\"><img src=\"images/reset.png\" style=\"border: 0px;\" /> ".gettext("Reset hitcounters")."</button>";
echo "</form>";
echo "\n</tr>\n</table>";
and now it is working fine. i think there is something which is heavy to load. pls try to solve it coz many of the others users may face the same problem
now one thing more brothers.
i have lots of sub albums so it is very hard for a user to jum over the galleries. so is there any option in Print menu plugin which will dispplay the list of subalbums under the album name. i m new on the zen and the php so pls could u provide me the code of that
Thanks Again
i have lots of sub albums so it is very hard for a user to jum over the galleries. so is there any option in Print menu plugin which will dispplay the list of subalbums under the album name. i m new on the zen and the php so pls could u provide me the code of that
PrintAlbumMenu has several options for the list (toplevel+subalbums, only topalbums, context sensitive, or only subalbums): http://www.zenphoto.org/documentation/plugins/_plugins---print_album_menu.php.html.