|
|
| Post notifications by default and auto insert post on new user (United States) |
|
|
There are a couple of enhancements needed here when the wall is working in a profile mode
- make the wall owner (profile owner) be subscribed to the post notifications by default (right now he needs to go to his public profile and check the box - not intuitive). I understand that this may be hard…as the "wall" is not aware that a particular user exists. Maybe an auto-trigger the first time someone views a particular user profile. The other option is trigger at registration?
- have a setting to disable people to subscribe to post notifications on other peoples wall…..spaying is not cool:)
Thanks.
Ivan |
|
|
|
 |  |
|
|
| Re: Post notifications by default (Australia) |
|
|
| Ivan wrote
There are a couple of enhancements needed here when the wall is working in a profile mode
- make the wall owner (profile owner) be subscribed to the post notifications by default (right now he needs to go to his public profile and check the box - not intuitive). I understand that this may be hard…as the "wall" is not aware that a particular user exists. Maybe an auto-trigger the first time someone views a particular user profile. The other option is trigger at registration?
- have a setting to disable people to subscribe to post notifications on other peoples wall…..spaying is not cool:)
|
1) You would be amazed at how long I spent on this trying to find a good, clean solution. Basically it would be great if it could check what type of Wall it is do a query for that type (ie. UserProfile Wall is easy - Group would check GroupOwner etc). The problem is that due to various reasons I stroed the ModuleID in the first version of the Wall - even though they are on the same page there is no direct link to the module it is one the page with - ideally you need to attach a Wall module to a particular module on that page so you would be able to look up the Wall module which belongs to Group/Event/User and update the notification record for a user. I also looked at it from the other module's point of view - I know when a Group or Event is created, so I wanted to insert a record into the Wall module then for the Owner, but the same problem exists - it is too losely coupled. For the UserProfile module it may be a little easier as it is treated slightly differently below the scenes - all UserProfile walls (ie. UP type) could be updated for the related ID (ie. your wall) but I don't have access to the CreateUser event in the core, so a trigger may be an option. The other option is possible to check it On Load. If a record has not been created yet for the Owner than insert one, but I was worried about performance and scaleability. This may be the simplest solution yet and I will have a think about this again.
2) My reasoning for this was that you can use the Members/Owner/All setting to control who can see the Wall. My logic was therefore - IF they can see the Wall, they might as well be able to subscribe to Notifications? They can just as easily bookmark the page and check everyday with the same end result? Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players
 |
|
|
|
 |  |
|
| |
 |  |
|
|
| Re: Post notifications by default (Bulgaria) |
|
|
1) I can see how it is hard to create the default notification. We decided to use a db trigger on new user registration.
2) We will be implementing a profile privacy functionality using a css tabs module. On the public profile page all modules (working of userid in the string) will sit in tabs and each user can configer privacy options for these tabs (see by all, registered users or friends only). Allowing users to subscribe to notifications will by pass this....no biggie though...we can touch the code.
|
|
|
|
 |  |
|
|
| Re: Post notifications by default (Australia) |
|
|
1) Can you share it with the class if possible Ivan? I may use this in PokerDIY in the meantime and you'll save me 30 minutes ;)
2) I could wrap this in a setting - we can discuss it when I get round to the next version of the Wall module. Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players
 |
|
|
|
 |  |
|
|
| Re: Post notifications by default (Bulgaria) |
|
|
see below. our portal is 0
IF OBJECT_ID('trig_AddREIMUser','TR') IS NOT NULL
DROP TRIGGER trig_AddREIMUser
GO
CREATE TRIGGER trig_AddREIMUser
ON Users
FOR INSERT
AS
DECLARE @UserID int
SELECT @UserID =(SELECT UserID FROM Inserted)
INSERT INTO SmartThinker_WallSubscription ([PortalID],[ModuleID],[RelatedID],[UserID],[Notify]) VALUES (0,648,@UserId,@UserId,1)
go |
|
|
|
 |  |
|
|
| Re: Post notifications by default (Australia) |
|
|
Thanks for that - note that I have updated the other SQL post to include updates for Group Members and Event Guests... I may write trigger to do the same as this sometime and will share it here. Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players
 |
|
|
|
 |  |
|
|
| Re: Post notifications by default (Australia) |
|
|
I wanted to auto-insert a Wall Post for new users (like a Welcome, bla bla message - see this new user for an example) so I added this trigger (I may make this into a feature at some point):
--Creates a wall post for that user when a new user is inserted
IF OBJECT_ID('trig_AddNewUserWallMessage','TR') IS NOT NULL DROP TRIGGER trig_AddNewUserWallMessage
GO
CREATE TRIGGER trig_AddNewUserWallMessage ON Users
FOR INSERT
AS
DECLARE @UserID int
SELECT @UserID =(SELECT UserID FROM Inserted)
INSERT INTO SmartThinker_WallPost (PortalID,ModuleID,ParentPostID,RelatedID,Subject,PostText,CreatedDate,ChangedDate,CreatedByUserID,ChangedByUserID,WallType)
--Portal 6, ModuleID 1970
VALUES (6,1970,-1,@UserId,'','<p>Hi, I''m an admin and I''m here to help! You can...</p> <ul> <li><a href="http://www.pokerdiy.com/edit-pokerdiy-profile.aspx">Edit your profile</a></li> <li><a href="http://www.pokerdiy.com/find-poker-leagues.aspx">Find a poker league</a> to join</li> <li><a href="http://www.pokerdiy.com/tell-a-friend.aspx">Tell some friends</a> about PokerDIY</li> <li><a href="http://www.pokerdiy.com/faq.aspx">Read the FAQs</a></li> </ul> <p>Still lost? <a href="http://www.pokerdiy.com/poker-forums.aspx">Introduce yourself on the forums</a> or <a href="http://www.pokerdiy.com/poker-player-profile/id/1.aspx">drop me a line on my wall</a>...</p>',GetDate(),GetDate(),1,1,2)
GO
Replace the ModuleID, PortalID and appropriate fields to match your site of course. Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players
 |
|
|
|
 |  |
|
|
| Re: Post notifications by default (United States) |
|
|
As far as the trigger goes to personal wall subscriptions, do you do it for the module on their personal profile page or on their public profile page? If you do it on their personal profile page will it send a message if they post a message one to their own Wall setup with "logged in" user?
Thanks,
Steve |
|
|
|
 |  |
|
|
| Re: Post notifications by default (Australia) |
|
|
[QUOTE]Steve J. wrote
...do you do it for the module on their personal profile page or on their public profile page? If you do it on their personal profile page will it send a message if they post a message one to their own Wall setup with "logged in" user?
/QUOTE]
I do it on the public profile page (the passed-in one). Yes, if you did it on the logged in one it would notify the person who posted on it, which would be the logged in user. Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players
 |
|
|
|
 |  |
|
|
| Re: Post notifications by default (Japan) |
|
|
dumb question, but to use this trigger, where should it be included?
Thanks
Mark |
|
|
|
 |  |
|
|
| Re: Post notifications by default (Denmark) |
|
|
Hi Mark, did you figure this out already?
It's in Host->SQL
I want to emphasize that you should not fiddle with SQL without some knowledge about what you are doing and never do anything without a complete site backup first. You will cry if you don't ;-)
Sry for this late reply but all the pinned topics (like this topic) doesn't show up on the aggregated list, and I mostly only look at the aggregated list. |
|
|
|
 |  |
|
|
| Re: Post notifications by default (Vietnam) |
|
|
Hi guys, thanks for the solution.
When I execute these scripts, I get this error:
System.Data.SqlClient.SqlException: Incorrect syntax near 'GO'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)
Even very simple queries, such as:
GO
GO
give the same error.
This error occurs in both SQL Server 2005 & 2008. Any ideas?
Thanks,
Duc |
|
|
|
 |  |
|
|
| Re: Post notifications by default (Vietnam) |
|
|
I've designed a set of triggers to default post notification in the group wall to true when a user joins a group. The solution is described in this article. Feedback is greatly appreciated!
Thanks,
Duc |
|
|
|