Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 10:13 am EST

Geeklog Forums

randome gallery block ok but lib-custom 444 error


Status: offline

etegration

Forum User
Full Member
Registered: 02/20/02
Posts: 179
i get error messages :


Warning: Cannot modify header information - headers already sent by (output started at CRazzrogram FilesApache GroupApache2htdocsgeeklog2confsystemlib-custom.php:444) in CRazzrogram FilesApache GroupApache2htdocsgeeklog2mainlib-common.php on line 811


line 444 of lib-custom is the beginning of the gallery block coding added to lib-custom and is (from 444 onwards) follows:

<?
/**
* Ver 1.2
* packetmad October 14, 2003 www.lanside.net
*
* Blaine Lang March 21/02 www.langfamily.ca
* Ver 1.1
* This Geeklog PHP function uses the Gallery Random Block code contibuted by Bharat Mediratta - Gallery Developer
*
* The Gallery random photo block will display a random photo from your Gallery in a geeklog block.
* The photo is displayed along with its caption and clicking the photo will take you directly to that photo in the appropriate album.
* This version of the random photo code only displays public photos - for which gallery has granted everyboddy access.
* Once a day it scans all your albums to see which ones are viewable by the general public.
* Then it saves that data and uses it for the rest of the day.
* If you change permissions on an album, add or delete albums the changes won't be reflected right away in the random photo block.
* You must have Gallery v1.2 or better to use this block.
*
* This block will also display the photo caption. This is nice when you add comments as a photo caption
* But if you have not, the block may display the default photo caption which gallery defaulted to which is your digicam IMAGE ID
* I have added a check and exclude these captions. Modify this as required - about halfway down in this function.
*
*/
function phpblock_galleryRandomPhoto() {
global $_CONF, $GALLERY_BASEDIR, $GALLERY_NO_SESSIONS, $gallery;
$GALLERY_NO_SESSIONS=true;
$GALLERY_BASEDIR = "C:/Program Files/Apache Group/Apache2/htdocs/geeklog2/main/gallery/";
define(CACHE_FILE, "C:/Program Files/Apache Group/Apache2/htdocs/geeklog2/main/gallery/block-random.cache&quotWink;
define(CACHE_EXPIRED, 86400);
require_once($GALLERY_BASEDIR ."init.php&quotWink;
include_once($_CONF['path_html'] . "/block-random.php&quotWink;

if ($profile) {
$timer = time();
}

/* Initializing the seed */
srand ((double) microtime() * 1000000);

// Check the cache file to see if it's up to date
$rebuild = 1;
if (fs_file_exists(CACHE_FILE)) {
$stat = fs_stat(CACHE_FILE);
$mtime = $stat[9];
if (time() - $mtime < CACHE_EXPIRED) {
$rebuild = 0;
}
}

if ($rebuild) {
scanAlbums();
saveCache();
} else {
readCache();
}

$album = chooseAlbum();

if ($album) {
$index = choosePhoto($album);
}

if (isset($index)) {
$id = $album->getPhotoId($index);
$retval = ""
."<a href=" .makeAlbumUrl($album->fields["name"], $id) .">"
.$album->getThumbnailTag($index)
."</a>";

$caption = $album->getCaption($index);

// Add any exclusions that you want for captions. I don't always add an caption and Gallery use the default image name
// which I don't want to display. My Cannon digicam uses IMG_XXXX and my Kodak uses DCP_XXXX
if (($caption) AND(!strstr($caption,"IMG_&quotWink) AND (!strstr($caption,"DCP_&quotWink)) {
$retval .= "<br><center>$caption</center>";
} else {
$retval .= "<br>";
}

$retval .= "<br><center>From: "
."<a href=" .makeAlbumUrl($album->fields["name"]) .">"
.$album->fields["title"]
."</a></center>";
} else {
$retval = "No photo chosen.";
}

if ($profile) {
$elapsed = time() - $timer;
$retval .= "<br>Elapsed: $elapsed secs";
}

return $retval;
}

?>


line 811 onwards from lib-common reads...


. ' Feed: ' . $A['title'] . '" href="' . $baseurl
. $A['filename'] . '">' . LB;
}
}
}
$header->set_var( 'feed_url', $feed_url );

if( empty( $pagetitle ) && isset( $_CONF['pagetitle'] ))
{
$pagetitle = $_CONF['pagetitle'];
}
if( empty( $pagetitle ))
{
if( empty( $topic ))
{
$pagetitle = $_CONF['site_slogan'];
}
else
{
$pagetitle = stripslashes( DB_getItem( $_TABLES['topics'], 'topic',
"tid = '$topic'" ));
}
}
if( !empty( $pagetitle ))
{
$pagetitle = ' - ' . $pagetitle;
}
$header->set_var( 'page_title', $_CONF['site_name'] . $pagetitle );

if( isset( $_CONF['advanced_editor'] ) && ( $_CONF['advanced_editor'] == 1 )
&& file_exists( $_CONF['path_layout']
. 'advanced_editor_header.thtml' ))
{
$header->set_file( 'editor' , 'advanced_editor_header.thtml'Wink;
$header->parse( 'advanced_editor', 'editor' );

}
else
{
$header->set_var( 'advanced_editor', '' );
}

$header->set_var( 'background_image', $_CONF['layout_url']
. '/images/bg.' . $_IMAGE_TYPE );
$header->set_var( 'site_url', $_CONF['site_url'] );
$header->set_var( 'layout_url', $_CONF['layout_url'] );
$header->set_var( 'site_mail', "mailto:{$_CONF['site_mail']}" );
$header->set_var( 'site_name', $_CONF['site_name'] );
$header->set_var( 'site_slogan', $_CONF['site_slogan'] );
$rdf = substr_replace( $_CONF['rdf_file'], $_CONF['site_url'], 0,
strlen( $_CONF['path_html'] ) - 1 );
$header->set_var( 'rdf_file', $rdf );
$header->set_var( 'rss_url', $rdf );

$msg = $LANG01[67] . ' ' . $_CONF['site_name'];

if( !empty( $_USER['username'] ))
{
$msg .= ', ' . $_USER['username'];
}


http://www.etegration.com.sg
http://www.itcow.com
http://www.ministryofhosting.com
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
remove the
Text Formatted Code
<? and ?>
 

from the beginning and end of your function in lib-custom.

-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

etegration

Forum User
Full Member
Registered: 02/20/02
Posts: 179
Quote by suprsidr: remove the
Text Formatted Code
<? and ?>

 

from the beginning and end of your function in lib-custom.

-s


Thanks will try, now bigger problem, i log out and try logging in again is impossible, notice this errors flash by then the same top reported error shown again on top of GL. Will try removing what you mention tonight, hope it solves it. Thanks!


Warning: Cannot modify header information - headers already sent by (output started at CRazzrogram FilesApache GroupApache2htdocsgeeklog2confsystemlib-custom.php:444) in CRazzrogram FilesApache GroupApache2htdocsgeeklog2confsystemlib-sessions.php on line 311

Warning: Cannot modify header information - headers already sent by (output started at CRazzrogram FilesApache GroupApache2htdocsgeeklog2confsystemlib-custom.php:444) in CRazzrogram FilesApache GroupApache2htdocsgeeklog2mainusers.php on line 894

Warning: Cannot modify header information - headers already sent by (output started at CRazzrogram FilesApache GroupApache2htdocsgeeklog2confsystemlib-custom.php:444) in CRazzrogram FilesApache GroupApache2htdocsgeeklog2mainusers.php on line 897

Warning: Cannot modify header information - headers already sent by (output started at CRazzrogram FilesApache GroupApache2htdocsgeeklog2confsystemlib-custom.php:444) in CRazzrogram FilesApache GroupApache2htdocsgeeklog2mainusers.php on line 924

http://www.etegration.com.sg
http://www.itcow.com
http://www.ministryofhosting.com
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
lib-custom should only have one set to php opening and closing tags, at the very beginning and the very end.

if you still have trouble and cannot login, change your random photo function to an empty function
Text Formatted Code

function phpblock_galleryRandomPhoto() {
}

 


and remove the block from the block editor.

And maybe upgrade to Gallery2, its much more robust.

Then you can simply use the G2Bridge plugin to manage your random photo block.


-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

All times are EST. The time is now 10:13 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content