Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

News and Gallery Problems

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Other PHPNuke Issues View previous topicPrinter friendly versionView next topic
Author Message
walters963

Beginner
Beginner


Joined: Apr 07, 2006
Posts: 2

PostPosted: Wed Apr 12, 2006 10:22 am    Post subject: News and Gallery Problems Reply with quote

I am having a couple od big problems with my phpnuke install. One is that no link show sup to delete news articles which means that the same news is gonna stay on my site forever.
The seconds is with my gallery integration, but I am afraid to ask for help in the gallery forums, because it seems that the first thing that support team says is "this has already been answered. Well I have search forever and cannot find my answer, but I do not have time to go through 1000 different posts. I have gallery integrated and working as a module, but none of the blocks work for me. The page loads up until the gallery block is supposed to load and then it stops!
www.bethanystudents.com
Here is my code if you can help me.

<?php

/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Coded by Dariush Molavi
* dari@nukedgallery.net
* http://www.nukedgallery.net
* (c) 2003 Dariush Molavi
* You may redistribute this block as long as this entire header
* remains unaltered.
*/

if (eregi("block-NG-newAlbums.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

global $gallery, $admin;

/* CHANGE THESE VARIABLES */
$GALLERY_BASEDIR = "/domains/bethanystudents.com/public_html/home/modules/gallery/";
define(PHPNUKE_ADDR,"http://www.bethanystudents.com/home/");
define(GALLERY_DIR_NAME,"gallery");
define(USE_THUMBS,0); // Set to 1 to show thumbnails, 0 to just list albums.
define(HOROZONTAL,1); //Set to 1 to list horozontally, 0 for vertically. If USE_THUMBS is 0,
//this is ignored, and albums will be listed vertically.
define(ALBUM_DIRECTORY,"/domains/bethanystudents.com/public_html/albums/");
define(MAX_NEW_ALBUMS,4); // Set this to the number of albums you want displayed.
define(PIC_SCALE,0); // Leave at 0 to use the Gallery default; or set to the width you want thumbnails
define(PIC_BORDER,0); // Leave at 0 for no border, or enter border thickness here.
define(ALBUM_CACHE_EXPIRE_TIME,86400);
/* DON"T CHANGE ANYTHING BELOW HERE */

require_once($GALLERY_BASEDIR."init.php");
define(ALBUMCACHE,ALBUM_DIRECTORY."album_list.cache");


function numAccessibleAlbums($user) {
global $newAlbumDB;

$numAlbums = 0;
foreach ($newAlbumDB->albumList as $album) {
if ($user->canReadAlbum($album))
$numAlbums++;
}
return $numAlbums;
}


function scanNewAlbums() {
global $albumDateCache, $albumNameCache, $gallery, $albumCount, $cacheUser, $newAlbumDB;

$albumNameCache = array();
$albumDateCache = array();
$cacheUser = new LoggedInUser();

$newAlbumDB = new AlbumDB(FALSE);
$albumCount = numAccessibleAlbums($cacheUser);
foreach ($newAlbumDB->albumList as $tmpAlbum) {
$name = $tmpAlbum->fields["name"];
$tempAlbum = new Album();
$tempAlbum->load($name);
array_push($albumNameCache,$name);
array_push($albumDateCache,$tempAlbum->fields['clicks_date']);
}

arsort($albumDateCache);
}

function saveNewAlbums() {
global $albumDateCache, $albumNameCache, $albumCount;

$fd = fs_fopen(ALBUMCACHE, "w");
$keys = array_keys($albumDateCache);

for($i=0; $i<$albumCount; $i++) {
$albumName = $albumNameCache[$keys[$i]];
fwrite($fd, "$albumName\n");
}
fclose($fd);
}

function readNewAlbums() {
global $gallery,$user,$admin;

$attr = "border=\"".PIC_BORDER."\"";

if(PIC_SCALE == 0) {
$scaleTo = $gallery->app->highlight_size;
}
else {
$scaleTo = PIC_SCALE;
}

$cacheFile = fs_fopen(ALBUMCACHE,"r");

if( is_user($user) ) {
$tempUser = new LoggedInUser();
}
else {
$tempUser = new EverybodyUser();
}

if (USE_THUMBS && HOROZONTAL) {
$content .= "<center><table border=\"0\"><tr align=\"center\">";
}
else {
$content .= "<center>";
}

if(is_admin($admin)) {
$content .="<p>
";
$content .="";
$content .="
";
}

$i = 0;
while ($i<MAX_NEW_ALBUMS) {
$line = fgets($cacheFile, 4096);
$parentTitle = "";
$currentAlbum = new Album();
$albumName = trim($line);
$currentAlbum->load($albumName);
if(($tempUser->canReadAlbum($currentAlbum)) || ($tempUser->isLoggedIn() && !$gallery->session->offline)) {
if($currentAlbum->fields['parentAlbumName']) {
$parentAlbum = new Album();
$parentAlbum->load($currentAlbum->fields['parentAlbumName']);
$parentTitle .= $parentAlbum->fields['title']." - ";
}
if(USE_THUMBS) {
if(HOROZONTAL) {
$content .= "<td align=\"center\">";
$content .= $currentAlbum->getHighlightTag($scaleTo,$attr)."<br>";
$content .= $parentTitle."".$currentAlbum->fields['title']."
</td>";
}
else {
$content .= "<center>";
$content .= $currentAlbum->getHighlightTag($scaleTo,$attr)."<br>";
$content .= $parentTitle."".$currentAlbum->fields['title']."
<p></center>";
}
}
else {
$content .= "<center>";
$content .= $parentTitle."".$currentAlbum->fields['title']."
<br></center>";
}
$i++;
}
}

if(USE_THUMBS && HOROZONTAL) {
$content .= "</tr></table></center>";
}

if(is_admin($admin)) {
$content .="<p>
";
$content .="";
$content .="
";
}

return $content;
}

if(is_admin($admin) && array_key_exists("refreshNewAlbumCache",$_POST)) {
unlink(ALBUMCACHE);
scanNewAlbums();
saveNewAlbums();
$content = readNewAlbums();
}
else {
$rebuild = 0;
if(fs_file_exists(ALBUMCACHE)) {
$stat = fs_stat(ALBUMCACHE);
$mtime = $stat[9];
if (time() - $mtime > ALBUM_CACHE_EXPIRE_TIME) {
$rebuild = 1;
}
}

if(!$rebuild) {
scanNewAlbums();
saveNewAlbums();
$content = readNewAlbums();
}
else {
$content = readNewAlbums();
}
}
?>
Back to top
Offline View user's profile Send private message
AdBot
   Post subject: News and Gallery Problems  

Back to top
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6284
Location: Washington Township, NJ, USA

PostPosted: Wed Apr 12, 2006 10:55 am    Post subject: Re: News and Gallery Problems Reply with quote

what version of gallery are you using?
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
walters963

Beginner
Beginner


Joined: Apr 07, 2006
Posts: 2

PostPosted: Wed Apr 12, 2006 10:57 am    Post subject: Re: News and Gallery Problems Reply with quote

Gallery 1.5.3
Back to top
Offline View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Other PHPNuke Issues View previous topicPrinter friendly versionView next topic

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Web HostingDedicated ServersDomain NamesDomain Name RegistrationDedicated Web HostingSEO Search Engine OptimisationSEOWeb Design New YorkSEO Web DesignWeb hosting AustraliaCheap Web Design

6th year online! 2003-2009
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia