Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


Chucks Extended Profile
Date: 2006/12/01 17:06 By: chucktrukk Status: User  
Karma: 11  
Junior Joomlapolitan

Posts: 31
graphgraph
This has not been tested on 1.02 yet

I have created a new function for an extended userProfile. It made it more easy for me to make the profile look anyway I wish.

What it does:
It loads all of the users information into variables such as
- $user->registerDate
- $user->hits

and allows you to place tabs wherever you want such as
- $userViewTabs["cb_tabmain"];
- $userViewTabs["cb_middle"];

How to use it:

  1. Create a backup copy of comprofiler.php

  2. Create a backup copy of comprofiler.html.php

  3. In comprofiler.php, replace HTML_comprofiler::userProfile with:
    Code:

     HTML_comprofiler::xtdUserProfile$user$option$submitvalue$my);



  4. Add a new function in comprofiler.html.php called xtdUserProfile (after or before function userProfile. Paste the following code)
    Code:

     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 != || ($user->block == && $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->setPageTitleunHtmlspecialchars(getNameFormat($user->name,$user->username,$ueConfig['name_format'])));             }             if ( method_exists($mainframe,"appendPathWay")) {                 $mainframe->appendPathWaygetNameFormat($user->name,$user->username,$ueConfig['name_format']));             }             $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'])) $tab = urldecode($_GET['tab']);             elseif (isset($_POST['tab'])) $tab = $_POST['tab'];             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));         } }



  5. Create a folder components/com_comprofiler/xtd_views

  6. Create a file in that folder called xtdUserProfile.php

  7. Paste this code in xtdUserProfile.php
    Code:

     <?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['allow_onlinestatus']==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); ?> <!-- Begin xtdUserProfile Template --> <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> <!-- End xtdUserProfile Template -->


  8. Lastly, edit the HTML that follows '<!-- Begin xtdUserProfile Template -->



Note 1: You may or may not want to use want to use the Dateformat, avatar, and online status code in xtdUserProfile.php. You can remove this if you would like.

Chuck

PS - I make no warranties and am not held liable with anything this code does for or against you. It is released as GNU GPL.
Click here to see the profile of this user The administrator has disabled public write access.


      Topics Author Date
    thread link
Chucks Extended Profile
chucktrukk 2006/12/01 17:06
    thread link
thread linkthread link Re:Chucks Extended Profile
chucktrukk 2006/12/01 17:33
    thread link
thread linkthread linkthread link Re:Chucks Extended Profile
radio 2006/12/03 22:42
    thread link
thread linkthread linkthread linkthread link Re:Chucks Extended Profile
chucktrukk 2006/12/04 19:01
    thread link
thread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
radio 2006/12/04 21:04
    thread link
thread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
chucktrukk 2006/12/04 22:46
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
radio 2006/12/04 23:54
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
chucktrukk 2006/12/05 07:13
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
radio 2006/12/05 17:55
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
tony 2006/12/06 19:33
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
radio 2006/12/06 19:53
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
tony 2006/12/06 21:37
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
tony 2006/12/06 22:24
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
Roland 2006/12/06 22:41
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
guilliam 2006/12/07 04:29
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
radio 2006/12/07 15:57
    thread link
thread linkthread linkthread linkthread link Re:Chucks Extended Profile
Crunkedout 2008/11/02 06:47
    thread link
thread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
chucktrukk 2008/11/18 14:32
    thread link
thread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
Crunkedout 2008/11/18 18:14
    thread link
thread linkthread linkthread link Re:Chucks Extended Profile
gypsydogg 2006/12/09 04:48
    thread link
thread linkthread linkthread link Re:Chucks Extended Profile
mossimo 2007/01/05 22:24
    thread link
thread linkthread linkthread linkthread link Re:Chucks Extended Profile
cypux 2007/07/09 09:18
    thread link
thread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
chucktrukk 2007/07/12 09:32
    thread link
thread linkthread link Re:Chucks Extended Profile
nickwild 2006/12/08 15:07
    thread link
thread linkthread linkthread link Re:Using different tabs
chucktrukk 2006/12/08 17:03
    thread link
thread linkthread linkthread linkthread link Re:Finding out the available fields
chucktrukk 2006/12/08 17:08
    thread link
thread linkthread linkthread linkthread linkthread link Re:Finding out the available fields
radio 2006/12/09 04:32
    thread link
thread linkthread link Re:Chucks Extended Profile
nickwild 2006/12/09 10:32
    thread link
thread linkthread linkthread link Re:Chucks Extended Profile
chucktrukk 2006/12/09 18:46
    thread link
thread linkthread linkthread linkthread link Re:Chucks Extended Profile
beat 2006/12/10 18:36
    thread link
thread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
radio 2006/12/11 04:02
    thread link
thread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
chucktrukk 2006/12/11 16:28
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
lynnbee 2006/12/12 00:13
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
chucktrukk 2006/12/12 05:58
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Chucks Extended Profile
lynnbee 2006/12/12 15:09
    thread link
thread linkthread link can u help me..
tokmoh 2006/12/13 19:55
    thread link
thread linkthread linkthread link Re:can u help me..
parth 2006/12/14 05:12
    thread link
thread linkthread linkthread linkthread link Re:can u help me..
chucktrukk 2006/12/14 07:06
    thread link
thread linkthread linkthread linkthread linkthread link Re:can u help me..
parth 2006/12/14 15:29
    thread link
thread linkthread linkthread linkthread linkthread linkthread link Using $my-&gt;id
parth 2006/12/14 19:58
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Using $my-&gt;id
parth 2006/12/15 08:46
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Using $my-&gt;id
chucktrukk 2006/12/16 07:31
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Using $my-&gt;id
parth 2006/12/19 12:28
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Solved
parth 2006/12/22 04:22
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Solved
lynnbee 2006/12/22 04:30
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Solved
parth 2006/12/22 04:34
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Solved
radio 2006/12/24 04:04
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Solved
radio 2006/12/25 02:43
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:Solved
<