easy linking in profile

18 years 1 month ago #6437 by lennox
easy linking in profile was created by lennox
hello, i want to display the 'easy'link in the persons login module.

What is the right code for it?

[code:1]"<b>"$mosConfig_live_site."/".$my->username."</b>"; [/code:1]

something like that?
For example, check www.petermixt.com


LENNOX
Official CB 3th Party Developer
Working on the CBRC2 Lennoxonline module
Official partner and PR-man of dcsFlashGames
RELEASED: Highest Karma Module
RELEASED: PROFILE VOTE KARMA PLUGIN


www.nightcity.nl

Please Log in to join the conversation.

17 years 10 months ago #11327 by centralpulse
Replied by centralpulse on topic Re:easy linking in profile
The code you're looking for is below, I have just implimented this one of my websites - I'm quite new to PHP so there is probably a better way, all I know is it works on my site using CB 1.0-RC2 with Joomla 1.0.8.

You're adding code into the file cb.menu.php found in components/com_comprofiler/plugin/user/plug_cbmenu

Go to line 1146 (just above the "add plugins' status" section) and past the following code

[code:1]// Profile Link
if ($params->get('profilelink', '1')==1) {
$mi = array(); $mi["_UE_MENU_STATUS"]["Profile Link"]["Profile Link"]=null;
$this->menuList->addObjectItem($mi, $user->username, sefRelToAbs($user->username), "",
"","", _UE_USERNAME,""«»);
}[/code:1]

You can change the title of the 'menu item' (in this code it is "Profile Link") simply by changing both

[code:1]$mi["_UE_MENU_STATUS"]["Profile Link"]["Profile Link"]=null;[/code:1]
to
[code:1]$mi["_UE_MENU_STATUS"]["Homepage"]["Homepage"]=null;[/code:1]
or what ever you wish to change it to.

This will display the username in it's own section linked to www.yourdomain.com/username
I haven't quite worked out how to display the link as www.yourdomain.com/username but if you want to display it as www.yourdomain.com/username paste in this code instead
[code:1] // Profile Link
if ($params->get('profilelink', '1')==1) {
$mi = array(); $mi["_UE_MENU_STATUS"]["Profile Link"]["Profile Link"]=null;
$this->menuList->addObjectItem($mi, sefRelToAbs($user->username), sefRelToAbs($user->username), "",
"","", _UE_USERNAME,""«»);
}[/code:1]
Same rules apply with changing the title.

Enjoy,
Ryan

LATEST CB WEBSITE BY CENTRAL PULSE ETOOLS: www.unilife.co.nz

Please Log in to join the conversation.

17 years 10 months ago #11329 by centralpulse
Replied by centralpulse on topic Re:easy linking in profile
I don't know why I didn't work this one out first!? It took me a lot longer to work out this basic piece of code but the earlier piece that was much less logical was created in a matter of minutes! haha... This is for the display options by the way B)

To have the link display as www.yoursite.com/username put the following piece of code in instead above "add plugins' status" (around line 1146)
[code:1] // Profile Link
if ($params->get('profilelink', '1')==1) {
$mi = array(); $mi["_UE_MENU_STATUS"]["Profile Link"]["Profile Link"]=null;
$this->menuList->addObjectItem($mi, "www.unilife.co.nz/$user->username", sefRelToAbs($user->username), "_blank",
"","", _UE_USERNAME,""«»);
}[/code:1]
And again to change the name of the title just change the both sets of text that says "Profile Link" to "what ever you want" but the parenthesis must stay in the code and no the parenthesis don't display! Sorry I couldn't help myself.

Enjoy this!

Ryan :evil:

LATEST CB WEBSITE BY CENTRAL PULSE ETOOLS: www.unilife.co.nz

Please Log in to join the conversation.

17 years 10 months ago #11354 by lennox
Replied by lennox on topic Re:easy linking in profile
very nice, thanks for you're time, i'm going to try this today (when i'm at home)
Karma for you!
I hope this work well :)


LENNOX
Official CB 3th Party Developer
Working on the CBRC2 Lennoxonline module
Official partner and PR-man of dcsFlashGames
RELEASED: Highest Karma Module
RELEASED: PROFILE VOTE KARMA PLUGIN


www.nightcity.nl

Please Log in to join the conversation.

17 years 10 months ago #11356 by centralpulse
Replied by centralpulse on topic Re:easy linking in profile
No a problem mate, I just hope it all makes sense, is clear enough and works! :blink:

Let me know how it goes.

Cheers,
Ryan :)

LATEST CB WEBSITE BY CENTRAL PULSE ETOOLS: www.unilife.co.nz

Please Log in to join the conversation.

17 years 10 months ago #11400 by jimmyp3016
Replied by jimmyp3016 on topic Re:easy linking in profile
Hey Guys,

I changed the code in the file and now the profile links show up in the profile page which is great. But when you click on any of them it goes to the home page. Is there another file i have to modify to get it to go to there profile page?

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.175 seconds

Facebook Twitter LinkedIn