Your phpBB Type: Standard phpBB3
MODs installed: Yes
Your knowledge: Basic Knowledge
What have you done before the problem was there?
What have you already tryed to solve the problem?
Description and Message
All greetings.
How to do would be to block User Menu be read new photos (number)? As New messages (0).
I should Board3 1.0.4 and phpBB Gallery 1.0.4.
Here's the code:
Code: Select all
//
// + new photo since last visit & you photo number
//
if ($user->data['is_registered'])
{
$ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true))));
if ($auth->acl_get('m_approve'))
{
$m_approve_fid_ary = array(-1);
$m_approve_fid_sql = '';
}
else if ($auth->acl_getf_global('m_approve'))
{
$m_approve_fid_ary = array_diff(array_keys($auth->acl_getf('!m_approve', true)), $ex_fid_ary);
$m_approve_fid_sql = ' AND (p.post_approved = 1' . ((sizeof($m_approve_fid_ary)) ? ' OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) : '') . ')';
}
else
{
$m_approve_fid_ary = array();
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
$sql = 'SELECT COUNT(distinct t.image_id) as total
FROM phpbb_gallery_images t
WHERE t.image_time > ' . $user->data['user_lastvisit'] . '
AND t.topic_moved_id = 0
' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.image_id', $ex_fid_ary, true) : '');
$result = $db->sql_query($sql);
$new_photo_count = (int) $db->sql_fetchfield('total');
// your photo number
$sql = "SELECT user_images
FROM phpbb_gallery_users
WHERE user_id = " . $user->data['user_id'];
$result = $db->sql_query($sql);
$you_photo_count = (int) $db->sql_fetchfield('user_images');
}
//
// - new photo since last visit & you photo number
//