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...