cb profile links?

michael
michael
Offline
0
have a general question about linking usernames to cb profile..i had read in a post where you mentioned to another member that this code will produce the desired effect.
$user =& JFactory::getUser($this->album->user_id);

echo $user->username ;

but im not sure exactly where to place that code.
im assuming its located in muscol/views/album/tmpl/default.php
but i dont want to make any mistakes..could you tell me what file i should place that code and on what line..
sorry for reposting as i posted this question in another old posting but i wasent sure if it was closed.
thanks again
Responses (3)
  • Accepted Answer

    Monday, September 29 2014, 11:04 AM - #Permalink
    0
    yes, that would be the file.
    this will show the username.
    The reply is currently minimized Show
  • Accepted Answer

    michael
    michael
    Offline
    Tuesday, September 30 2014, 06:08 AM - #Permalink
    0
    Hey thanks for the response.
    aw man that didnt work for me so well. when posted as this
    album>tmpl>default.php

    starting from line 1, complete with opening and closing tags

    defined('_JEXEC') or die('Restricted access');
    $user =& JFactory::getUser(); ?>
    $user =& JFactory::getUser($this->album->user_id);
    echo $user->userame ;
    */
    the username is non clickable on the aritsts page and on the album page and the song page..the clickable username returns me back to the artists page.
    which makes the most sense. so i guess i can now simplify my question and thanks for your help.

    So i then posted the code as per the forum post to get the artists name to link to the cb profile so i pasted this code into both artists>artists.php and common.php (assuming it was one of these for the artists profile backlink which i may have been mistaken)

    $user =& JFactory::getUser($this->artist->user_id);
    {
    echo 'More info: username . '/">Contact Me';
    }
    ?>
    did not work for me...any idea if im placing the code in the wrong place or with the wrong tags?

    So specifically my question is..
    to make the username on the artist page which normally is non clickable instead a backlink to their profile would the above code work and which file would i place that code in because it was never mentioned in the post, and also why did the code you provided not work...did i place the code in the wrong place or with the wrong tags?
    Thanks for any help i really appreciate it
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, October 02 2014, 10:51 AM - #Permalink
    0
    the code was not for this to be clickable, it was only to show the name.

    also.. what is this: */

    ?
    in line 7 approx. a closing comment tag?

    not to offend you.. but do you know PHP? the code you're using is really strange.. the syntax, I mean.
    The reply is currently minimized Show
Your Reply