Skip to Content Skip to Menu

Custom URL Plugin leads to First and Last Name >.

  • Flipsider
  • Flipsider
  • OFFLINE
  • Posts: 137
  • Thanks: 0
  • Karma: -82
17 years 11 months ago #23307 by Flipsider
I did the customurl hack and it does lead me to domain.com/username but in the plugin, it shows domain.com/First Last . E.g.:
www.domain.com/flipsider (works)
www.domain.com/Jordan Bar-El (shows in plugin)

I'd like to have the plugin show the username.

Thanks,
Jordan

De-Karma me... if you dare...
CB Xbox Gamercard Plugin (Gone] - CB Xbox Gamercard Module (Gone)

Please Log in or Create an account to join the conversation.

  • nihir
  • nihir
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
17 years 10 months ago #25864 by nihir
I've figured out how to fix the plugin that you're talking about. Just replace the code in customurl.php (/components/com_profiler/plugin/user/plug_cbcustomurltab/)
with the following code:
[code:1]<?php
/**
* Zoom Tab Class for handling the CB tab api
* @package Community Builder
* @author Unknown, PeterMixt, JoomlaJoe, Beat
*/

class getCustomurlTab extends cbTabHandler {
/**
* Constructor
*/
function getCustomurlTab() {
$this->cbTabHandler();
}

function getDisplayTab($tab,$user,$ui) {
$params=$this->params;
global $database;


//if ( $name ) {
$query = "SELECT username FROM #__users as username WHERE id = ". $user->id;
$database->setQuery( $query );
//print $database->getQuery();
$name = $database->loadObjectList();
//} else {
// $name = htmlentities($user->username);
//}

$agetekst = $params->get('CustomUrlText', "Url"«»);
$mi = array(); $mi["_UE_MENU_STATUS"][$params->get('CustomUrlText', "Url"«»)]["Url"]=null;
$siteurl = $params->get('SiteUrl', " www.meetyoinmexico.com "«»);
if ($name[0]->name=="Administrator"«»)
{
$name[0]->name="admin";
}

$this->addMenu( array( "position" => "menuList" ,
"arrayPos" => $mi ,
"caption" => $siteurl."/".$name[0]->username ,
"url" => "" ,
"target" => "" ,
"img" => null ,
"alt" => null ,
"tooltip" => ""«») );


} //end getDisplayTab
} //end class getZoomTab.

?>[/code:1]

The problem was the SQL Query was retreiving "Name" which is the full name and not "username".

Hope that helps!

Please Log in or Create an account to join the conversation.

  • johnnyb
  • johnnyb
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
17 years 10 months ago #26359 by johnnyb
I tried the custom url plugin and it shows up in the tab menu, however it doent work. The url doesnt exist. Any clues. Any help would be appreciated.

www.uspgta.com

Please Log in or Create an account to join the conversation.

  • Flipsider
  • Flipsider
  • OFFLINE
  • Posts: 137
  • Thanks: 0
  • Karma: -82
17 years 10 months ago #26418 by Flipsider
Hi, you need to create the custom url mod first before using this plugin.

De-Karma me... if you dare...
CB Xbox Gamercard Plugin (Gone] - CB Xbox Gamercard Module (Gone)

Please Log in or Create an account to join the conversation.

  • gayus
  • gayus
  • OFFLINE
  • Posts: 11
  • Thanks: 0
  • Karma: 0
17 years 10 months ago #26458 by gayus
The code is still show the First and Last Name.
How to change to username?
Thank you:)


gayus.

Please Log in or Create an account to join the conversation.

  • gayus
  • gayus
  • OFFLINE
  • Posts: 11
  • Thanks: 0
  • Karma: 0
17 years 10 months ago #27166 by gayus
gayus wrote:

The code is still show the First and Last Name.
How to change to username?
Thank you:)



It's worked i fixed to username. Check this out: www.christernet.com/gayus
Replace the code customurl.php adjust with your website
@ /components/com_profiler/plugin/user/plug_cbcustomurltab/
with the following code:
[code:1]
<?php
/**
* Zoom Tab Class for handling the CB tab api
* @package Community Builder
* @author Unknown, PeterMixt, JoomlaJoe, Beat
*/

// 12/7/2006 10:07AM | Fixed to username by gayus/GW.

class getCustomurlTab extends cbTabHandler {
/**
* Constructor
*/
function getCustomurlTab() {
$this->cbTabHandler();
}

function getDisplayTab($tab,$user,$ui) {
$params=$this->params;
global $database;


//if ( $username ) {
$query = "SELECT username FROM #__users as username WHERE id = ". $user->id;
$database->setQuery( $query );
//print $database->getQuery();
$username = $database->loadObjectList();
//} else {
// $username = htmlentities($user->username);
//}

$agetekst = $params->get('CustomUrlText', "Url"«»);
$mi = array(); $mi["_UE_MENU_STATUS"][$params->get('CustomUrlText', "Url"«»)]["Url"]=null;
$siteurl = $params->get('SiteUrl', " www.christernet.com "«»);
if ($username[0]->username=="Administrator"«»)
{
$username[0]->username="admin";
}

$this->addMenu( array( "position" => "menuList" ,
"arrayPos" => $mi ,
"caption" => $siteurl."/".$username[0]->username ,
"url" => "" ,
"target" => "" ,
"img" => null ,
"alt" => null ,
"tooltip" => ""«») );


} //end getDisplayTab
} //end class getZoomTab.

?>
[/code:1]


gayus.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum