Welcome to Geeklog, Anonymous Saturday, August 31 2024 @ 11:38 pm EDT
Geeklog Forums
Further integration with Gallery
bas
So after some digging around in both the Geeklog and Gallery code I came to this modification in the init.php (from line 144 onwards) in Gallery :
} else if (!strcmp($GALLERY_EMBEDDED_INSIDE, "geeklog")) {
include_once("/opt/geeklog/public_html/lib-common.php");
include_once("/opt/geeklog/system/lib-database.php");
include($GALLERY_BASEDIR . "classes/gallery/UserDB.php");
include($GALLERY_BASEDIR . "classes/gallery/User.php");
/* Load our user database (and user object) */
$gallery->userDB = new Gallery_UserDB;
if(!empty($_USER['uid'])) {
/* Load their user object with their username as the key */
$result = DB_query("SELECT username FROM WHERE uid = ''");
$U = DB_fetchArray($result);
$gallery->user = $gallery->userDB->getUserByUsername(strtolower($U['username']));
}
} else {
Note: replace /opt/geeklog with the path to your geeklog installation.
Note: this replaces the inclusion of lib-common.php in init.php in John's hack.
Note: Users in Gallery are CASE-SENSITIVE, so I made the mapping to user lower case. You need to define the users in Gallery as lower-case for this hack to work.
Nore : This hack has only been tested on Geeklog 1.3.1 and Gallery 1.2.5
This code provides a mapping with the users of geeklog and the users defined in Gallery. It's not the most elegant solution since it requires two places for user-administration, but it does the job.
The nicest solution would be to create a new User and UserDB class for Gallery that directly use the user-information in Geeklog. This is something I may implement in the future.
Ok have fun,
Bas.
squatty
In a world without walls and fences, who needs Windows and Gates?
Anonymous
![Wink Wink](https://www.geeklog.net/forum/image_set/pixel.gif)
bas
bas
![Wink Wink](https://www.geeklog.net/forum/image_set/pixel.gif)
Anonymous
- 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