News:

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

Main Menu

Membergroup Profiles

Started by lordtron, July 22, 2008, 12:34:40 PM

Previous topic - Next topic

lordtron

SMF: 1.1.4

Is it possible to change the link to someones forum profile to a non-forum page?

Example:
Lets say I am in a membergroup called SMF.
So if anyone tries to goto my profile they will be going to the non-forum page.
And everyone that is not apart of the SMF membergroup will have the default forum Profile.

VainSoftGames.com - New Design To Gaming

Robbo_

#1
Go into Sources/Load.php and find the line
'href' => $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'],
      'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',

and change it to
'href' => $profile['GROUP_ID'] == {group_id_here} ? {new_href} : $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'],
      'link' => '<a href=" . ($profile['GROUP_ID'] == {group_id_here} ? {new_href} : $scripturl . '?action=profile;u=' . $profile['ID_MEMBER']). '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',


Replace {group_id_here} with the id of the group that has the changes and {new_href} with the url you would like them to go to.
Aus-Newerth

Quote from: IRC
Roph> I just finished a double 1/2lb cheese, bacon & salad beef burger
Roph> no woman on earth could satisfy me as much as I am satisfied right now by this burger
... later on ...
Roph> how could ensie go about satisfying me =o
<Ensiferous> Roph: Merely looking at me would yield far more pleasure than a burger can provide.

lordtron

But will that allow everyone in the SMF group have there own custom Profile or will they all goto the same page?

VainSoftGames.com - New Design To Gaming

Robbo_

That is set for just one page. However if you were to do a bit of modding you could make them go to whatever they want.

You would have to add a field to the members table, add it to the memberContext array and also add an option (another array I think) to change it to whatever you want through the profile.

If you don't know how to do that then hopefully someone else isn't as tired as me and might go through it in detail :p
Aus-Newerth

Quote from: IRC
Roph> I just finished a double 1/2lb cheese, bacon & salad beef burger
Roph> no woman on earth could satisfy me as much as I am satisfied right now by this burger
... later on ...
Roph> how could ensie go about satisfying me =o
<Ensiferous> Roph: Merely looking at me would yield far more pleasure than a burger can provide.

lordtron

Yeah, I will need someone that can go into detail with that for me. Cause I lost you half-way....

But thanks for at least telling me that much. Thats better than nothing.
Do you think it would be possible to do it by memberID instead of groupID?

VainSoftGames.com - New Design To Gaming

Robbo_

Yes it will be possible. If I had the time I would make a mod to do all this for you with a permission you can set for the membergroup. Unfortunately I have limited time to even do the stuff I want to do.
Aus-Newerth

Quote from: IRC
Roph> I just finished a double 1/2lb cheese, bacon & salad beef burger
Roph> no woman on earth could satisfy me as much as I am satisfied right now by this burger
... later on ...
Roph> how could ensie go about satisfying me =o
<Ensiferous> Roph: Merely looking at me would yield far more pleasure than a burger can provide.

lordtron

Well thanks anyways man...This is a lot of help and a time saver.

VainSoftGames.com - New Design To Gaming

Rumbaar

Well in the new href URL just use the variable $profile['ID_MEMBER'] somewhere to make it different pointer for each member ID.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

lordtron

But where would I put what ID goes to where then?

VainSoftGames.com - New Design To Gaming

Rumbaar

I don't know what is the URL you are sending them too or creating these 'custom' profiles at?  You would use your target URL and then add the membersID to it, so can make it look for different page maybe?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

lordtron

I don't want to add there memberID to the URL cause then if I want to look for someone I have to look up there ID and that will be a pain after awhile.


I have this:
http://vainsoft.com/model/boards/index.php?action=profile;u=2

But I want this(URL to custom Profile):
http://vainsoft.com/model/ourgirls/stevie

VainSoftGames.com - New Design To Gaming

Rumbaar

Well then just use $profile['realName'] then to call their account name.  Just have to make sure they are one and the same and they never change it.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

lordtron

Your just making it more confusing for me man lol

So where does $profile['realName'] go?

VainSoftGames.com - New Design To Gaming

Rumbaar

For the replacement URL try:
http://vainsoft.com/model/ourgirls/' . $profile['realName'] . '
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

lordtron

#14
Well I know right off the back that won't work lol
Cause I only use there first name in the URL.
And I can't use memberName due to members having the same name.



Could I use a custom field I created with this method. Cause I enter in myself what the folder is called for the custom profile. Could I just use that.
(Only I can edit this field and nobody can see it if I have not entered in a value for it)

VainSoftGames.com - New Design To Gaming

Rumbaar

Well you'll have to write a function that extracts that information of that particular person and populate that variable with your details.  You're on your own on that one, as it's not really part of General Support for SMF.

Maybe easier to change it so you use their forums display name instead of just their first name in that profile URL.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

lordtron

Oh I already figured out how to populate that variable, figured it out last night at 2am lol


I was just wondering if it would work with this.

VainSoftGames.com - New Design To Gaming

Rumbaar

Well if you worked it out 'last night at 2am' why didn't you just try it and see?  But each their own...
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

lordtron

Cause I didn't really do it last night at 2am for that reason. I did it to pull information from fields that where made by Custom Field Mod. And I used it has a test since I knew that field already had something entered in it.

VainSoftGames.com - New Design To Gaming

lordtron

#19
Alright, I put the code in and fixed the errors I was getting, but it doesn't work. I click on someones profile that is in the membergroup I selected and it still goes to there forum profile not where I want it to goto.


VainSoftGames.com - New Design To Gaming

Advertisement: