SOLVED: show name on profile + profile link

16 years 11 months ago #36446 by chac416

Edit: you can ignore this part for now. the solution is below. easy to do. won't take long.
p.s. KARMA PLZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ :)

p.s.2: i need to know how to take off the "required" icon in the registration page from the first and last name fields. thanks

Hello
I want to show the name of the user on his/hers profile.
I was just tweaking around with the cb_menu plugin.
i copy pasted the codes of the "HITS" and changed it to "NAME".
in the admin backend, it shows the option to show or hide the name. in the frontend, shows nothing, haha.

codes i added:
in cb.menu.php on line 1108
__________________________
if ($params->get('name', '1')==1) {
$mi = array(); $mi["_UE_MENU_STATUS"]["_UE_NAME"]["_UE_NAME"]=null;
$this->menuList->addObjectItem($mi, $user->name,"", "",
"","", _UE_NAME_DESC,"");
}
_______________________

in cb.menu.php i added:
<param name="name" type="radio" default="1" label="_UE_NAME" description="">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
_________________________


now obviously, i did miss something :) what is it? i need help in that.

so HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP lol

oh, p.s. yes, the name will have to be extracted from joomla core db (table: #_core_acl_aro ; column: name)

Post edited by: chac416, at: 2007/04/27 08:54

Please Log in to join the conversation.

16 years 11 months ago #36447 by chac416
Replied by chac416 on topic Re:show name on profile
okay, wait wait. i managed to show the first name lol

not from the joomla core db, but from cb db,

so instead, i used: $user->firstname

now i have to see about the middle and last name :p

Please Log in to join the conversation.

16 years 11 months ago #36449 by chac416
Replied by chac416 on topic Re:show name on profile
ahhh, nevermind, i made all the changes i want. now i added, first name, last name, and profile link. (for the link to actually direct you to the member's profile, use Trail's tweaking to the .htacess, search the forum :p)

from cb.menu.php, after
[code:1] function getDisplayTab($tab,$user,$ui) {
global $database, $ueConfig, $_PLUGINS, $_CB_OneTwoRowsStyleToggle;

$params=$this->params;
[/code:1]
[code:1] // First Name (Added by chac416 - www.filfili.com)
if ($params->get('firstname', '1')==1) {
$mi = array(); $mi["_UE_MENU_STATUS"]["_UE_FIRSTNAME"]["_UE_FIRSTNAME"]=null;
$this->menuList->addObjectItem($mi, $user->firstname, "", "",
"","", _UE_FIRSTNAME_DESC,""«»);
}
// Last Name (Added by chac416 - www.filfili.com)
if ($params->get('lastname', '1')==1) {
$mi = array(); $mi["_UE_MENU_STATUS"]["_UE_LASTNAME"]["_UE_LASTNAME"]=null;
$this->menuList->addObjectItem($mi, $user->lastname, "", "",
"","", _UE_LASTNAME_DESC,""«»);
}
// Profile link (Added by chac416 - www.filfili.com)
if ($params->get('profileLink', '1')==1) {
$mi = array(); $mi["_UE_MENU_STATUS"]["_UE_PROFILELINK"]["_UE_PROFILELINK"]=null;
$this->menuList->addObjectItem($mi, 'www.lebanonfirst.com/'.$user->username, $user->username, "",
"","", _UE_PROFILELINK_DESC,""«»);
}[/code:1]

Post edited by: chac416, at: 2007/04/27 08:34

Post edited by: chac416, at: 2007/04/27 08:34

Please Log in to join the conversation.

16 years 11 months ago #36450 by chac416
Replied by chac416 on topic Re:show name on profile
from cb.menu.xml, after
[code:1]
<tab name="_UE_USER_STATUS" description="" class="getStatusTab" fields="0" position="cb_right" displaytype="html" ordering="-5" enabled="1" sys="3">
<params>
<param name="@spacer" type="spacer" default="Display Settings" label="User Profile Status :" description="" />[/code:1]
[code:1]
<param name="firstname" type="radio" default="1" label="_UE_FIRSTNAME" description="">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
<param name="lastname" type="radio" default="1" label="_UE_LASTNAME" description="">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>

[/code:1]

this is important. it makes the options manageable from the cb admin (CB Menu tab management). each option can be turned on and off.

Post edited by: chac416, at: 2007/04/27 08:57

Please Log in to join the conversation.

16 years 11 months ago #36451 by chac416
Replied by chac416 on topic Re:show name on profile
from the language file, default_language.php:
[code:1]
//First, Last and Profile Link - Added by chac416 - www.filfili.com
DEFINE('_UE_FIRSTNAME','First Name');
DEFINE('_UE_LASTNAME','Last Name');
DEFINE('_UE_PROFILELINK','Profile Link');


DEFINE('_UE_FIRSTNAME_DESC','First Name');
DEFINE('_UE_LASTNAME_DESC','Last Name');
DEFINE('_UE_PROFILELINK_DESC','Direct link to member\'s profile');
[/code:1]

Please Log in to join the conversation.

16 years 11 months ago #36456 by chac416
Replied by chac416 on topic Re:show name on profile
hooorayyyyy, im being productive tonight haha,
i fixed the registration issue. here's what you should do to get the profile "visible" icon beside the first and last name fields.

in comprofiler.html.php

change:
[code:1] <td class="titleCell"><?php echo _UE_YOUR_FNAME; ?>:</td>
<td class="fieldCell"><input class="inputbox" type="text" size="40" mosReq="1" mosLabel="<?php
echo _UE_YOUR_FNAME; ?>" name="firstname" value="<?php if (isset($rowExtras->firstname)) echo htmlspecialchars($rowExtras->firstname);?>" /><?php
echo getFieldIcons(1,true,($ueConfig!=3)); ?></td>
</tr>
<tr>
<td class="titleCell"><?php echo _UE_YOUR_LNAME; ?>:</td>
<td class="fieldCell"><input class="inputbox" type="text" size="40" mosReq="1" mosLabel="<?php
echo _UE_YOUR_LNAME; ?>" name="lastname" value="<?php if (isset($rowExtras->lastname)) echo htmlspecialchars($rowExtras->lastname);?>" /><?php
echo getFieldIcons(1,true,($ueConfig!=3)); ?></td>
[/code:1]

to
[code:1]
<td class="titleCell"><?php echo _UE_YOUR_FNAME; ?>:</td>
<td class="fieldCell"><input class="inputbox" type="text" size="40" mosReq="1" mosLabel="<?php
echo _UE_YOUR_FNAME; ?>" name="firstname" value="<?php if (isset($rowExtras->firstname)) echo htmlspecialchars($rowExtras->firstname);?>" /><?php
echo getFieldIcons(1,true,($ueConfig!=1)); ?></td>
</tr>
<tr>
<td class="titleCell"><?php echo _UE_YOUR_LNAME; ?>:</td>
<td class="fieldCell"><input class="inputbox" type="text" size="40" mosReq="1" mosLabel="<?php
echo _UE_YOUR_LNAME; ?>" name="lastname" value="<?php if (isset($rowExtras->lastname)) echo htmlspecialchars($rowExtras->lastname);?>" /><?php
echo getFieldIcons(1,true,($ueConfig!=1)); ?></td>
[/code:1]


it's a simple change, you change the 3 to 1

p.s. the BBcode aren't working (on both, firefox and ie)

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.176 seconds

Facebook Twitter LinkedIn