[TH] Social Groups [Deleted]

Thanks in the first place,
but this does not actually solve my problem. When I play around with the permissions I can take the ability to view social group and allow only members to see them. Sounds great, but that means that all the groups are completly hidden for the normal user (not a member of any group), that means he does not know that they exist in the first place... :S.
What I would suggest - and I hope you like that Idea - is that there is a permission to only allow members to view threads within a group, but show the group and group overview page to everyone. So there would be a text like "you must be a member to view the content". The easiest way for a creator would be a setting (while creating a group) to set it to "private". I made a very bad preview via MS Paint (don't wonder, it's part German)

As a "guest"/not a member: (the description is also added via paint to make things clear)
View attachment 38640

As a member:
View attachment 38639


What do you think?
I (and I guess a lot of other users too) would love you even more for that feature :D

Greetings from Germany,
Mathis
I'm pretty sure that everything you want to do is already possible. Why don't you take the permission to view threads instead of taking the permission to view social group?

Noticed a regular error in my Server Log ...

Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Unknown column 'social_forum.user_id' in 'on clause' - library/Zend/Db/Statement/Mysqli.php:77

occurring from /find-new/threads. Definitely have user_id in xf_social_forum
Thanks. I'll check it out.
 
Thanks, now I got it :)

Found an error while opening recent activities.

PHP:
Argument 1 passed to Waindigo_SocialGroups_Model_SocialForum::getNodePermissions() must be an array, boolean given, called in library/Waindigo/SocialGroups/Model/Post.php on line 77 and defined
 
XenForo_Application::handlePhpError() in Waindigo/SocialGroups/Model/SocialForum.php at line 510
Waindigo_SocialGroups_Model_SocialForum->getNodePermissions() in Waindigo/SocialGroups/Model/Post.php at line 77
Waindigo_SocialGroups_Model_Post->canViewPostAndContainer() in XenForo/NewsFeedHandler/DiscussionMessage/Post.php at line 80
XenForo_NewsFeedHandler_DiscussionMessage_Post->canViewNewsFeedItem() in XenForo/Model/NewsFeed.php at line 368
XenForo_Model_NewsFeed->_getViewableNewsFeedItems() in XenForo/Model/NewsFeed.php at line 131
XenForo_Model_NewsFeed->fillOutNewsFeedItems() in XenForo/Model/NewsFeed.php at line 106
XenForo_Model_NewsFeed->getNewsFeed() in XenForo/ControllerPublic/RecentActivity.php at line 16
XenForo_ControllerPublic_RecentActivity->actionIndex() in XenForo/FrontController.php at line 310
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in index.php at line 13

Is there a quick fix?
 
Is there a quick fix?
In library\Waindigo\SocialGroups\SocialForum.php, try replacing line 88:
PHP:
$object->_socialForum = XenForo_Model::create('Waindigo_SocialGroups_Model_SocialForum')->getSocialForumById($socialForum, $fetchOptions);
with:
PHP:
$socialForumModel = XenForo_Model::create('Waindigo_SocialGroups_Model_SocialForum');
if ($socialForum = $socialForumModel->getSocialForumById($socialForum, $fetchOptions)) {
    $object->_socialForum = $socialForum;
}
 
Wow, that was quick, but not a fix :P
New Error:
Code:
Undefined index: node_id
 
XenForo_Application::handlePhpError() in Waindigo/SocialGroups/Model/SocialForum.php at line 522
Waindigo_SocialGroups_Model_SocialForum->getNodePermissions() in Waindigo/SocialGroups/Model/Post.php at line 77
Waindigo_SocialGroups_Model_Post->canViewPostAndContainer() in XenForo/NewsFeedHandler/DiscussionMessage/Post.php at line 80
XenForo_NewsFeedHandler_DiscussionMessage_Post->canViewNewsFeedItem() in XenForo/Model/NewsFeed.php at line 368
XenForo_Model_NewsFeed->_getViewableNewsFeedItems() in XenForo/Model/NewsFeed.php at line 131
XenForo_Model_NewsFeed->fillOutNewsFeedItems() in XenForo/Model/NewsFeed.php at line 106
XenForo_Model_NewsFeed->getNewsFeed() in XenForo/ControllerPublic/RecentActivity.php at line 16
XenForo_ControllerPublic_RecentActivity->actionIndex() in XenForo/FrontController.php at line 310
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in index.php at line 13
 
Wow, that was quick, but not a fix :p
What exactly is it that you are doing to get this error? Seems from the errors that you are loading a thread from a social forum that no longer exists. Does that sound about right?

