本文整理汇总了PHP中db_rowarr函数的典型用法代码示例。如果您正苦于以下问题:PHP db_rowarr函数的具体用法?PHP db_rowarr怎么用?PHP db_rowarr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了db_rowarr函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_pmsg
function send_pmsg()
{
$this->pmsg_opt |= 16 | 32;
$this->pmsg_opt &= 16 | 32 | 1 | 2 | 4;
foreach ($GLOBALS['recv_user_id'] as $v) {
$id = db_qid("INSERT INTO phpgw_fud_pmsg (\n\t\t\t\tto_list,\n\t\t\t\touser_id,\n\t\t\t\tip_addr,\n\t\t\t\thost_name,\n\t\t\t\tpost_stamp,\n\t\t\t\ticon,\n\t\t\t\tfldr,\n\t\t\t\tsubject,\n\t\t\t\tattach_cnt,\n\t\t\t\tfoff,\n\t\t\t\tlength,\n\t\t\t\tduser_id,\n\t\t\t\tref_msg_id,\n\t\t\t\tpmsg_opt\n\t\t\t) VALUES (\n\t\t\t\t" . strnull(addslashes($this->to_list)) . ",\n\t\t\t\t" . $this->ouser_id . ",\n\t\t\t\t'" . $this->ip_addr . "',\n\t\t\t\t" . $this->host_name . ",\n\t\t\t\t" . $this->post_stamp . ",\n\t\t\t\t" . strnull($this->icon) . ",\n\t\t\t\t1,\n\t\t\t\t'" . addslashes($this->subject) . "',\n\t\t\t\t" . intzero($this->attach_cnt) . ",\n\t\t\t\t" . $this->foff . ",\n\t\t\t\t" . $this->length . ",\n\t\t\t\t" . $v . ",\n\t\t\t\t" . strnull($this->ref_msg_id) . ",\n\t\t\t\t" . $this->pmsg_opt . ")");
$GLOBALS['send_to_array'][] = array($v, $id);
$um[$v] = $id;
}
$c = uq('SELECT id, email, users_opt, icq FROM phpgw_fud_users WHERE id IN(' . implode(',', $GLOBALS['recv_user_id']) . ') AND users_opt>=64 AND (users_opt & 64) > 0');
$from = $GLOBALS['usr']->alias;
reverse_fmt($from);
$subject = $this->subject;
reverse_fmt($subject);
while ($r = db_rowarr($c)) {
/* do not send notifications about messages sent to self */
if ($r[0] == $this->ouser_id) {
continue;
}
if (!($r[2] & 4)) {
$r[1] = $r[3] . '@pager.icq.com';
}
send_pm_notification($r[1], $um[$r[0]], $subject, $from, $r[2]);
}
}
示例2: attach_rebuild_cache
function attach_rebuild_cache($id)
{
$c = uq('SELECT a.id, a.original_name, a.fsize, a.dlcount, CASE WHEN m.icon IS NULL THEN \'unknown.gif\' ELSE m.icon END FROM phpgw_fud_attach a LEFT JOIN phpgw_fud_mime m ON a.mime_type=m.id WHERE message_id=' . $id . ' AND attach_opt=0');
while ($r = db_rowarr($c)) {
$ret[] = $r;
}
return isset($ret) ? $ret : null;
}
示例3: ignore_rebuild_cache
function ignore_rebuild_cache($uid)
{
$q = uq('SELECT ignore_id FROM phpgw_fud_user_ignore WHERE user_id=' . $uid);
while ($ent = db_rowarr($q)) {
$arr[$ent[0]] = 1;
}
if (isset($arr)) {
q('UPDATE phpgw_fud_users SET ignore_list=\'' . addslashes(serialize($arr)) . '\' WHERE id=' . $uid);
return $arr;
} else {
q('UPDATE phpgw_fud_users SET ignore_list=NULL WHERE id=' . $uid);
return;
}
}
示例4: delete_zero
function delete_zero($tbl, $q)
{
$cnt = 0;
$c = q($q);
while ($r = db_rowarr($c)) {
$a[] = $r[0];
++$cnt;
}
if ($cnt) {
q('DELETE FROM ' . $tbl . ' WHERE id IN (' . implode(',', $a) . ')');
}
unset($c);
draw_info($cnt);
}
示例5: rebuild_forum_view
function rebuild_forum_view($forum_id, $page = 0)
{
if (!db_locked()) {
$ll = 1;
db_lock('phpgw_fud_thread_view WRITE, phpgw_fud_thread WRITE, phpgw_fud_msg WRITE, phpgw_fud_forum WRITE');
}
$tm = __request_timestamp__;
/* Remove expired moved thread pointers */
q('DELETE FROM phpgw_fud_thread WHERE forum_id=' . $forum_id . ' AND last_post_date<' . ($tm - 86400 * $GLOBALS['MOVED_THR_PTR_EXPIRY']) . ' AND moved_to!=0');
if ($aff_rows = db_affected()) {
q('UPDATE phpgw_fud_forum SET thread_count=thread_count-' . $aff_rows . ' WHERE id=' . $forum_id);
$page = 0;
}
/* De-announce expired announcments and sticky messages */
$r = q("SELECT phpgw_fud_thread.id FROM phpgw_fud_thread INNER JOIN phpgw_fud_msg ON phpgw_fud_thread.root_msg_id=phpgw_fud_msg.id WHERE phpgw_fud_thread.forum_id=" . $forum_id . " AND thread_opt>=2 AND (phpgw_fud_msg.post_stamp+phpgw_fud_thread.orderexpiry)<=" . $tm);
while ($tid = db_rowarr($r)) {
q("UPDATE phpgw_fud_thread SET orderexpiry=0, thread_opt=thread_opt & ~ (2|4) WHERE id=" . $tid[0]);
}
unset($r);
if (__dbtype__ == 'pgsql') {
$tmp_tbl_name = "phpgw_fud_ftvt_" . get_random_value();
q("CREATE TEMP TABLE " . $tmp_tbl_name . " ( forum_id INT NOT NULL, page INT NOT NULL, thread_id INT NOT NULL, pos SERIAL, tmp INT )");
if ($page) {
q("DELETE FROM phpgw_fud_thread_view WHERE forum_id=" . $forum_id . " AND page<" . ($page + 1));
q("INSERT INTO " . $tmp_tbl_name . " (thread_id,forum_id,page,tmp) SELECT phpgw_fud_thread.id, phpgw_fud_thread.forum_id, 2147483647, CASE WHEN thread_opt>=2 AND (phpgw_fud_msg.post_stamp+phpgw_fud_thread.orderexpiry>" . $tm . " OR phpgw_fud_thread.orderexpiry=0) THEN 2147483647 ELSE phpgw_fud_thread.last_post_date END AS sort_order_fld FROM phpgw_fud_thread INNER JOIN phpgw_fud_msg ON phpgw_fud_thread.root_msg_id=phpgw_fud_msg.id WHERE forum_id=" . $forum_id . " AND phpgw_fud_msg.apr=1 ORDER BY sort_order_fld DESC, phpgw_fud_thread.last_post_id DESC LIMIT " . $GLOBALS['THREADS_PER_PAGE'] * $page);
} else {
q("DELETE FROM phpgw_fud_thread_view WHERE forum_id=" . $forum_id);
q("INSERT INTO " . $tmp_tbl_name . " (thread_id,forum_id,page,tmp) SELECT phpgw_fud_thread.id, phpgw_fud_thread.forum_id, 2147483647, CASE WHEN thread_opt>=2 AND (phpgw_fud_msg.post_stamp+phpgw_fud_thread.orderexpiry>" . $tm . " OR phpgw_fud_thread.orderexpiry=0) THEN 2147483647 ELSE phpgw_fud_thread.last_post_date END AS sort_order_fld FROM phpgw_fud_thread INNER JOIN phpgw_fud_msg ON phpgw_fud_thread.root_msg_id=phpgw_fud_msg.id WHERE forum_id=" . $forum_id . " AND phpgw_fud_msg.apr=1 ORDER BY sort_order_fld DESC, phpgw_fud_thread.last_post_id DESC");
}
q("INSERT INTO phpgw_fud_thread_view (thread_id,forum_id,page,pos) SELECT thread_id,forum_id,CEIL(pos/" . $GLOBALS['THREADS_PER_PAGE'] . ".0),(pos-(CEIL(pos/" . $GLOBALS['THREADS_PER_PAGE'] . ".0)-1)*" . $GLOBALS['THREADS_PER_PAGE'] . ") FROM " . $tmp_tbl_name);
q("DROP TABLE " . $tmp_tbl_name);
return;
} else {
if (__dbtype__ == 'mysql') {
if ($page) {
q('DELETE FROM phpgw_fud_thread_view WHERE forum_id=' . $forum_id . ' AND page<' . ($page + 1));
q("INSERT INTO phpgw_fud_thread_view (thread_id,forum_id,page,tmp) SELECT phpgw_fud_thread.id, phpgw_fud_thread.forum_id, 2147483645, CASE WHEN thread_opt>=2 AND (phpgw_fud_msg.post_stamp+phpgw_fud_thread.orderexpiry>" . $tm . " OR phpgw_fud_thread.orderexpiry=0) THEN 4294967294 ELSE phpgw_fud_thread.last_post_date END AS sort_order_fld FROM phpgw_fud_thread INNER JOIN phpgw_fud_msg ON phpgw_fud_thread.root_msg_id=phpgw_fud_msg.id WHERE forum_id=" . $forum_id . " AND phpgw_fud_msg.apr=1 ORDER BY sort_order_fld DESC, phpgw_fud_thread.last_post_id DESC LIMIT 0, " . $GLOBALS['THREADS_PER_PAGE'] * $page);
q('UPDATE phpgw_fud_thread_view SET page=CEILING(pos/' . $GLOBALS['THREADS_PER_PAGE'] . '), pos=pos-(CEILING(pos/' . $GLOBALS['THREADS_PER_PAGE'] . ')-1)*' . $GLOBALS['THREADS_PER_PAGE'] . ' WHERE forum_id=' . $forum_id . ' AND page=2147483645');
} else {
q('DELETE FROM phpgw_fud_thread_view WHERE forum_id=' . $forum_id);
q("INSERT INTO phpgw_fud_thread_view (thread_id,forum_id,page,tmp) SELECT phpgw_fud_thread.id, phpgw_fud_thread.forum_id, 2147483645, CASE WHEN thread_opt>=2 AND (phpgw_fud_msg.post_stamp+phpgw_fud_thread.orderexpiry>" . $tm . " OR phpgw_fud_thread.orderexpiry=0) THEN 4294967294 ELSE phpgw_fud_thread.last_post_date END AS sort_order_fld FROM phpgw_fud_thread INNER JOIN phpgw_fud_msg ON phpgw_fud_thread.root_msg_id=phpgw_fud_msg.id WHERE forum_id=" . $forum_id . " AND phpgw_fud_msg.apr=1 ORDER BY sort_order_fld DESC, phpgw_fud_thread.last_post_id DESC");
q('UPDATE phpgw_fud_thread_view SET page=CEILING(pos/' . $GLOBALS['THREADS_PER_PAGE'] . '), pos=pos-(CEILING(pos/' . $GLOBALS['THREADS_PER_PAGE'] . ')-1)*' . $GLOBALS['THREADS_PER_PAGE'] . ' WHERE forum_id=' . $forum_id);
}
}
}
if (isset($ll)) {
db_unlock();
}
}
示例6: array
function &get_all_read_perms($uid, $mod)
{
$limit = array(0);
$r = uq('SELECT resource_id, group_cache_opt FROM phpgw_fud_group_cache WHERE user_id=' . _uid);
while ($ent = db_rowarr($r)) {
$limit[$ent[0]] = $ent[1] & 2;
}
if (_uid) {
$r = uq("SELECT resource_id FROM phpgw_fud_group_cache WHERE resource_id NOT IN (" . implode(',', array_keys($limit)) . ") AND user_id=2147483647 AND (group_cache_opt & 2) > 0");
while ($ent = db_rowarr($r)) {
if (!isset($limit[$ent[0]])) {
$limit[$ent[0]] = 1;
}
}
if ($mod) {
$r = uq('SELECT forum_id FROM phpgw_fud_mod WHERE user_id=' . _uid);
while ($ent = db_rowarr($r)) {
$limit[$ent[0]] = 1;
}
}
}
return $limit;
}
示例7: poll_cache_rebuild
function poll_cache_rebuild($poll_id, &$data)
{
if (!$poll_id) {
$data = null;
return;
}
if (!$data) {
/* rebuild from cratch */
$c = uq('SELECT id, name, count FROM phpgw_fud_poll_opt WHERE poll_id=' . $poll_id);
while ($r = db_rowarr($c)) {
$data[$r[0]] = array($r[1], $r[2]);
}
if (!$data) {
$data = null;
}
} else {
/* register single vote */
$data[$poll_id][1] += 1;
}
}
示例8: array
$GLOBALS['_ALTERNATOR_'][$key] = array('p' => 1, 't' => count($args), 'v' => $args);
return $args[0];
}
$k =& $GLOBALS['_ALTERNATOR_'][$key];
if ($k['p'] == $k['t']) {
$k['p'] = 0;
}
return $k['v'][$k['p']++];
}
$TITLE_EXTRA = ': Avatar Selection Form';
/* here we draw the avatar control */
$icons_per_row = 5;
$c = uq('SELECT id, descr, img FROM phpgw_fud_avatar ORDER BY id');
$avatars_data = '';
$col = 0;
while ($r = db_rowarr($c)) {
if (!($col++ % $icons_per_row)) {
$avatars_data .= '</tr><tr>';
}
$avatars_data .= '<td class="' . alt_var('avatarsel_cl', 'Av1', 'Av2') . '">
<a class="GenLink" href="javascript: window.opener.document.fud_register.reg_avatar.value=\'' . $r[0] . '\'; window.opener.document.reg_avatar_img.src=\'images/avatars/' . $r[2] . '\'; window.close();"><img src="images/avatars/' . $r[2] . '" alt="" /><br /><font class="SmallText">' . $r[1] . '</font></a></td>';
}
if (!$avatars_data) {
$avatars_data = '<td class="NoAvatar">No Avatars available</td>';
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-15">
<title><?php
示例9: approve
function approve($id, $unlock_safe = false)
{
/* fetch info about the message, poll (if one exists), thread & forum */
$mtf = db_sab('SELECT
m.id, m.poster_id, m.apr, m.subject, m.foff, m.length, m.file_id, m.thread_id, m.poll_id, m.attach_cnt,
m.post_stamp, m.reply_to, m.mlist_msg_id,
t.forum_id, t.last_post_id, t.root_msg_id, t.last_post_date,
m2.post_stamp AS frm_last_post_date,
f.name AS frm_name,
u.alias, u.email, u.sig,
n.id AS nntp_id, ml.id AS mlist_id
FROM phpgw_fud_msg m
INNER JOIN phpgw_fud_thread t ON m.thread_id=t.id
INNER JOIN phpgw_fud_forum f ON t.forum_id=f.id
LEFT JOIN phpgw_fud_msg m2 ON f.last_post_id=m2.id
LEFT JOIN phpgw_fud_users u ON m.poster_id=u.id
LEFT JOIN phpgw_fud_mlist ml ON ml.forum_id=f.id
LEFT JOIN phpgw_fud_nntp n ON n.forum_id=f.id
WHERE m.id=' . $id . ' AND m.apr=0');
/* nothing to do or bad message id */
if (!$mtf) {
return;
}
if ($mtf->alias) {
reverse_fmt($mtf->alias);
} else {
$mtf->alias = $GLOBALS['ANON_NICK'];
}
if (!db_locked()) {
db_lock('phpgw_fud_thread_view WRITE, phpgw_fud_level WRITE, phpgw_fud_users WRITE, phpgw_fud_forum WRITE, phpgw_fud_thread WRITE, phpgw_fud_msg WRITE');
$ll = 1;
}
q("UPDATE phpgw_fud_msg SET apr=1 WHERE id=" . $mtf->id);
if ($mtf->poster_id) {
user_set_post_count($mtf->poster_id);
}
$last_post_id = $mtf->post_stamp > $mtf->frm_last_post_date ? $mtf->id : 0;
if ($mtf->root_msg_id == $mtf->id) {
/* new thread */
rebuild_forum_view($mtf->forum_id);
$threads = 1;
} else {
/* reply to thread */
if ($mtf->post_stamp > $mtf->last_post_date) {
th_inc_post_count($mtf->thread_id, 1, $mtf->id, $mtf->post_stamp);
} else {
th_inc_post_count($mtf->thread_id, 1);
}
rebuild_forum_view($mtf->forum_id, q_singleval('SELECT page FROM phpgw_fud_thread_view WHERE forum_id=' . $mtf->forum_id . ' AND thread_id=' . $mtf->thread_id));
$threads = 0;
}
/* update forum thread & post count as well as last_post_id field */
frm_updt_counts($mtf->forum_id, 1, $threads, $last_post_id);
if ($unlock_safe || isset($ll)) {
db_unlock();
}
if ($mtf->poll_id) {
poll_activate($mtf->poll_id, $mtf->forum_id);
}
$mtf->body = read_msg_body($mtf->foff, $mtf->length, $mtf->file_id);
if ($GLOBALS['FUD_OPT_1'] & 16777216) {
index_text(preg_match('!Re: !i', $mtf->subject) ? '' : $mtf->subject, $mtf->body, $mtf->id);
}
/* handle notifications */
if ($mtf->root_msg_id == $mtf->id) {
if (empty($mtf->frm_last_post_date)) {
$mtf->frm_last_post_date = 0;
}
/* send new thread notifications to forum subscribers */
$c = uq('SELECT u.email, u.icq, u.users_opt
FROM phpgw_fud_forum_notify fn
INNER JOIN phpgw_fud_users u ON fn.user_id=u.id
LEFT JOIN phpgw_fud_forum_read r ON r.forum_id=fn.forum_id AND r.user_id=fn.user_id
INNER JOIN phpgw_fud_group_cache g1 ON g1.user_id=2147483647 AND g1.resource_id=' . $mtf->forum_id . '
LEFT JOIN phpgw_fud_group_cache g2 ON g2.user_id=fn.user_id AND g2.resource_id=' . $mtf->forum_id . '
WHERE
fn.forum_id=' . $mtf->forum_id . ' AND fn.user_id!=' . (int) $mtf->poster_id . '
AND (CASE WHEN (r.last_view IS NULL AND (u.last_read=0 OR u.last_read >= ' . $mtf->frm_last_post_date . ')) OR r.last_view > ' . $mtf->frm_last_post_date . ' THEN 1 ELSE 0 END)=1
AND ((CASE WHEN g2.id IS NOT NULL THEN g2.group_cache_opt ELSE g1.group_cache_opt END) & 2) > 0');
$notify_type = 'frm';
} else {
/* send new reply notifications to thread subscribers */
$c = uq('SELECT u.email, u.icq, u.users_opt, r.msg_id, u.id
FROM phpgw_fud_thread_notify tn
INNER JOIN phpgw_fud_users u ON tn.user_id=u.id
LEFT JOIN phpgw_fud_read r ON r.thread_id=tn.thread_id AND r.user_id=tn.user_id
INNER JOIN phpgw_fud_group_cache g1 ON g1.user_id=2147483647 AND g1.resource_id=' . $mtf->forum_id . '
LEFT JOIN phpgw_fud_group_cache g2 ON g2.user_id=tn.user_id AND g2.resource_id=' . $mtf->forum_id . '
WHERE
tn.thread_id=' . $mtf->thread_id . ' AND tn.user_id!=' . (int) $mtf->poster_id . '
AND (r.msg_id=' . $mtf->last_post_id . ' OR (r.msg_id IS NULL AND ' . $mtf->post_stamp . ' > u.last_read))
AND ((CASE WHEN g2.id IS NOT NULL THEN g2.group_cache_opt ELSE g1.group_cache_opt END) & 2) > 0');
$notify_type = 'thr';
}
while ($r = db_rowarr($c)) {
if ($r[2] & 16) {
$to['EMAIL'] = $r[0];
} else {
$to['ICQ'] = $r[1] . '@pager.icq.com';
}
//.........这里部分代码省略.........
示例10: create_theme_select
function create_theme_select($name, $def = null)
{
$theme_select_values = '';
$r = uq("SELECT id, name FROM phpgw_fud_themes WHERE theme_opt>=1 AND (theme_opt & 1) > 0 ORDER BY ((theme_opt & 2) > 0) DESC");
while ($t = db_rowarr($r)) {
$selected = $t[0] == $def ? ' selected' : '';
$theme_select_values .= '<option value="' . $t[0] . '"' . $selected . '>' . $t[1] . '</option>';
}
return '<select name="' . $name . '">
' . $theme_select_values . '
</select>';
}
示例11: rebuild_stats_cache
function rebuild_stats_cache($last_msg_id)
{
$tm_expire = __request_timestamp__ - $GLOBALS['LOGEDIN_TIMEOUT'] * 60;
list($obj->last_user_id, $obj->user_count) = db_saq('SELECT MAX(id), count(*)-1 FROM phpgw_fud_users');
$obj->online_users_anon = q_singleval('SELECT count(*) FROM phpgw_fud_ses s WHERE time_sec>' . $tm_expire . ' AND user_id>2000000000');
$obj->online_users_hidden = q_singleval('SELECT count(*) FROM phpgw_fud_ses s INNER JOIN phpgw_fud_users u ON u.id=s.user_id WHERE s.time_sec>' . $tm_expire . ' AND (u.users_opt & 32768) > 0');
$obj->online_users_reg = q_singleval('SELECT count(*) FROM phpgw_fud_ses s INNER JOIN phpgw_fud_users u ON u.id=s.user_id WHERE s.time_sec>' . $tm_expire . ' AND (u.users_opt & 32768)=0');
$c = uq('SELECT u.id, u.alias, u.users_opt, u.custom_color FROM phpgw_fud_ses s INNER JOIN phpgw_fud_users u ON u.id=s.user_id WHERE s.time_sec>' . $tm_expire . ' AND (u.users_opt & 32768)=0 ORDER BY s.time_sec DESC LIMIT ' . $GLOBALS['MAX_LOGGEDIN_USERS']);
while ($r = db_rowarr($c)) {
$obj->online_users_text[$r[0]] = draw_user_link($r[1], $r[2], $r[3]);
}
q('UPDATE phpgw_fud_stats_cache SET
cache_age=' . __request_timestamp__ . ',
last_user_id=' . (int) $obj->last_user_id . ',
user_count=' . (int) $obj->user_count . ',
online_users_anon=' . (int) $obj->online_users_anon . ',
online_users_hidden=' . (int) $obj->online_users_hidden . ',
online_users_reg=' . (int) $obj->online_users_reg . ',
online_users_text=' . strnull(addslashes(@serialize($obj->online_users_text))));
$obj->last_user_alias = q_singleval('SELECT alias FROM phpgw_fud_users WHERE id=' . $obj->last_user_id);
$obj->last_msg_subject = q_singleval('SELECT subject FROM phpgw_fud_msg WHERE id=' . $last_msg_id);
return $obj;
}
示例12: get_fud_table_list
function get_fud_table_list()
{
$r = uq("SHOW TABLES LIKE '" . str_replace("_", "\\_", $GLOBALS['DBHOST_TBL_PREFIX']) . "%'");
while (list($ret[]) = db_rowarr($r)) {
}
array_pop($ret);
return $ret;
}
示例13: tmpl_create_forum_select
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];
$selection_options .= '<option value="0">' . $r[2] . '</option>';
}
$selected = $frm_id == $r[0] ? ' selected' : '';
$selection_options .= '<option value="' . $r[0] . '"' . $selected . '> ' . htmlspecialchars($r[1]) . '</option>';
}
unset($c);
return '<form action="/egroupware/fudforum/3814588639/index.php" name="frmquicksel" method="get" onSubmit="javascript: if (document.frmquicksel.frm_id.value < 1) document.frmquicksel.frm_id.value=' . $frm_id . ';">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="GenText" valign="bottom">
<font class="SmallText"><b>Goto Forum:</b><br /></font>
<select class="SmallText" name="frm_id" onChange="javascript: if ( this.value==0 ) return false; document.frmquicksel.submit();">
' . $selection_options . '
</select>
<input type="hidden" name="t" value="' . $dest . '">' . _hs . '<input type="hidden" name="forum_redr" value="1">
</td><td valign="bottom"><input type="submit" class="button" name="frm_goto" value="Go" ></td></tr></table></form>';
} else {
$c = q('SELECT f.id, f.name, c.name, c.id, CASE WHEN ' . $GLOBALS['usr']->last_read . ' < m.post_stamp AND (fr.last_view IS NULL OR m.post_stamp > fr.last_view) THEN 1 ELSE 0 END AS reads
FROM phpgw_fud_fc_view v
INNER JOIN phpgw_fud_forum f ON f.id=v.f
INNER JOIN phpgw_fud_cat c ON c.id=v.c
LEFT JOIN phpgw_fud_msg m ON m.id=f.last_post_id
' . ($mod ? '' : 'LEFT JOIN phpgw_fud_mod mm ON mm.user_id=' . _uid . ' AND mm.forum_id=f.id INNER JOIN phpgw_fud_group_cache g1 ON g1.resource_id=f.id AND g1.user_id=2147483647 LEFT JOIN phpgw_fud_group_cache g2 ON g2.resource_id=f.id AND g2.user_id=' . _uid) . '
LEFT JOIN phpgw_fud_forum_read fr ON fr.forum_id=f.id AND fr.user_id=' . _uid . '
' . ($mod ? '' : ' WHERE mm.id IS NOT NULL OR ((CASE WHEN g2.id IS NULL THEN g1.group_cache_opt ELSE g2.group_cache_opt END) & 1) > 0') . '
ORDER BY v.id');
while ($r = db_rowarr($c)) {
if ($prev_cat_id != $r[3]) {
$prev_cat_id = $r[3];
$selection_options .= '<option value="0">' . $r[2] . '</option>';
}
$selected = $frm_id == $r[0] ? ' selected' : '';
$selection_options .= $r[4] ? '<option value="' . $r[0] . '"' . $selected . '> *(UNREAD) ' . htmlspecialchars($r[1]) . '</option>' : '<option value="' . $r[0] . '"' . $selected . '> ' . htmlspecialchars($r[1]) . '</option>';
}
unset($c);
return '<form action="/egroupware/fudforum/3814588639/index.php" name="frmquicksel" method="get" onSubmit="javascript: if (document.frmquicksel.frm_id.value < 1) document.frmquicksel.frm_id.value=' . $frm_id . ';">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="GenText" valign="bottom">
<font class="SmallText"><b>Goto Forum:</b><br /></font>
<select class="SmallText" name="frm_id" onChange="javascript: if ( this.value==0 ) return false; document.frmquicksel.submit();">
' . $selection_options . '
</select>
<input type="hidden" name="t" value="' . $dest . '">' . _hs . '<input type="hidden" name="forum_redr" value="1">
</td><td valign="bottom"><input type="submit" class="button" name="frm_goto" value="Go" ></td></tr></table></form>';
}
}
示例14: rebuild_forum_cat_order
}
} else {
if (isset($_POST['btn_chcat'], $_POST['frm_id'], $_POST['cat_id'], $_POST['dest_cat'])) {
if (frm_move_forum((int) $_POST['frm_id'], (int) $_POST['dest_cat'], $cat_id)) {
rebuild_forum_cat_order();
$r = db_saq('SELECT f.name, c1.name, c2.name FROM ' . $tbl . 'forum f INNER JOIN ' . $tbl . 'cat c1 ON c1.id=' . $cat_id . ' INNER JOIN ' . $tbl . 'cat c2 ON c2.id=' . (int) $_POST['dest_cat'] . ' WHERE f.id=' . (int) $_POST['frm_id']);
logaction(_uid, 'CHCATFORUM', 'Moved forum "' . addslashes($r[0]) . '" from category: "' . addslashes($r[1]) . '" to category: "' . addslashes($r[2]) . '"');
}
}
}
}
if (isset($_GET['o'], $_GET['ot'])) {
if (in_array($_GET['ot'], array('name', 'descr', 'date_created'))) {
$i = 0;
$r = q("SELECT id FROM {$tbl}forum WHERE cat_id={$cat_id} ORDER BY {$_GET['ot']} " . ((int) $_GET['o'] ? 'ASC' : 'DESC'));
while ($o = db_rowarr($r)) {
q("UPDATE {$tbl}forum SET view_order=" . ++$i . " WHERE id={$o[0]}");
}
rebuild_forum_cat_order();
}
}
require $WWW_ROOT_DISK . 'adm/admpanel.php';
?>
<h2>Editing forums for <?php
echo $cat_name;
?>
</h2>
<?php
if (!isset($_GET['chpos'])) {
?>
<a href="admcat.php?<?php