| Author |
Message |
wHiTeHaT
Beginner


Joined: Jul 28, 2003 Posts: 10
|
|
| Back to top |
|
|
AdBot
|
| Post subject: block-NG-AlbumList |
|
|
|
|
|
| Back to top |
|
 |
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Thu Dec 02, 2004 1:22 pm Post subject: Re: block-NG-AlbumList |
|
|
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 |
|
|
Gerb
Beginner


Joined: Dec 02, 2004 Posts: 1
|
Posted: Thu Dec 02, 2004 1:51 pm Post subject: Re: block-NG-AlbumList |
|
|
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 |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Thu Dec 02, 2004 2:02 pm Post subject: Re: block-NG-AlbumList |
|
|
$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 |
|
|
wHiTeHaT
Beginner


Joined: Jul 28, 2003 Posts: 10
|
Posted: Thu Dec 02, 2004 2:49 pm Post subject: Re: block-NG-AlbumList |
|
|
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 |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Thu Dec 02, 2004 3:19 pm Post subject: Re: block-NG-AlbumList |
|
|
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 |
|
|
wHiTeHaT
Beginner


Joined: Jul 28, 2003 Posts: 10
|
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Thu Dec 02, 2004 3:29 pm Post subject: Re: block-NG-AlbumList |
|
|
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 |
|
|
wHiTeHaT
Beginner


Joined: Jul 28, 2003 Posts: 10
|
Posted: Thu Dec 02, 2004 3:33 pm Post subject: Re: block-NG-AlbumList |
|
|
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 |
|
|
wHiTeHaT
Beginner


Joined: Jul 28, 2003 Posts: 10
|
Posted: Thu Dec 02, 2004 3:35 pm Post subject: Re: block-NG-AlbumList |
|
|
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 |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Thu Dec 02, 2004 3:44 pm Post subject: Re: block-NG-AlbumList |
|
|
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 |
|
|
wHiTeHaT
Beginner


Joined: Jul 28, 2003 Posts: 10
|
Posted: Thu Dec 02, 2004 3:58 pm Post subject: Re: block-NG-AlbumList |
|
|
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 |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Thu Dec 02, 2004 4:01 pm Post subject: Re: block-NG-AlbumList |
|
|
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 |
|
|
wHiTeHaT
Beginner


Joined: Jul 28, 2003 Posts: 10
|
Posted: Thu Dec 02, 2004 4:10 pm Post subject: Re: block-NG-AlbumList |
|
|
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  |
|
| Back to top |
|
|
|
|
|
|
|