Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Aileen on March 12, 2008, 04:39:48 PM

Title: Go to PM user page when profile is clicked
Post by: Aileen on March 12, 2008, 04:39:48 PM
Instead of going to the profile can we PM a user instead when the user name is clicked on:

on post
who's online
view profile


Thanks
Title: Re: Go to PM user page when profile is clicked
Post by: Bulakbol on March 12, 2008, 07:23:44 PM
If you change all of those, how would you view their profile then? You can replace any occurences of
action=profile

with
action=pm;sa=send;

in Sources/BoardIndex.php and Load.php. Try it and find out what you will get.
Title: Re: Go to PM user page when profile is clicked
Post by: Eliana Tamerin on March 12, 2008, 07:25:20 PM
I'm guessing you could view memberlist or click on the (http://www.simplemachines.org/community/Themes/smsite/images/icons/profile_sm.gif) View Profile image in the post details. Just don't change the View Profile one, there's also a Personal Message/Online indicator icon that you should use instead.
Title: Re: Go to PM user page when profile is clicked
Post by: Bulakbol on March 12, 2008, 07:37:39 PM
I'm not sure if by making the changes in BoardIndex.php and Load.php will affect those you mentioned. I haven't tried it.
Title: Re: Go to PM user page when profile is clicked
Post by: Eliana Tamerin on March 12, 2008, 07:41:55 PM
Don't think it would be boardindex.php. Perhaps Display.php and Who.php.
Title: Re: Go to PM user page when profile is clicked
Post by: Aileen on March 15, 2008, 01:10:17 PM
found it all

BoardIndex.php
BoardIndex.template.php
Recent.php
Load.php
MessageIndex.php
Display.template

I dont know if I missed something but it is any file with action=profile
Title: Re: Go to PM user page when profile is clicked
Post by: codenaught on March 15, 2008, 01:11:48 PM
So does that mean you were able to figure this out Aileen? Any additional assistance needed?
Title: Re: Go to PM user page when profile is clicked
Post by: Aileen on March 15, 2008, 01:20:06 PM
yes, just one problem.... all but the "profile" of the latest member in infocenter is not yet changed.

What file to edit it still says action=profile

instead of action=pm;sa=send;
Title: Re: Go to PM user page when profile is clicked
Post by: codenaught on March 15, 2008, 01:22:29 PM
Sources/Subs.php:

// This looks weird, but it's because BoardIndex.php references the variable.
$context['common_stats']['latest_member'] = array(
'id' => $modSettings['latestMember'],
'name' => $modSettings['latestRealName'],
'href' => $scripturl . '?action=profile;u=' . $modSettings['latestMember'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $modSettings['latestMember'] . '">' . $modSettings['latestRealName'] . '</a>',
);


Notice the 'link' line.
Title: Re: Go to PM user page when profile is clicked
Post by: Aileen on March 15, 2008, 01:34:13 PM
Thanks. its now all working

BTW in some of the files i edited

'href' => $scripturl . aslo

but for subs i just edited the

'link' =>


Mind if I ask for the difference between the 2.

Because when I edited the

'href' => $scripturl  in subs there was an error
Title: Re: Go to PM user page when profile is clicked
Post by: codenaught on March 15, 2008, 02:01:31 PM
'href' will hold the actual address of the link, so for instance:

'href' => 'http://www.google.com'

Whereas, 'link' would hold the entire <a href="...">...</a> link code like:

'link' => '<a href="http://www.google.com">Google</a>'

The template will either use something like:

<a href="' . $context['some_index']['href'] . '">Google</a> or simply just $context['some_index']['link']. I am not aware of any standard for when to use one over the other (they are both used in the templates depending on the variable). But basically by providing the 'href' it allows people to customize the link as needed in the template, while the 'link' one can be used if it is just a simple link with nothing special needing to be modified from it.
Title: Re: Go to PM user page when profile is clicked
Post by: Aileen on March 15, 2008, 05:56:37 PM
thank you so much akabugeyes. I think it solved my problem
Title: Re: Go to PM user page when profile is clicked
Post by: codenaught on March 15, 2008, 06:12:51 PM
You're welcome. Just let us know if you run into any additional problems. :)
Title: Re: Go to PM user page when profile is clicked
Post by: Aileen on March 15, 2008, 08:54:18 PM
One last follow up question. How can I change the link in the RSS for new members from action=profile to action=pm;sa=send

I mean what file to edit

thanks
Title: Re: Go to PM user page when profile is clicked
Post by: codenaught on March 15, 2008, 08:58:23 PM
That would be News.php. :)
Title: Re: Go to PM user page when profile is clicked
Post by: Aileen on March 16, 2008, 12:25:15 AM
Thank you so much. I will edit it. BTW with my previous file edits. Can I add no follow on all files. or only one file will do the trick?
Title: Re: Go to PM user page when profile is clicked
Post by: Aileen on October 27, 2008, 09:22:25 AM
any updates on this?
Title: Re: Go to PM user page when profile is clicked
Post by: [SiNaN] on November 22, 2008, 11:25:05 AM
Do you still need help with this Aileen?

If yes, what you want is adding "nofollow" attribute to all user links?