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  

block-NG-AlbumList

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Blocks View previous topicPrinter friendly versionView next topic
Author Message
wHiTeHaT

Beginner
Beginner


Joined: Jul 28, 2003
Posts: 10

PostPosted: Thu Dec 02, 2004 9:46 am    Post subject: block-NG-AlbumList Reply with quote

i added the block block-NG-AlbumList.php to my nuke site
however when i click on the links that showing up it send me to the gallery OUTSIDE of nuke instead of the embedded page.
i first thought it was couse of a mod i used (scrolling block-NG-AlbumList.php). So i took the block from the downloads and did a comparing.There i notice 2 differences:
Code: ›
in the scrolling block it say on line 32:
                $myName = $myAlbum->getAlbumname($i);

And in the original block it say on line 26:
                $myName = $myAlbum->isAlbumName($i);

The original block NOT work.(the 1 from the downloads here).

if any1 can offer me help to get the block run properly so it links INSIDE nuke, it would be apreciated.(i made a search here on the forum but i couldnt find a direct answer)
with kind regards wHiTeHaT Wink
Back to top
Offline View user's profile Send private message
AdBot
   Post subject: block-NG-AlbumList  

Back to top
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Thu Dec 02, 2004 1:22 pm    Post subject: Re: block-NG-AlbumList Reply with quote

Can you POST your amended code from the BLOCK here, also a link to your site so we can see it.
_________________
"The only difference between me and a madman is that I'm not mad."
Back to top
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Gerb

Beginner
Beginner


Joined: Dec 02, 2004
Posts: 1

PostPosted: Thu Dec 02, 2004 1:51 pm    Post subject: Re: block-NG-AlbumList Reply with quote

Just one change on line 26 made it work correctly. All of my links open inside Nuke so not sure why yours isn't. This is the only change I made...

Code: › <?php
global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME;


// CHANGE THIS TO REFLECT YOUR INSTALLATION     
$GALLERY_BASEDIR = "/home/httpd/phpnuke.nukedgallery.net/htdocs/modules/gallery/";
$GALLERY_MODULENAME = "gallery";
// DON"T CHANGE ANYTHING BELOW HERE

require_once($GALLERY_BASEDIR."init.php");
$GALLERY_EMBEDDED_INSIDE = "nuke";
$GALLERY_EMBEDDED_INSIDE_TYPE = "phpnuke";

$content = "";

$albumDB = new AlbumDB(FALSE);

function printAlbumList($albumName,$depth=0) {
        global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME;

        $printedHeader = 0;
        $myAlbum = new Album();
        $myAlbum->load($albumName);
        $numPhotos = $myAlbum->numPhotos(1);
        for ($i=1; $i <= $numPhotos; $i++) {
                $myName = $myAlbum->getAlbumName($i);
                if ($myName && !$myAlbum->isHidden($i)) {
                        $nestedAlbum = new Album();
                        $nestedAlbum->load($myName);
                        if ($gallery->user->canReadAlbum($nestedAlbum)) {
                                $val2 = $nestedAlbum->fields['title'];
                                $content .= "<div style=\"margin: 0px 0px 0px 20px\">";
                                $content .= "<span class=fineprint>";
                                $content .= "<a href=\"";
                                $content .= makeAlbumUrl($myName);
                                $content .= "\">$val2</a>\n";
                                $content .= printAlbumList($myName,$depth+1);
                                $content .= "</span>";
                                $content .= "</div>";
                        }
                }
        }
   return $content;
}

foreach ($albumDB->albumList as $album) {
   if (!$album->isRoot()) {
      continue;
   }
   $content .= "<a href=\"".makeAlbumUrl($album->fields['name'])."\">" .$album->fields['title'] ."</a>\n<br>";
   $content .=  printAlbumList($album->fields["name"]);

}

?>
Back to top
Offline View user's profile Send private message
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Thu Dec 02, 2004 2:02 pm    Post subject: Re: block-NG-AlbumList Reply with quote

$GALLERY_BASEDIR = "/home/httpd/phpnuke.nukedgallery.net/htdocs/modules/gallery/";

needs changing to your server path.

Also maybe change this:

global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME;

To:

global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME, $GALLERY_EMBEDDED_INSIDE_TYPE;

Also what is the URL to your site?
_________________
"The only difference between me and a madman is that I'm not mad."
Back to top
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
wHiTeHaT

Beginner
Beginner


Joined: Jul 28, 2003
Posts: 10

PostPosted: Thu Dec 02, 2004 2:49 pm    Post subject: Re: block-NG-AlbumList Reply with quote

i added the global but it still not work :

Code: ›
<?php

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

global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME;


// CHANGE THIS TO REFLECT YOUR INSTALLATION     
$GALLERY_BASEDIR = "/xxxx/xxxxxxxx/xxxxxxxxxxx/modules/gallery/";
$GALLERY_MODULENAME = "gallery";
// DON"T CHANGE ANYTHING BELOW HERE

require_once($GALLERY_BASEDIR."init.php");
$GALLERY_EMBEDDED_INSIDE = "nuke";
$GALLERY_EMBEDDED_INSIDE_TYPE = "phpNuke";

