Posted by kaerast on February 1, 2007 at 12:14am
8 followers
| Project: | Guestbook |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
Enable a separate guestbook for each organic group, with permissions to decide whether group members or everybody can post to it.
Comments
#1
Reasonable request. However, seems like there is not much demand for it...?
#2
I'd like to see this happen. It would definitely allow a more reasonable discussion space for each group. Sun, could you give me a summary of what needs to be done to make this happen, and I'll take a look at the code and see if I can do it?
...not assigning this to myself since I don't have a whole lot of free time, so if it's really complicated I probably won't have time to do it.
#3
Well, we have a conceptual barrier for this, because guestbooks are tied 1:1 to user ids currently. That means, guestbook id 0 is a site's guestbook, and guestbook id > 0 is a user's guestbook. However, for OG integration, I'd understand that each group might have an own guestbook, not tied to a specific user...?
If that was the desired feature, we would have to remove this hard id relationship first. Basically, this would also mean that a user could have more than one guestbook, or there could be more than one site guestbook. However, I do not see a use-case for this on regular sites... so we might want to investigate whether there are other potential solutions to support external guestbook ids.
#4
Would it be better to just branch the module and change all UID references to GID, or would it be better to create a separate table for non-UID guestbooks? From a database perspective neither is particularly hard... I think the complicated part will be determining (A) how to get the guestbook to load on group pages and (B) how to tell whether we're looking at a group or a user. Plus there would be a bunch of settings and permissions to add, and we should start with Guestbook 2 anyway to get Panels integration (right?)...
If you're hesitant about putting a bunch of unnecessary code into Guestbook, I think modularization would be the best idea. In other words, Guestbook could be made into an API, and a submodule could determine where to show it. So there could be a User Guestbook submodule that would pass the UID and type 'uid' to the API, and a OG Guestbook submodule that would pass the GID and type 'og' to the API, and methods could be determined from there.
However, that seems like it would require a lot of refactoring that I don't really have time for right now. What do you think?
...and actually, now that I'm thinking about this, it sounds a lot like normal comments. Comments can't be enabled for groups, but maybe that's a better route to look at.
#5
Please note that Guestbook 2.x does not differ that much from 1.x -- it's mostly a clean-up release, but also ships with Panels and User Display API integration - as well as integration with Notifications (already on the way). I do not think that modularization helps in any way - we'd still have the barrier of hard-tied guestbook ids with sub-modules, and the core module would have to know what to do with a guestbook id in any case.
There have been discussions about turning guestbooks into nodes in another issue. However, using nodes has some other caveats, too (outlined in the other issue).
Next to ids, there are some other things to consider: Who's the owner of a group guestbook, resp. who gets administrative access?
#6
I've started outlining a separate module for this, written from scratch. I haven't looked too deeply into the Guestbook code, but I don't really have the time to muddle through everything I'd need to there. I decided to put the guestbook-comment-form as well as the guestbook comments in (separate) blocks, so that they can either be added to the "content" region below the RoN or placed anywhere if OG Panels is enabled.
If you'd like to contribute or you have an objection, please let me know. Otherwise, feel free to close this issue, and I'll post back in here when I'm finished with the module.
#7
I understand that a complete feature-set including an upgrade path for existing users might be too complex for what you need currently. However, it would be great if you would not create another project for that module, because having two projects providing almost identical features would confuse all Drupal users. Instead, everyone could learn and would benefit most from a proof-of-concept implementation, which can be integrated into Guestbook module in the long run. Please bear in mind that I've taken over the Guestbook project just a short time ago and the module will advance, too - maybe in other areas, but maybe also in a similar fashion.
I hope you did not misunderstood my previous comments: I'm absolutely open to work with you on the concept and whole task, to find a solution that fits best to Guestbook's future, i.e. planned enhancements. Your idea of separate sub-modules was not bad and I could imagine that not everyone who needs user guestbooks likes to have a site guestbook - however, I guess that most people who want user guestbooks would also want OG guestbooks, so we'd still have the id clash problem...
#8
Honestly, I'd much rather work on Guestbook than write a new module, because Guestbook already has a user base, tested code, and integration with Panels etc. that I likely wouldn't have time to get to.
However, what I'm working on has a much more open architecture than Guestbook does right now. If I added only a little more code to the module, a Guestbook could appear on every page (including profiles) now. Although I admittedly haven't really gone through the Guestbook code to see if it could be expanded, I'm hesitant to do so.
So: perhaps a Guestbook 3 is in order? I won't have time to port all the old features, but perhaps you'd be interested?
I'll understand if you say that you'd rather expand the current Guestbook architecture rather than rewrite it from scratch, especially if there are any modules that rely on Guestbook (I'm not aware of any...). But I suspect that I'd end up rewriting much of it anyway in frustration, and it takes significantly longer... :(
That said, I'm not very far into writing this thing, so we can probably still figure something out.
#9
I couldn't wait, so I went ahead and wrote this. It's very simple, and I haven't tested it to see if it works. But if it does work, it will work on all nodes.
All it does is add two blocks to the system (plus a settings page and a permission). One block allows adding messages to the node's guestbook, and the other displays the latest messages. At this time, there is no way to see more messages than are displayed in the block. The module adds one database table.
The idea is that the two blocks will be added to the content area on group pages. (Enter this code in the visibility section of the block configuration):
<?php$type = FALSE;
if (arg(0) == 'node' && is_numeric(arg(1))) {
$type = db_result(db_query("SELECT type FROM {node} WHERE nid = %d", arg(1)));
}
return $type;
?>
Also, at this time the module doesn't work for user profiles. There is a To Do list at the top of the .module file (which doesn't include either making this work on user profiles or adding a page to view all the messages for a group, although those should be added).
Obviously, change the extension from .tar_.gz to .tar.gz before extracting.
#10
Well, I've looked through your code now. It looks like you really couldn't wait. ;)
I thought about this some more. One consideration was - based on the new path layout in 2.x - to have a paradigm shift and allow books to lay around wherever they could exist in reality, too, meaning: /guestbook (site), /user/#/guestbook, /node/#/guestbook, aso. This in turn would require one guestbook core module, and several add-on modules like guestbook_site, guestbook_user, guestbook_node, or guestbook_og, and maybe even guestbook_domain, which would all just implement the necessary integration steps for the corresponding correlation.
The core module would have to provide all "guestbook" features in a modular way, meaning: forms, processing, modular access permissions, and integration with other modules, like CAPTCHA. All add-on modules would re-use and leverage that core module. If guestbook core might use nodes for guestbooks or comments for guestbook entries, all add-on modules would benefit from such improvements immediately.
All of this sounds sane, however, the key question still remains: if we kick the uid relation and want to replace it with a gid (guestbook id) relation, each add-on module has to provide its own mapping table including configuration for any additional guestbook features.
So, one potential way could be: (guestbook_user example)
- Column 'uid' from {guestbook} is moved into {guestbook_user}, including user configuration like intro text.
- Column 'gid' is added to both {guestbook_user} and {guestbook}, maintaining the relation between both tables.
- Column 'module' is added to {guestbook}, containing "guestbook_user" for all guestbooks by guestbook_user module.
#11
I worked on my code again today and it's much more polished now. And everything actually works, for any node. Here's my to-do list:
* Add configurable input filtering to messages* Get settings page to show up in administration (and get it to work!)
* Add an edit function and permission to "edit all messages" and "edit own messages"
* Add a "delete own message" ability
* Add Activity integration
* Add a page that shows excess messages
* Add a validation function for the message submission form so the message doesn't get truncated if it gets too long
* For OG: settings per-group, via hook_form_alter(): display guestbook on this group, allow all to post in guestbook, allow only members to post in guestbook
I decided I'm not going to make this work with user profiles. So, that means there's no reason this can't be its own module. I tend to agree with you that Guestbook does as much as it needs to do, and there's not any great reason to expand the codebase for so many users that don't need it. And I still feel like entirely refactoring the Guestbook codebase is more work than writing another module. While I feel like for Drupal in general it's usually better to have API-based modules - you've said yourself Guestbook is pretty much parallel to comments on nodes, and so in most cases there's no reason to use a Guestbook API for anything other than users. And it does its job with users. The module I've written is for the special case where comments are disabled on node types; and it does its job there, too, albeit less fancily.
So unless you can think of another use case for a Guestbook API, I think it would just be duplicating node/comment code for little reason. (For admin-only use, there are already other modules that let you "take notes" on the site, or one could use unpublished comments.)
#12
Oh - and the module, of course. ;)
...if you agree with my argument in my last comment and you're interested in helping out with this module, you're more than welcome. If you don't want to/have time to help, I understand. If you disagree, then I apologize for taking your time, and please know that I would love to help if I had the time available.
#13
Hm. 7 of 8 points of your todo list in #11 are or will be duplicated features of Guestbook (or the envisioned Guestbook core/API module). Also, I intentionally listed guestbook_node and guestbook_og as separate modules, because I think that integration with OG needs to account for different or at least additional conditions than a plain node integration. FWIW, there are other use-cases for having a guestbook core - for example, guestbook_site could provide a guestbook for each Drupal site on a multi-site setup, and/or could be enhanced with a guestbook_domain module that integrates with Domain Access to provide a guestbook for each domain.
All in all, it seems to me that you got stuck with that node_guestbook module and you rather want to scratch your own itch than expanding on the features of the existing project. To be honest, I do not have time nor will to convince you any further, but I want to say thank you for inspiring me to #306450: Split module into core and integration modules. All I ask you is to not create a project for node_guestbook on d.o, because this will definitely lead to confusion among end-users in the end.
#14
Fair enough - I mean, Guestbook is still a vastly superior module. I just didn't have the time either to wait for this to develop or to develop it myself... but I will still look forward to what's coming and I will make an effort to contribute if I can. :)
Sorry for the... erm... distraction.
#15
I would like to know a little more about the conceptual requirement for this and use case. I don't get why this would be needed and if needed wouldn't it create more complications for users?
1. Groups have different levels of permissions open, moderated, invite and closed. What happens when guestbook is made available for each types?
2. Can only group members write to guestbook? or anyone member of a site (but not necessarily member of group) is expected to write in the users guestbook?
There are already existing features which can implement guestbook style functionality and comes free with all bells and whistles of groups (notifications, RSS etc).
e.g A story can be created in group, made it for group only and named guestbook so only members can publish there.
Or that story can be made public so any site member (even if they are not member of group) can write entries on that page. I use this configuration successfully in production now. OG allows only this page designated as guestbook can be made public and everything else can be kept private to groups members if you wish.
There are all kinds of combinations possibles using existing features of OG to implement guestbook. A group can have multiple guestbooks (each with different permission setting if required) or even multiple groups can share one common page as guestbook etc.
With OG panel page, you can have the guestbook in its own tab or differnt panel etc. And because it is real node-comment set you can use views.
SO I am little curious what you are trying to achieve that is currently not possible in existing OG feature set (other than it is not called guestbook)?
#16
Sorry changed title by mistake. Moving it back as it was.
#17
@ajayg: From my understanding, the difference would be that users of a community would not need to "hi-jack" any given functionality. After creating a group the group admin(s) would be able to decide whether they want to add a guestbook, and who will have read/write access to it. Of course, you can always "think your way around systems" (like I did) and that might work out for technology-oriented communities, but it certainly won't for sites that are used by regular end-users who "don't know and break the system".
#18
@sun,
actually that is currently possible at group manager's level now without hi-jacking functionality or complicated configuration. The site admin sets OG configuration to let author decide how to give access to page at the time of creation. The group manager A creates a page in the group , calls it guestbook and make it public. That's it. Another group manager B, can create a page guestbook but does not make it public so it is available within the group only. Third group manager C, creates two guest books pages one public, one for group members only.
So I am not understanding what is so complicated about it? It is like any other page they create now and just need to call that page "guestbook."
#19
People just expect Guestbooks to be there if they want them, end of story, without having to think about what's involved in adding a (private) story, enabling comments on it, and putting the comments and comment-submission-form in panels on the group page. I mean, adding a panel is complicated enough in the first place, and a lot of people don't enable OG Panels. If you took a standard Facebook user, for instance--that user would create the group "OMG I LOST MY PHONE I NEED NUMBERS NOW" and you'd end up with a thousand forum topics with a single ten-digit (U.S.) number in each one, unless you had a Guestbook enabled without previous configuration.
#20
hmmm ! May be I don't understand the customer you are referring. On my site I have a type "page" , group enabled and comment enabled by default. I don't have forums. And not exactly the phone number, but I do see private groups created "potluk at my place this Sunday' with just one page "who is bringing what" and everyone writes as comments to that page. I have comment textbox on the same page setting so it is obvious people need to reply there rather than creating a new page.
Atleast my audience never felt a need to call something "guestbook". They call it whatever they want and seems happy as they are getting the entries they want in the comments. Actually each group comes up with creative names or borrow from populer websites like wall, scrapbook, guestbook whatver.
Anyway I stop here, since we are getting into subjective needs based on audience understanding and obviously I am unable to understand audience you have in mind. Just chimed in to suggest perhaps what you need can be accomplished with existing feature set.
#21
subscribing
#22
sort of following this...what about "Guestbook as Content Type" - in this scenario, a user may create one or more Guest Books (similar to how people may create only *one* content profile with that module, but requests are in queue for 'multiples') - in the case of a 2nd or 3rd guestbook, they are constrained and may only be created if the individual is Group Manager/Creator of a Group and if so, only 1 for each group which is just the Group ID/guestbook (something to that effect)
if done this way, then like 'content profile,' a user logs in and is redirected as usual to 'user profile' and sees button to 'add a guestbook for your own account that only you can see' (or something to that effect) unless or until he/she creates one...
does this mimic the structure of content profile in any similar ways? anything to borrow from that effort?
#23
Did this get implemented??
#24
subscribe
#25
Thanks for taking the time to report this issue.
However, marking as duplicate of #72607: Use entities for guestbooks and guestbook entries. You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.