|
|
|
Need help about little coding...
|
|
Date: 2007/05/31 21:24
|
By: Cano
|
Status: User
|
|
|
Karma: 1  
|
|
Fresh Joomlapolitan  | Posts: 12 |   | |
|
Hi everyone.
I would like to show a number points on the profilpage of the member.
So, i have added "points" field in the joomla_comprofiler table. Then, i have opened cb.menu.php file, And after this :
| Code: | //------------------- User Status items for User Status Window:
// Hits
if ($params->get('hits', '1')==1) {
$mi = array(); $mi["_UE_MENU_STATUS"]["_UE_HITS"]["_UE_HITS"]=null;
$this->menuList->addObjectItem($mi, $user->hits,"", "",
"","", _UE_HITS_DESC,"");
}
// Point system by Cano
$mi = array(); $mi["_UE_MENU_STATUS"]["_UE_POINTS"]["_UE_POINTS"]=null;
$this->menuList->addObjectItem($mi, $user->points,"", "",
"","", _UE_POINTS_DESC,"");
// Online Status
if($ueConfig['allow_onlinestatus']==1 && $params->get('online', '1')==1) {
$database->setQuery("SELECT COUNT(*) FROM #__session WHERE userid =". (int) $user->id);
$isonline = $database->loadResult();
$mi = array(); $mi["_UE_MENU_STATUS"]["_UE_ONLINESTATUS"]["_UE_ONLINESTATUS"]=null;
$this->menuList->addObjectItem($mi, ($isonline > 0) ? _UE_ISONLINE : _UE_ISOFFLINE,"", "",
"","", _UE_ONLINESTATUS_DESC,"");
}
|
I have added that :
| Code: | // Try to show a table data
$mi = array(); $mi["_UE_MENU_STATUS"]["_UE_POINTS"]["_UE_POINTS"]=null;
$this->menuList->addObjectItem($mi, $user->points,"", "",
"","", _UE_POINTS_DESC,"");
|
But it doesn't work really...
Look yourself http://img502.imageshack.us/my.php?image=bugxv0.jpg
Whereas i have change the value of points to 5 in phpmyadmin tool.
The value is already 0!
What's the problem ?
thx
Post edited by: Cano, at: 2007/05/31 21:25
|
|
The administrator has disabled public write access. |
|
|
|
|
Re:Need help about little coding...
|
|
Date: 2007/06/01 19:06
|
By: Cano
|
Status: User
|
|
|
Karma: 1  
|
|
Fresh Joomlapolitan  | Posts: 12 |   | |
|
Finaly i've resolved the problem myself.
The code where :
| Code: |
// Point system by Cano
{
$database->setQuery("SELECT points FROM #__comprofiler WHERE id =". (int) $user->id);
$varpoints = $database->loadResult();
$mi = array(); $mi["_UE_MENU_STATUS"]["_UE_POINTS"]["_UE_POINTS"]=null;
$this->menuList->addObjectItem($mi, $varpoints,"", "","","", _UE_POINTS_DESC,"");
}
|
|
|
The administrator has disabled public write access. |
|
|
|
|
Re:Need help about little coding...
|
|
Date: 2008/09/02 23:33
|
By: vilo
|
Status:
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 13 |   | |
|
I was looking for some help and I was really happy to find your post on using:
$this->menuList->addObjectItem
I copied your code into plugin I am working on, adjusted it to my situation in hope it will allow me to add element to the status area of Profile page. However I've got error message instead which says:
Fatal error: Call to a member function addObjectItem() on a non-object in /Applications/MAMP/htdocs/www/traderhood/components/com_comprofiler/plugin/user/plug_cbgendertab/
myplugin.php on line 63
That is basically saying it could not find function addObjectItem() I am trying to use.
Only place I found that function to be present is in the cb.menu.php.
My question to you is how did you made that function available to your plugin? Did you do some include of cb.menu.php in your plugin, or you copied it from cb.menu.php and recreated it in your plugin or something else entirely.
I am pulling my hair here for quite a while trying to figure out how to change values of existing tabs. Any help would be much appreciated.
|
|
The administrator has disabled public write access. |
|
|