$content = "";

$albumDB = new AlbumDB(FALSE);

function printAlbumList($albumName,$depth=0) {
        global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME, $GALLERY_EMBEDDED_INSIDE_TYPE;

        $printedHeader = 0;
        $myAlbum = new Album();
        $myAlbum->load($albumName);
        $numPhotos = $myAlbum->numPhotos(1);
        for ($i=1; $i <= $numPhotos; $i++) {
                $myName = $myAlbum->getAlbumname($i);
                if ($myName && !$myAlbum->isHidden($i)) {
                        $nestedAlbum = new Album();
                        $nestedAlbum->load($myName);
                        if ($gallery->user->canReadAlbum($nestedAlbum)) {
                                $val2 = $nestedAlbum->fields['title'];
                                $content .= "<div style=\"margin: 0px 0px 0px 20px\">";
                                $content .= "<span class=fineprint>";
                                $content .= "<a href=\"";
                                $content .= makeAlbumUrl($myName);
                                $content .= "\">$val2</a>\n";
                                $content .= printAlbumList($myName,$depth+1);
                                $content .= "</span>";
                                $content .= "</div>";
                                $content .= "</marquee>";
                        }
                }
        }
        return $content;
}

$content .= "<marquee loop=\"infinite\" direction=\"up\" behavior=\"scroll\" align=\"center\" scrollamount= \"2\" scrolldelay=\"60\" height=\"220\" onmouseover='this.stop()' onmouseout='this.start()'>";

foreach ($albumDB->albumList as $album) {
        if (!$album->isRoot()) {
                continue;
        }
        $content .= "<a href=\"".makeAlbumUrl($album->fields['name'])."\">" .$album->fields['title'] ."</a>\n<br>";
        $content .=  printAlbumList($album->fields["name"]);
}

?>


http://www.barcodediver.com
Back to top
Offline View user's profile Send private message
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Thu Dec 02, 2004 3:19 pm    Post subject: Re: block-NG-AlbumList Reply with quote

Sry - I thought he BLOCK already did that (kept INSIDE NUKE) - maybe there has been a code change on Gallery since the BLOCK was released.

I have done a quick 'hack' of the BLOCK:

Code: ›
<?php
global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME;


// CHANGE THIS TO REFLECT YOUR INSTALLATION     
$GALLERY_BASEDIR = "/path/to/modules/gallery/";
$GALLERY_MODULENAME = "gallery";
// DON"T CHANGE ANYTHING BELOW HERE

require_once($GALLERY_BASEDIR."init.php");
$GALLERY_EMBEDDED_INSIDE = "nuke";
$GALLERY_EMBEDDED_INSIDE_TYPE = "phpnuke";

$content = "";

$albumDB = new AlbumDB(FALSE);

function printAlbumList($albumName,$depth=0) {
        global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME;

        $printedHeader = 0;
        $myAlbum = new Album();
        $myAlbum->load($albumName);
        $numPhotos = $myAlbum->numPhotos(1);
        for ($i=1; $i <= $numPhotos; $i++) {
                $myName = $myAlbum->getAlbumName($i);
                if ($myName && !$myAlbum->isHidden($i)) {
                        $nestedAlbum = new Album();
                        $nestedAlbum->load($myName);
                        if ($gallery->user->canReadAlbum($nestedAlbum)) {
                                $val2 = $nestedAlbum->fields['title'];
                                $content .= "<div style=\"margin: 0px 0px 0px 20px\">";
                                $content .= "<span class=fineprint>";
                                $content .= "<a href=\"";
                                $content .= "modules.php?set_albumName=$myName&op=modload&name=$GALLERY_MODULENAME&file=index&include=view_album.php\">$val2</a>\n";
                                $content .= printAlbumList($myName,$depth+1);
                                $content .= "</span>";
                                $content .= "</div>";
                        }
                }
        }
   return $content;
}

foreach ($albumDB->albumList as $album) {
   if (!$album->isRoot()) {
      continue;
   }
   $myName = $album->fields['name'];
   $content .= "<a href=\"modules.php?set_albumName=$myName&op=modload&name=$GALLERY_MODULENAME&file=index&include=view_album.php\">" .$album->fields['title'] ."</a>\n<br>";
   $content .=  printAlbumList($album->fields["name"]);

}

?>



See how you get on.
_________________
"The only difference between me and a madman is that I'm not mad."
Back to top
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
wHiTeHaT

Beginner
Beginner


Joined: Jul 28, 2003
Posts: 10

PostPosted: Thu Dec 02, 2004 3:24 pm    Post subject: Re: block-NG-AlbumList Reply with quote

lol yes almost 100%
(i keep the scrolling in it)

but i get url like this:
http://www.barcodediver.com/modules.php ... _album.php
Back to top
Offline View user's profile Send private message
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Thu Dec 02, 2004 3:29 pm    Post subject: Re: block-NG-AlbumList Reply with quote

DOH!! Forget the 'hack'

