Subject: Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 04/04/05 04:16pm
By: zewt

I must be missing a step somewhere, with getting Gallery integrated with my GL install.

I have both GL and Gallery installed and working fine. And when I make the config change for an embedded gallery and add the full path to my GL install it seems to work fine.

But when I visit my GL URL (localhost/geeklog/main). I see nothing about gallery anywhere.

When I visit my Gallery URL (localhost/gallery), I now see GL with Gallery in it.

What am I missing? Do I need to add Gallery as a static page or Block?

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 04/04/05 04:27pm
By: Dirk

Gallery is not a plugin, i.e. it doesn't use Geeklog's plugin API and therefore won't show up in the list of installed plugins.

bye, Dirk

[edit: bah, didn't read the post properly - listen to what knuff said and ignore me]

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 04/04/05 04:29pm
By: knuff

You have to activate the link in lib-custom.php.

Look for this code and uncomment it.

/**
* This is an example of a function that returns menu entries to be used for
* the 'custom' entry in $_CONF['menu_elements'] (see config.php).
*
*/
/*
function CUSTOM_menuEntries ()
{
    global $_CONF, $_USER;

    $myentries = array ();

    // Sample link #1: Link to Gallery
    $myentries[] = array ('url'   => $_CONF['site_url'] . '/gallery/',
                          'label' => 'Gallery');

    // Sample link #2: Link to the Personal Calendar - only visible for
    // logged-in users
    if (!empty ($_USER['uid']) && ($_USER['uid'] > 1)) {
        $myentries[] = array ('url'   => $_CONF['site_url']
                                         . '/calendar.php?mode=personal',
                              'label' => 'My Calendar');
    }

    return $myentries;
}
*/



Once you did that and adapted config.php you will see the gallery link in your menu.

Additionally you can add some blocks, like the random picture block.
Have a look at Squatty for available plugins / blocks

Greetz,
Boris

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 04/04/05 04:35pm
By: zewt

Thanks for the tips. I see by that code that Gallery IS expected to be in the main_html directory of GL.

I give it a try.

Thanks again.

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 04/04/05 04:55pm
By: zewt

That got it.

Thanks again for the help.

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 12/04/05 02:44pm
By: johnc10

After uncommenting the custom_menuEntries procedure at the end of geeklog/system/lib-custom.php , then edit geeklog/config.php and uncomment 'custom' (remove //).

If you have uncommented all the previous menu elements, remember to add a comma after the 'plugins' immediately above 'custom' else you will be going around in circles trying to find why it WONT WORK AAAAAHHH. It now works, bliss.

$_CONF['menu_elements'] = array
(
'home', // link to homepage
'contribute', // contribute / "submit a story" link
'links', // link to the links section (aka web resources)
'polls', // link to past polls
'calendar', // link to the site calendar
'search', // link to advanced search
'stats', // link to site stats
'prefs', // link to user's preferences
'plugins', // links added by plugins, like {plg_menu_elements}
'custom' // for custom links (see lib-custom.php)
);

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 12/04/05 02:59pm
By: knuff

[QUOTE BY= johnc10]... change CUSTOM to lowercase custom also ...
[/QUOTE]

And why would you do that ???

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 12/04/05 03:05pm
By: johnc10

True, it doesn't make any difference. I just looked at a previous procedure and it was in lowercase. The comma does though!

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 04/07/05 11:47am
By: Anonymous

[QUOTE BY= johnc10]
If you have uncommented all the previous menu elements, remember to add a comma after the 'plugins' immediately above 'custom' else you will be going around in circles trying to find why it WONT WORK AAAAAHHH. It now works, bliss.
[/QUOTE]


That's what's been bustin' my chops!
Thanks!!!!

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 10:32am
By: terminator

Hi all I realise this is an old issue, but for those of us new to geeklog it still is pertinent. I have tried the solutions described above to display the link to gallery to no avail. However, after studying the config.php and lib-common.php files I was able to come up with a solution that does work for me. Yes, I know that it is recommended that customizations be done in lib-custom.php...be that as it may for others who encounter this same issue rather than getting frustrated like I did at one point and was thinking of seeking another simpler package. I will post what I did. Maybe it may help someone else.

There are three changes necessary to display the gallery link on the top of the page. One to config.php and two to lib-common.php.

Below is the change to config.php
Add gallery to the menu elements as below;

$_CONF['menu_elements'] = array
(
'home', // link to homepage
'contribute', // contribute / "submit a story" link
'links', // link to the links section (aka web resources)
'polls', // link to past polls
'calendar', // link to the site calendar
'search', // link to advanced search
//'stats', // link to site stats
'prefs', // link to user's preferences
'plugins', // links added by plugins, like {plg_menu_elements}
'gallery', //link to gallery
'custom' // for custom links (see lib-custom.php)


Now for Lib-common.php
1st add gallery to the menu elements sub-menu of "COM_renderMenu"
as seen below;

function COM_renderMenu( &$header, $plugin_menu )
{
global $_CONF, $_USER, $LANG01, $topic;

if( empty( $_CONF['menu_elements'] ))
{
$_CONF['menu_elements'] = array( // default set of links
'contribute', 'links', 'polls', 'calendar', 'search', 'gallery', 'stats',
'plugins');
}

2nd change:
Add the following code under: "foreach( $_CONF['menu_elements'] as $item )


case 'gallery':
$url = $_CONF['site_url'] . '/gallery/index.php';
$label = gallery;
if( $anon &&
( $_CONF['loginrequired'] || $_CONF['statsloginrequired'] ))
{
$allowed = false;
}
break;


I hope you find this helpful.


Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 11:23am
By: terminator

Ahh...I am retracting the above...It does solve one problem but produces undesired results in the admin page....so I will investigate a solution. Back to the drawing board...lol

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 11:54am
By: terminator

Ok, the changes are cleared for implementation. I isolated the error I was getting and it was unrelated to the changes above. Infact it was an issue with the hosting service. So happy trails.

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 12:44pm
By: drshakagee

Instead of hacking lib_common.php why don't you just hard code a link in your header.thtml file?

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 01:04pm
By: terminator

sounds good but I wouldn't know where to start...lol

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 01:39pm
By: drshakagee

Just open the header.thtml (public_html/layout/yourtheme/) file and look for {menu_elements} and add your link right after it.

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 02:10pm
By: Dirk

If I may interrupt here: The "custom" menu entry in config.php and lib-custom.php was made exactly for this purpose (that's why it even includes an example that links to Gallery ...).

So what exactly is your problem with this?

bye, Dirk

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 02:28pm
By: terminator

Well, now. I never said I had a problem, other than that as per the recommended solutions made earlier in this post don't seem to work for me. Of course I could be missing something or doing something wrong. However, I did exactly as instructed, but fail to produce the desired result. Hence the reason I took the measures I did. Now, do you have a problem with that?

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 02:53pm
By: Dirk

[QUOTE BY= terminator] Now, do you have a problem with that?[/QUOTE]
Nope. I'm just irritated when someone takes the complicated route when we provide a much easier (and cleaner, IMO) solution.

Btw, did you remove the comment markers around CUSTOM_menuEntries?

bye, Dirk

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 03:27pm
By: terminator

Dirk, I prefer the easy way too, but I if it doesn't work I am not one to just give up...lol. Yeah I did uncomment that entry....Who knows maybe there are gremlins in there...lol

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 03:41pm
By: Dirk

[QUOTE BY= terminator] Yeah I did uncomment that entry....[/QUOTE]
I wasn't talking about the "comment" entry in config.php, but about the entire CUSTOM_menuEntries function in lib-custom.php. It is commented out by default.

bye, Dirk

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 03:48pm
By: terminator

Yes. Here is an excerpt from lib-custom.php.

/*
function CUSTOM_menuEntries ()
{
global $_CONF, $_USER;

$myentries = array ();

Sample link #1:Link to Gallery
$myentries[] = array ('url' => '/home/cartiqco/public_html/vision/gallery/',
'label' => 'Gallery');

//Sample link #2: Link to the Personal Calendar - only visible for
// logged-in users
if (!empty ($_USER['uid']) && ($_USER['uid'] > 1)) {
$myentries[] = array ('url' => $_CONF['site_url']
. '/calendar.php?mode=personal',
'label' => 'My Calendar');
}

return $myentries;
}

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 03:53pm
By: Dirk

[QUOTE BY= terminator] Yes. Here is an excerpt from lib-custom.php.

/*
function CUSTOM_menuEntries ()
[/QUOTE]

That /* up there is what I'm talking about. The entire function is in a comment ...

bye, Dirk

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 04:23pm
By: terminator

ok, here is it as it stands now but it still doesn't work.

function CUSTOM_menuEntries ()
{
global $_CONF, $_USER;

$myentries = array ();

Sample link #1:Link to Gallery
$myentries[] = array ('url' => '/home/cartiqco/public_html/vision/gallery/',
'label' => 'Gallery');

//Sample link #2: Link to the Personal Calendar - only visible for
// logged-in users
if (!empty ($_USER['uid']) && ($_USER['uid'] > 1)) {
$myentries[] = array ('url' => $_CONF['site_url']
. '/calendar.php?mode=personal',
'label' => 'My Calendar');
}

return $myentries;
}

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 04:29pm
By: terminator

Dirk, you know I don't want to waste your precious time on this issue. Since I already have the functionality I was looking for anyway. However, I appreciate your help. Infact, if you would be interested in helping me with a more interesting problem then I would be eternally gratefully. So, if you are so inclined please check out the link below. I posted this previously, and whilst they have been lots of views, noone has as yet responded to it. Maybe, you might have some insight.
Thanks in advance.


Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 08/07/05 04:31pm
By: terminator

http://www.geeklog.net/forum/viewtopic.php?forum=2&showtopic=55200

Is Gallery supposed to be installed in the PLUGIN dir?

Posted on: 09/07/05 11:53am
By: Dirk

[QUOTE BY= terminator] Dirk, you know I don't want to waste your precious time on this issue. Since I already have the functionality I was looking for anyway.[/QUOTE]
Well, it irks me when a function that we added precisely for your problem doesn't work for whatever reason.

Besides, hacking lib-common.php is never a good solution, as that is the one file in Geeklog that changes the most (see the recent security release ...). So it's almost bound to cause problems with the next update.

[QUOTE BY= terminator] However, I appreciate your help. Infact, if you would be interested in helping me with a more interesting problem then I would be eternally gratefully. So, if you are so inclined please check out the link below.[/QUOTE]
Sorry, I know next to nothing about the random gallery block. But there are gazillions of posts about this block, both here and over on squatty.com ...

bye, Dirk

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=50701