News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Excluding one member group from...

Started by Uhura!, November 22, 2012, 10:26:58 AM

Previous topic - Next topic

Uhura!

I did not understand this
QuoteReplace 1 in the $exculde_from_top array with the group id(s) you have, separated by comma.

Can you clarify?

Thanks!
:) Our Parenting Spot is an online parenting community for fathers, mothers, grandparents, teachers, and family service professionals. 8) We also provide low cost advertising options for authors, family service providers, and businesses with family friendly products and services. ;D Visit us @ www.OurParentingSpot.net!

Joker™

[code$exculde_from_top = array('staff1 group id', 'staff2 group id');

'1' represents admin group :P.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Uhura!

Crazy question. Where can I see a group's ID?
:) Our Parenting Spot is an online parenting community for fathers, mothers, grandparents, teachers, and family service professionals. 8) We also provide low cost advertising options for authors, family service providers, and businesses with family friendly products and services. ;D Visit us @ www.OurParentingSpot.net!

Joker™

Quote from: Uhura! on December 01, 2012, 04:14:27 PM
Crazy question. Where can I see a group's ID?
Administration Center » Membergroups » Edit Membergroups

Click on each member group who's id is required. See the url and number after 'group=' in the url represents the group id.

Easy way use this
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Uhura!

Quote from: Joker™ on December 01, 2012, 04:18:44 PM
Quote from: Uhura! on December 01, 2012, 04:14:27 PM
Crazy question. Where can I see a group's ID?
Administration Center » Membergroups » Edit Membergroups

Click on each member group who's id is required. See the url and number after 'group=' in the url represents the group id.

Easy way use this

Hi,

The part in red is where I get lost.
:) Our Parenting Spot is an online parenting community for fathers, mothers, grandparents, teachers, and family service professionals. 8) We also provide low cost advertising options for authors, family service providers, and businesses with family friendly products and services. ;D Visit us @ www.OurParentingSpot.net!

Joker™

Please read the description of the mod. It'll help you to understand what I'm trying to say.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Hj Ahmad Rasyid Hj Ismail


Uhura!

Quote from: Joker™ on December 01, 2012, 11:37:51 PM
Please read the description of the mod. It'll help you to understand what I'm trying to say.

I see the problem now... :)

I have no "ID" Column... See the attachment. But... I saw the group # in the link when I hit "modify"... Group 2!

So - I will try this now
:) Our Parenting Spot is an online parenting community for fathers, mothers, grandparents, teachers, and family service professionals. 8) We also provide low cost advertising options for authors, family service providers, and businesses with family friendly products and services. ;D Visit us @ www.OurParentingSpot.net!

Uhura!

Do I need to correct exculde to be exclude?
:) Our Parenting Spot is an online parenting community for fathers, mothers, grandparents, teachers, and family service professionals. 8) We also provide low cost advertising options for authors, family service providers, and businesses with family friendly products and services. ;D Visit us @ www.OurParentingSpot.net!

Uhura!

Error:
An Error Has Occurred!
Unknown column 'm.id_group' in 'where clause'
File: /home/ourmo0/public_html/community/Sources/PortalBlocks.php
Line: 494
:) Our Parenting Spot is an online parenting community for fathers, mothers, grandparents, teachers, and family service professionals. 8) We also provide low cost advertising options for authors, family service providers, and businesses with family friendly products and services. ;D Visit us @ www.OurParentingSpot.net!

Joker™

Quote from: Uhura! on December 02, 2012, 11:00:29 AM
I see the problem now... :)

I have no "ID" Column... See the attachment. But... I saw the group # in the link when I hit "modify"... Group 2!

So - I will try this now
It's not a default SMF feature. For that only I've created the above mentioned mod.


Quote from: Uhura! on December 02, 2012, 12:58:56 PM
Error:
An Error Has Occurred!
Unknown column 'm.id_group' in 'where clause'
File: /home/ourmo0/public_html/community/Sources/PortalBlocks.php
Line: 494
Grrr, this is what happens while working on multiple things :P


Make edits to following file(Make backup of file before editing)

Sources/PortalBocks.php

Code (Find this function:) Select
sp_topPoster

Now in this function only make the following edits

Code (Find:) Select
$type = !empty($parameters['type']) ? (int) $parameters['type'] : 0;

Code (Add after:) Select
$exculde_from_top = array('1');


Code (Find:) Select
$request = $smcFunc['db_query']('', '
SELECT
mem.id_member, mem.real_name, COUNT(*) as posts,
mem.avatar, a.id_attach, a.attachment_type, a.filename
FROM {db_prefix}messages AS m
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
WHERE m.poster_time > {int:start_time}
AND m.id_member != 0
GROUP BY mem.id_member
ORDER BY posts DESC
LIMIT {int:limit}',
array(
'start_time' => $start_time,
'limit' => $limit,
)
);


Code (Replace it with:) Select
$request = $smcFunc['db_query']('', '
SELECT
mem.id_member, mem.real_name, COUNT(*) as posts,
mem.avatar, a.id_attach, a.attachment_type, a.filename
FROM {db_prefix}messages AS m
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
WHERE m.poster_time > {int:start_time}
AND m.id_member != 0
                AND mem.id_group NOT IN ({array_int:exculde_from_top})
GROUP BY mem.id_member
ORDER BY posts DESC
LIMIT {int:limit}',
array(
'start_time' => $start_time,
'limit' => $limit,
                'exculde_from_top' => $exculde_from_top,
)
);



Code (Find:) Select
$request = $smcFunc['db_query']('','
SELECT
m.id_member, m.real_name, m.posts, m.avatar,
a.id_attach, a.attachment_type, a.filename
FROM {db_prefix}members AS m
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = m.id_member)
ORDER BY posts DESC
LIMIT {int:limit}',
array(
'limit' => $limit,
)
);


Code (Replace it with:) Select
$request = $smcFunc['db_query']('','
SELECT
m.id_member, m.real_name, m.posts, m.avatar,
a.id_attach, a.attachment_type, a.filename
FROM {db_prefix}members AS m
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = m.id_member)
                WHERE m.id_group NOT IN ({array_int:exculde_from_top})
ORDER BY posts DESC
LIMIT {int:limit}',
array(
'limit' => $limit,
                'exculde_from_top' => $exculde_from_top,
)
);


Replace 1 in the $exculde_from_top array with the group id(s) you have, separated by comma.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Uhura!

Thanks!

Do I need to correct exculde to be exclude?
:) Our Parenting Spot is an online parenting community for fathers, mothers, grandparents, teachers, and family service professionals. 8) We also provide low cost advertising options for authors, family service providers, and businesses with family friendly products and services. ;D Visit us @ www.OurParentingSpot.net!

Colin

Unless you want to fix every instance of it. :P
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Kindred

You should also note:   Support for and assistance with specific mods should be requested in the support thread for that individual mod.   Since this is a request for help with SimplePortal, it SHOULD have been posted in the SimplePortal support thread (or on the simpleportal support site), not in the main SMF support area.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: