×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: code for make sef url to profile user

code for make sef url to profile user 15 years 6 months ago #1442

  • BrOncO
  • BrOncO's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
hello hall,

first thx for this cool component and sorry for my bad english.

i ave edited the code for make the user profile link sef, in this moment is not traslate.

in file comment.class.php find:
function profileLink($s, $id)
    {
        global $mosConfig_live_site;
        return $id ? "<a href='$mosConfig_live_site/index.php?option=com_comprofiler&task=userProfile&user=$id'>$s</a>" : $s;
    }

and replace with:
function profileLink($s, $id)
    {
        global $mosConfig_live_site;
		if($id !=''){
		   $link=sefRelToAbs("index.php?option=com_comprofiler&task=userProfile&user=$id");
		   return "<a href='$link'>$s</a>";
		}else{
		   return $s;
		}
 
    }

I hope it is useful to somebody,


tested in my server, joomla 1.0X

;)

code for make sef url to profile user 15 years 2 months ago #2767

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
here is the function for joomla 1.5
function profileLink($s, $id)
    {
	if(strcmp($id,'')) {
	    $link = JRoute::_(JRoute::_('index.php?option=com_comprofiler&task=userProfile&user='.$id));
	    return '<a href="'.$link.'">'.$s.'</a>';
	} else {
	    return $s;
	}
    }

Thanks for the hint BrOncO! (added to the next release)

code for make sef url to profile user 14 years 11 months ago #4167

  • Nugjii
  • Nugjii's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
my site comments 1 st page profile avatar links true but click pagenation then avatar link is news url"profile url". how to solve it. my english bad sorry.

code for make sef url to profile user 14 years 11 months ago #4169

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hm, that is interesting error. Do you use 4.0 or 3.26?

code for make sef url to profile user 14 years 11 months ago #4196

  • Nugjii
  • Nugjii's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
Version 4.0.

code for make sef url to profile user 14 years 11 months ago #4200

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Nugji!
Yep, this was a bug!
change the code to this:
function profileLink($s, $id)
    {
	if(strcmp($id,'')) {
	    $link = JRoute::_('index.php?option=com_comprofiler&task=userProfile&user='.$id);
	    return "<a href='$link'>".$s."</a>";
	} else {
	    return $s;
	}
    }
and it should start to work as expected :)

code for make sef url to profile user 14 years 11 months ago #4202

  • Nugjii
  • Nugjii's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
ok. problem solved. big tnx. i'm search bug for my router.php file. but ", \''...
  • Page:
  • 1
Time to create page: 0.140 seconds