SMF + G2

Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Tue, 2005-05-24 21:25

This project was started after I saw a need for it - at the time there was only one gallery available for SMF, and it didn't have nearly as many features as Gallery2 (or Gallery1 for that matter - and it still doesn't).

Status: Current verion: 1.0 (Released November 17th, 2011)
Project site: http://galleryproject.oldiesmann.us
Preview: http://galleryproject.oldiesmann.us/index.php?action=gallery (registration encouraged, but not required)
Download: http://galleryproject.oldiesmann.us/index.php?action=tpmod;dl
Features: Complete integration into SMF - gallery can be embedded (.../index.php?action=gallery) or bridged (redirects to external gallery instead of embedding it). User account info is updated automatically as needed. "Link membergroups" option maps every SMF membergroup with a Gallery membergroup of the same name (if the group doesn't exist yet, it will be created) and updates group membership as needed. Also includes automatic language detection - the language you use in Gallery will be dependent on what language you're using in SMF (so if you're using Spanish in SMF, you will also use Spanish in Gallery).

New features in 1.0

  • Updated lightboxv2 to latest version
  • New sub-items for the Gallery menu item (Your Album, Your Gallery Profile, SMF+G2 Settings and G2 Site Admin)
  • "Visit <user>'s Gallery Album" link in profile replaced with standard linked camera icon
  • "Visit <user>'s Gallery Profile" link in profile moved to Profile Info menu
  • Support for SMF 2.0 and 2.0.1 (and package should install on future versions as well barring code changes that interfere with things)
 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-05-24 21:36

you'd have to post your integration code plus the rows of your g2_users and g2_externalidmap tables, without, i can't tell you what's wrong.

i assume you should delete all (obsolete) rows of the g2 table g2_externalidmap.

and your integration code shouldn't call GalleryEmbed::init with an activeUserId that isn't mapped to an exisisting user.

 
d3vlabs

Joined: 2005-05-10
Posts: 100
Posted: Tue, 2005-05-24 21:43

Oldiesmann! Where are the themes at :X

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-05-24 21:49

Oldiesmann, and btw: i'd recommend copying a lot of code from the existing integrations, perhaps wordpress is a good start to copy from. unless SMF has "events" or "hooks" which allow an event based synchronization.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Tue, 2005-05-24 21:54

valiant - I call GalleryEmbed::init and then check for "ERROR_MISSING_OBJECT" (meaning the user hasn't been added yet). If this is the case, then it goes through the procedures to add the user to Gallery along with the appropriate groups (if necessary) before calling GalleryEmbed::init again. It's not perfect yet, but it generally works. I will take a look at that table when I get a chance and see what I can do.

d3v - I'll install more Gallery themes soon. My main focus is getting the integration to work right now.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-05-24 22:01

Oldiesmann, see my discussion in the WP thread of the last weeks. You shouldn't call GalleryEmbed::init twice. And there's a lot of prototype code you could implement. Or just copy from the WP guys, it's all open source GPLed code.

for existing code, click on the embedding&integration link in my signature.
i'd happily review your code, that's what i'm hear for :)

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Tue, 2005-05-24 22:17

Ok. I don't have access to phpMyAdmin at the moment (stupid network firewall at school blocks nearly every port that isn't extremely common...), so I wrote a PHP script to check that table...

There were still a couple of entries relating to an entity with g_externalId of "1" (which of course would be the ID_MEMBER for the account I was having problems with), so I deleted those. Now it's complaining about my code to automatically add people to the "Site Admins" group ("ERROR_MISSING_OBJECT: 3 GalleryGroup"); What should I do so that it automatically adds everyone from SMF's "Administrators" group to Gallery's "Site Admins" group?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-05-24 22:47

see my code in the xaraya integration... ;)

depends on if you plan to synchronize not only users, but groups too.
i'd recommend synchronizing only users.

in this case, you'd have to do something like this:
1. get the g2 user object, e.g. by GalleryCoreApi::loadentitybyextid($smfUserId);
2. get the g2 entityId of the admin group, e.g. by

list ($ret, $adminGroupId) = GalleryCoreApi::getPluginParameter('module', 'core', 'id.adminGroup');
if ($ret->isError()) {
// handle the error
exit;
}
$ret = GalleryCoreApi::addUserToGroup($user->getId(), $adminGroupId);
if ($ret->isError()) {
// handle the error somehow
return $ret->wrap(__FILE__, __LINE__);
}

// finally call GalleryEmbed::done() if you don't plan to call GalleryEmbed::handleRequest();

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Tue, 2005-05-24 22:56

I would prefer to synchronize both groups and members if at all possible. I would at least like to get it so that SMF"s administrators have administrative powers in Gallery as well. I will check out the code that you suggested.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-05-24 23:06

use the above code if you synchronize users and would like to make users admins, whose corresponding users in smf are also admins.

by synchronizing groups i mean creating all groups that exist in SMF in G2 and the other way around. i guarantee you, that's not as easy as it sounds. it's only simple, if g2 and SMF have the exact same group management architecture.

if you choose to synchronize groups, and once all SMF groups are synchronized to the G2 groups, you can add users to groups, e.g. to the admin group, just by the convienience function GalleryEmbed::addUserToGroup($smfUserId, $smfAdminGroupId);

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Tue, 2005-05-24 23:27

I wasn't planning to make Gallery groups exist in SMF. I just want all of SMF's groups to exist in Gallery for the most part. I'd like to sync SMF's Administrators group with Gallery's Site Admins group so that anyone who is an Administrator in SMF is a Site Admin in Gallery (but not necessarily the other way around). I can add users to groups and create groups quite easily, but the only issue is the administrators. Once that's taken care of, things should be pretty easy to handle.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Wed, 2005-05-25 15:24

Ok... I changed the code a bit so it will now try to create the user first, and add them to their groups, before it ever calls init. However, now when I attempt to go to the gallery with my Oldiesmann account, I get this:

Fatal error: Undefined class name 'gallerycoreapi' in /.../galleryproject/gallery2/modules/core/classes/GalleryEmbed.class on line 261

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-05-25 16:22

Oldiesmann, please take a look at the existing integrations.
Or read the docs in GalleryEmbed.class:

Quote:
/**
* Access point for external application in which Gallery is embedded.
* See docs/EMBEDDING for more information on using the GalleryEmbed class.
* Three interaction modes:
* 1) GalleryEmbed::init(array(..)) followed by GalleryEmbed::handleRequest()
* 2) GalleryEmbed::init() followed by other GalleryEmbed/G2 calls,
* end with GalleryEmbed::done() <-- REQUIRED
* 3) Single GalleryEmbed::logout() call
*

you have to call GalleryEmbed::init() before you do anything else. Calling GalleryEmbed::init boots G2, includes the most important classes etc.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Wed, 2005-05-25 16:39

Ok. Thanks for that info. I was trying to find a way to call gallery::init only once without having to reload the page (one method I tried yesterday resulted in an endless loop...). I will have to go modify my other code then as well so everything else works.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-05-25 16:48

when you have created a user, you can login in G2 with GalleryEmbed::checkActiveUser, no need to call GalleryEmbed::init again.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Wed, 2005-05-25 17:54

Ah! Thanks :)

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Wed, 2005-05-25 18:15

Thanks for that info :)

I finally got my Oldiesmann account working :D

Now to go edit the rest of the code to make sure things work properly.

Do I have to call init() before calling checkActiveUser() or not? I need to use one of them in several places to determine whether or not to do certain things in gallery by looking for ERROR_MISSING_OBJECT (for example, when logging out - no sense in creating a user in Gallery just so we can log them out...).

Now that I have created my Administrators account in Gallery, I'm going to logout of my board, and login to gallery as admin and figure out how to make that group administrators...

Also, I would still like to know if it's possible to do everything through the embedded Gallery. No real point in having it embedded in the board if all the links point to main.php...

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-05-25 21:54
Quote:
/**
* Access point for external application in which Gallery is embedded.
* See docs/EMBEDDING for more information on using the GalleryEmbed class.
* Three interaction modes:
* 1) GalleryEmbed::init(array(..)) followed by GalleryEmbed::handleRequest()
* 2) GalleryEmbed::init() followed by other GalleryEmbed/G2 calls,
* end with GalleryEmbed::done() <-- REQUIRED
* 3) Single GalleryEmbed::logout() call
*

no need to call init for the logout call.
you need to call GalleryEmbed::init before checkactiveuser.
again, please take a look at the existing integrations, all your questions are either answered in existing forum discussions or in the code.

Quote:
Also, I would still like to know if it's possible to do everything through the embedded Gallery. No real point in having it embedded in the board if all the links point to main.php...

only DownloadItem links (the actual images) go directly to main.php when G2 is embedded. and this is for performace reasons.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Wed, 2005-05-25 22:16

That's the problem... No matter what I do, the links all point to main.php. And the only way I can get those links to work properly is to set the embedPath to '/galleryproject/gallery2' and relativeG2Path to '' - otherwise they end up pointing to /galleryproject/main.php.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-05-25 22:33

change your embedPath, embedUrl, relativeG2Path arguments for the GalleryEmbed::init call.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Wed, 2005-05-25 22:45

I was editing my previous post to include that information when you were typing... The embedURL is set to index.php?action=gallery because that's how I want to access it in SMF.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-05-25 22:50

embedPath = /galleryproject/
embedUri = index.php?action=gallery
relativeG2Path = gallery2/

see: docs/EMBEDDING

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Wed, 2005-05-25 22:56

If I try that method, all the links point to /galleryproject/main.php instead of /galleryproject/gallery2/main.php

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-05-25 23:08

- make sure you use g2 beta b3.
- make sure you use the exact values from my last post.
- let me see your code, can't help you without seeing the code.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Wed, 2005-05-25 23:14

I always end up with links that look something like this...

http://smf.oldiesmann.us/galleryproject/gallery2/main.php?g2_view=members:MembersList&g2_return=http%3A%2F%2Fsmf.oldiesmann.us%2Fgalleryproject%2Findex.php%3Faction%3Dgallery&g2_returnName=album

However, as soon as I click it, it takes me directly to main.php instead of actually returning the "g2_return" URL.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Wed, 2005-05-25 23:20

I am using g2 beta 3
If I use your exact values, the links don't work (they all point to smf.oldiesmann.us/galleryproject/main.php... instead of smf.oldiesmann.us/galleryproject/gallery2/main.php...).

Code:

	global $modSettings, $db_prefix, $user_info, $context, $ID_MEMBER, $g2data, $g2moddata;

	include_once($modSettings['gallery_path'] . '/embed.php');
	loadTemplate('index');
	$context['sub_template'] = 'Gallery';

	$galleryparams = array('embedURI' => 'index.php?action=gallery',
				'embedPath' => '/galleryproject/gallery2',
				'relativeG2Path' => '',
				'loginRedirect' => '/index.php',
				'activeUserId' => $ID_MEMBER,
				'activeLanguage' => 'enUS');

	$try = GalleryEmbed::init($galleryparams);
	if($try->isError())
	{
		if(ERROR_MISSING_OBJECT)
		{
			GalleryEmbed::createUser("$ID_MEMBER", array('username'=>$user_info['username'],
									'email'=>$user_info['email'],
									'fullname'=>$user_info['name'],
									'language'=>'enUS',
									'hashedpassword'=>$user_info['passwd'],
									'hashmethod'=>'md5'));
			foreach($user_info['groups'] AS $group)
			{
				$query = db_query("SELECT groupName FROM {$db_prefix}membergroups WHERE ID_GROUP='$group'", __FILE__, __LINE__);
				$result = mysql_fetch_assoc($query);
				$trysomething= GalleryEmbed::CreateGroup($group, $result['groupName']);

				if($trysomething->isError() && !ERROR_COLLISION)
				{
					fatal_error($trysomething->getAsHtml(), false);
				}

				$trysomethingelse = GalleryEmbed::addUserToGroup($ID_MEMBER, $group);
				if($trysomethingelse->isError())
					fatal_error($trysomethingelse->getAsHtml(), false);

				mysql_free_result($query);
				unset($result);
			}
			$ret = GalleryEmbed::checkActiveUser($ID_MEMBER);
			if($ret->isError())
				fatal_error($ret->getAsHtml(), false);
		}
		else
		{
			fatal_error($try->getAsHtml());
		}
	}
	$g2data = GalleryEmbed::HandleRequest();
	$title = '';
	list($title, $css, $javascript) = GalleryEmbed::ParseHead($g2data['headHtml']);
	$context['page_title'] = $title;
	GalleryEmbed::done();

The fatal_error() function is used to pipe Gallery errors through SMF (makes things look nicer).

The "template_Gallery()" function in index.template.php just contains code to output the HTML:

global $g2data, $context;

$context['html_headers'] = $g2data['headHtml'];
echo $g2data['bodyHtml'];
 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-05-25 23:35
   $galleryparams = array('embedURI' => 'index.php?action=gallery',
            'embedPath' => '/galleryproject/gallery2',
            'relativeG2Path' => '',
            'loginRedirect' => '/index.php',
            'activeUserId' => $ID_MEMBER,
            'activeLanguage' => 'enUS'); 

change it to:

   $galleryparams = array('embedURI' => 'index.php?action=gallery',
            'embedPath' => '/galleryproject/',
            'relativeG2Path' => 'gallery2/',
            'loginRedirect' => 'index.php',
            'activeUserId' => $ID_MEMBER); 

(i changed the paths and removed the language. set language only if you know that it's needed, because it's not as fast as when you leave it away.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-05-25 23:39

and change

 if($try->isError())
   {
      if(ERROR_MISSING_OBJECT)
      {
         GalleryEmbed::createUser("$ID_MEMBER", array('username'=>$user_info['username'],
                           'email'=>$user_info['email'],
                           'fullname'=>$user_info['name'],
                           'language'=>'enUS',
                           'hashedpassword'=>$user_info['passwd'],
                           'hashmethod'=>'md5')); 

to:

 if($try->isError())
   {
     if ($ret->getErrorCode() & ERROR_MISSING_OBJECT)
        {
            // check if there's no G2 user mapped to the activeUserId
            $ret = GalleryEmbed::isExternalIdMapped($ID_MEMBER, 'GalleryUser');

            if ($ret->getErrorCode() & ERROR_MISSING_OBJECT)
            {

         GalleryEmbed::createUser("$ID_MEMBER", array('username'=>$user_info['username'],
                           'email'=>$user_info['email'],
                           'fullname'=>$user_info['name'],
                           'language'=>'enUS',
                           'hashedpassword'=>$user_info['passwd'],
                           'hashmethod'=>'md5')); 

note: enUS is not a valid g2 language format. en or en_GB are valid G2 language codes.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-05-25 23:42

and your code always tries to create a new group when you map a new user to g2, that will fail as soon as you map a 2nd user.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Thu, 2005-05-26 00:53

I tried the code you gave me, but everytime I do that it wants to point all the links to .../galleryproject/main.php instead of .../galleryproject/gallery2/main.php. I did make the other code changes though. The reason I'm attempting to create a group everytime a new member is added is to make sure all the groups get added in. You will notice that I am ignoring "ERROR_COLLISION", which is what happens if the assigned group already exists.

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Thu, 2005-05-26 04:40

Oldiesmann,

Grab the WPG2 Plugin and look at the g2embed.php at the function g2_login($initcall=FALSE)

Also if you look at some of the ::init threads in these forums you will see basically a series of concerns in the performance and how to correct this in some cases..

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-05-26 09:17

Oldiesmann, found the problem, array indices are not case-insensitive, so it ignored your embedUri. change embedURI to embedUri and use the paths i listed in my previous post.

and there are better strategies to synchronize groups...

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Thu, 2005-05-26 14:26

Thanks for the help again valiant. I will make the changes and see what I can do about synchronizing the admin groups.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-05-26 14:39

Oldiesmann, as i said, i'd recommend to keep it simple and not synchronize groups at all. just get the g2 id of the user and the g2 id of the admin group and synchronize.
groups other than the admin group don't offer much functionality when you synch' them.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Thu, 2005-05-26 17:06

I'm not trying to add members to existing gallery groups except for the admin. In every other case, I'm mapping a new Gallery group to an existing one in SMF. What's wrong with this? It adds a lot more flexibility to the integration.

How exactly do I tell Gallery to make members of SMF's "Administrator" group a member of Gallery's "Site Admins" group? I want people to be able to administrate their gallery without having to logout of their board and login to Gallery as "admin".

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-05-26 17:25

basically, you do it right at the moment. call GalleryEmbed::addUserToGroup right after GalleryEmbed::createUser.
but before calling GalleryEmbed::createGroup, i'd check if that is necessary.

and again, why not look at the existing WP code? you could learn so much and all these question would be answered automatically.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Thu, 2005-05-26 17:31

Sorry. I will do that. I apologize for asking so many questions, and will look over the wordpress stuff first.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Thu, 2005-05-26 20:05

I've been looking at the wordpress code and it has been quite helpful. I also figured out how to take care of the admins. However, I still have a question...

Is there any way to figure out what group(s) a member belongs to? I'm trying to figure out what the best method is for updating group membership for groups based on SMF's post groups. If I can figure out what group(s) a member belongs to, I can easily pull the information about their post group from the database and update appropriately. SMF's functionality lets MySQL handle everything using a big "CASE WHERE..." block (see Chapter 19 of the MySQL manual if you have no clue what I'm talking about...), so it doesn't actually give you any data in regards to whose post group stuff is changing.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-05-26 20:58

the xaraya integration is the only integration where groups are sync'ed too (i did it as a proof of concept).
i'd recommend looking at this code, but the problem is that xaraya manages groups in trees (a group can have subgroups, etc.) and thus it's more complicated and not the best code to learn from.
anyway, it's xaraya/gallery2/xaradminapi/createhook.php if you want to look how it's done.

you want to know in what g2 groups a g2 user is in?
see GalleryCoreApi::fetchGroupsForUser()
also see modules/core/classes/GalleryCoreApi.class for other functions.
some additional functions can be found in modules/core/classes/GalleryEmbed.class
that's about all you need to know about G2.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Thu, 2005-05-26 23:33

I'll look at the suggested files/methods. Thanks again :)

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Fri, 2005-05-27 18:15

Well, it was a bit of a pain, but I did it :)

function gallery_groupCheck($userid)
{
        global $db_prefix, $user_info;


	// Get the ID of the user's post group
	$query = db_query("SELECT ID_POST_GROUP FROM smf_members WHERE ID_MEMBER = '$userid'");
	$result = mysql_result($query, 0);

	// Get their Gallery User ID
	list($ret, $value) = GalleryCoreApi::loadEntityByExternalId($userid, 'GalleryUser');
	if($ret->isError())
	{
		fatal_error($ret->getAsHtml(), false);
	}

	// Get all the groups that they belong to in Gallery
	list($ret, $galgroups) = GalleryCoreApi::loadGroupsForUser($value->getId());
	if($ret->isError())
	{
		fatal_error($ret->getAsHtml(), false);
	}

	// Get the Gallery Group ID for their post group
	list($ret, $galpostgroupid) = GalleryCoreApi::loadEntityByExternalId($result, 'GalleryGroup');
	if($ret->isError())
	{
		fatal_error($ret->getAsHtml(), false);
	}

	// Check to see if they're in this group - if so, assume all is well and leave...
	if(!in_array($galgroups, $galpostgroupid->getId())
	{
		// They aren't, so add them to it
		$ret = GalleryEmbed::AddUserToGroup($userid, $result);

		// Get all the *other* post groups...
		$query2 = db_query("SELECT ID_GROUP, groupName FROM {$db_prefix}membergroups WHERE minPosts != '-1' && ID_GROUP != '$result'", __FILE__, __LINE__);
		$postgroupgalids = array();

		// Loop through until we find which group we should remove them from...
		while($results = mysql_fetch_assoc($query2))
		{
			// Get the Gallery Group ID for this post group
			list($ret, $ids) = GalleryCoreApi::loadEntityByExternalId($results['ID_GROUP']);
			if($ret->isError())
				fatal_error($ret->getAsHtml(), false);

			// Is this the one we want to remove them from?
			if(in_array($galgroups, $list->getId())
			{
				// Success! Remove them, then go back where we came from
				GalleryEmbed::removeUserFromGroup($userid, $results['ID_GROUP']);
				return;
			}			
		}
		
	}
	else
	{
		// Such a shame... all that work for nothing!
		return;
	}
}

The hardest part was figuring out the easiest way to determine the ID number of the group to remove them from in Gallery...

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-05-27 19:02

why do you remove the user from the other groups?
can a SMF user only be in a single post group of SMF?

variable naming:
it's your code and i have absolutely nothing to say. but don't you think naming $result something more meaningful like $smfGroupId would make your code a little more readable? and $value could be named $g2User.

but the code looks good.

one question though. in

// Get the Gallery Group ID for their post group
   list($ret, $galpostgroupid) = GalleryCoreApi::loadEntityByExternalId($result, 'GalleryGroup');
   if($ret->isError())
   {
      fatal_error($ret->getAsHtml(), false);
   } 

you assume that the group already exists in G2. how so? do you create all SMF groups in G2 somewhere else?

and I guess gallery_groupCheck($userid) only gets called when you create a new G2 user, right? that would be good.

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Fri, 2005-05-27 20:36

The user is only removed from one other group - the one that is mapped to a post-based group that they no longer belong to.

SMF has two types of membergroups - post-based (called "ranks" by phpBB and other forum systems) and non-post-based. The code I wrote is to make sure that the user is always in the appropriate group in Gallery based on what post group they belong to. They can be in any number of other groups though (such as Administrator, Global Moderator or any other groups the admin creates).

I will work on variable names soon... My main goal is to get everything working at this point. Once I'm out of school in a few weeks, I'll have a lot more time to play around with this, and will be making a lot of changes then. I am also planning to create a custom template for Gallery that will allow Gallery to match any SMF theme (should not be that difficult to do :)).

In answer to your question - I missed that issue. I thought about doing that at first, but because that function is only called after the user has been created and only if they're not accessing Gallery for the first time, so I just assumed that the group would arleady exist... I wasn't thinking :) I will add code to check to make sure that group exists first, and create it if necessary.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-05-28 23:13

Oldiesman, if you want to change the title of the topic, just edit your first post of the thread and change it.

And as this topic is sticky now, please put informational stuff into the fist post (edit it) much like it is done in the other sticky topic.

thanks for the effort!

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Tue, 2005-05-31 15:15

You're welcome :)

 
mykal

Joined: 2005-02-25
Posts: 37
Posted: Sun, 2005-06-05 23:10

Man, I cant wait for this! OldiesMann is always on the ball! Good Job.

 
aravot
aravot's picture

Joined: 2005-03-05
Posts: 61
Posted: Fri, 2005-07-08 08:57

Any new development on this

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Thu, 2005-08-04 01:13

Yeah. Sorry for the lack of info. I've been really busy the past few months, and haven't had time to work on it. I finally got time to do so last night, and wrote up a mod for SMF 1.0.x. I am going to be writing one for 1.1 Beta 3 Public soon, and then will test both out thouroughly. After that, I'm going to write up some instructions and will release the integration. Glad to see that there's a lot of interest in this project :)

 
aravot
aravot's picture

Joined: 2005-03-05
Posts: 61
Posted: Fri, 2005-08-05 05:43

if you need help beta testing let me know

 
mab

Joined: 2005-08-25
Posts: 1
Posted: Thu, 2005-08-25 13:21
aravot wrote:
if you need help beta testing let me know

i also can help as a beta-tester...

 
Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Fri, 2005-10-07 00:20

Quick update. I finished writing the code for the new account creation feature and it seems to work well (at least it did for one person who tried it). I still have a few more bugs to work out, but should start beta testing soon.

The Oldiesmann
SMF Support Specialist