radio,
This is my UserProfile code (it's not updated for 1.2):
function userProfile
[code:1]
global $database, $_REQUEST, $ueConfig, $my;
if (isset($_REQUEST)) {
if (!allowAccess( $ueConfig,'RECURSE', userGID($my->id))) {
echo _UE_NOT_AUTHORIZED;
return;
}
} else {
if ($uid==0) {
echo _UE_REGISTERFORPROFILE;
return;
}
}
$users=array();
if (setUserDBrequest($uid)) {
$users = $database->loadObjectList();
}
if (count($users)==0) {
echo _UE_NOSUCHPROFILE;
return;
}
$user = $users[0];
HTML_comprofiler::«»xtdUserProfile( $user, $option, $submitvalue, $my);
[/code:1]
Then I added a new function to comprofiler.html.php (underneath userProfile)
[code:1]
function xtdUserProfile($user, $option,$submitvalue) {
global $database,$my,$ueConfig,$_REQUEST,$_POST,$_PLUGINS, $mainframe;
$_PLUGINS->loadPluginGroup('user');
$results = $_PLUGINS->trigger( 'onBeforeUserProfileRequest', array(&$user,1));
if ($_PLUGINS->is_errors()) {
echo "<script type=\"text/javascript\">alert(\"".$_PLUGINS->getErrorMSG()."\"«»); window.history.go(-1); </script>\n";
exit();
}
$cbMyIsModerator = isModerator($my->id);
$cbUserIsModerator = isModerator($user->id);
$showProfile=1;
if ($user->banned != 0 || ($user->block == 1 && $user->confirmed && $user->approved)) {
echo "<font color=red>"._UE_USERPROFILEBANNED;
if($my->id != $user->id && $cbMyIsModerator != 1) {
$showProfile=0;
} else {
if ($user->block == 1) {
echo ": "._LOGIN_BLOCKED;
}
if ($user->banned != 0) {
echo "<br />".nl2br($user->bannedreason);
}
}
echo "<br /></font>";
}
if (!$user->confirmed) echo "<font color=red>"._UE_USER_NOT_CONFIRMED."</font><br />";
if (!$user->approved) echo "<font color=red>"._UE_USER_NOT_APPROVED."</font><br />";
if ((!$user->confirmed || !$user->approved) && $cbMyIsModerator!=1) {
$showProfile=0;
}
if ($showProfile==1) {
if ( method_exists($mainframe,"setPageTitle"«»)) {
$mainframe->setPageTitle( unHtmlspecialchars(getNameFormat($user->name,$user->username,$ueConfig)));
}
if ( method_exists($mainframe,"appendPathWay"«»)) {
$mainframe->appendPathWay( getNameFormat($user->name,$user->username,$ueConfig));
}
$i=1;
outputCbTemplate(1);
echo initToolTip(1);
?>
<script type="text/javascript">
function cbConnSubmReq() {
cClick();
document.connOverForm.submit();
}
function confirmSubmit() {
if (confirm("<?php echo _UE_CONFIRMREMOVECONNECTION; ?>"«»))
return true ;
else
return false ;
}
</script>
<?php
$results = $_PLUGINS->trigger( 'onBeforeUserProfileDisplay', array(&$user,1,&$cbUserIsModerator,&$cbMyIsModerator)); //$ui=1 //BBB: params?
if ($_PLUGINS->is_errors()) {
echo "<script type=\"text/javascript\">alert(\"".$_PLUGINS->getErrorMSG()."\"«»); window.history.go(-1); </script>\n";
exit();
}
if (is_array($results)) {
for ($i=0, $n=count($results); $i<$n; $i++) {
echo $results[$i];
}
}
$tabs = new cbTabs( 0, 1 );
$userViewTabs = $tabs->getViewTabs($user); // this loads, registers menu and user status and renders the tabs
require_once ($mosConfig_absolute_path . 'components/com_comprofiler/xtd_views/xtdUserProfile.php');
$tab = null;
if (isset($_GET)) $tab = urldecode($_GET);
elseif (isset($_POST)) $tab = $_POST;
if ($tab) echo "<script type=\"text/javascript\">showCBTab('".addslashes(htmlspecialchars($tab))."');</script>\n";
if($my->id!=$user->id) {
recordViewHit($my->id,$user->id,getenv('REMOTE_ADDR'));
}
$_PLUGINS->trigger( 'onAfterUserProfileDisplay', array($user,true));
}
}
[/code:1]
Then I created a folder called components/com_comprofiler/xtd_views/xtdUserProfile.php:
[code:1]
<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$avatar = $user->avatar;
$avatarapproved = $user->avatarapproved;
if ($avatar=='' || $avatar==null) {
//$avatar_img = "components/com_comprofiler/plugin/language/default_language/images/tnnophoto.jpg";
$avatar_img = sefRelToAbs( 'components/com_comprofiler/plugin/language/default_language/images/nophoto.jpg' );
} elseif ($avatarapproved==0) {
$avatar_img = sefRelToAbs( 'components/com_comprofiler/plugin/language/default_language/images/tnpendphoto.jpg' );
} elseif (strpos($avatar,"gallery/"«»)===false) {
$avatar_img = "images/comprofiler/tn".$avatar;
} else {
$avatar_img = sefRelToAbs( 'images/comprofiler/' .$avatar );
}
if($ueConfig==1) {
$database->setQuery("SELECT COUNT(*) FROM #__session WHERE userid =".$user->id);
$isonline = $database->loadResult();
$online_status = '';
if ($isonline > 0) {
$online_status = 'Online';
} else {
$online_status = 'Offline';
}
}
//Date Functions
if ($user->lastupdatedate == '0000-00-00 00:00:00') {
$user->lastupdatedate = 'Never';
} else {
$user->lastupdatedate = cbFormatDate($user->lastupdatedate);
}
$user->registerDate = cbFormatDate($user->registerDate);
$user->lastvisitDate = cbFormatDate($user->lastvisitDate);
?>
<table cellpadding="0" cellspacing="0" border="0" width="540">
<tr>
<td>
<div style="float:left; width:150px; height:209px; margin: 0 10px 5px 10px; text-align:center;"><img src="<?php echo $avatar_img; ?>" title="Your Avatar" alt="Your Avatar" /></div>
<div style="float:right; width:103px; margin: 0 10px 0 10px;">
<a href="<?php echo sefRelToAbs( 'index.php?option=com_comprofiler&task=usersList' ); ?>" title="The Community">
</a>
</div>
<p><?php echo $user->username; ?>'s Profile</p>
<p><strong>Hits:</strong> <?php echo $user->hits; ?><br/>
<strong>Online Status:</strong> <?php echo $online_status; ?><br/>
<strong>Member Since:</strong> <?php echo $user->registerDate; ?><br/>
<strong>Last Online:</strong> <?php echo $user->lastvisitDate; ?><br/>
<strong>Last Updated:</strong> <?php echo $user->lastupdatedate; ?><br/>
<br/><?php echo $userViewTabs["cb_head"]; ?></p>
</td>
</tr>
<tr>
<td><br/>
<?php echo $userViewTabs["cb_tabmain"]; ?><br/>
<?php echo $userViewTabs["cb_underall"]; ?><br/>
<?php echo $userViewTabs["cb_middle"]; ?>
</td>
</tr>
</table>
[/code:1]
What this does is allow you to modify xtdUserProfile to look however you want more easily (at least for me).
There may be some errors in there.
Chuck
Of course I make no warranties, etc al.