how to have a 'featured photo' on another page.
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
Hmm... I'm afraid this question is out of my league. -Beckett ( beck@beckettmw.com) |
|
Gaile
Joined: 2002-07-20
Posts: 1301 |
![]() |
Marie, Why are you even using an iframe there? You have the iframe inside a table cell - why not just use the featured photo code inside the table cell instead of inside an iframe being called into the table? Your iframe is set for no scroll, so it's not like you wanted people to be able to scroll for a larger photo. I'm confused as to the logic of using the iframe there...but then I am often confused... :-? |
|
fuzioneer
Joined: 2003-07-01
Posts: 7 |
![]() |
i have installed your mod and it is working in a fashion !!! i can go into gallery and select a featured photo, that photo gets displayed on my front page but i also get an error message as follows:- " Line 55 of session.php as follows:- URL of site is www.davidburley.com/roundtheworld/ |
|
tomken
Joined: 2003-07-12
Posts: 1 |
![]() |
Hello...... Does anyone think that it would be possible to include more than one feature photo? I run a website for a band and would like to feature 3-5 photos from our last show on our homepage. I am doing it now by hardcoding it with straight html. Is there anyway I could make this easier with php? My website is http://staticblu.com |
|
tenaki
Joined: 2003-04-08
Posts: 106 |
![]() |
Hi I am trying to install this but get the following error Parse error: parse error, unexpected $ in /home/********/public_html/classifieds/featured-photo.php on line 90 Any clues please |
|
jokorn
Joined: 2003-02-23
Posts: 2 |
![]() |
:D |
|
tenaki
Joined: 2003-04-08
Posts: 106 |
![]() |
Thanks fot the reply, I want to update the pic daily so the featured photo would be ideal |
|
slimis
Joined: 2003-07-23
Posts: 9 |
![]() |
Hello all! Parse error: parse error in /xxxx/xxxx/xxxx/gallery/featured-photo.php on line 27 This is the correct path to the file, I have removed all trailing spaces <?php /* * Featured photo block for Gallery * Beckett Madden-Woods (beckett@beckettmw.com) * * This is basically block-random.php from Gallery * Original author and copyright: * * Gallery - a web based photo album viewer and editor * Copyright (C) 2000-2001 Bharat Mediratta * * Find the original GNU GPL license at http://gallery.sourceforge.net/ */ /* Hack prevention. */ if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) { print "Security violation\n"; exit; } /* edit this if necessary, but include the trailing slash! */ $GALLERY_BASEDIR = "${DOCUMENT_ROOT}/gallery/"; if ($set) { require($GALLERY_BASEDIR . "init.php"); define(FEATURE_CACHE, $gallery->app->albumDir . "/featured-photo.cache"); ?> <html> <head> <title>Highlight Photo</title> <?php echo getStyleSheetLink() ?> </head> <body> <center> <?php if ($gallery->session->albumName && isset($index)) { if ($fd = fs_fopen(FEATURE_CACHE, "w")) { fwrite($fd, $gallery->session->albumName . "/$index"); fclose($fd); print "New featured photo saved.\n</html>"; } else { print "<span class=\"error\">Error: Could not open cache file" . "</span>\n"; } } else { print "<span class=\"error\">Error: Invalid parameters.</span>\n"; } print "<br /><br /><form>\n"; print "<input type=\"submit\" value=\"Close\" onclick='parent.close()'>\n"; print "</form>\n"; print "</html>"; exit; } else { require($GALLERY_BASEDIR . "init.php"); define(FEATURE_CACHE, $gallery->app->albumDir . "/featured-photo.cache"); /* read in from cache file */ if ($fd = fs_fopen(FEATURE_CACHE, "r")) { while ($line = fgets($fd, 4096)) { list($albumName, $index) = explode("/", $line); } fclose($fd); } if ($albumName) { $album = new Album(); $album->load($albumName); } if ($album && $index) { $id = $album->getPhotoId($index); $PHOTO_URL = makeAlbumURL($album->fields["name"], $id); $ALBUM_URL = makeAlbumURL($album->fields["name"]); $IMG = "<a href=\"$PHOTO_URL\">" . $album->getThumbnailTag($index) . "</a>"; $CAPTION = $album->getCaption($index); $FROM = "From: <a href=\"$ALBUM_URL\">" . $album->fields["title"] . "</a>"; print "<div id=\"photoheader\">\n"; print "<b>Featured Photo</b>\n"; print "</div>\n\n"; print "<div id=\"photo\">\n"; print "$IMG\n"; print "</div>\n\n"; print "<div id=\"caption\">\n"; print "$CAPTION<br />\n"; print "$FROM\n"; print "</div>\n"; } else { print "<div id=\"feature_caption\">\n"; print "No featured photo.\n"; print "</div>\n"; } } ?> |
|
Addict
Joined: 2003-07-23
Posts: 27 |
![]() |
Ignore this post... |
|
Addict
Joined: 2003-07-23
Posts: 27 |
![]() |
fuzioneer wrote:
i have installed your mod and it is working in a fashion !!! I get the same on PostNuke. I've not looked into the cause though. I'll check it out tomorrow if beckett doesn't beat me to it. :wink: |
|
Addict
Joined: 2003-07-23
Posts: 27 |
![]() |
Here's the fix. Edit featured-photo.php accordingly. /* edit this if necessary, but include the trailing slash! */ $GALLERY_BASEDIR = "modules/gallery/"; Should be modified to include global variables for Gallery. Replace the code posted above with the code below global $GALLERY_NO_SESSIONS; global $GALLERY_BASEDIR; global $GALLERY_EMBEDDED_INSIDE; global $GALLERY_MODULENAME; global $op; global $mop; global $include; global $name; $GALLERY_MODULENAME = "gallerymodulename"; //Whatever you called your module $GALLERY_BASEDIR = "modules/$GALLERY_MODULENAME/"; $GALLERY_EMBEDDED_INSIDE = "nuke"; $GALLERY_NO_SESSIONS = true;
This should resolve the session issue. Hope that helps..... I used the Core/php block for PostNuke. That's the easiest way to utilize this code. Just paste the following in the content area: include("modules/gallerymodulename/featured-photo.php"); Replace the 'gallerymodulename with your gallery module's name. beckett, great start on this feature.:D I'm working to add a few things to it. I'll post them as I get them done if anyone is interested. |
|
mib
Joined: 2003-04-26
Posts: 22 |
![]() |
I was looking for a possibility to resize the featured photo. This is my idea... <?php /* * * Different photo size and place for featured photo * Michael Baehni approx. media * * Based on * * Featured photo block for Gallery * Beckett Madden-Woods (beckett@beckettmw.com) * * This is basically block-random.php from Gallery * Original author and copyright: * * Gallery - a web based photo album viewer and editor * Copyright (C) 2000-2001 Bharat Mediratta * * Find the original GNU GPL license at http://gallery.sourceforge.net/ */ /* Hack prevention. */ if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) { print "Security violation\n"; exit; } /* edit this if necessary, but include the trailing slash! */ $GALLERY_BASEDIR = "/opt/root/home/.../public_html/gallery/"; $dest = "/opt/root/home/.../public_html/imx/"; $source = "/opt/root/home/.../fotos/"; $pix ="titelbild.jpg"; $size = 350; if ($set) { require($GALLERY_BASEDIR . "init.php"); define(FEATURE_CACHE, $gallery->app->albumDir . "/featured-photo.cache"); ?> <html> <head> <title>Highlight Photo</title> <?php echo getStyleSheetLink() ?> </head> <body> <center> <?php if ($gallery->session->albumName && isset($index)) { if ($fd = fs_fopen(FEATURE_CACHE, "w")) { fwrite($fd, $gallery->session->albumName . "/$index"); fclose($fd); $albumName = $gallery->session->albumName; if ($albumName) { $album = new Album(); $album->load($albumName); } $photo= $album->getPhotoPath($index); $photo = substr (strrchr ($photo, '='), 1 ); $res = resize_image($source.$photo,$dest.$pix, $size); print "New featured photo resized and saved.\n</html>"; } else { print "<span class=\"error\">Error: Could not open cache file" . "</span>\n"; } } else { print "<span class=\"error\">Error: Invalid parameters.</span>\n"; } print "<br /><br /><form>\n"; print "<input type=\"submit\" value=\"Close\" onclick='parent.close()'>\n"; print "</form>\n"; print "</html>"; exit; } else { require($GALLERY_BASEDIR . "init.php"); define(FEATURE_CACHE, $gallery->app->albumDir . "/featured-photo.cache"); /* read in from cache file */ if ($fd = fs_fopen(FEATURE_CACHE, "r")) { while ($line = fgets($fd, 4096)) { list($albumName, $index) = explode("/", $line); } fclose($fd); } if ($albumName) { $album = new Album(); $album->load($albumName); } $id = $album->getPhotoId($index); $PHOTO_URL = makeAlbumURL($album->fields["name"], $id); $ALBUM_URL = makeAlbumURL($album->fields["name"]); $CAPTION = $album->getCaption($index); $FROM = "From: <a href=\"$ALBUM_URL\">" . $album->fields["title"] . "</a>"; } ?> |
|
jhuber
Joined: 2003-07-11
Posts: 3 |
![]() |
Anyone else getting the wrong photo. Some photos work and one in particular doesn't. Choosing featured photo writes the wrong photo to cache. The gallery is really small right now. More Info: The position number is correct just album name incorrect. More Info 2: It happens when a I choose a photo in an album that has nested albums. |
|
jhuber
Joined: 2003-07-11
Posts: 3 |
![]() |
I think I fixed it. I changed the the way the album name is set in view_album.php It was: Quote:
/* Joe Block for Pic o Day */ Now: Quote:
/* Joe Block for Pic o Day */ I don't know PHP or much of any another language for that matter. So, if I did something that is going to break or flat wrong let me know. |
|
thominendicott
![]()
Joined: 2003-07-28
Posts: 4 |
![]() |
Beckett - that is AWESOME. I'll have to try that out myself. |
|
mib
Joined: 2003-04-26
Posts: 22 |
![]() |
Just try to resize the image with the resize function and copy it to another place. pbyjp wrote:
YEP!! I finally got it. :lol: /* edit this if necessary, but include the trailing slash! */ $GALLERY_BASEDIR = "/opt/root/home/.../public_html/gallery/"; $dest = "/opt/root/home/.../public_html/imx/"; $source = "/opt/root/home/.../fotos/"; $pix ="titelbild.jpg"; $size = 350; if ($set) { require($GALLERY_BASEDIR . "init.php"); define(FEATURE_CACHE, $gallery->app->albumDir . "/featured-photo.cache"); ?> <html> <head> <title>Highlight Photo</title> <?php echo getStyleSheetLink() ?> </head> <body> <center> <?php if ($gallery->session->albumName && isset($index)) { if ($fd = fs_fopen(FEATURE_CACHE, "w")) { fwrite($fd, $gallery->session->albumName . "/$index"); fclose($fd); $albumName = $gallery->session->albumName; if ($albumName) { $album = new Album(); $album->load($albumName); } $photo= $album->getPhotoPath($index); $photo = substr (strrchr ($photo, '='), 1 ); $res = resize_image($source.$photo,$dest.$pix, $size); print "New featured photo resized and saved.\n</html>"; |
|
zchoice
Joined: 2003-07-26
Posts: 31 |
![]() |
I tried this but no luck. What might I be missing? |
|
bubonic
Joined: 2003-09-07
Posts: 10 |
![]() |
I keep getting 'Parse error: parse error in /home/httpd/htdocs/gallery/featured-photo.php on line 84' This is really a nice feature, hope I can get some help. |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
OKAY! Here this! This thread's gotten too long and confusing. For anyone with issues regarding featured_photo, OR with mods, etc., PLEASE post a new topic, and include "featured_photo" somewhere in the topic. I'm locking this topic now, as it's too unwieldy to follow. -Beckett ( beck@beckettmw.com) |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
NEW VERSION UPDATED FOR v1.4.4 AND NEWER I've updated the code after two years to work with some newer versions. -Beckett ( beck@beckettmw.com) |
|