本文整理汇总了PHP中db_rowobj函数的典型用法代码示例。如果您正苦于以下问题:PHP db_rowobj函数的具体用法?PHP db_rowobj怎么用?PHP db_rowobj使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了db_rowobj函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_sql_disk_usage
function get_sql_disk_usage()
{
$ver = q_singleval('SELECT VERSION()');
if ($ver[0] != 4 && strncmp($ver, '3.23', 4)) {
return;
}
$sql_size = 0;
$c = uq('SHOW TABLE STATUS FROM ' . $GLOBALS['phpgw_info']['server']['db_name'] . ' LIKE \'' . $GLOBALS['DBHOST_TBL_PREFIX'] . '%\'');
while ($r = db_rowobj($c)) {
$sql_size += $r->Data_length + $r->Index_length;
}
return $sql_size;
}
示例2: grp_rebuild_cache
function grp_rebuild_cache($user_id = null)
{
$list = array();
if ($user_id !== null) {
$lmt = ' user_id IN(' . implode(',', $user_id) . ') ';
} else {
$lmt = '';
}
/* generate an array of permissions, in the end we end up with 1ist of permissions */
$r = uq("SELECT gm.user_id AS uid, gm.group_members_opt AS gco, gr.resource_id AS rid FROM phpgw_fud_group_members gm INNER JOIN phpgw_fud_group_resources gr ON gr.group_id=gm.group_id WHERE gm.group_members_opt>=65536 AND (gm.group_members_opt & 65536) > 0" . ($lmt ? ' AND ' . $lmt : ''));
while ($o = db_rowobj($r)) {
foreach ($o as $k => $v) {
$o->{$k} = (int) $v;
}
if (isset($list[$o->rid][$o->uid])) {
if ($o->gco & 131072) {
$list[$o->rid][$o->uid] |= $o->gco;
} else {
$list[$o->rid][$o->uid] &= $o->gco;
}
} else {
$list[$o->rid][$o->uid] = $o->gco;
}
}
$tmp_t = "phpgw_fud_gc_" . __request_timestamp__;
q("CREATE TEMPORARY TABLE " . $tmp_t . " (a INT, b INT, c INT)");
$tmp = array();
foreach ($list as $k => $v) {
foreach ($v as $u => $p) {
$tmp[] = $k . ", " . $p . ", " . $u;
}
}
if ($tmp) {
if (__dbtype__ == 'mysql') {
ins_m($tmp_t, "a,b,c", $tmp, 1);
} else {
ins_m($tmp_t, "a,b,c", $tmp, "integer, integer, integer");
}
}
if (!db_locked()) {
$ll = 1;
db_lock("phpgw_fud_group_cache WRITE");
}
q("DELETE FROM phpgw_fud_group_cache" . ($lmt ? ' WHERE ' . $lmt : ''));
q("INSERT INTO phpgw_fud_group_cache (resource_id, group_cache_opt, user_id) SELECT a,b,c FROM " . $tmp_t);
if (isset($ll)) {
db_unlock();
}
q("DROP TABLE " . $tmp_t);
}
示例3: qry_limit
LEFT JOIN phpgw_fud_mod mm ON mm.forum_id=f.id AND mm.user_id=' . _uid . '
WHERE
m.apr=1
' . $date_limit . '
' . ($frm_id ? ' AND f.id=' . $frm_id : '') . '
' . ($th ? ' AND t.id=' . $th : '') . '
' . (isset($_GET['reply_count']) ? ' AND t.replies=' . (int) $_GET['reply_count'] : '') . '
' . $unread_limit . '
' . $perm_limit . '
ORDER BY
f.last_post_id, t.last_post_date, m.post_stamp
LIMIT ' . qry_limit($count, $start));
/* message drawing code */
$message_data = '';
$n = $prev_frm = $prev_th = '';
while ($r = db_rowobj($c)) {
if ($prev_frm != $r->forum_id) {
$prev_frm = $r->forum_id;
$message_data .= '<tr><th class="SelFS">Forum: <a class="thLnk" href="/egroupware/fudforum/3814588639/index.php?t=' . t_thread_view . '&frm_id=' . $r->forum_id . '&' . _rsid . '"><font class="lg">' . htmlspecialchars($r->name) . '</font></a></th></tr>';
$perms = perms_from_obj($r, $usr->users_opt & 1048576);
}
if ($prev_th != $r->thread_id) {
$thl[] = $r->thread_id;
$prev_th = $r->thread_id;
$message_data .= '<tr><th class="SelTS"> Topic: <a class="thLnk" href="/egroupware/fudforum/3814588639/index.php?t=' . d_thread_view . '&goto=' . $r->id . '&' . _rsid . '">' . $r->thr_subject . '</a></th></tr>';
}
if (_uid && $r->last_view < $r->post_stamp && $r->post_stamp > $usr->last_read && !isset($mark_read[$r->thread_id])) {
$mark_read[$r->thread_id] = $r->id;
}
$usr->md = $r->md;
$message_data .= tmpl_drawmsg($r, $usr, $perms, false, $n, '');
示例4: perms_from_obj
INNER JOIN phpgw_fud_msg m2 ON m2.id=t.root_msg_id
INNER JOIN phpgw_fud_forum f ON t.forum_id=f.id
' . ($usr->users_opt & 1048576 ? '' : ' INNER JOIN phpgw_fud_mod mm ON mm.forum_id=t.forum_id AND mm.user_id=' . _uid) . '
LEFT JOIN phpgw_fud_users u ON m.poster_id=u.id
LEFT JOIN phpgw_fud_users u2 ON mr.user_id=u2.id
LEFT JOIN phpgw_fud_level l ON u.level_id=l.id
LEFT JOIN phpgw_fud_poll p ON m.poll_id=p.id
LEFT JOIN phpgw_fud_poll_opt_track pot ON pot.poll_id=p.id AND pot.user_id=' . _uid . '
ORDER BY mr.id');
$perms = perms_from_obj($r, $usr->users_opt & 1048576);
$MOD = 1;
$reported_message = '';
$n = 0;
$_GET['start'] = 0;
$usr->md = 1;
while ($obj = db_rowobj($r)) {
$user_login = $obj->report_user_id ? '<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=usrinfo&id=' . $obj->report_user_id . '&' . _rsid . '">' . $obj->report_user_login . '</a>' : '' . $GLOBALS['ANON_NICK'];
if (empty($prev_thread_id) || $prev_thread_id != $obj->thread_id) {
$prev_thread_id = $obj->thread_id;
}
$message = tmpl_drawmsg($obj, $usr, $perms, false, $n, null);
$reported_message .= '<tr class="RowStyleC"><td>
<table border=0 cellspacing=0 cellpadding=3 width="100%">
<tr>
<td align=left nowrap valign=top>
<font class="SmallText">
<b>Riferito da:</b> ' . $user_login . '<br />
<b>Il:</b> ' . strftime("%a, %d %B %Y %H:%M", $obj->report_stamp) . '
</font>
</td>
<td align=center width="100%" valign=top>
示例5: tmpl_drawpmsg
function tmpl_drawpmsg($obj, $usr, $mini)
{
$o1 =& $GLOBALS['FUD_OPT_1'];
$o2 =& $GLOBALS['FUD_OPT_2'];
$a =& $obj->users_opt;
$b =& $usr->users_opt;
$c =& $obj->level_opt;
if (!$mini) {
$custom_tag = $obj->custom_status ? '<br />' . $obj->custom_status : '';
if ($obj->avatar_loc && $a & 8388608 && $b & 8192 && $o1 & 28 && !($c & 2)) {
if (!($c & 1)) {
$level_name =& $obj->level_name;
$level_image = $obj->level_img ? ' <img src="images/' . $obj->level_img . '" alt="" />' : '';
} else {
$level_name = $level_image = '';
}
} else {
$level_image = $obj->level_img ? ' <img src="images/' . $obj->level_img . '" alt="" />' : '';
$obj->avatar_loc = '';
$level_name =& $obj->level_name;
}
$avatar = $obj->avatar_loc || $level_image ? '<td class="avatarPad" width="1">' . $obj->avatar_loc . $level_image . '</td>' : '';
$dmsg_tags = $custom_tag || $level_name ? '<div class="ctags">' . $level_name . $custom_tag . '</div>' : '';
if ($o2 & 32 && !($a & 32768) || $b & 1048576) {
$obj->login = $obj->alias;
$online_indicator = $obj->last_visit + $GLOBALS['LOGEDIN_TIMEOUT'] * 60 > __request_timestamp__ ? '<img src="/egroupware/fudforum/3814588639/theme/italian/images/online.gif" alt="' . $user_login . ' è attualmente online" title="' . $user_login . ' è attualmente online" />' : '<img src="/egroupware/fudforum/3814588639/theme/italian/images/offline.gif" alt="' . $user_login . ' è attualmente offline" title="' . $user_login . ' è attualmente offline" />';
} else {
$online_indicator = '';
}
$host_name = $obj->host_name && $o1 & 268435456 ? '<b>Da:</b> ' . $obj->host_name . '<br />' : '';
$ip_address = '';
if ($obj->location) {
if (strlen($obj->location) > $GLOBALS['MAX_LOCATION_SHOW']) {
$location = substr($obj->location, 0, $GLOBALS['MAX_LOCATION_SHOW']) . '...';
} else {
$location = $obj->location;
}
$location = '<br /><b>Località:</b> ' . $location;
} else {
$location = '';
}
$msg_icon = !$obj->icon ? '' : '<img src="images/message_icons/' . $obj->icon . '" alt="" /> ';
$usr->buddy_list = @unserialize($usr->buddy_list);
if ($obj->user_id != _uid && $obj->user_id > 0) {
$buddy_link = !isset($usr->buddy_list[$obj->user_id]) ? '<a href="/egroupware/fudforum/3814588639/index.php?t=buddy_list&' . _rsid . '&add=' . $obj->user_id . '" class="GenLink">aggiungi alla buddy list</a><br />' : '<br />[<a href="/egroupware/fudforum/3814588639/index.php?t=buddy_list&del=' . $obj->user_id . '&redr=1&' . _rsid . '" class="GenLink">remove from buddy list</a>]';
} else {
$buddy_link = '';
}
/* show im buttons if need be */
if ($b & 16384) {
$im_icq = $obj->icq ? '<a href="/egroupware/fudforum/3814588639/index.php?t=usrinfo&id=' . $obj->user_id . '&' . _rsid . '#icq_msg"><img src="/egroupware/fudforum/3814588639/theme/italian/images/icq.gif" alt="" title="' . $obj->icq . '" /></a> ' : '';
$im_aim = $obj->aim ? '<a href="aim:goim?screenname=' . $obj->aim . '&message=Hi.+Are+you+there?" target="_blank"><img src="/egroupware/fudforum/3814588639/theme/italian/images/aim.gif" title="' . $obj->aim . '" alt="" /></a> ' : '';
$im_yahoo = $obj->yahoo ? '<a target="_blank" href="http://edit.yahoo.com/config/send_webmesg?.target=' . $obj->yahoo . '&.src=pg"><img src="/egroupware/fudforum/3814588639/theme/italian/images/yahoo.gif" alt="" title="' . $obj->yahoo . '" /></a> ' : '';
$im_msnm = $obj->msnm ? '<a href="mailto:' . $obj->msnm . '"><img src="/egroupware/fudforum/3814588639/theme/italian/images/msnm.gif" title="' . $obj->msnm . '" alt="" /></a>' : '';
$im_jabber = $obj->jabber ? '<img src="/egroupware/fudforum/3814588639/theme/italian/images/jabber.gif" title="' . $obj->jabber . '" alt="" />' : '';
if ($o2 & 2048) {
$im_affero = $obj->affero ? '<a href="http://svcs.affero.net/rm.php?r=' . $obj->affero . '&ll=0.' . urlencode($GLOBALS['affero_domain']['host']) . '&lp=0.' . urlencode($GLOBALS['affero_domain']['host']) . '&ls=' . urlencode($obj->subject) . '" target=_blank><img alt="" src="/egroupware/fudforum/3814588639/theme/italian/images/affero_reg.gif" /></a>' : '<a href="http://svcs.affero.net/rm.php?m=' . urlencode($obj->email) . '&ll=0.' . urlencode($GLOBALS['affero_domain']['host']) . '&lp=0.' . urlencode($GLOBALS['affero_domain']['host']) . '&ls=' . urlencode($obj->subject) . '" target=_blank><img alt="" src="/egroupware/fudforum/3814588639/theme/italian/images/affero_noreg.gif" /></a>';
} else {
$im_affero = '';
}
$dmsg_im_row = $im_icq || $im_aim || $im_yahoo || $im_msnm || $im_jabber || $im_affero ? $im_icq . ' ' . $im_aim . ' ' . $im_yahoo . ' ' . $im_msnm . ' ' . $im_jabber . ' ' . $im_affero . '<br />' : '';
} else {
$dmsg_im_row = '';
}
if ($obj->ouser_id != _uid) {
$user_profile = '<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=usrinfo&id=' . $obj->user_id . '&' . _rsid . '"><img src="/egroupware/fudforum/3814588639/theme/italian/images/msg_about.gif" alt="" /></a>';
$email_link = $o1 & 4194304 && $a & 16 ? '<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=email&toi=' . $obj->user_id . '&' . _rsid . '"><img src="/egroupware/fudforum/3814588639/theme/italian/images/msg_email.gif" alt="" /></a>' : '';
$private_msg_link = '<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=ppost&toi=' . $obj->user_id . '&' . _rsid . '"><img title="Invia un messaggi privato a questo utente" src="/egroupware/fudforum/3814588639/theme/italian/images/msg_pm.gif" alt="" /></a>';
} else {
$user_profile = $email_link = $private_msg_link = '';
}
$edit_link = $obj->fldr == 4 ? '<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=ppost&msg_id=' . $obj->id . '&' . _rsid . '"><img src="/egroupware/fudforum/3814588639/theme/italian/images/msg_edit.gif" alt="" /></a> ' : '';
if ($obj->fldr == 1) {
$reply_link = '<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=ppost&reply=' . $obj->id . '&' . _rsid . '"><img src="/egroupware/fudforum/3814588639/theme/italian/images/msg_reply.gif" alt="" /></a> ';
$quote_link = '<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=ppost&quote=' . $obj->id . '&' . _rsid . '"><img src="/egroupware/fudforum/3814588639/theme/italian/images/msg_quote.gif" alt="" /></a> ';
} else {
$reply_link = $quote_link = '';
}
$profile_link = '<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=usrinfo&id=' . $obj->user_id . '&' . _rsid . '">' . $obj->alias . '</a>';
$dmsg_user_info = '<br /><b>Messaggi:</b> ' . $obj->posted_msg_count . '<br />
<b>Registrato:</b> ' . strftime("%B %Y", $obj->join_date) . '
' . $location;
$msg_toolbar = '<tr><td colspan="2" class="MsgToolBar"><table border=0 cellspacing=0 cellpadding=0 width="100%"><tr>
<td nowrap align="left">' . $user_profile . ' ' . $email_link . ' ' . $private_msg_link . '</td>
<td nowrap align="right"><a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=pmsg&' . _rsid . '&btn_delete=1&sel=' . $obj->id . '"><img src="/egroupware/fudforum/3814588639/theme/italian/images/msg_delete.gif" alt="" /></a> ' . $edit_link . $reply_link . $quote_link . '<a class="GenLink" href="/egroupware/fudforum/3814588639/index.php?t=ppost&forward=' . $obj->id . '&' . _rsid . '"><img src="/egroupware/fudforum/3814588639/theme/italian/images/msg_forward.gif" alt="" /></a></td>
</tr></table></td></tr>';
} else {
$dmsg_user_info = $dmsg_tags = $dmsg_im_row = $user_profile = $msg_toolbar = $buddy_link = $avatar = $online_indicator = $host_name = $location = $msg_icon = '';
$profile_link = $obj->alias;
}
$msg_body = $obj->length ? read_pmsg_body($obj->foff, $obj->length) : 'Non c'è il corpo del messaggio!';
$file_attachments = '';
if ($obj->attach_cnt) {
$c = uq('SELECT a.id, a.original_name, a.dlcount, m.icon, a.fsize FROM phpgw_fud_attach a LEFT JOIN phpgw_fud_mime m ON a.mime_type=m.id WHERE a.message_id=' . $obj->id . ' AND attach_opt=1');
while ($r = db_rowobj($c)) {
$sz = $r->fsize / 1024;
$sz = $sz < 1000 ? number_format($sz, 2) . 'KB' : number_format($sz / 1024, 2) . 'MB';
if (!$r->icon) {
$r->icon = 'unknown.gif';
}
//.........这里部分代码省略.........
示例6: q_singleval
$desc = 'all';
} else {
$desc = 'none';
}
$ttl = q_singleval("SELECT count(*) FROM phpgw_fud_pmsg WHERE duser_id=" . _uid . " AND fldr=" . $folder_id);
$count = $usr->posts_ppg ? $usr->posts_ppg : $POSTS_PER_PAGE;
$start = empty($_GET['start']) || $_GET['start'] >= $ttl ? 0 : (int) $_GET['start'];
$c = uq('SELECT p.id, p.read_stamp, p.post_stamp, p.duser_id, p.ouser_id, p.subject, p.pmsg_opt, p.fldr, p.pdest,
u.users_opt, u.alias, u.last_visit AS time_sec,
u2.users_opt AS users_opt2, u2.alias AS alias2, u2.last_visit AS time_sec2
FROM phpgw_fud_pmsg p
INNER JOIN phpgw_fud_users u ON p.ouser_id=u.id
LEFT JOIN phpgw_fud_users u2 ON p.pdest=u2.id
WHERE duser_id=' . _uid . ' AND fldr=' . $folder_id . ' ORDER BY post_stamp DESC LIMIT ' . qry_limit($count, $start));
$private_msg_entry = '';
while ($obj = db_rowobj($c)) {
switch ($obj->fldr) {
case 1:
case 2:
$action = '<a href="/egroupware/fudforum/3814588639/index.php?t=ppost&' . _rsid . '&reply=' . $obj->id . '" class="GenLink"><img src="/egroupware/fudforum/3814588639/theme/default/images/msg_reply.gif" alt="" /></a> <a href="/egroupware/fudforum/3814588639/index.php?t=ppost&quote=' . $obj->id . '&' . _rsid . '" class="GenLink"><img src="/egroupware/fudforum/3814588639/theme/default/images/msg_quote.gif" alt="" /></a> <a href="/egroupware/fudforum/3814588639/index.php?t=ppost&forward=' . $obj->id . '&' . _rsid . '" class="GenLink"><img src="/egroupware/fudforum/3814588639/theme/default/images/msg_forward.gif" alt="" /></a>';
break;
case 3:
$obj->users_opt = $obj->users_opt2;
$obj->alias = $obj->alias2;
$obj->time_sec = $obj->time_sec2;
$obj->ouser_id = $obj->pdest;
$action = '';
break;
case 5:
$action = '<a href="/egroupware/fudforum/3814588639/index.php?t=ppost&' . _rsid . '&forward=' . $obj->id . '" class="GenLink"><img src="/egroupware/fudforum/3814588639/theme/default/images/msg_forward.gif" alt="" /></a>';
break;
示例7: qry_limit
pot.id AS cant_vote
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_users u ON m.poster_id=u.id
LEFT JOIN phpgw_fud_level l ON u.level_id=l.id
LEFT JOIN phpgw_fud_poll p ON m.poll_id=p.id
LEFT JOIN phpgw_fud_poll_opt_track pot ON pot.poll_id=p.id AND pot.user_id=' . _uid . '
WHERE
m.thread_id=' . $_GET['th'] . ' AND m.apr=1
ORDER BY m.id ASC LIMIT ' . qry_limit($count, $_GET['start']));
$obj2 = $message_data = '';
$usr->md = $frm->md;
$m_num = 0;
while ($obj = db_rowobj($result)) {
$message_data .= tmpl_drawmsg($obj, $usr, $perms, false, $m_num, array($_GET['start'], $count));
$obj2 = $obj;
}
unset($result);
un_register_fps();
if (!isset($_GET['prevloaded'])) {
th_inc_view_count($frm->id);
if (_uid && $obj2) {
if ($frm->last_forum_view < $obj2->post_stamp) {
user_register_forum_view($frm->forum_id);
}
if ($frm->last_view < $obj2->post_stamp) {
user_register_thread_view($frm->id, $obj2->post_stamp, $obj2->id);
}
}
示例8: foreach
if (is_array($a) && @count($a)) {
foreach ($a as $i) {
$attch[] = array('id' => $i[0], 'name' => $i[1], 'nd' => $i[3]);
}
$fpdf->add_attacments($attch);
}
}
/* handle polls */
if ($o->poll_name && $o->poll_cache) {
$pc = @unserialize($o->poll_cache);
if (is_array($pc) && count($pc)) {
reverse_fmt($o->poll_name);
foreach ($pc as $opt) {
$opt[0] = strip_tags(post_to_smiley($opt[0], $re));
reverse_fmt($opt[0]);
$votes[] = array('name' => $opt[0], 'votes' => $opt[1]);
}
$fpdf->add_poll($o->poll_name, $votes, $o->total_votes);
}
}
$fpdf->end_message();
} while ($o = db_rowobj($c));
un_register_fps();
$fpdf->end_page();
pdf_close($fpdf->pdf);
$pdf = pdf_get_buffer($fpdf->pdf);
header('Content-type: application/pdf');
header('Content-length: ' . strlen($pdf));
header('Content-disposition: inline; filename=FUDforum' . date('Ymd') . '.pdf');
echo $pdf;
pdf_delete($fpdf->pdf);