News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

[2.0] Membergroup Prefix/Suffix'

Started by Liam., October 05, 2009, 12:22:46 PM

Previous topic - Next topic

Liam.

Hello everyone.

With my main website coming up, again, I will be wanting certain membergroups to have a prefix infront of their name. For example, if I have the name "Killer" - it and I am in the GM Membergroup, I will become called "iKiller". If I am a Premium Member and called "Bob", I might happen to be called "vipBob". This won't actually become the users user/display name, but just while they are in that membergroup.

Arantor

Holder of controversial views, all of which my own.


Liam.

Everywhere that the Display name is shown.

Marcus Forsberg

Could be interesting.
* Nas eyes Arantor.

Liam.

* iKorp eyes Nas eying Arantor.
* iKorp shouts "Pervert"!

I know it'd be hard to include it everywhere, but it'd be a really good mod, and well worth it IMHO.

Arantor

The problem with doing that is that there are a LOT of places that gets called, as I discovered doing my "Slash through banned usernames" mod (which is still unfinished)

It isn't, unfortunately, just a case of doing it in a few places. Every place that the name is called in a query would have to be modified, in many cases adding the membergroups table which isn't present in those queries.

So it'd slow your forum down, too.
Holder of controversial views, all of which my own.


Liam.

It wouldn't slow it down too much, would it? Couldn't you do it globally to add it before any reference of the Display Name? Also, since you're doing your slash through banned usernames, why not make a note of all places where it's called, and go through them on both mods?

Arantor

Quote from: iKorp on October 05, 2009, 01:39:13 PM
It wouldn't slow it down too much, would it?

If you have to load another table in queries that currently don't use said table, yes.

QuoteCouldn't you do it globally to add it before any reference of the Display Name?

No, because there isn't a single global loading of all display names. The only name ever loaded centrally that you can RELY on to be centrally done is the current user's. Almost every other instance is pulled as and when it is necessary.

QuoteAlso, since you're doing your slash through banned usernames, why not make a note of all places where it's called, and go through them on both mods?

* Arantor just adds a list of multiple places in every file in Sources.

It's even more complex, at least in slash through banned usernames I never have to refer to another table or tablejoin, I simply have to extend the list of fields added (sometimes multiple times where membertable is joined back twice to the other tables, in which case you have to join member group table twice as well)

To get an idea of the complexity, take a look at the code in Member Color Link, it's mostly the same code as that.
Holder of controversial views, all of which my own.


Liam.

Okay, if it'd be that complicated - how about hardcoding it in for each membergroup? That wouldn't be usersufficient (for the people who will use the mod), but it'd work...

Arantor

No, it's still membergroup dependent. Would be easier since you wouldn't have to haul in the membergroups table. But more complex to configure and would be specific to your site rather than a generic mod.
Holder of controversial views, all of which my own.


Hell Raiser

He actually took this idea of prefix and suffix from other forum scripts or may not be  :P
Need Help with SMF ? Ask me may be i can help you out




Liam.

Actually Hell Raiser, I did ^_^ It's quite a common, well working mod aswell...

Also, being specific to my site would also be fine, having it as a generic mod would be good for everyone else, but I've only seen one similar request like this on the forums before.

Arantor

I can tell you now, most users that answer mod requests here (and believe me, there aren't that many), they want to write generic mods that everyone can use.

I'm not entirely clear on the benefits of doing this, especially given the performance hit that entails (though it's not so bad in RC2)
Holder of controversial views, all of which my own.


Advertisement: