[SOLVED] linking code to profile?

13 years 5 months ago #146484 by jakobe75
[SOLVED] linking code to profile? was created by jakobe75
what would be (if possible) the code to add to a field to link it to a profile.

I dont mean just website.com/userprofile/username...

like for example in the userlist...when you see the avatar and click on it, it takes you to that profile.

I want to do the same thing in userlists but with a regular image "CLICK HERE TO SEE PROFILE"

I can easily delimit a field to get an image in the userlist, but what substitution code would I apply to this field to have it link the the profile.

reasoning:
Only my Paid users see avatars, but free users can still use the lists and search.

The lists look a little boring without an avatar or an image.

I cant use any of my regular delimited images that already appear on the free profiles. as those already are directly linked to the register page.

So I was thinking maybe there was a way to create a delimited field of an image and add an if statement to it to get it to link to each profile displayed.

sugggestions?
thanks

Post edited by: krileon, at: 2010/11/17 19:46

Please Log in to join the conversation.

13 years 5 months ago #146490 by jakobe75
Replied by jakobe75 on topic Re:linking code to profile?
this was my first attempt.

- created a delimiter field
- added an image to it
- add this code as the link
[code:1]index.php?option=com_comprofiler&Itemid=127&task=userprofile&[user_id][/code:1]

also tried
[code:1]index.php?option=com_comprofiler&task=userprofile&[user_id]&Itemid=127[/code:1]

The url produced by the browser seems correct but it doesnt link.. I get these errors

Illegal variable _files or _env or _get or _post or _cookie or _server or _session or globals passed to script.


I think I'm close.

Please Log in to join the conversation.

13 years 5 months ago #146491 by jakobe75
Replied by jakobe75 on topic Re:linking code to profile?
Okay I think I got it

yes?

[code:1]index.php?option=com_comprofiler&task=userprofile&user=[user_id]&Itemid=127[/code:1]


I think this is the answer,
seems to work.


and I could not have found the answer on my own without Krileon's tutorials about substitutions and IF statements.

Thanks

Post edited by: jakobe75, at: 2010/11/17 17:19

Please Log in to join the conversation.

13 years 5 months ago #146524 by krileon
Replied by krileon on topic Re:linking code to profile?

Okay I think I got it

Yes that is correct. Below is direct format of URL from inside CB for usage with substitutions.

[code:1]
index.php?option=com_comprofiler&task=userprofile&user=[user_id]&Itemid=ITEM_ID_HERE
[/code:1]

Now this is different if you're viewing your own profile which is the following.

[code:1]
index.php?option=com_comprofiler&Itemid=ITEM_ID_HERE
[/code:1]

So an IF substitution is definitely suggested to ensure the user is using the correct URL.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 5 months ago #146526 by jakobe75
Replied by jakobe75 on topic Re:linking code to profile?
great,

thanks got it!

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.444 seconds

Facebook Twitter LinkedIn