vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v3.0 Support > "How Do I..." Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 10-19-2007, 05:03 PM
Sal Collaziano Sal Collaziano is offline
Member
 
Join Date: Mar 2004
Posts: 42
Default Possible to display only posts by specific user group?

Is it possible to display the posts (on the front page of my vBAdvanced enhanced site) from ONLY specific usergroups or users?

Thanks in advance...
Reply With Quote
  #2  
Old 10-20-2007, 08:20 AM
Sal Collaziano Sal Collaziano is offline
Member
 
Join Date: Mar 2004
Posts: 42
Default Re: Possible to display only posts by specific user group?

Maybe somebody knows of a mod/hack that can do it? Basically, I want to have posts from all my forums make it to the front page - however, I only want posts from a specific user or usergroup...
Reply With Quote
  #3  
Old 10-20-2007, 10:49 AM
bobster65 bobster65 is offline
Senior Member
 
Join Date: Mar 2006
Posts: 587
Default Re: Possible to display only posts by specific user group?

Quote:
Originally Posted by Sal Collaziano View Post
Is it possible to display the posts (on the front page of my vBAdvanced enhanced site) from ONLY specific usergroups or users?

Thanks in advance...
You could modify the recentthreads.php file to do this. You would just need to modify the where clause in the main query. There are a bunch of people here that could do it for ya.
Reply With Quote
  #4  
Old 10-22-2007, 10:45 AM
Sal Collaziano Sal Collaziano is offline
Member
 
Join Date: Mar 2004
Posts: 42
Default Re: Possible to display only posts by specific user group?

Thank you.. If it's something that can be done by editing a file, I can do that - but I'd need to know how. If it's a database query, I can do that too - but I'd need to know the query...
Reply With Quote
  #5  
Old 10-22-2007, 11:30 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Possible to display only posts by specific user group?

You could add a new plugin to the 'vba_cmps_module_recthreads_start' location with the following code:

Code:
$vba_threads_condition .= ' AND user.usergroupid IN(X, Y, Z)';
$rthread_join .= ' LEFT JOIN ' . TABLE_PREFIX . 'user AS user ON (thread.postuserid = user.userid)';
Replace X, Y, Z with the usergroupid(s). Note that will only work if the member has the selected group as their primary usergroup.
Reply With Quote
  #6  
Old 10-23-2007, 09:45 AM
Sal Collaziano Sal Collaziano is offline
Member
 
Join Date: Mar 2004
Posts: 42
Question Re: Possible to display only posts by specific user group?

Hi Brian,

Thank you. I tried the following:

Code:
$vba_threads_condition .= ' AND user.usergroupid IN(11)';
$rthread_join .= ' LEFT JOIN ' . TABLE_PREFIX . 'user AS user ON (thread.postuserid = user.userid)';
I'd like for usergroup 11 to be the only group where topics appear on the front page.. Unfortunately, other usergroups' topics are still making it... Any ideas?

Thanks again...
Reply With Quote
  #7  
Old 10-23-2007, 12:56 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Possible to display only posts by specific user group?

Did you make sure to add the new plugin to the 'vba_cmps_module_recthreads_start' hook location, and make sure to mark it as 'Active'?
Reply With Quote
  #8  
Old 10-23-2007, 05:08 PM
Sal Collaziano Sal Collaziano is offline
Member
 
Join Date: Mar 2004
Posts: 42
Default Re: Possible to display only posts by specific user group?

Quote:
Originally Posted by Brian View Post
Did you make sure to add the new plugin to the 'vba_cmps_module_recthreads_start' hook location, and make sure to mark it as 'Active'?
If all this is done on the same 'edit' page, than yes.. Is there somewhere else I needed to touch on this?

Thank you...
Reply With Quote
  #9  
Old 10-24-2007, 01:05 PM
Sal Collaziano Sal Collaziano is offline
Member
 
Join Date: Mar 2004
Posts: 42
Default Re: Possible to display only posts by specific user group?

Don't give up on me now! Anyone else have any ideas? I guess this is a unique request.. I figured maybe more people would have wanted this functionality in the past. The thing is, I want to be able to have topics from all my forums on my vBa front page - but I don't want just anybody getting there...

Thanks in advance...
Reply With Quote
  #10  
Old 10-24-2007, 02:01 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Possible to display only posts by specific user group?

Try going back to your Plugin Manager in the Admin CP, find the plugin you just added, make sure that the checkbox next to it is checked, and then click the 'Save Active Status' button at the bottom.
Reply With Quote
  #11  
Old 10-24-2007, 05:31 PM
Sal Collaziano Sal Collaziano is offline
Member
 
