Photos on administration>dashboard

Hi, i think most of you would like to have the photos situation on the dashborad on the administration...

I mean like on D6.1.6 you can easly view all the photos or the unapproved photos from the dashborad page, not from the photos modules..

This is what i do :

open the file inc>classes>BxDolAdminDashborad.php

after this function :

function getUsersBlock() {

global $oAdmTemplate, $MySQL, $site;

$iUsersCountAll = (int)$MySQL->getOne("SELECT COUNT(`ID`) FROM `Profiles` WHERE 1");

$iUsersCountUnapproved = (int)$MySQL->getOne("SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status`<>'Active'");

return array(

'icon' => $oAdmTemplate->getIconUrl('dashboard_users.png'),

'title' => '<a href="' . $site['url_admin'] . 'profiles.php">' . _t('_adm_txt_dashboard_users') . '</a>',

'url' => '',

'content' => $oAdmTemplate->parseHtmlByName('dashboard_content.html', array(

'cell_11' => '<a href="' . $site['url_admin'] . 'profiles.php?type=all">' . _t('_adm_txt_dashboard_users_all') . '</a> (' . $iUsersCountAll . ')',

'cell_12' => '',

'cell_21' => '<a href="' . $site['url_admin'] . 'profiles.php?type=unapproved">' . _t('_adm_txt_dashboard_users_unapproved') . '</a> (' . $iUsersCountUnapproved . ')',

'cell_22' => ''

))

);

}

add this :

function getPhotosBlock() {

global $oAdmTemplate, $MySQL, $site;

$iUsersCountAll = (int)$MySQL->getOne("SELECT COUNT(`ID`) FROM `bx_photos_main` WHERE 1");

$iUsersCountUnapproved = (int)$MySQL->getOne("SELECT COUNT(`ID`) FROM `bx_photos_main` WHERE `Status`<>'approved'");

return array(

'icon' => $oAdmTemplate->getIconUrl('dashboard_phs.png'),

'title' => '<a href="' . $site['url_admin'] . 'profiles.php">' . _t('_adm_txt_dashboard_photos') . '</a>',

'url' => '',

'content' => $oAdmTemplate->parseHtmlByName('dashboard_content.html', array(

'cell_11' => '<a href="' . BX_DOL_URL_ROOT . 'modules/?r=photos/administration">' . _t('_adm_txt_dashboard_photos_all') . '</a> (' . $iUsersCountAll . ')',

'cell_12' => '',

'cell_21' => '<a href="' . BX_DOL_URL_ROOT . 'modules/?r=photos/administration">' . _t('_adm_txt_dashboard_photos_unapproved') . '</a> (' . $iUsersCountUnapproved . ')',

'cell_22' => ''

))

);

}

Go to setting>language and add this 3 new Key :

key 1 :  _adm_txt_dashboard_photos     string : Photos

key2 :  _adm_txt_dashboard_photos_all  string : All Photos

key 3 :  _adm_txt_dashboard_photos_unapproved   string : Unapproved Photos

After that go to your database at the table : sys_admin_dashboard

insert a new line :

ID 11

Name : sys_photos

Content : return BxDolAdminDashboard::getPhotosBlock();

Column : 1

Order : 6

That it ! The only thing if you want add an icon you must to named : dashboard_phs.png  and added it to :  administration>templates>css>images>icons

Now, it work at 99% . My only problem is the link for see the unapproved photos, that i don't know how to do...

The link for the All photos is :  'cell_11' => '<a href="' . BX_DOL_URL_ROOT . 'modules/?r=photos/administration">' . _t('_adm_txt_dashboard_photos_all') . '</a> (' . $iUsersCountAll . ')',

But i don't know  for the Unapproved.

After that you can easly modifid this function also for the Video or music...

I hope can be usefull...

...
Quote · 1 Feb 2010

No body can help me to get worked it at 100% ?

Thank you...

...
Quote · 2 Feb 2010

do as you could put the module activity on the dashboard of the members?

Quote · 22 Feb 2010

great job stedracu, thank you, we extend your idea :)

Quote · 23 Feb 2010

Here we are:

Feedback dashboard block

1. open the file inc>classes>BxDolAdminDashboard.php

2. find function getUsersBlock

3. after last bracket insert:

/* feedback block by denast - start */

function getFeedbackBlock() {
global $oAdmTemplate, $MySQL, $site;
$iFdbCountAll = (int)$MySQL->getOne("SELECT COUNT(`id`) FROM `bx_fdb_entries` WHERE 1");
$iFdbCountApproved = (int)$MySQL->getOne("SELECT COUNT(`id`) FROM `bx_fdb_entries` WHERE `Status`<>'1'");
$iFdbCountUnapproved = (int)$MySQL->getOne("SELECT COUNT(`id`) FROM `bx_fdb_entries` WHERE `Status`<>'0'");

return array(
'icon' => $oAdmTemplate->getIconUrl('dashboard_fdb.png'),
'title' => '<a href="' . BX_DOL_URL_ROOT . 'modules/?r=feedback/admin/">' . _t('_feedback_bcaption_view_admin') . '</a> (' . $iFdbCountAll . ')',
'url' => '',
'content' => $oAdmTemplate->parseHtmlByName('dashboard_content.html', array(
'cell_11' => '<a href="' . BX_DOL_URL_ROOT . 'modules/?r=feedback/admin/">' . _t('_feedback_dshb_approved') . '</a> (' . $iFdbCountApproved . ')',
'cell_12' => '',
'cell_21' => '<a href="' . BX_DOL_URL_ROOT . 'modules/?r=feedback/admin/">' . _t('_feedback_dshb_unapproved') . '</a> (' . $iFdbCountUnapproved . ')',
'cell_22' => ''
))
);
}

/* feedback block by denast - end */

4. open your PhpMyAdmin Database and SQL Insert:

INSERT INTO `sys_admin_dashboard` (
`id` ,
`name` ,
`content` ,
`column` ,
`order`
)
VALUES (
'11', 'sys_feedback', 'return BxDolAdminDashboard::getFeedbackBlock();', '2', '6'
);

5. make two (2) new language keys:

_feedback_dshb_approved
_feedback_dshb_unapproved

6. Take a can of beer from your fridge.

7. drink it.

8. forgot: icon of your choice with a name dashboard_fdb.png in administration>templates>css>images>icons

for example


-------------------------

that's all folks. thanks stedracu

mod is prepared in colaboration with sweety050

Quote · 23 Feb 2010

great job stedracu, thank you, we extend your idea :)

Thank you, I am happy to contribute even I sometimes.....

And you too made a good job, i don't think at the feedback...

...
Quote · 23 Feb 2010

Does this work for 7.0.2? I tried and I get the following error: Fatal error: Call to undefined method BxDolAdminDashboard::getPhotosBlock() in /home/sheave/public_html/beta/inc/classes/BxDolAdminDashboard.php(60) : eval()'d code on line 1

Quote · 4 Oct 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.