return $perms & $obj->group_cache_opt;
}
function make_perms_query(&$fields, &$join, $fid = '')
{
    if (!$fid) {
        $fid = 'f.id';
    }
    if (_uid) {
        $join = ' INNER JOIN phpgw_fud_group_cache g1 ON g1.user_id=2147483647 AND g1.resource_id=' . $fid . ' LEFT JOIN phpgw_fud_group_cache g2 ON g2.user_id=' . _uid . ' AND g2.resource_id=' . $fid . ' ';
        $fields = ' (CASE WHEN g2.id IS NOT NULL THEN g2.group_cache_opt ELSE g1.group_cache_opt END) AS group_cache_opt ';
    } else {
        $join = ' INNER JOIN phpgw_fud_group_cache g1 ON g1.user_id=0 AND g1.resource_id=' . $fid . ' ';
        $fields = ' g1.group_cache_opt ';
    }
}
ses_update_status($usr->sid, 'Legge il forum <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=thread&frm_id=' . $frm->id . '">' . $frm->name . '</a>', $frm_id);
$announcements = '';
if ($frm->is_ann) {
    $today = gmdate('Ymd', __request_timestamp__);
    $res = uq('SELECT a.subject, a.text FROM phpgw_fud_announce a INNER JOIN phpgw_fud_ann_forums af ON a.id=af.ann_id AND af.forum_id=' . $frm->id . ' WHERE a.date_started<=' . $today . ' AND a.date_ended>=' . $today);
    while ($r = db_rowarr($res)) {
        $announcements .= '<tr><td class="AnnText" colspan="' . $ann_cols . '"><font class="AnnSubjText">' . $r[0] . '</font><br />' . $r[1] . '</td></tr>';
    }
}
function tmpl_create_forum_select($frm_id, $mod)
{
    $prev_cat_id = 0;
    $selection_options = '';
    if (!isset($_GET['t']) || $_GET['t'] != 'thread' && $_GET['t'] != 'threadt') {
        $dest = t_thread_view;
    } else {
    invl_inp_err();
}
$m = db_sab('SELECT
		p.*,
		u.id AS user_id, u.alias, u.users_opt, u.avatar_loc, u.email, u.posted_msg_count, u.join_date,
		u.location, u.sig, u.icq, u.aim, u.msnm, u.yahoo, u.jabber, u.affero, u.custom_status, u.last_visit,
		l.name AS level_name, l.level_opt, l.img AS level_img
	FROM
		phpgw_fud_pmsg p
		INNER JOIN phpgw_fud_users u ON p.ouser_id=u.id
		LEFT JOIN phpgw_fud_level l ON u.level_id=l.id
	WHERE p.duser_id=' . _uid . ' AND p.id=' . $id);
if (!$m) {
    invl_inp_err();
}
ses_update_status($usr->sid, 'Legge/Scrive i messagi personali');
$cur_ppage = tmpl_cur_ppage($m->fldr, $folders, $m->subject);
/* Next Msg */
if ($nid = q_singleval('SELECT p.id FROM phpgw_fud_pmsg p INNER JOIN phpgw_fud_users u ON u.id=p.ouser_id WHERE p.duser_id=' . _uid . ' AND p.fldr=' . $m->fldr . ' AND post_stamp>' . $m->post_stamp . ' ORDER BY p.post_stamp ASC LIMIT 1')) {
    $dpmsg_next_message = '<a href="/egroupware/fudforum/3814588639/index.php?t=pmsg_view&amp;' . _rsid . '&amp;id=' . $nid . '" class="GenLink">Messaggio successivo <img src="/egroupware/fudforum/3814588639/theme/italian/images/goto.gif" alt="" /></a>';
} else {
    $dpmsg_next_message = '';
}
/* Prev Msg */
if ($pid = q_singleval('SELECT p.id FROM phpgw_fud_pmsg p INNER JOIN phpgw_fud_users u ON u.id=p.ouser_id WHERE p.duser_id=' . _uid . ' AND p.fldr=' . $m->fldr . ' AND p.post_stamp<' . $m->post_stamp . ' ORDER BY p.post_stamp DESC LIMIT 1')) {
    $dpmsg_prev_message = '<a href="/egroupware/fudforum/3814588639/index.php?t=pmsg_view&amp;' . _rsid . '&amp;id=' . $pid . '" class="GenLink"><img src="/egroupware/fudforum/3814588639/theme/italian/images/goback.gif" alt="" /> Messaggio precedente</a>';
} else {
    $dpmsg_prev_message = '';
}
$private_message_entry = tmpl_drawpmsg($m, $usr, false);
if (!$m->read_stamp && $m->pmsg_opt & 16) {
$custom_tags = $u->custom_status ? '' . $u->custom_status . '<br />' : '';
if (!($usr->users_opt & 1048576)) {
    $frm_perms = get_all_read_perms(_uid, $usr->users_opt & 524288);
}
$moderation = '';
if ($u->users_opt & 524288) {
    $c = uq('SELECT f.id, f.name FROM phpgw_fud_mod mm INNER JOIN phpgw_fud_forum f ON mm.forum_id=f.id INNER JOIN phpgw_fud_cat c ON f.cat_id=c.id WHERE ' . ($usr->users_opt & 1048576 ? '' : 'f.id IN(' . implode(',', array_keys($frm_perms)) . ') AND ') . 'mm.user_id=' . $u->id);
    while ($r = db_rowarr($c)) {
        $moderation .= '<a href="/egroupware/fudforum/3814588639/index.php?t=' . t_thread_view . '&amp;frm_id=' . $r[0] . '&amp;' . _rsid . '" class="GenLink">' . htmlspecialchars($r[1]) . '</a>&nbsp;';
    }
    if ($moderation) {
        $moderation = 'Moderatore di:&nbsp;' . $moderation;
    }
}
$TITLE_EXTRA = ': Informazioni utente ' . $user_info;
ses_update_status($usr->sid, 'Guarda il profilo di <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=usrinfo&id=' . $u->id . '">' . $user_info . '</a>');
$status = !empty($level_name) || !empty($moderation) || !empty($level_image) || !empty($custom_tags) ? '<tr class="' . alt_var('search_alt', 'RowStyleA', 'RowStyleB') . '"><td nowrap valign="top" class="GenText">Status:</td><td class="GenText">
<font class="LevelText">
' . $level_name . '
' . $level_image . '
' . $custom_tags . '
</font>
' . $moderation . '
</td></tr>' : '';
$avg = sprintf('%.2f', $u->posted_msg_count / ((__request_timestamp__ - $u->join_date) / 86400));
if ($avg > $u->posted_msg_count) {
    $avg = $u->posted_msg_count;
}
$last_post = '';
if ($u->u_last_post_id) {
    $r = db_saq('SELECT m.subject, m.id, m.post_stamp, t.forum_id FROM phpgw_fud_msg m INNER JOIN phpgw_fud_thread t ON m.thread_id=t.id WHERE m.id=' . $u->u_last_post_id);
    if (!empty($usr->ignore_list)) {
        $usr->ignore_list = @unserialize($usr->ignore_list);
    }
    if (($ignore_id = q_singleval('SELECT id FROM phpgw_fud_users WHERE id=' . $_GET['add'] . ' AND (users_opt & 1048576)=0')) && !isset($usr->ignore_list[$ignore_id])) {
        ignore_add(_uid, $ignore_id);
    }
    check_return($usr->returnto);
}
if (isset($_GET['del']) && ($_GET['del'] = (int) $_GET['del'])) {
    ignore_delete(_uid, $_GET['del']);
    /* needed for external links to this form */
    if (isset($_GET['redr'])) {
        check_return($usr->returnto);
    }
}
ses_update_status($usr->sid, 'Browsing own ignore list');
$ignore_member_search = $FUD_OPT_1 & (8388608 | 4194304) ? '<br>Or use the <a href="javascript://" class="GenLink" onClick="javascript: window_open(\'/egroupware/fudforum/3814588639/index.php?t=pmuserloc&amp;' . _rsid . '&amp;js_redr=buddy_add.add_login&amp;overwrite=1\', \'user_list\', 250,250);">Find User</a> feature to find a person.' : '';
$tabs = '';
if (_uid) {
    $tablist = array('Settings' => 'register', 'Subscriptions' => 'subscribed', 'Referrals' => 'referals', 'Buddy List' => 'buddy_list', 'Ignore List' => 'ignore_list');
    if (isset($_POST['mod_id'])) {
        $mod_id_chk = $_POST['mod_id'];
    } else {
        if (isset($_GET['mod_id'])) {
            $mod_id_chk = $_GET['mod_id'];
        } else {
            $mod_id_chk = null;
        }
    }
    if (!$mod_id_chk) {
        if ($FUD_OPT_1 & 1024) {
        }
        char_fix($reg_bio);
        char_fix($reg_sig);
        $b_year = $_POST['b_year'];
        $b_month = $_POST['b_month'];
        $b_day = $_POST['b_day'];
        if (isset($_POST['avatar_type'])) {
            $avatar_type = $_POST['avatar_type'];
        }
    }
}
if (empty($reg_time_zone)) {
    $reg_time_zone = $SERVER_TZ;
}
if (!$mod_id) {
    ses_update_status($usr->sid, 'Guarda il suo profilo', 0, 0);
}
$TITLE_EXTRA = ': Pagina di registrazione';
$tabs = '';
if (_uid) {
    $tablist = array('Impostazioni' => 'register', 'Iscrizioni' => 'subscribed', 'Referrals' => 'referals', 'Buddy List' => 'buddy_list', 'Ignore List' => 'ignore_list');
    if (isset($_POST['mod_id'])) {
        $mod_id_chk = $_POST['mod_id'];
    } else {
        if (isset($_GET['mod_id'])) {
            $mod_id_chk = $_GET['mod_id'];
        } else {
            $mod_id_chk = null;
        }
    }
    if (!$mod_id_chk) {
$custom_tags = $u->custom_status ? '' . $u->custom_status . '<br />' : '';
if (!($usr->users_opt & 1048576)) {
    $frm_perms = get_all_read_perms(_uid, $usr->users_opt & 524288);
}
$moderation = '';
if ($u->users_opt & 524288) {
    $c = uq('SELECT f.id, f.name FROM phpgw_fud_mod mm INNER JOIN phpgw_fud_forum f ON mm.forum_id=f.id INNER JOIN phpgw_fud_cat c ON f.cat_id=c.id WHERE ' . ($usr->users_opt & 1048576 ? '' : 'f.id IN(' . implode(',', array_keys($frm_perms)) . ') AND ') . 'mm.user_id=' . $u->id);
    while ($r = db_rowarr($c)) {
        $moderation .= '<a href="/egroupware/fudforum/3814588639/index.php?t=' . t_thread_view . '&amp;frm_id=' . $r[0] . '&amp;' . _rsid . '" class="GenLink">' . htmlspecialchars($r[1]) . '</a>&nbsp;';
    }
    if ($moderation) {
        $moderation = 'Moderator of:&nbsp;' . $moderation;
    }
}
$TITLE_EXTRA = ': User Information ' . $u->alias;
ses_update_status($usr->sid, 'Looking at <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=usrinfo&amp;id=' . $u->id . '">' . $u->alias . '&#39;s</a> profile');
$status = !empty($level_name) || !empty($moderation) || !empty($level_image) || !empty($custom_tags) ? '<tr class="' . alt_var('search_alt', 'RowStyleA', 'RowStyleB') . '"><td nowrap valign="top" class="GenText">Status:</td><td class="GenText">
<font class="LevelText">
' . $level_name . '
' . $level_image . '
' . $custom_tags . '
</font>
' . $moderation . '
</td></tr>' : '';
$avg = sprintf('%.2f', $u->posted_msg_count / ((__request_timestamp__ - $u->join_date) / 86400));
if ($avg > $u->posted_msg_count) {
    $avg = $u->posted_msg_count;
}
$last_post = '';
if ($u->u_last_post_id) {
    $r = db_saq('SELECT m.subject, m.id, m.post_stamp, t.forum_id FROM phpgw_fud_msg m INNER JOIN phpgw_fud_thread t ON m.thread_id=t.id WHERE m.id=' . $u->u_last_post_id);
    $a = $_GET;
    unset($a['rid'], $a['S'], $a['t']);
    if (isset($a[$var])) {
        unset($a[$var]);
        $rm = 1;
    }
    $url = '/sel';
    foreach ($a as $k => $v) {
        $url .= '/' . $k . '/' . $v;
    }
    if (!isset($rm)) {
        $url .= '/' . $var . '/' . $val;
    }
    return $url . '/' . _rsid;
}
ses_update_status($usr->sid, 'Sfoglia <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=selmsg&date=today&rid=' . $usr->id . '">Messaggi odierni</a>');
$count = $usr->posts_ppg ? $usr->posts_ppg : $POSTS_PER_PAGE;
if (!isset($_GET['start']) || !($start = (int) $_GET['start'])) {
    $start = 0;
}
/* limited to today */
if (isset($_GET['date'])) {
    if ($_GET['date'] != 'today') {
        $tm = __request_timestamp__ - ((int) $_GET['date'] - 1) * 86400;
    } else {
        $tm = __request_timestamp__;
    }
    list($day, $month, $year) = explode(' ', strftime('%d %m %Y', $tm));
    $tm_today_start = mktime(0, 0, 0, $month, $day, $year);
    $tm_today_end = $tm_today_start + 86400;
    $date_limit = ' AND m.post_stamp>' . $tm_today_start . ' AND m.post_stamp<' . $tm_today_end . ' ';
    /* remove stuff in quotes */
    while (($p = strpos($body, '<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1"><tr><td class="SmallText"><b>')) !== false) {
        $e = strpos($body, '<br></td></tr></table>', $p) + strlen('<br></td></tr></table>');
        $body = substr($body, 0, $p) . substr($body, $e);
    }
    $body = strip_tags($body);
    if (strlen($body) > $GLOBALS['MNAV_MAX_LEN']) {
        $body = substr($body, 0, $GLOBALS['MNAV_MAX_LEN']) . '...';
    }
    return $body;
}
$search_options = tmpl_draw_radio_opt('field', "all\nsubject", "Messaggio completo\nSolo oggetto", $field, '', '', '&nbsp;&nbsp;');
$logic_options = tmpl_draw_select_opt("AND\nOR", "AND\nOR", $search_logic, '', '');
$sort_options = tmpl_draw_select_opt("DESC\nASC", "ordine decrescente\nordine crescente", $sort_order, '', '');
$TITLE_EXTRA = ': Ricerca ' . htmlspecialchars($srch);
ses_update_status($usr->sid, 'Cerca nei topic');
$page_pager = '';
if ($srch) {
    if (!($c =& fetch_search_cache($srch, $start, $ppg, $search_logic, $field, $sort_order, $forum_limiter, $total))) {
        $search_data = '<br />
<table border="0" cellspacing="1" cellpadding="2" class="ContentTable">
<tr class="RowStyleA"><th colspan=2 width="100%" align="center">Nessun risultato</th></tr>
</table>';
    } else {
        $i = 0;
        $search_data = '';
        while ($r = db_rowobj($c)) {
            $body = trim_body(read_msg_body($r->foff, $r->length, $r->file_id));
            $poster_info = !empty($r->poster_id) ? '<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=usrinfo&amp;id=' . $r->poster_id . '&amp;' . _rsid . '">' . $r->alias . '</a>' : '' . $GLOBALS['ANON_NICK'];
            ++$i;
            $search_data .= '<tr class="' . alt_var('search_alt', 'RowStyleA', 'RowStyleB') . '"><td class="GenText" width="100%">' . $i . '. <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=' . d_thread_view . '&amp;goto=' . $r->id . '&amp;' . _rsid . '">' . $r->subject . '</a><br />' . $body . '</td><td class="GenText" nowrap><a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=' . t_thread_view . '&amp;frm_id=' . $r->forum_id . '&amp;' . _rsid . '">' . $r->forum_name . '</a></td><td class="GenText" nowrap><font class="DateText">' . strftime("%a, %d %B %Y %H:%M", $r->post_stamp) . '</font> Da: ' . $poster_info . '</td></tr>';
Example #9
0
}
function trim_body($body)
{
    /* remove stuff in quotes */
    while (($p = strpos($body, '<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1"><tr><td class="SmallText"><b>')) !== false) {
        $e = strpos($body, '<br></td></tr></table>', $p) + strlen('<br></td></tr></table>');
        $body = substr($body, 0, $p) . substr($body, $e);
    }
    $body = strip_tags($body);
    if (strlen($body) > $GLOBALS['MNAV_MAX_LEN']) {
        $body = substr($body, 0, $GLOBALS['MNAV_MAX_LEN']) . '...';
    }
    return $body;
}
$TITLE_EXTRA = ': Message Navigator';
ses_update_status($usr->sid, 'Browsing Messages using <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=mnav">Message Navigator</a>');
if ($forum_limiter) {
    if ($forum_limiter[0] != 'c') {
        $qry_lmt = ' AND f.id=' . (int) $forum_limiter . ' ';
    } else {
        $qry_lmt = ' AND c.id=' . (int) substr($forum_limiter, 1) . ' ';
    }
} else {
    $qry_lmt = '';
}
$mnav_time_unit = tmpl_draw_select_opt("60\n3600\n86400\n604800\n2635200", "Minute(s)\nHour(s)\nDay(s)\nWeek(s)\nMonth(s)", $unit, '', '');
if (!$rng) {
    $mnav_pager = $rng = '';
    $unit = 86400;
    $mnav_data = '<br />
<div align="center">
            $page_next_url = $arg . '&amp;start=' . $page_start . $suf;
            $page_last_url = $arg . '&amp;start=' . $page_start_2 . $suf;
        } else {
            $page_next_url = $page_last_url = $arg;
            pager_replace($page_next_url, $page_start, $count);
            pager_replace($page_last_url, $page_start_2, $count);
        }
        $page_pager_data .= !$js_pager ? '&nbsp;&nbsp;<a href="' . $page_next_url . '" class="PagerLink">&gt;</a>&nbsp;&nbsp;<a href="' . $page_last_url . '" class="PagerLink">&raquo;</a>' : '&nbsp;&nbsp;<a href="javascript://" onClick="' . $page_next_url . '" class="PagerLink">&gt;</a>&nbsp;&nbsp;<a href="javascript://" onClick="' . $page_last_url . '" class="PagerLink">&raquo;</a>';
    }
    return !$js_pager ? '<font class="SmallText"><b>Pages (' . $ttl_pg . '): 
[' . $page_pager_data . ']
</b></font>' : '<font class="SmallText"><b>Pages (' . $ttl_pg . '): 
[' . $page_pager_data . ']
</b></font>';
}
ses_update_status($usr->sid, '<a href="/egroupware/fudforum/3814588639/index.php?t=polllist">Reviewing Available Polls</a>');
if (!isset($_GET['oby'])) {
    $_GET['oby'] = 'DESC';
}
if (!isset($_GET['start']) || !($start = (int) $_GET['start'])) {
    $start = 0;
}
if (isset($_GET['uid']) && ($uid = (int) $_GET['uid'])) {
    $usr_lmt = ' p.owner=' . $uid . ' AND ';
} else {
    $uid = $usr_lmt = '';
}
if ($_GET['oby'] == 'ASC') {
    $oby = 'ASC';
    $oby_rev_val = 'DESC';
} else {
{
    if (!$fid) {
        $fid = 'f.id';
    }
    if (_uid) {
        $join = ' INNER JOIN phpgw_fud_group_cache g1 ON g1.user_id=2147483647 AND g1.resource_id=' . $fid . ' LEFT JOIN phpgw_fud_group_cache g2 ON g2.user_id=' . _uid . ' AND g2.resource_id=' . $fid . ' ';
        $fields = ' (CASE WHEN g2.id IS NOT NULL THEN g2.group_cache_opt ELSE g1.group_cache_opt END) AS group_cache_opt ';
    } else {
        $join = ' INNER JOIN phpgw_fud_group_cache g1 ON g1.user_id=0 AND g1.resource_id=' . $fid . ' ';
        $fields = ' g1.group_cache_opt ';
    }
}
if (!($FUD_OPT_2 & 512)) {
    error_dialog('Tree view of the topic listing has been disabled.', 'The administrator has disabled the tree view of the topic listing, please use the flat view instead.');
}
ses_update_status($usr->sid, 'Browsing forum (tree view) <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=threadt&amp;frm_id=' . $frm->id . '">' . htmlspecialchars($frm->name) . '</a>', $frm->id);
$announcements = '';
if ($frm->is_ann) {
    $today = gmdate('Ymd', __request_timestamp__);
    $res = uq('SELECT a.subject, a.text FROM phpgw_fud_announce a INNER JOIN phpgw_fud_ann_forums af ON a.id=af.ann_id AND af.forum_id=' . $frm->id . ' WHERE a.date_started<=' . $today . ' AND a.date_ended>=' . $today);
    while ($r = db_rowarr($res)) {
        $announcements .= '<tr><td class="AnnText" colspan="' . $ann_cols . '"><font class="AnnSubjText">' . $r[0] . '</font><br />' . $r[1] . '</td></tr>';
    }
}
function tmpl_create_forum_select($frm_id, $mod)
{
    $prev_cat_id = 0;
    $selection_options = '';
    if (!isset($_GET['t']) || $_GET['t'] != 'thread' && $_GET['t'] != 'threadt') {
        $dest = t_thread_view;
    } else {
function read_msg_body($off, $len, $file_id)
{
    $fp = register_fp($file_id);
    fseek($fp, $off);
    return fread($fp, $len);
}
$adm = $usr->users_opt & 1048576;
if (!$adm && !($FUD_OPT_1 & 8388608) && (!($FUD_OPT_1 & 4194304) || !_uid)) {
    std_error('disabled');
}
if (isset($_GET['js_redr'])) {
    define('plain_form', 1);
    $adm = 0;
}
$TITLE_EXTRA = ': Trova utenti';
ses_update_status($usr->sid, 'Cerca utenti');
if (!isset($_GET['start']) || !($start = (int) $_GET['start'])) {
    $start = 0;
}
$count = $MEMBERS_PER_PAGE;
if (isset($_GET['pc'])) {
    $ord = 'posted_msg_count DESC';
} else {
    if (isset($_GET['us'])) {
        $ord = 'alias';
    } else {
        $ord = 'id DESC';
    }
}
$usr_login = !empty($_GET['usr_login']) ? trim($_GET['usr_login']) : '';
$usr_email = !empty($_GET['usr_email']) ? trim($_GET['usr_email']) : '';
Example #13
0
		m.id=' . $mid . ' AND m.apr=1');
if (!isset($_GET['prevloaded'])) {
    th_inc_view_count($th);
    if (_uid) {
        if ($frm->last_view < $msg_obj->post_stamp) {
            user_register_thread_view($th, $msg_obj->post_stamp, $mid);
        }
        if ($frm->last_forum_view < $msg_obj->post_stamp) {
            user_register_forum_view($frm->forum_id);
        }
    }
    $subscribe_status = $frm->subscribed ? '| <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=tree&amp;th=' . $th . '&amp;notify=' . $usr->id . '&amp;' . _rsid . '&amp;opt=off&amp;mid=' . $mid . '" title="Smetti di ricevere notifiche dei nuovi messaggi in questo topic">Cancella la tua iscrizione dal topic</a>&nbsp;' : '| <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=tree&amp;th=' . $th . '&amp;notify=' . $usr->id . '&amp;' . _rsid . '&amp;opt=on&amp;mid=' . $mid . '" title="Ricevi una notifica di nuovi messaggi all&#39;interno di questo topic">Iscriviti al topic</a>&nbsp;';
} else {
    $subscribe_status = '';
}
ses_update_status($usr->sid, 'Legge il topic (vista ad albero) <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=tree&th=' . $frm->id . '&' . _rsid . '">' . $frm->subject . '</a>', $frm->id);
function tmpl_create_forum_select($frm_id, $mod)
{
    $prev_cat_id = 0;
    $selection_options = '';
    if (!isset($_GET['t']) || $_GET['t'] != 'thread' && $_GET['t'] != 'threadt') {
        $dest = t_thread_view;
    } else {
        $dest = $_GET['t'];
    }
    if (!_uid) {
        /* anon user, we can optimize things quite a bit here */
        $c = q('SELECT f.id, f.name, c.name, c.id FROM phpgw_fud_group_cache g INNER JOIN phpgw_fud_fc_view v ON v.f=g.resource_id INNER JOIN phpgw_fud_forum f ON f.id=g.resource_id INNER JOIN phpgw_fud_cat c ON c.id=f.cat_id WHERE g.user_id=0 AND group_cache_opt>=1 AND (group_cache_opt & 1) > 0 ORDER BY v.id');
        while ($r = db_rowarr($c)) {
            if ($prev_cat_id != $r[3]) {
                $prev_cat_id = $r[3];
    if (!empty($usr->buddy_list)) {
        $usr->buddy_list = @unserialize($usr->buddy_list);
    }
    if (($buddy_id = q_singleval('SELECT id FROM phpgw_fud_users WHERE id=' . $_GET['add'])) && !isset($usr->buddy_list[$buddy_id])) {
        buddy_add(_uid, $buddy_id);
    }
    check_return($usr->returnto);
}
if (isset($_GET['del']) && ($_GET['del'] = (int) $_GET['del'])) {
    buddy_delete(_uid, $_GET['del']);
    /* needed for external links to this form */
    if (isset($_GET['redr'])) {
        check_return($usr->returnto);
    }
}
ses_update_status($usr->sid, 'Browsing own buddy list');
if ($FUD_OPT_1 & 8388608 || _uid && $FUD_OPT_1 & 4194304) {
    $buddy_member_search = '<br>Or use the <a href="javascript://" class="GenLink" onClick="javascript: window_open(\'/egroupware/fudforum/3814588639/index.php?t=pmuserloc&amp;' . _rsid . '&amp;js_redr=buddy_add.add_login&amp;overwrite=1\', \'user_list\', 250,250);">Find User</a> feature to find a person.';
} else {
    $buddy_member_search = '';
}
$tabs = '';
if (_uid) {
    $tablist = array('Settings' => 'register', 'Subscriptions' => 'subscribed', 'Referrals' => 'referals', 'Buddy List' => 'buddy_list', 'Ignore List' => 'ignore_list');
    if (isset($_POST['mod_id'])) {
        $mod_id_chk = $_POST['mod_id'];
    } else {
        if (isset($_GET['mod_id'])) {
            $mod_id_chk = $_GET['mod_id'];
        } else {
            $mod_id_chk = null;
if (_uid === '_uid') {
    exit('sorry, you can not access this page');
}
$section = isset($_GET['section']) ? $_GET['section'] : '';
switch ($section) {
    case 'usermaintance':
    case 'boardusage':
    case 'readingposting':
        $file = '/web/htdocs/www.milanin.com/home/egroupware/fudforum/3814588639/theme/italian/help/' . $section . '.hlp';
        $return_top = '<div align="center" class="GenText">[ <a href="/egroupware/fudforum/3814588639/index.php?t=help_index&amp;' . _rsid . '" class="GenLink">Torna all&#39;indice</a> ]</div>';
        break;
    default:
        $file = '/web/htdocs/www.milanin.com/home/egroupware/fudforum/3814588639/theme/italian/help/faq_index.hlp';
        $return_top = '';
}
ses_update_status($usr->sid, 'Legge le <a href="/egroupware/fudforum/3814588639/index.php?t=help_index" class="GenLink">F.A.Q.</a>');
$TITLE_EXTRA = ': F.A.Q.';
$str = file_get_contents($file);
$tt_len = strlen('TOPIC_TITLE:');
$th_len = strlen('TOPIC_HELP:');
$help_section_data = '';
while (($str = strstr($str, 'TOPIC_TITLE:')) !== false) {
    $end_of = strpos($str, "\n");
    $topic_title = substr($str, $tt_len, $end_of - $tt_len);
    $str = strstr($str, 'TOPIC_HELP:');
    $str = substr($str, $th_len);
    $end_of_str = strstr($str, 'TOPIC_TITLE:');
    $topic_help = substr($str, 0, strlen($str) - strlen($end_of_str));
    $str = $end_of_str;
    $rs = _rsid;
    $topic_help = str_replace('%_rsid%', $rs, $topic_help);
Example #16
0
            }
            /* redirect the user to their message */
            header('Location: /egroupware/fudforum/3814588639/index.php?t=' . $t . '&goto=' . $msg_post->id . '&' . _rsidl);
            exit;
        }
    }
    /* Form submitted and user redirected to own message */
}
/* $prevloaded is SET, this form has been submitted */
if ($reply_to || $th_id && !$msg_id) {
    ses_update_status($usr->sid, 'Risponde a <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=msg&goto=' . $thr->root_msg_id . '">' . $thr->subject . '</a> in ' . $frm->name . '', $frm->id, 0);
} else {
    if ($msg_id) {
        ses_update_status($usr->sid, 'Risponde a <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=msg&goto=' . $thr->root_msg_id . '">' . $thr->subject . '</a> in ' . $frm->name . '', $frm->id, 0);
    } else {
        ses_update_status($usr->sid, 'Scrive un nuovo topic in <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=thread&frm_id=' . $frm->id . '">' . $frm->name . '</a>', $frm->id, 0);
    }
}
if (isset($_POST['spell'])) {
    $GLOBALS['MINIMSG_OPT']['DISABLED'] = true;
}
$start = '';
if ($th_id && empty($GLOBALS['MINIMSG_OPT']['DISABLED'])) {
    $GLOBALS['DRAWMSG_OPTS']['NO_MSG_CONTROLS'] = 1;
    $count = $usr->posts_ppg ? $usr->posts_ppg : $POSTS_PER_PAGE;
    $start = isset($_GET['start']) ? (int) $_GET['start'] : (isset($_POST['minimsg_pager_switch']) ? (int) $_POST['minimsg_pager_switch'] : 0);
    $total = $thr->replies + 1;
    if ($reply_to && !isset($_POST['minimsg_pager_switch']) && $total > $count) {
        $start = $total - q_singleval("SELECT count(*) FROM phpgw_fud_msg WHERE thread_id=" . $th_id . " AND apr=1 AND id>=" . $reply_to);
        $msg_order_by = 'ASC';
    } else {
Example #17
0
            pmsg_move((int) $m, $move_to, false);
        } else {
            pmsg_del((int) $m);
        }
    }
}
if (isset($_GET['folder_id']) && isset($folders[$_GET['folder_id']])) {
    $folder_id = $_GET['folder_id'];
} else {
    if (isset($_POST['folder_id']) && isset($folders[$_POST['folder_id']])) {
        $folder_id = $_POST['folder_id'];
    } else {
        $folder_id = 1;
    }
}
ses_update_status($usr->sid, 'Using private messaging');
$cur_ppage = tmpl_cur_ppage($folder_id, $folders);
$lnk = $folder_id == 4 ? '/egroupware/fudforum/3814588639/index.php?t=pmsg&amp;msg_id' : '';
$author_dest_col = $folder_id == 3 ? 'Recipient' : 'Author';
$select_options_cur_folder = tmpl_draw_select_opt(implode("\n", array_keys($folders)), implode("\n", $folders), $folder_id, '', '');
$disk_usage = q_singleval('SELECT SUM(length) FROM phpgw_fud_pmsg WHERE duser_id=' . _uid);
$percent_full = ceil($disk_usage / $MAX_PMSG_FLDR_SIZE * 100);
$full_indicator = ceil($percent_full * 1.69);
if ($percent_full < 90) {
    $full_indicator = '<td class="pmSn"><img src="blank.gif" alt="" width=' . $full_indicator . ' height="8" /></td>';
} else {
    if ($percent_full >= 90 && $percent_full < 100) {
        $full_indicator = '<td class="pmSa"><img src="blank.gif" alt="" width=' . $full_indicator . ' height="8" /></td>';
    } else {
        $full_indicator = '<td class="pmSf"><img src="blank.gif" alt="" width=' . $full_indicator . ' height="8" /></td>';
    }
{
    if (!$fid) {
        $fid = 'f.id';
    }
    if (_uid) {
        $join = ' INNER JOIN phpgw_fud_group_cache g1 ON g1.user_id=2147483647 AND g1.resource_id=' . $fid . ' LEFT JOIN phpgw_fud_group_cache g2 ON g2.user_id=' . _uid . ' AND g2.resource_id=' . $fid . ' ';
        $fields = ' (CASE WHEN g2.id IS NOT NULL THEN g2.group_cache_opt ELSE g1.group_cache_opt END) AS group_cache_opt ';
    } else {
        $join = ' INNER JOIN phpgw_fud_group_cache g1 ON g1.user_id=0 AND g1.resource_id=' . $fid . ' ';
        $fields = ' g1.group_cache_opt ';
    }
}
if (!($FUD_OPT_1 & 536870912)) {
    std_error('disabled');
}
ses_update_status($usr->sid, 'Quelli che si fanno gli affari degli altri, proprio come te');
$rand_val = get_random_value();
$limit =& get_all_read_perms(_uid, $usr->users_opt & (524288 | 1048576));
$c = uq('SELECT
			s.action, s.user_id, s.forum_id,
			u.alias, u.custom_color, s.time_sec, u.users_opt,
			m.id, m.subject, m.post_stamp,
			t.forum_id,
			mm1.id, mm2.id
		FROM phpgw_fud_ses s
		LEFT JOIN phpgw_fud_users u ON s.user_id=u.id
		LEFT JOIN phpgw_fud_msg m ON u.u_last_post_id=m.id
		LEFT JOIN phpgw_fud_thread t ON m.thread_id=t.id
		LEFT JOIN phpgw_fud_mod mm1 ON mm1.forum_id=t.forum_id AND mm1.user_id=' . _uid . '
		LEFT JOIN phpgw_fud_mod mm2 ON mm2.forum_id=s.forum_id AND mm2.user_id=' . _uid . '
		WHERE s.time_sec>' . (__request_timestamp__ - $LOGEDIN_TIMEOUT * 60) . ' AND s.user_id!=' . _uid . ' ORDER BY u.alias, s.time_sec DESC');
        $k['p'] = 0;
    }
    return $k['v'][$k['p']++];
}
if (!_uid) {
    std_error('login');
}
/* delete forum subscription */
if (isset($_GET['frm_id']) && ($_GET['frm_id'] = (int) $_GET['frm_id'])) {
    forum_notify_del(_uid, $_GET['frm_id']);
}
/* delete thread subscription */
if (isset($_GET['th']) && ($_GET['th'] = (int) $_GET['th'])) {
    thread_notify_del(_uid, $_GET['th']);
}
ses_update_status($usr->sid, 'Browsing own subscriptions');
$tabs = '';
if (_uid) {
    $tablist = array('Settings' => 'register', 'Subscriptions' => 'subscribed', 'Referrals' => 'referals', 'Buddy List' => 'buddy_list', 'Ignore List' => 'ignore_list');
    if (isset($_POST['mod_id'])) {
        $mod_id_chk = $_POST['mod_id'];
    } else {
        if (isset($_GET['mod_id'])) {
            $mod_id_chk = $_GET['mod_id'];
        } else {
            $mod_id_chk = null;
        }
    }
    if (!$mod_id_chk) {
        if ($FUD_OPT_1 & 1024) {
            $tablist['Private Messaging'] = 'pmsg';
    if (!q_singleval('SELECT CASE WHEN ((' . $usr->users_opt . ' & 1048576) = 0) THEN mm.id ELSE 1 END FROM phpgw_fud_msg m INNER JOIN phpgw_fud_thread t ON m.thread_id=t.id LEFT JOIN phpgw_fud_mod mm ON t.forum_id=mm.forum_id AND mm.user_id=' . _uid . ' WHERE m.id=' . ($appr ? $appr : $del))) {
        if (db_affected()) {
            std_error('perms');
        } else {
            $del = $appr = 0;
        }
    }
}
if ($appr) {
    fud_msg_edit::approve($appr, true);
} else {
    if ($del) {
        fud_msg_edit::delete(false, $del);
    }
}
ses_update_status($usr->sid, '', 0);
/* for sanity sake, we only select up to POSTS_PER_PAGE messages, simply because otherwise the form will
 * become unmanageable.
 */
$r = $query_type("SELECT\n\t\tm.*,\n\t\tt.thread_opt, t.root_msg_id, t.last_post_id, t.forum_id,\n\t\tf.message_threshold, f.name AS frm_name,\n\t\tc.name AS cat_name,\n\t\tu.id AS user_id, u.alias AS login, u.avatar_loc, u.email, u.posted_msg_count, u.join_date, u.location,\n\t\tu.sig, u.custom_status, u.icq, u.jabber, u.affero, u.aim, u.msnm, u.yahoo, u.last_visit AS time_sec, u.users_opt,\n\t\tl.name AS level_name, l.level_opt, l.img AS level_img,\n\t\tp.max_votes, p.expiry_date, p.creation_date, p.name AS poll_name, p.total_votes,\n\t\tpot.id AS cant_vote\n\tFROM\n\t\tphpgw_fud_msg m\n\tINNER JOIN phpgw_fud_thread t ON m.thread_id=t.id\n\tINNER JOIN phpgw_fud_forum f ON t.forum_id=f.id\n\tINNER JOIN phpgw_fud_fc_view v ON v.f=f.id\n\t" . ($usr->users_opt & 1048576 ? '' : ' INNER JOIN phpgw_fud_mod mm ON f.id=mm.forum_id AND mm.user_id=' . _uid . ' ') . "\n\tINNER JOIN phpgw_fud_cat c ON f.cat_id=c.id\n\tLEFT JOIN phpgw_fud_users u ON m.poster_id=u.id\n\tLEFT JOIN phpgw_fud_level l ON u.level_id=l.id\n\tLEFT JOIN phpgw_fud_poll p ON m.poll_id=p.id\n\tLEFT JOIN phpgw_fud_poll_opt_track pot ON pot.poll_id=p.id AND pot.user_id=" . _uid . "\n\tWHERE (f.forum_opt>=2 AND (f.forum_opt & 2) > 0) AND m.apr=0\n\tORDER BY v.id, m.post_stamp DESC LIMIT " . $POSTS_PER_PAGE);
$prev_thread_id = $modque_message = '';
$m_num = 0;
/* quick cheat to give us full access to the messages ;) */
$perms = 2147483647;
$_GET['start'] = 0;
$usr->md = 1;
while ($obj = db_rowobj($r)) {
    if (!$prev_thread_id || $prev_thread_id != $obj->thread_id) {
        $prev_thread_id = $obj->thread_id;
    }
    $message = tmpl_drawmsg($obj, $usr, $perms, false, $m_num, null);
Example #21
0
    reload_collapse($cs);
} else {
    if (_uid && $usr->cat_collapse_status) {
        $cs = $usr->cat_collapse_status;
        reload_collapse($cs);
    } else {
        $cs = '';
    }
}
if (!_uid) {
    $mark_all_read = $welcome_message = '';
} else {
    $welcome_message = '<font class="GenText">Benvenuto <b>' . $usr->alias . '</b>, l&#39;ultima volta sei stato con noi ' . strftime("%A, %d %B %Y alle %H:%M", $usr->last_visit) . '</font><br />';
    $mark_all_read = '<div align=right><font class="SmallText">[<a href="/egroupware/fudforum/3814588639/index.php?t=markread&amp;' . _rsid . '" class="GenLink" title="Tutti i tuoi messaggi non letti verranno marcati come letti">segna tutti i messaggi come letti</a>]</font></div>';
}
ses_update_status($usr->sid, 'Sfoglia l&#39;<a href="/egroupware/fudforum/3814588639/index.php?t=index" class="GenLink">elenco dei forum</a>');
if (!isset($th)) {
    $th = 0;
}
if (!isset($frm->id)) {
    $frm->id = 0;
}
$unread_posts = _uid ? '<b>::</b> <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=selmsg&amp;unread=1&amp;' . _rsid . '&amp;frm_id=' . $frm->id . '" title="Mostra tutti i messaggi non letti">Messaggi non letti</a>&nbsp;' : '';
$unanswered_posts = !$th ? '<b>::</b> <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=selmsg&amp;reply_count=0&amp;' . _rsid . '&amp;frm_id=' . $frm->id . '" title="Mostra tutti i messaggi che non hanno risposta">Messaggi senza risposta</a>' : '';
$TITLE_EXTRA = ': Benvenuto nel forum di TGM Online!';
$forum_list_table_data = '';
/* List of fetched fields & their ids
	  0	msg.subject,
	  1	msg.id AS msg_id,
	  2	msg.post_stamp,
	  3	users.id AS user_id,
        }
        char_fix($reg_bio);
        char_fix($reg_sig);
        $b_year = $_POST['b_year'];
        $b_month = $_POST['b_month'];
        $b_day = $_POST['b_day'];
        if (isset($_POST['avatar_type'])) {
            $avatar_type = $_POST['avatar_type'];
        }
    }
}
if (empty($reg_time_zone)) {
    $reg_time_zone = $SERVER_TZ;
}
if (!$mod_id) {
    ses_update_status($usr->sid, 'Viewing own profile', 0, 0);
}
$TITLE_EXTRA = ': Register Form';
$tabs = '';
if (_uid) {
    $tablist = array('Settings' => 'register', 'Subscriptions' => 'subscribed', 'Referrals' => 'referals', 'Buddy List' => 'buddy_list', 'Ignore List' => 'ignore_list');
    if (isset($_POST['mod_id'])) {
        $mod_id_chk = $_POST['mod_id'];
    } else {
        if (isset($_GET['mod_id'])) {
            $mod_id_chk = $_GET['mod_id'];
        } else {
            $mod_id_chk = null;
        }
    }
    if (!$mod_id_chk) {
    $k =& $GLOBALS['_ALTERNATOR_'][$key];
    if ($k['p'] == $k['t']) {
        $k['p'] = 0;
    }
    return $k['v'][$k['p']++];
}
if (!isset($_GET['id']) || !($tmp = db_saq('SELECT id, alias, posted_msg_count, join_date FROM phpgw_fud_users WHERE id=' . (int) $_GET['id']))) {
    invl_inp_err();
} else {
    $uid = $tmp[0];
    $u_alias = $tmp[1];
    $u_pcount = $tmp[2];
    $u_reg_date = $tmp[3];
}
$TITLE_EXTRA = ': Mostra i messaggi di: ' . htmlspecialchars($u->login);
ses_update_status($usr->sid, 'Visualizza messaggi per: <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=usrinfo&id=' . $uid . '">' . htmlspecialchars($u->login) . '</a>');
if (!isset($_GET['start']) || !($start = (int) $_GET['start'])) {
    $start = 0;
}
if (!($usr->users_opt & 1048576)) {
    $fids = implode(',', array_keys(get_all_read_perms(_uid, $usr->users_opt & 524288)));
}
if (isset($_GET['so']) && !strcasecmp($_GET['so'], 'asc')) {
    $SORT_ORDER = 'ASC';
    $SORT_ORDER_R = 'DESC';
} else {
    $SORT_ORDER = 'DESC';
    $SORT_ORDER_R = 'ASC';
}
$post_entry = '';
if ($usr->users_opt & 1048576 || $fids) {
            $page_next_url = $arg . '&amp;start=' . $page_start . $suf;
            $page_last_url = $arg . '&amp;start=' . $page_start_2 . $suf;
        } else {
            $page_next_url = $page_last_url = $arg;
            pager_replace($page_next_url, $page_start, $count);
            pager_replace($page_last_url, $page_start_2, $count);
        }
        $page_pager_data .= !$js_pager ? '&nbsp;&nbsp;<a href="' . $page_next_url . '" class="PagerLink">&gt;</a>&nbsp;&nbsp;<a href="' . $page_last_url . '" class="PagerLink">&raquo;</a>' : '&nbsp;&nbsp;<a href="javascript://" onClick="' . $page_next_url . '" class="PagerLink">&gt;</a>&nbsp;&nbsp;<a href="javascript://" onClick="' . $page_last_url . '" class="PagerLink">&raquo;</a>';
    }
    return !$js_pager ? '<font class="SmallText"><b>Pagine (' . $ttl_pg . '): 
[' . $page_pager_data . ']
</b></font>' : '<font class="SmallText"><b>Pagine (' . $ttl_pg . '): 
[' . $page_pager_data . ']
</b></font>';
}
ses_update_status($usr->sid, '<a href="/egroupware/fudforum/3814588639/index.php?t=polllist">Sto controllando i sondaggi</a>');
if (!isset($_GET['oby'])) {
    $_GET['oby'] = 'DESC';
}
if (!isset($_GET['start']) || !($start = (int) $_GET['start'])) {
    $start = 0;
}
if (isset($_GET['uid']) && ($uid = (int) $_GET['uid'])) {
    $usr_lmt = ' p.owner=' . $uid . ' AND ';
} else {
    $uid = $usr_lmt = '';
}
if ($_GET['oby'] == 'ASC') {
    $oby = 'ASC';
    $oby_rev_val = 'DESC';
} else {
    /* remove stuff in quotes */
    while (($p = strpos($body, '<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1"><tr><td class="SmallText"><b>')) !== false) {
        $e = strpos($body, '<br></td></tr></table>', $p) + strlen('<br></td></tr></table>');
        $body = substr($body, 0, $p) . substr($body, $e);
    }
    $body = strip_tags($body);
    if (strlen($body) > $GLOBALS['MNAV_MAX_LEN']) {
        $body = substr($body, 0, $GLOBALS['MNAV_MAX_LEN']) . '...';
    }
    return $body;
}
$search_options = tmpl_draw_radio_opt('field', "all\nsubject", "Entire Message\nSubject Only", $field, '', '', '&nbsp;&nbsp;');
$logic_options = tmpl_draw_select_opt("AND\nOR", "AND\nOR", $search_logic, '', '');
$sort_options = tmpl_draw_select_opt("DESC\nASC", "Descending Order\nAscending Order", $sort_order, '', '');
$TITLE_EXTRA = ': Search For ' . htmlspecialchars($srch);
ses_update_status($usr->sid, 'Searching posts');
$page_pager = '';
if ($srch) {
    if (!($c =& fetch_search_cache($srch, $start, $ppg, $search_logic, $field, $sort_order, $forum_limiter, $total))) {
        $search_data = '<br />
<table border="0" cellspacing="1" cellpadding="2" class="ContentTable">
<tr class="RowStyleA"><th colspan=2 width="100%" align="center">No Results</th></tr>
</table>';
    } else {
        $i = 0;
        $search_data = '';
        while ($r = db_rowobj($c)) {
            $body = trim_body(read_msg_body($r->foff, $r->length, $r->file_id));
            $poster_info = !empty($r->poster_id) ? '<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=usrinfo&amp;id=' . $r->poster_id . '&amp;' . _rsid . '">' . $r->alias . '</a>' : '' . $GLOBALS['ANON_NICK'];
            ++$i;
            $search_data .= '<tr class="' . alt_var('search_alt', 'RowStyleA', 'RowStyleB') . '"><td class="GenText" width="100%">' . $i . '. <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=' . d_thread_view . '&amp;goto=' . $r->id . '&amp;' . _rsid . '">' . $r->subject . '</a><br />' . $body . '</td><td class="GenText" nowrap><a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=' . t_thread_view . '&amp;frm_id=' . $r->forum_id . '&amp;' . _rsid . '">' . $r->forum_name . '</a></td><td class="GenText" nowrap><font class="DateText">' . strftime("%a, %d %B %Y %H:%M", $r->post_stamp) . '</font> By: ' . $poster_info . '</td></tr>';
        $k['p'] = 0;
    }
    return $k['v'][$k['p']++];
}
if (!_uid) {
    std_error('login');
}
/* delete forum subscription */
if (isset($_GET['frm_id']) && ($_GET['frm_id'] = (int) $_GET['frm_id'])) {
    forum_notify_del(_uid, $_GET['frm_id']);
}
/* delete thread subscription */
if (isset($_GET['th']) && ($_GET['th'] = (int) $_GET['th'])) {
    thread_notify_del(_uid, $_GET['th']);
}
ses_update_status($usr->sid, 'Sfoglia le proprie sottoscrizioni');
$tabs = '';
if (_uid) {
    $tablist = array('Impostazioni' => 'register', 'Iscrizioni' => 'subscribed', 'Referrals' => 'referals', 'Buddy List' => 'buddy_list', 'Ignore List' => 'ignore_list');
    if (isset($_POST['mod_id'])) {
        $mod_id_chk = $_POST['mod_id'];
    } else {
        if (isset($_GET['mod_id'])) {
            $mod_id_chk = $_GET['mod_id'];
        } else {
            $mod_id_chk = null;
        }
    }
    if (!$mod_id_chk) {
        if ($FUD_OPT_1 & 1024) {
            $tablist['Messaggi privati'] = 'pmsg';
    $k =& $GLOBALS['_ALTERNATOR_'][$key];
    if ($k['p'] == $k['t']) {
        $k['p'] = 0;
    }
    return $k['v'][$k['p']++];
}
if (!isset($_GET['id']) || !($tmp = db_saq('SELECT id, alias, posted_msg_count, join_date FROM phpgw_fud_users WHERE id=' . (int) $_GET['id']))) {
    invl_inp_err();
} else {
    $uid = $tmp[0];
    $u_alias = $tmp[1];
    $u_pcount = $tmp[2];
    $u_reg_date = $tmp[3];
}
$TITLE_EXTRA = ': Show Posts by: ' . $u_alias;
ses_update_status($usr->sid, 'Viewing posts by: <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=usrinfo&amp;id=' . $uid . '">' . $u_alias . '</a>');
if (!isset($_GET['start']) || !($start = (int) $_GET['start'])) {
    $start = 0;
}
if (!($usr->users_opt & 1048576)) {
    $fids = implode(',', array_keys(get_all_read_perms(_uid, $usr->users_opt & 524288)));
}
if (isset($_GET['so']) && !strcasecmp($_GET['so'], 'asc')) {
    $SORT_ORDER = 'ASC';
    $SORT_ORDER_R = 'DESC';
} else {
    $SORT_ORDER = 'DESC';
    $SORT_ORDER_R = 'ASC';
}
$post_entry = '';
if ($usr->users_opt & 1048576 || $fids) {
Example #28
0
		m.id=' . $mid . ' AND m.apr=1');
if (!isset($_GET['prevloaded'])) {
    th_inc_view_count($th);
    if (_uid) {
        if ($frm->last_view < $msg_obj->post_stamp) {
            user_register_thread_view($th, $msg_obj->post_stamp, $mid);
        }
        if ($frm->last_forum_view < $msg_obj->post_stamp) {
            user_register_forum_view($frm->forum_id);
        }
    }
    $subscribe_status = $frm->subscribed ? '| <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=tree&amp;th=' . $th . '&amp;notify=' . $usr->id . '&amp;' . _rsid . '&amp;opt=off&amp;mid=' . $mid . '" title="Stop receiving notifications about new posts in this topic">Unsubscribe from topic</a>&nbsp;' : '| <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=tree&amp;th=' . $th . '&amp;notify=' . $usr->id . '&amp;' . _rsid . '&amp;opt=on&amp;mid=' . $mid . '" title="Receive notification about new posts inside this topic">Subscribe to topic</a>&nbsp;';
} else {
    $subscribe_status = '';
}
ses_update_status($usr->sid, 'Browsing topic (tree view) <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=tree&amp;th=' . $frm->id . '&amp;' . _rsid . '">' . $frm->subject . '</a>', $frm->id);
function tmpl_create_forum_select($frm_id, $mod)
{
    $prev_cat_id = 0;
    $selection_options = '';
    if (!isset($_GET['t']) || $_GET['t'] != 'thread' && $_GET['t'] != 'threadt') {
        $dest = t_thread_view;
    } else {
        $dest = $_GET['t'];
    }
    if (!_uid) {
        /* anon user, we can optimize things quite a bit here */
        $c = q('SELECT f.id, f.name, c.name, c.id FROM phpgw_fud_group_cache g INNER JOIN phpgw_fud_fc_view v ON v.f=g.resource_id INNER JOIN phpgw_fud_forum f ON f.id=g.resource_id INNER JOIN phpgw_fud_cat c ON c.id=f.cat_id WHERE g.user_id=0 AND group_cache_opt>=1 AND (group_cache_opt & 1) > 0 ORDER BY v.id');
        while ($r = db_rowarr($c)) {
            if ($prev_cat_id != $r[3]) {
                $prev_cat_id = $r[3];
    $a = $_GET;
    unset($a['rid'], $a['S'], $a['t']);
    if (isset($a[$var])) {
        unset($a[$var]);
        $rm = 1;
    }
    $url = '/sel';
    foreach ($a as $k => $v) {
        $url .= '/' . $k . '/' . $v;
    }
    if (!isset($rm)) {
        $url .= '/' . $var . '/' . $val;
    }
    return $url . '/' . _rsid;
}
ses_update_status($usr->sid, 'Browsing <a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=selmsg&amp;date=today&amp;rid=' . $usr->id . '">Today&#39;s Posts</a>');
$count = $usr->posts_ppg ? $usr->posts_ppg : $POSTS_PER_PAGE;
if (!isset($_GET['start']) || !($start = (int) $_GET['start'])) {
    $start = 0;
}
/* limited to today */
if (isset($_GET['date'])) {
    if ($_GET['date'] != 'today') {
        $tm = __request_timestamp__ - ((int) $_GET['date'] - 1) * 86400;
    } else {
        $tm = __request_timestamp__;
    }
    list($day, $month, $year) = explode(' ', strftime('%d %m %Y', $tm));
    $tm_today_start = mktime(0, 0, 0, $month, $day, $year);
    $tm_today_end = $tm_today_start + 86400;
    $date_limit = ' AND m.post_stamp>' . $tm_today_start . ' AND m.post_stamp<' . $tm_today_end . ' ';
function read_msg_body($off, $len, $file_id)
{
    $fp = register_fp($file_id);
    fseek($fp, $off);
    return fread($fp, $len);
}
$adm = $usr->users_opt & 1048576;
if (!$adm && !($FUD_OPT_1 & 8388608) && (!($FUD_OPT_1 & 4194304) || !_uid)) {
    std_error('disabled');
}
if (isset($_GET['js_redr'])) {
    define('plain_form', 1);
    $adm = 0;
}
$TITLE_EXTRA = ': Find User';
ses_update_status($usr->sid, 'Searching for users');
if (!isset($_GET['start']) || !($start = (int) $_GET['start'])) {
    $start = 0;
}
$count = $MEMBERS_PER_PAGE;
if (isset($_GET['pc'])) {
    $ord = 'posted_msg_count DESC';
} else {
    if (isset($_GET['us'])) {
        $ord = 'alias';
    } else {
        $ord = 'id DESC';
    }
}
$usr_login = !empty($_GET['usr_login']) ? trim($_GET['usr_login']) : '';
$usr_email = !empty($_GET['usr_email']) ? trim($_GET['usr_email']) : '';