Join Date: Mar 2004
Posts: 42
Default Re: Possible to display only posts by specific user group?

No luck.. Are you sure this would work? If so, maybe I've just got something set incorrectly.. Could I pay you for your time for personal support?
Reply With Quote
  #12  
Old 10-25-2007, 11:44 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Possible to display only posts by specific user group?

Yes, that code will work... It is the Recent Threads module that you're trying to apply this to, right?
Reply With Quote
  #13  
Old 10-25-2007, 04:02 PM
Sal Collaziano Sal Collaziano is offline
Member
 
Join Date: Mar 2004
Posts: 42
Default Re: Possible to display only posts by specific user group?

Oh, maybe that's it! My fault! Sorry! It's the "news" module!

So how would the code look for that?
Reply With Quote
  #14  
Old 10-26-2007, 07:16 AM
Sal Collaziano Sal Collaziano is offline
Member
 
Join Date: Mar 2004
Posts: 42
Default Re: Possible to display only posts by specific user group?

What I tried this morning was just change the module this was applied to, to "vba_cmps_module_news_start" but I was still able to post a topic with an account outside usergroup id11..

Would the code be any different to allow only one usergroup to get those front page 'news' posts?

The Execution Order is "5". Could that mean anything?

Last edited by Sal Collaziano; 10-26-2007 at 07:19 AM.
Reply With Quote
  #15  
Old 10-26-2007, 12:55 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Possible to display only posts by specific user group?

Quote:
Originally Posted by Sal Collaziano View Post
Oh, maybe that's it! My fault! Sorry! It's the "news" module!

So how would the code look for that?
That would be the problem then. I saw "recent threads" somewhere in this thread, so assumed that's the module you were trying to do this with. For the news module, you would need to look in the modules/news.php file for this code:
PHP Code:
WHERE thread.threadid IN(" . implode(',', $newstids) . "
And repalce with this:
PHP Code:
WHERE thread.threadid IN(" . implode(',', $newstids) . ")
  AND 
user.usergroupid IN(11
Reply With Quote
  #16  
Old 10-26-2007, 01:20 PM
Sal Collaziano Sal Collaziano is offline
Member
 
Join Date: Mar 2004
Posts: 42
Default Re: Possible to display only posts by specific user group?

Okay. I think I'm getting closer now.. The only issue is - the new code took out the news and recent post columns altogether.. I have the usergroup set correctly.. There's one primary member of usergroup #11..

I removed the plugin to see if that would clear things up to no avail.. I'm sorry about all these questions and bumps in the road - but I know this can work...

Any ideas?

Thanks again...
Reply With Quote
  #17  
Old 10-26-2007, 01:24 PM
Sal Collaziano Sal Collaziano is offline
Member
 
Join Date: Mar 2004
Posts: 42
Default Re: Possible to display only posts by specific user group?

Okay, wait.. I think the user just needs to post new topics... On the other hand, I'm not sure what's wrong with the 'recent posts' area...
Reply With Quote
  #18  
Old 10-26-2007, 01:35 PM
Sal Collaziano Sal Collaziano is offline
Member
 
Join Date: Mar 2004
Posts: 42
Default Re: Possible to display only posts by specific user group?

Okay. It just took a little tweaking.. Everything's working perfectly.. Thank you for your help, Brian!
Reply With Quote
  #19  
Old 09-06-2012, 11:10 AM
wotws wotws is offline
Junior Member
 
Join Date: Sep 2011
Posts: 6
Default

how can we do it for a user?
Reply With Quote
  #20  
Old 09-18-2012, 05:03 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default

Change this:
PHP Code:
AND user.usergroupid IN(11
To this:
PHP Code:
AND post.userid IN(XYZ
(change X, Y, Z to the userid(s) you want to include)
__________________
Frequently Asked Questions
CMPS Users Manual

For vBadvanced software assistance, please use the support forums.
Unsolicted PMs, IMs, and email will not be responded to.
If you have a non-software related question or problem with your account, please submit a support ticket.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
When I use a promotion for my registered user to move to a new custom user group... GamingVidz.com "How Do I..." Questions 3 12-28-2006 09:32 PM
"getnew" user specific NEW POSTS Module MortysTW "How Do I..." Questions 5 06-27-2006 07:26 PM
New user group bug michaelsilvia Troubleshooting & Problems 1 09-05-2005 06:09 PM
Custom Field visible/edit to specific group only libertate "How Do I..." Questions 1 07-04-2005 11:16 AM
Make a category for a specific group attroll "How Do I..." Questions 2 10-17-2004 11:19 PM


All times are GMT -4. The time now is 04:50 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.