Just realised you didn't put BOTH '$GALLERY_EMBEDDED_INSIDE_TYPE' in the BLOCK. You missed the GLOBAL statement at the top of the code.
_________________
"The only difference between me and a madman is that I'm not mad."
Back to top
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
wHiTeHaT

Beginner
Beginner


Joined: Jul 28, 2003
Posts: 10

PostPosted: Thu Dec 02, 2004 3:33 pm    Post subject: Re: block-NG-AlbumList Reply with quote

mmm this is strange ( you must now i'm not familiar with the gallery code)
i'm sure i have the correct url
however i get a security message:

Security error! The file you tried to include is not on the approved file list. To include this file you must edit Gallery's index.php and add view_album to the $safe_to_include array

the url's looking good:
http://www.barcodediver.com/modules.php ... HTMS-Khram
Back to top
Offline View user's profile Send private message
wHiTeHaT

Beginner
Beginner


Joined: Jul 28, 2003
Posts: 10

PostPosted: Thu Dec 02, 2004 3:35 pm    Post subject: Re: block-NG-AlbumList Reply with quote

slackbladder wrote: › DOH!! Forget the 'hack'

Just realised you didn't put BOTH '$GALLERY_EMBEDDED_INSIDE_TYPE' in the BLOCK. You missed the GLOBAL statement at the top of the code.



no i had added it (just not in the code i showed you) and it still not worked
Back to top
Offline View user's profile Send private message
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Thu Dec 02, 2004 3:44 pm    Post subject: Re: block-NG-AlbumList Reply with quote

My guess is the problem is osc2nuke related.

The 'hack' worked for you though didn't it? The URL you posted seems to work.
_________________
"The only difference between me and a madman is that I'm not mad."
Back to top
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
wHiTeHaT

Beginner
Beginner


Joined: Jul 28, 2003
Posts: 10

PostPosted: Thu Dec 02, 2004 3:58 pm    Post subject: Re: block-NG-AlbumList Reply with quote

no i dont think it's osc2nuke related, i use nuke 7.5 with this gallery module.

and no the link not work for me, it give the error message as above
Back to top
Offline View user's profile Send private message
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Thu Dec 02, 2004 4:01 pm    Post subject: Re: block-NG-AlbumList Reply with quote

http://www.barcodediver.com/modules.php ... _album.php

Code: ›
<?php
global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME;


// CHANGE THIS TO REFLECT YOUR INSTALLATION     
$GALLERY_BASEDIR = "/path/to/modules/gallery/";
$GALLERY_MODULENAME = "gallery";
// DON"T CHANGE ANYTHING BELOW HERE

require_once($GALLERY_BASEDIR."init.php");
$GALLERY_EMBEDDED_INSIDE = "nuke";
$GALLERY_EMBEDDED_INSIDE_TYPE = "phpnuke";

$content = "";

$albumDB = new AlbumDB(FALSE);

function printAlbumList($albumName,$depth=0) {
        global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME;

        $printedHeader = 0;
        $myAlbum = new Album();
        $myAlbum->load($albumName);
        $numPhotos = $myAlbum->numPhotos(1);
        for ($i=1; $i <= $numPhotos; $i++) {
                $myName = $myAlbum->getAlbumName($i);
                if ($myName && !$myAlbum->isHidden($i)) {
                        $nestedAlbum = new Album();
                        $nestedAlbum->load($myName);
                        if ($gallery->user->canReadAlbum($nestedAlbum)) {
                                $val2 = $nestedAlbum->fields['title'];
                                $content .= "<div style=\"margin: 0px 0px 0px 20px\">";
                                $content .= "<span class=fineprint>";
                                $content .= "<a href=\"";
                                $content .= "modules.php?set_albumName=$myName&op=modload&name=$GALLERY_MODULENAME&file=index&include=view_album.php\">$val2</a>\n";
                                $content .= printAlbumList($myName,$depth+1);
                                $content .= "</span>";
                                $content .= "</div>";
                        }
                }
        }
   return $content;
}

foreach ($albumDB->albumList as $album) {
   if (!$album->isRoot()) {
      continue;
   }
   $myName = $album->fields['name'];
   $content .= "<a href=\"modules.php?set_albumName=$myName&op=modload&name=$GALLERY_MODULENAME&file=index&include=view_album.php\">" .$album->fields['title'] ."</a>\n<br>";
   $content .=  printAlbumList($album->fields["name"]);

}

?>



This link works for me - and it is generated from the 'hacked' block?
_________________
"The only difference between me and a madman is that I'm not mad."
Back to top
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
wHiTeHaT

Beginner
Beginner


Joined: Jul 28, 2003
Posts: 10

PostPosted: Thu Dec 02, 2004 4:10 pm    Post subject: Re: block-NG-AlbumList Reply with quote

yes sorry maby we miss understoud.

the block you created works 100% , but i noticed that the url was a little strange (as that it isnt nuke's behavior) . then i discovered that all url's are like that... for the gallery.
you are verry thankfull for your help and i encurrage to keep on going to good work.


Grtzzz wHiTeHaT Wink
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 » Blocks 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