当前位置: 首页>>代码示例>>PHP>>正文


PHP q_singleval函数代码示例

本文整理汇总了PHP中q_singleval函数的典型用法代码示例。如果您正苦于以下问题:PHP q_singleval函数的具体用法?PHP q_singleval怎么用?PHP q_singleval使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了q_singleval函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: attach_add

function attach_add($at, $owner, $attach_opt = 0, $ext = 0)
{
    $mime_type = (int) q_singleval("SELECT id FROM phpgw_fud_mime WHERE fl_ext='" . addslashes(substr(strrchr($at['name'], '.'), 1)) . "'");
    $id = db_qid("INSERT INTO phpgw_fud_attach (location,message_id,original_name,owner,attach_opt,mime_type,fsize) VALUES('',0,'" . addslashes($at['name']) . "', " . $owner . ", " . $attach_opt . ", " . $mime_type . ", " . $at['size'] . ")");
    safe_attachment_copy($at['tmp_name'], $id, $ext);
    return $id;
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:7,代码来源:getfile.php

示例2: th_move

function th_move($id, $to_forum, $root_msg_id, $forum_id, $last_post_date, $last_post_id)
{
    if (!db_locked()) {
        db_lock('phpgw_fud_poll WRITE, phpgw_fud_thread_view WRITE, phpgw_fud_thread WRITE, phpgw_fud_forum WRITE, phpgw_fud_msg WRITE');
        $ll = 1;
    }
    $msg_count = q_singleval("SELECT count(*) FROM phpgw_fud_thread LEFT JOIN phpgw_fud_msg ON phpgw_fud_msg.thread_id=phpgw_fud_thread.id WHERE phpgw_fud_msg.apr=1 AND phpgw_fud_thread.id=" . $id);
    q('UPDATE phpgw_fud_thread SET forum_id=' . $to_forum . ' WHERE id=' . $id);
    q('UPDATE phpgw_fud_forum SET post_count=post_count-' . $msg_count . ' WHERE id=' . $forum_id);
    q('UPDATE phpgw_fud_forum SET thread_count=thread_count+1,post_count=post_count+' . $msg_count . ' WHERE id=' . $to_forum);
    q('DELETE FROM phpgw_fud_thread WHERE forum_id=' . $to_forum . ' AND root_msg_id=' . $root_msg_id . ' AND moved_to=' . $forum_id);
    if ($aff_rows = db_affected()) {
        q('UPDATE phpgw_fud_forum SET thread_count=thread_count-' . $aff_rows . ' WHERE id=' . $to_forum);
    }
    q('UPDATE phpgw_fud_thread SET moved_to=' . $to_forum . ' WHERE id!=' . $id . ' AND root_msg_id=' . $root_msg_id);
    q('INSERT INTO phpgw_fud_thread
		(forum_id, root_msg_id, last_post_date, last_post_id, moved_to)
	VALUES
		(' . $forum_id . ', ' . $root_msg_id . ', ' . $last_post_date . ', ' . $last_post_id . ', ' . $to_forum . ')');
    rebuild_forum_view($forum_id);
    rebuild_forum_view($to_forum);
    $c = q('SELECT poll_id FROM phpgw_fud_msg WHERE thread_id=' . $id . ' AND apr=1 AND poll_id>0');
    while ($r = db_rowarr($c)) {
        $p[] = $r[0];
    }
    unset($c);
    if (isset($p)) {
        q('UPDATE phpgw_fud_poll SET forum_id=' . $to_forum . ' WHERE id IN(' . implode(',', $p) . ')');
    }
    if (isset($ll)) {
        db_unlock();
    }
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:33,代码来源:mvthread.php

示例3: poll_validate

function poll_validate($poll_id, $msg_id)
{
    if (($mid = (int) q_singleval('SELECT id FROM phpgw_fud_msg WHERE poll_id=' . $poll_id)) && $mid != $msg_id) {
        return 0;
    } else {
        return $poll_id;
    }
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:8,代码来源:poll.php

示例4: 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;
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:13,代码来源:admstats.php

示例5: register_vote

function register_vote(&$options, $poll_id, $opt_id, $mid)
{
    /* invalid option or previously voted */
    if (!isset($options[$opt_id]) || q_singleval('SELECT id FROM phpgw_fud_poll_opt_track WHERE poll_id=' . $poll_id . ' AND user_id=' . _uid)) {
        return;
    }
    if (db_li('INSERT INTO phpgw_fud_poll_opt_track(poll_id, user_id, poll_opt) VALUES(' . $poll_id . ', ' . _uid . ', ' . $opt_id . ')', $a)) {
        q('UPDATE phpgw_fud_poll_opt SET count=count+1 WHERE id=' . $opt_id);
        q('UPDATE phpgw_fud_poll SET total_votes=total_votes+1 WHERE id=' . $poll_id);
        poll_cache_rebuild($opt_id, $options);
        q('UPDATE phpgw_fud_msg SET poll_cache=' . strnull(addslashes(@serialize($options))) . ' WHERE id=' . $mid);
    }
    return 1;
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:14,代码来源:reported.php

示例6: grp_delete_member

function grp_delete_member($id, $user_id)
{
    if (!$user_id || $user_id == '2147483647') {
        return;
    }
    q('DELETE FROM phpgw_fud_group_members WHERE group_id=' . $id . ' AND user_id=' . $user_id);
    if (q_singleval("SELECT id FROM phpgw_fud_group_members WHERE user_id=" . $user_id . " LIMIT 1")) {
        /* we rebuild cache, since this user's permission for a particular resource are controled by
         * more the one group. */
        grp_rebuild_cache(array($user_id));
    } else {
        q("DELETE FROM phpgw_fud_group_cache WHERE user_id=" . $user_id);
    }
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:14,代码来源:groupmgr.php

示例7: ignore_add

    }
    if (!empty($usr->ignore_list)) {
        $usr->ignore_list = @unserialize($usr->ignore_list);
    }
    if (!isset($usr->ignore_list[$ignore_id])) {
        ignore_add(_uid, $ignore_id);
    } else {
        error_dialog('Info', 'You already have this user on your ignore list');
    }
}
/* incomming from message display page (ignore link) */
if (isset($_GET['add']) && ($_GET['add'] = (int) $_GET['add'])) {
    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) {
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:31,代码来源:ignore_list.php

示例8: php_uname

}
require $WWW_ROOT_DISK . 'adm/admpanel.php';
?>
<h2>System Configuration</h2>
<table class="datatable">
<tr>
	<td><b>PHP built On:</b></td>
	<td><?php 
echo php_uname();
?>
</td>
</tr>
<tr>
	<td><b>Database Version:</b></td>
	<td><?php 
echo q_singleval('SELECT VERSION()');
?>
</td>
</tr>
<tr>
	<td><b>PHP Version:</b></td>
	<td><?php 
echo PHP_VERSION;
?>
</td>
</tr>
<tr>
	<td><b>Web Server:</b></td>
	<td><?php 
echo get_server_software();
?>
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:31,代码来源:admsysinfo.php

示例9: is_forum_notified

function is_forum_notified($user_id, $forum_id)
{
    return q_singleval('SELECT id FROM phpgw_fud_forum_notify WHERE forum_id=' . $forum_id . ' AND user_id=' . $user_id);
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:4,代码来源:threadt.php

示例10: alt_var

        $email_link = '<tr class="' . alt_var('search_alt', 'RowStyleA', 'RowStyleB') . '"><td nowrap class="GenText">Email:</td><td class="GenText">[<a href="/egroupware/fudforum/3814588639/index.php?t=email&amp;toi=' . $u->id . '&amp;' . _rsid . '">Clicca qui per spedire un&#39;email all&#39;utente</a>]</td></tr>';
    } else {
        $email_link = '';
    }
}
if ($referals = q_singleval('SELECT count(*) FROM phpgw_fud_users WHERE referer_id=' . $u->id)) {
    $referals = '<tr class="' . alt_var('search_alt', 'RowStyleA', 'RowStyleB') . '"><td nowrap class="GenText">Utenti referenziati:</td><td class="GenText"><a href="/egroupware/fudforum/3814588639/index.php?t=list_referers&amp;' . _rsid . '">' . $referals . ' Utenti</a></td></tr>';
} else {
    $referals = '';
}
if (_uid && _uid != $u->id && !q_singleval("SELECT id FROM phpgw_fud_buddy WHERE user_id=" . _uid . " AND bud_id=" . $u->id)) {
    $buddy = '<tr class="' . alt_var('search_alt', 'RowStyleA', 'RowStyleB') . '"><td nowrap class="GenText">Buddy:</td><td class="GenText"><a href="/egroupware/fudforum/3814588639/index.php?t=buddy_list&amp;add=' . $u->id . '&amp;' . _rsid . '" class="GenLink">aggiungi alla buddy list</a></td></tr>';
} else {
    $buddy = '';
}
if ($polls = q_singleval('SELECT count(*) FROM phpgw_fud_poll p INNER JOIN phpgw_fud_forum f ON p.forum_id=f.id WHERE p.owner=' . $u->id . ' AND f.cat_id>0 ' . ($usr->users_opt & 1048576 ? '' : ' AND f.id IN(' . implode(',', array_keys($frm_perms)) . ')'))) {
    $polls = '<tr class="' . alt_var('search_alt', 'RowStyleA', 'RowStyleB') . '"><td nowrap class="GenText">Sondaggi:</td><td class="GenText"><a href="/egroupware/fudforum/3814588639/index.php?t=polllist&amp;uid=' . $u->id . '&amp;' . _rsid . '">' . $polls . '</a></td></tr>';
} else {
    $polls = '';
}
$usrinfo_private_msg = $FUD_OPT_1 & 1024 && _uid ? '<tr class="' . alt_var('search_alt', 'RowStyleA', 'RowStyleB') . '"><td nowrap class="GenText">Messaggio privato:</td><td class="GenText"><a href="/egroupware/index.php?menuaction=messenger.uimessenger.compose&message_to=;' . _rsid . '&amp;message_to=' . $u->alias . '" class="GenLink"><img src="/egroupware/fudforum/3814588639/theme/italian/images/msg_pm.gif" /></a></td></tr>' : '';
if ($u->users_opt & 1024) {
    $gender = '<tr class="' . alt_var('search_alt', 'RowStyleA', 'RowStyleB') . '"><td nowrap class="GenText">Genere:</td><td class="GenText">Maschio</td></tr>';
} else {
    if (!($u->users_opt & 512)) {
        $gender = '<tr class="' . alt_var('search_alt', 'RowStyleA', 'RowStyleB') . '"><td nowrap class="GenText">Genere:</td><td class="GenText">Femmina</td></tr>';
    } else {
        $gender = '';
    }
}
$location = $u->location ? '<tr class="' . alt_var('search_alt', 'RowStyleA', 'RowStyleB') . '"><td nowrap class="GenText">Località:</td><td class="GenText">' . $u->location . '</td></tr>' : '';
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:31,代码来源:usrinfo.php

示例11: pmsg_del

function pmsg_del($mid, $fldr = null)
{
    if (is_null($fldr) && is_null($fldr = q_singleval('SELECT fldr FROM phpgw_fud_pmsg WHERE duser_id=' . _uid . ' AND id=' . $mid))) {
        return;
    }
    if ($fldr != 5) {
        pmsg_move($mid, 5, false);
    } else {
        q('DELETE FROM phpgw_fud_pmsg WHERE id=' . $mid);
        $c = uq('SELECT id FROM phpgw_fud_attach WHERE message_id=' . $mid . ' AND attach_opt=1');
        while ($r = db_rowarr($c)) {
            @unlink($GLOBALS[''] . $r[0] . '.atch');
        }
        q('DELETE FROM phpgw_fud_attach WHERE message_id=' . $mid . ' AND attach_opt=1');
    }
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:16,代码来源:pmsg_view.php

示例12: q

">
<input type="hidden" name="adm_confirm" value="1">
<div align="center">You are taking away administration privileges from <font color="red"><b><?php 
                echo $u->alias;
                ?>
</b></font>!<br><br>
Are you sure you want to do this?<br>
<input type="submit" value="Yes" name="btn_yes"> <input type="submit" value="No" name="btn_no">
</div>
</form>
</body></html>
<?php 
                exit;
            } else {
                if (isset($_POST['btn_yes'])) {
                    if (q_singleval('SELECT count(*) FROM ' . $DBHOST_TBL_PREFIX . 'mod WHERE user_id=' . $u->id)) {
                        q('UPDATE ' . $DBHOST_TBL_PREFIX . 'users SET users_opt=(users_opt & ~ 1048576) |524288 WHERE id=' . $usr_id);
                        $u->users_opt ^= 1048576;
                    } else {
                        q('UPDATE ' . $DBHOST_TBL_PREFIX . 'users SET users_opt=users_opt & ~ (524288|1048576) WHERE id=' . $usr_id);
                        $u->users_opt = $u->users_opt & ~(1048576 | 524288);
                    }
                }
            }
        } else {
            if (!isset($_POST['adm_confirm'])) {
                ?>
<html>
<title>Adminstrator confirmation</title>
<body color="white">
<form method="post" action="admuser.php"><?php 
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:31,代码来源:admuser.php

示例13: foreach

     if (!$gid) {
         $error_reason = 'Failed to add group';
         $error = 1;
     } else {
         if ($gr_resource) {
             foreach ($gr_resource as $v) {
                 q('INSERT INTO ' . $DBHOST_TBL_PREFIX . 'group_resources (resource_id, group_id) VALUES(' . (int) $v . ', ' . $gid . ')');
             }
         }
         /* only rebuild the group cache if the all ANON/REG users were added */
         if ($gr_ramasks) {
             grp_rebuild_cache(array(0, 2147483647));
         }
     }
 } else {
     if (($frm = q_singleval('SELECT forum_id FROM ' . $DBHOST_TBL_PREFIX . 'groups WHERE id=' . $edit)) !== null) {
         /* update an existing group */
         if (!$res) {
             $old = db_sab("SELECT groups_opt, groups_opti FROM " . $DBHOST_TBL_PREFIX . "groups WHERE id=" . $edit);
         } else {
             $old =& $res[$edit];
         }
         group_sync($edit, isset($_POST['gr_name']) ? $_POST['gr_name'] : null, $gr_inherit_id, $perm, $permi);
         if (!$frm) {
             q('DELETE FROM ' . $DBHOST_TBL_PREFIX . 'group_resources WHERE group_id=' . $edit);
             $aff = db_affected();
             if ($gr_resource) {
                 foreach ($gr_resource as $v) {
                     q('INSERT INTO ' . $DBHOST_TBL_PREFIX . 'group_resources (resource_id, group_id) VALUES(' . (int) $v . ', ' . $edit . ')');
                 }
             }
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:31,代码来源:admgroups.php

示例14: compile_all

     $edit = '';
 } else {
     if (isset($_GET['rebuild']) && ($data = db_saq('SELECT theme, lang, name FROM ' . $DBHOST_TBL_PREFIX . 'themes WHERE id=' . (int) $_GET['rebuild']))) {
         compile_all($data[0], $data[1], $data[2]);
     } else {
         if (isset($_GET['edit']) && ($c = db_arr_assoc('SELECT * FROM ' . $DBHOST_TBL_PREFIX . 'themes WHERE id=' . $edit))) {
             foreach ($c as $k => $v) {
                 ${'thm_' . $k} = $v;
             }
             $thm_t_default = $c['theme_opt'] & 2;
             $thm_enabled = $c['theme_opt'] & 1;
         } else {
             if (isset($_GET['del']) && (int) $_GET['del'] > 1) {
                 fud_theme::delete((int) $_GET['del']);
             } else {
                 if (isset($_GET['optimize']) && $is_tok && ($t_name = q_singleval('SELECT name FROM ' . $DBHOST_TBL_PREFIX . 'themes WHERE id=' . (int) $_GET['optimize']))) {
                     /* optimize *.php files */
                     $path = $WWW_ROOT_DISK . 'theme/' . $t_name;
                     $dir = opendir($path);
                     $path .= '/';
                     while ($f = readdir($dir)) {
                         if ($f == '.' || $f == '..') {
                             continue;
                         }
                         if (@is_file($path . $f) && substr($f, -4) == '.php') {
                             $toks = token_get_all(file_get_contents($path . $f));
                             while (get_func_usage($toks)) {
                             }
                             clean_code($path . $f, $toks);
                         }
                     }
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:31,代码来源:admthemes.php

示例15: user_set_post_count

function user_set_post_count($uid)
{
    $pd = db_saq("SELECT MAX(id),count(*) FROM phpgw_fud_msg WHERE poster_id=" . $uid . " AND apr=1");
    $level_id = (int) q_singleval('SELECT id FROM phpgw_fud_level WHERE post_count <= ' . $pd[1] . ' ORDER BY post_count DESC LIMIT 1');
    q('UPDATE phpgw_fud_users SET u_last_post_id=' . (int) $pd[0] . ', posted_msg_count=' . (int) $pd[1] . ', level_id=' . $level_id . ' WHERE id=' . $uid);
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:6,代码来源:index.php


注:本文中的q_singleval函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。