To fix this error, replace line 77+78 in library/Waindigo/SocialGroups/Model/Post.php
PHP:
$nodePermissions = $socialForumModel->getNodePermissions($socialForum->toArray(), $socialForum->getSocialForumMembers());
XenForo_Visitor::getInstance()->setNodePermissions($forum['node_id'], $nodePermissions);
with:
PHP:
if (isset($socialForum['social_forum_id'])) {
    $nodePermissions = $socialForumModel->getNodePermissions($socialForum->toArray(), $socialForum->getSocialForumMembers());
    XenForo_Visitor::getInstance()->setNodePermissions($forum['node_id'], $nodePermissions);
}

Really need to solve the bigger issue of why you have threads linked to deleted social forums though. This should not happen.
 
Could be. I deleted a bunch of test groups and their threads.
By the way, if you want to delete a group an automatic deletion of threads would be nice, not necessary but nice ;)
 
still...
Code:
Undefined index: node_id
 
XenForo_Application::handlePhpError() in Waindigo/SocialGroups/Model/SocialForum.php at line 522
Waindigo_SocialGroups_Model_SocialForum->getNodePermissions() in Waindigo/SocialGroups/Model/Post.php at line 77
Waindigo_SocialGroups_Model_Post->canViewPostAndContainer() in XenForo/NewsFeedHandler/DiscussionMessage/Post.php at line 80
XenForo_NewsFeedHandler_DiscussionMessage_Post->canViewNewsFeedItem() in XenForo/Model/NewsFeed.php at line 368
XenForo_Model_NewsFeed->_getViewableNewsFeedItems() in XenForo/Model/NewsFeed.php at line 131
XenForo_Model_NewsFeed->fillOutNewsFeedItems() in XenForo/Model/NewsFeed.php at line 106
XenForo_Model_NewsFeed->getNewsFeed() in XenForo/ControllerPublic/RecentActivity.php at line 16
XenForo_ControllerPublic_RecentActivity->actionIndex() in XenForo/FrontController.php at line 310
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in /index.php at line 13
 
Recent activity:
Code:
Undefined index: node_id
 
XenForo_Application::handlePhpError() in Waindigo/SocialGroups/Model/SocialForum.php at line 522
Waindigo_SocialGroups_Model_SocialForum->getNodePermissions() in Waindigo/SocialGroups/Model/Post.php at line 77
Waindigo_SocialGroups_Model_Post->canViewPostAndContainer() in XenForo/NewsFeedHandler/DiscussionMessage/Post.php at line 80
XenForo_NewsFeedHandler_DiscussionMessage_Post->canViewNewsFeedItem() in XenForo/Model/NewsFeed.php at line 368
XenForo_Model_NewsFeed->_getViewableNewsFeedItems() in XenForo/Model/NewsFeed.php at line 131
XenForo_Model_NewsFeed->fillOutNewsFeedItems() in XenForo/Model/NewsFeed.php at line 106
XenForo_Model_NewsFeed->getNewsFeed() in XenForo/ControllerPublic/RecentActivity.php at line 16
XenForo_ControllerPublic_RecentActivity->actionIndex() in XenForo/FrontController.php at line 310
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in /var /index.php at line 13

New group:

Code:
Undefined index: node_id
 
XenForo_Application::handlePhpError() in Waindigo/SocialGroups/SocialForum.php at line 161
Waindigo_SocialGroups_SocialForum->offsetGet() in Waindigo/SocialGroups/ControllerPublic/SocialForum.php at line 21
Waindigo_SocialGroups_ControllerPublic_SocialForum->_preDispatch() in XenForo/Controller.php at line 303
XenForo_Controller->preDispatch() in XenForo/FrontController.php at line 309
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in /index.php at line 13
 
This doesn't make a lot of sense. There is something weird going on somewhere but it is not clear from the errors you are sending.

For this error, replace lines 17-23 of library/Waindigo/SocialGroups/ControllerPublic/SocialForum.php
PHP:
if ($socialForumId = $this->_input->filterSingle('social_forum_id', XenForo_Input::UINT))
{
    if ($socialForum = Waindigo_SocialGroups_SocialForum::setup($socialForumId))
    {
        $this->_request->setParam('node_id', $socialForum['node_id']);
    }
}

with
PHP:
if ($socialForumId = $this->_input->filterSingle('social_forum_id', XenForo_Input::UINT))
{
    if ($socialForum = Waindigo_SocialGroups_SocialForum::setup($socialForumId))
    {
        if (isset($socialForum['node_id']))
        {
          $this->_request->setParam('node_id', $socialForum['node_id']);
        }
    }
}
 
Well.... The erros are gone, but when I try to open a group it redirects to the forum index.
That's all I can say. I used Nodes as Tabs, open the groups tab, see the groups, click one and I go to the forums overview (not only social forum, main index, I do not display social forums on the index)
 
I think I need to rewind that. Could it be that one of your edited solutions where inside library/Waindingo/SocialGroups/SocialForum.php then you edited the path?
I reuploaded the SocialForum.php and now it seems to work. :)

Thanks
 
Back
Top Bottom