Welcome to Geeklog, Anonymous Tuesday, January 31 2023 @ 09:23 pm EST

Geeklog Forums

The Weirdest Upgrade - For the real Experts please....


Status: offline

ola_one

Forum User
Full Member
Registered: 06/28/03
Posts: 186
Please this may seem a little wordy, but it is killing me, so pardon me please....

My site was running with the following for the past 6 Months at the minimum.

Windows 2000 Advanced Server
Apache 2.0.48
PHP 4.3.4
Mysql 4.0.13
Geeklog 1.3.8sr4
Gallery 1.4.1pl1

Two days ago, I decided to add the random photo block and the trouble begins.

After adding the random photo block, I got an error 1064 on my server and in trying to solve this problem, decided to upgrade Geeklog to 1.3.9sr1.

At this point I untarred Geeklog and copied it over the existing Geeklog Directory. All I edited were (Config.PHP, Lib-Common.php)

The upgrade/installation was supposedly okay, but it did not get rid of my random photo block problem.

The function that I copied to lib-custom looks like the following, the first part is the end of a previous function and the random photo function follows (Not the whole function - just some of it).

If I leave the function this way, I get to my webpage and in the PHP Block that I created for random photo,
I do not get a random photo, instead what I get is: Error in PHP Block. Function, phpblock_galleryRandomPhoto, does not exist.

return mail ($to, $subject, $message, $headers);
}
*/

* 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;

However when I change the function to (by adding the bold)
return mail ($to, $subject, $message, $headers);
}
*/
/*
* 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;

I get a 1064 error and cannot get to my homepage(http://www.feyiola.com). But if instead of going to my homepage you type http://www.feyiola.com/calendar.php you get to the calendar.

So the problem is with the homepage somehow.

Now the problem includes Gallery and as much as I try to reconfigure Gallery, it is no longer wrapped in Geeklog. It was wrapped in Geeklog from inception up until yesterday after the updates....Now when you click on Photographs, you get to my Gallery, but not inside Geeklog even though I chose embedded in Geeklog during configuration and reconfigurations...

I have at this time used the first random function to show you this problem. To get to the web site, just add calendar.php as I stated earlier. and then when you click on Photographs, you will see what I was saying.

Thanks a million if you can solve this problem...
 Quote

Status: offline

JohnVanVliet

Forum User
Full Member
Registered: 10/09/03
Posts: 161
hi this is the code --edited
that i ues in lib-custom
Text Formatted Code
......................
..........
 $user_templates->parse('output', 'memberdetail');
    $retval .= $user_templates->finish($user_templates->get_var('output'));

    return $retval;
}
function phpblock_plugin_menu()
{
    $retval = '';
    $plugin_menu = PLG_getMenuItems();
    for( $i = 1; $i <= count($plugin_menu); $i++ )
    {
        $url = current($plugin_menu);
        $plg = key($plugin_menu);
        $retval .= '<a href="' . $url . '">' . $plg . '</a><br>';
        next( $plugin_menu );
    }
    return $retval;
}
function phpblock_galleryRandomPhoto() {
        global $_CONF, $GALLERY_BASEDIR, $GALLERY_NO_SESSIONS, $gallery;
        $GALLERY_NO_SESSIONS=true;
        $GALLERY_BASEDIR = "/webroot/gallery/";
        define(CACHE_FILE, "/webroot/gallery/RandPhoto/block-random.cache");
        define(CACHE_EXPIRED, 30);
        require_once($GALLERY_BASEDIR ."init.php");
        include_once($_CONF['path_html'] . "/block-random.php");

        if ($profile) {
            $timer = time();
        }
                /* Initializing the seed */
        srand ((double) microtime() * 1000);
               
        // 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_")) AND (!strstr($caption,"DCP_"))) {
                        $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;
}


/**
* This is an example of a custom email function. When this function is NOT
* commented out, Geeklog would send all emails through this function
* instead of sending them through COM_mail in lib-common.php.
*
* This is basically a re-implementation of the way emails were sent
* prior to Geeklog 1.3.9 (Geeklog uses PEAR::Mail as of version 1.3.9).
*
*/
/*
function CUSTOM_mail($to, $subject, $message, $from = '', $html = false, $priority = 0)
{
    global $_CONF, $LANG_CHARSET;

    if (empty ($LANG_CHARSET)) {
        $charset = $_CONF['default_charset'];
        if (empty ($charset)) {
            $charset = 'iso-8859-1';
        }
    } else {
        $charset = $LANG_CHARSET;
    }

    if (empty ($from)) {
        $from = $_CONF['site_name'] . ' <' . $_CONF['site_mail'] . '>';
    }

    $headers  = 'From: ' . $from . "rn"
              . 'X-Mailer: Geeklog ' . VERSION . "rn";

    if ($priority > 0) {
        $headers .= 'X-Priority: ' . $priority . "rn";
    }

    if ($html) {
        $headers .= "Content-Type: text/html; charset={$charset}rn"
                 .  'Content-Transfer-Encoding: 8bit';
    } else {
        $headers .= "Content-Type: text/plain; charset={$charset}";
    }

    return mail ($to, $subject, $message, $headers);
}
*/

?>

 


you may have a "{ }" proplem--ie.missing one

and is block-random.php in public_html

and is there a file hear
/webroot/gallery/RandPhoto/block-random.cache


PS i have a very,very odd set up so be warned
 Quote

All times are EST. The time is now 09:23 pm.

  • 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