本文整理汇总了PHP中cpg_db_fetch_rowset函数的典型用法代码示例。如果您正苦于以下问题:PHP cpg_db_fetch_rowset函数的具体用法?PHP cpg_db_fetch_rowset怎么用?PHP cpg_db_fetch_rowset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cpg_db_fetch_rowset函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_subcat_data
/**
* Function to get the category data
*/
function get_subcat_data($parent, $ident = '')
{
global $CONFIG, $CAT_LIST;
if ($CONFIG['categories_alpha_sort'] == 1) {
$sort_query = 'name';
} else {
$sort_query = 'pos';
}
$sql = "SELECT cid, name, description " . "FROM {$CONFIG['TABLE_CATEGORIES']} " . "WHERE parent = '{$parent}' " . "ORDER BY {$sort_query}";
$result = cpg_db_query($sql);
if (($cat_count = mysql_num_rows($result)) > 0) {
$rowset = cpg_db_fetch_rowset($result);
$pos = 0;
foreach ($rowset as $subcat) {
if ($pos > 0) {
$CAT_LIST[] = array('cid' => $subcat['cid'], 'parent' => $parent, 'pos' => $pos++, 'prev' => $prev_cid, 'cat_count' => $cat_count, 'name' => $ident . $subcat['name']);
$CAT_LIST[$last_index]['next'] = $subcat['cid'];
} else {
$CAT_LIST[] = array('cid' => $subcat['cid'], 'parent' => $parent, 'pos' => $pos++, 'cat_count' => $cat_count, 'name' => $ident . $subcat['name']);
}
$prev_cid = $subcat['cid'];
$last_index = count($CAT_LIST) - 1;
get_subcat_data($subcat['cid'], $ident . ' ');
}
}
}
示例2: alb_get_subcat_data
/**
* alb_get_subcat_data()
*
* @param integer $parent
* @param string $ident
**/
function alb_get_subcat_data($parent, $ident = '')
{
global $CONFIG, $CAT_LIST, $USER_DATA;
// select cats where the users can change the albums
$groups = '';
foreach ($USER_DATA['groups'] as $group) {
$groups .= "group_id = '{$group}' OR ";
}
$groups .= "0";
$result = cpg_db_query("SELECT cid, name, description FROM {$CONFIG['TABLE_CATEGORIES']} WHERE parent = '{$parent}' AND cid != 1 ORDER BY pos");
if ($result->numRows() > 0) {
$rowset = cpg_db_fetch_rowset($result);
foreach ($rowset as $subcat) {
if (!GALLERY_ADMIN_MODE) {
$check_group = cpg_db_query("SELECT group_id FROM {$CONFIG['TABLE_CATMAP']} WHERE ({$groups}) AND cid = " . $subcat['cid']);
$check_group_rowset = cpg_db_fetch_rowset($check_group);
if ($check_group_rowset) {
$CAT_LIST[] = array($subcat['cid'], $ident . $subcat['name']);
}
} else {
$CAT_LIST[] = array($subcat['cid'], $ident . $subcat['name']);
}
alb_get_subcat_data($subcat['cid'], $ident . ' ');
}
}
}
示例3: minicms
function minicms($content = '')
{
global $MINICMS, $CONFIG, $cat, $album, $REFERER, $lang_minicms, $HTML_SUBST_DECODE, $cms_array;
if ($MINICMS['dbver'] != MINICMS_DBVER) {
echo "<h2>{$lang_minicms['minicms_full']} {$MINICMS['dbver']}</h2><br />{$lang_minicms['dbver_nomatch']}: " . MINICMS_DBVER . "<br />";
minicms_configure(false);
//auto-updater and dont print the "go" button
}
$where = isset($MINICMS['ID']) ? "ID='{$MINICMS['ID']}'" : "conid='{$MINICMS['conid']}' AND type='{$MINICMS['type']}'";
$query = "SELECT * FROM {$CONFIG['TABLE_CMS']} WHERE {$where} ORDER BY cpos";
$result = cpg_db_query($query);
$cms_array = cpg_db_fetch_rowset($result);
$counter = 0;
foreach ($cms_array as $key => $cms) {
$cms_array[$key]['next_ID'] = $counter < count($cms_array) - 1 && $cms['type'] == $cms_array[$counter + 1]['type'] && $cms['conid'] == $cms_array[$counter + 1]['conid'] ? '&id2=' . $cms_array[$counter + 1]['ID'] : '';
$cms_array[$key]['prev_ID'] = $counter > 0 && $cms['type'] == $cms_array[$counter - 1]['type'] && $cms['conid'] == $cms_array[$counter - 1]['conid'] ? '&id2=' . $cms_array[$counter - 1]['ID'] : '';
$cms_array[$key]['content'] = html_entity_decode(stripslashes($cms['content']));
$counter++;
}
ob_start();
theme_minicms($cms_array);
//$content.=ob_get_clean();
$content = ob_get_clean();
return $content;
}
示例4: get_album_data
function get_album_data()
{
global $CONFIG, $ALBUM_LIST;
$result = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} ORDER BY title");
if (mysql_num_rows($result) > 0) {
$rowset = cpg_db_fetch_rowset($result);
foreach ($rowset as $alb) {
$ALBUM_LIST[] = array($alb['aid'], $alb['title']);
}
}
}
示例5: alb_get_subcat_data
/**
* alb_get_subcat_data()
*
* @param integer $parent
* @param string $ident
**/
function alb_get_subcat_data($parent, $ident = '')
{
global $CONFIG, $CAT_LIST;
$result = cpg_db_query("SELECT cid, name, description FROM {$CONFIG['TABLE_CATEGORIES']} WHERE parent = '{$parent}' AND cid != 1 ORDER BY pos");
if (mysql_num_rows($result) > 0) {
$rowset = cpg_db_fetch_rowset($result);
foreach ($rowset as $subcat) {
$CAT_LIST[] = array($subcat['cid'], $ident . $subcat['name']);
alb_get_subcat_data($subcat['cid'], $ident . ' ');
}
}
}
示例6: get_album_data
function get_album_data($category, $ident)
{
global $CONFIG, $catStr, $ALBUM_SET;
$sql = "SELECT aid,title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = {$category} " . $ALBUM_SET;
$result = cpg_db_query($sql);
if (($cat_count = mysql_num_rows($result)) > 0) {
$rowset = cpg_db_fetch_rowset($result);
foreach ($rowset as $subcat) {
$catStr .= "\n {$ident}<album>\n {$ident}<id>{$subcat['aid']}</id>\n {$ident}<name>{$subcat['title']}</name>\n {$ident}</album>";
}
}
}
示例7: h5u_config_groupSel
function h5u_config_groupSel($grpn = 0)
{
global $CONFIG, $superCage;
$sql = "SELECT group_id, group_name FROM {$CONFIG['TABLE_USERGROUPS']} ORDER BY group_name";
$rslt = cpg_db_query($sql);
$group_list = cpg_db_fetch_rowset($rslt, true);
$htm = '<select name="h5u_gSel" onchange="selectConfigGroup(event,this)" style="margin-left:3em">';
$htm .= '<option value="0"' . ($grpn == 0 ? ' selected' : '') . '>< default ></option>';
foreach ($group_list as $group) {
$htm .= '<option value="' . $group['group_id'] . '"' . ($grpn == $group['group_id'] ? ' selected' : '') . '>' . $group['group_name'] . '</option>';
}
return $htm . '</select><div id="h5u_busy"></div>';
}
示例8: thumb_get_subcat_data
function thumb_get_subcat_data($parent, &$album_set_array)
{
global $CONFIG;
$result = cpg_db_query("SELECT cid, name, description FROM {$CONFIG['TABLE_CATEGORIES']} WHERE parent = '{$parent}'");
if (mysql_num_rows($result) > 0) {
$rowset = cpg_db_fetch_rowset($result);
foreach ($rowset as $subcat) {
$result = cpg_db_query("SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = {$subcat['cid']}");
$album_count = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
$album_set_array[] = $row['aid'];
}
// while
thumb_get_subcat_data($subcat['cid'], $album_set_array);
}
}
}
示例9: get_subcat_data
/**
* get_subcat_data()
*
* @param integer $parent
* @param string $ident
**/
function get_subcat_data($parent, $ident = '')
{
global $CONFIG, $CAT_LIST, $USER_DATA;
//select cats where the users can change the albums
$group_id = $USER_DATA['group_id'];
$result = cpg_db_query("SELECT cid, name, description FROM {$CONFIG['TABLE_CATEGORIES']} WHERE parent = '{$parent}' AND cid != 1 ORDER BY pos");
if (mysql_num_rows($result) > 0) {
$rowset = cpg_db_fetch_rowset($result);
foreach ($rowset as $subcat) {
$check_group = cpg_db_query("SELECT group_id FROM {$CONFIG['TABLE_CATMAP']} WHERE group_id = '{$group_id}' AND cid=" . $subcat['cid']);
$check_group_rowset = cpg_db_fetch_rowset($check_group);
if ($check_group_rowset) {
$CAT_LIST[] = array($subcat['cid'], $ident . $subcat['name']);
}
get_subcat_data($subcat['cid'], $ident . ' ');
}
}
}
示例10: secondary_user_groups_page_start
function secondary_user_groups_page_start()
{
global $CONFIG, $cpg_udb, $secondary_user_groups_user_groups;
if (!$cpg_udb->can_join_tables) {
return;
} else {
define('CAN_JOIN_TABLES', '1');
}
$group_id_add = $CONFIG['bridge_enable'] ? 100 : 0;
$result = cpg_db_query("SELECT {$cpg_udb->field['grouptbl_group_id']} AS group_id, {$cpg_udb->field['grouptbl_group_name']} AS group_name FROM {$cpg_udb->groupstable}");
while ($row = mysql_fetch_assoc($result)) {
$group_names[$row['group_id'] + $group_id_add] = $row['group_name'];
}
mysql_free_result($result);
$users = cpg_db_fetch_rowset(cpg_db_query("SELECT {$cpg_udb->field['user_id']} AS user_id FROM {$cpg_udb->usertable}"));
foreach ($users as $user) {
$group_ids = cpg_get_groups($user['user_id']);
foreach ($group_ids as $group_id) {
if ($group_names[$group_id]) {
$secondary_user_groups_user_groups[$user['user_id']][] = $group_names[$group_id];
}
}
}
}
示例11: usergroup_list_box
/**
* usergroup_list_box()
*
* @param integer $cid
*
* @return string $usergroup_listbox
**/
function usergroup_list_box($cid)
{
global $CONFIG, $LINEBREAK, $cpg_udb;
$add = $cpg_udb->use_post_based_groups ? 100 : 0;
$exclude_groups = array($cpg_udb->guestgroup + $add);
foreach ($cpg_udb->admingroups as $id) {
$exclude_groups[] = $id + $add;
}
//get the category info from the db
$sql = "SELECT ug.group_name AS name, ug.group_id AS id, catm.group_id AS catm_gid FROM {$CONFIG['TABLE_USERGROUPS']} AS ug LEFT JOIN {$CONFIG['TABLE_CATMAP']} AS catm ON catm.group_id = ug.group_id AND catm.cid = {$cid}";
$sql .= " HAVING id NOT IN (" . implode(', ', $exclude_groups) . ")";
// don't list administrator and guest groups
$result = cpg_db_query($sql);
$rowset = cpg_db_fetch_rowset($result, true);
//put the values in an array for ease of use and clean code for now
foreach ($rowset as $row) {
$groups[$row['id']]['name'] = $row['name'];
if ($row['catm_gid'] != null) {
$groups[$row['id']]['selected'] = 'true';
} else {
$groups[$row['id']]['selected'] = 'false';
}
}
//create listbox
$usergroup_listbox = '<select name="user_groups[]" class="listbox" multiple="multiple">' . $LINEBREAK;
//loop through all groups
foreach ($groups as $id => $values) {
$usergroup_listbox .= ' <option value="' . $id . '"' . ($values['selected'] == 'true' ? 'selected="selected"' : '') . ' >' . $values['name'] . '</option>' . $LINEBREAK;
}
$usergroup_listbox .= '</select>' . $LINEBREAK;
//return listbox
return $usergroup_listbox;
}
示例12: get_user_albums
function get_user_albums($user_id = '')
{
global $CONFIG, $USER_ALBUMS_ARRAY, $user_albums_list;
if ($user_id != '') {
$or = " OR category='" . (FIRST_USER_CAT + $user_id) . "'";
}
if (!isset($USER_ALBUMS_ARRAY[USER_ID])) {
$user_albums = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category='" . (FIRST_USER_CAT + USER_ID) . "' {$or} ORDER BY title");
if (mysql_num_rows($user_albums)) {
$user_albums_list = cpg_db_fetch_rowset($user_albums);
} else {
$user_albums_list = array();
}
mysql_free_result($user_albums);
$USER_ALBUMS_ARRAY[USER_ID] = $user_albums_list;
} else {
$user_albums_list =& $USER_ALBUMS_ARRAY[USER_ID];
}
}
示例13: cpg_db_fetch_rowset
$public_albums_list = cpg_db_fetch_rowset($public_albums);
} else {
$public_albums_list = array();
}
//do the same for non-categorized albums
if ($public_albums_no_cat->numRows()) {
$public_albums_list_no_cat = cpg_db_fetch_rowset($public_albums_no_cat);
} else {
$public_albums_list_no_cat = array();
}
//merge the 2 album arrays
$public_albums_list = array_merge($public_albums_list, $public_albums_list_no_cat);
if (USER_ID) {
$user_albums = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category='" . (FIRST_USER_CAT + USER_ID) . "' ORDER BY title");
if ($user_albums->numRows()) {
$user_albums_list = cpg_db_fetch_rowset($user_albums);
} else {
$user_albums_list = array();
}
} else {
$user_albums_list = array();
}
if (!count($public_albums_list) && !count($user_albums_list)) {
// there's no album where the user is allowed to upload to
if (USER_CAN_CREATE_ALBUMS) {
cpg_die(ERROR, $lang_upload_php['err_no_alb_uploadables'] . '<br /> <br /><a href="albmgr.php" title="' . $lang_user_admin_menu['albmgr_title'] . '" class="admin_menu">' . $lang_user_admin_menu['albmgr_lnk'] . '</a>', __FILE__, __LINE__);
} else {
cpg_die(ERROR, $lang_upload_php['err_no_alb_uploadables'], __FILE__, __LINE__);
}
}
// Assign maximum file size for browser controls.
示例14: get_pic_comments
function get_pic_comments($pid)
{
global $CONFIG;
$comment_query = "SELECT msg_author, msg_date, msg_body FROM " . $CONFIG['TABLE_COMMENTS'] . " WHERE pid=" . $pid . " LIMIT 5";
logg($comment_query);
$result = cpg_db_query($comment_query);
$rows = cpg_db_fetch_rowset($result);
return $rows;
}
示例15: xfd_head
function xfd_head()
{
global $CONFIG, $thisplugin, $XFDSET, $album, $cat;
$xfd_feed = "index.php?file=xfeed/xfeed";
$superCage = Inspekt::makeSuperCage();
switch ($XFDSET['xfd_theme']) {
case 0:
$color = "orange";
break;
case 1:
$color = "azure";
break;
case 2:
$color = "red";
break;
case 3:
$color = "blue";
break;
case 4:
$color = "trans_dark";
break;
case 5:
$color = "trans_light";
break;
}
$header = "\r\n <!-- Begin CPG XFeed Headcode -->\r\n ";
if ($XFDSET['xfd_feedroute'] == 1) {
$xfeed_loc = "feeds.feedburner.com/" . $XFDSET['xfd_feedburnuname'];
$header .= "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"" . $CONFIG['gallery_name'] . " - Feedburner\" href=\"http://" . $xfeed_loc . "\" />\n";
}
$extra_header = $header_str = '';
if ($superCage->get->keyExists('album')) {
$album = $superCage->get->getRaw('album');
$header_str .= "&album={$album}";
}
if ($superCage->get->keyExists('cat')) {
$cat = $superCage->get->getRaw('cat');
$header_str .= "&cat={$cat}";
}
// Code to show the proper title for various RSS and ATOM
$extraTitle = '';
if ($album) {
if ((int) $album) {
$albumDetails = get_album_name((int) $album);
$album = $albumDetails['title'];
} else {
$album = ucwords($album);
}
$extraTitle .= " | {$album}";
}
if (!is_null($cat) && (int) $cat !== FALSE) {
if ($cat < 0) {
$album = -$cat;
$query = "SELECT category FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = '{$album}'";
$result = cpg_db_query($query);
$row = cpg_db_fetch_rowset($result);
$cat = $row[0]['category'];
}
$cat_name = populate_category_name($cat);
$extraTitle .= " | {$cat_name}";
}
if ($header_str) {
$extra_header = "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"{$CONFIG['gallery_name']}{$extraTitle} - RSS\" href=\"{$CONFIG['ecards_more_pic_target']}{$xfd_feed}{$header_str}\" />\r\n <link rel=\"alternate\" type=\"application/atom+xml\" title=\"" . $CONFIG['gallery_name'] . "{$extraTitle} - Atom\" href=\"{$CONFIG['ecards_more_pic_target']}{$xfd_feed}&type=atom{$header_str}\" />";
}
$header .= " <link rel=\"alternate\" type=\"application/rss+xml\" title=\"" . $CONFIG['gallery_name'] . " - RSS\" href=\"" . $CONFIG['ecards_more_pic_target'] . $xfd_feed . "\" />\r\n <link rel=\"alternate\" type=\"application/atom+xml\" title=\"" . $CONFIG['gallery_name'] . " - Atom\" href=\"" . $CONFIG['ecards_more_pic_target'] . $xfd_feed . "&type=atom\" />\r\n {$extra_header}\r\n <style type=\"text/css\">\r\n .xfeeds{background-image: url(./plugins/xfeed/images/xfeeds_" . $color . ".png);}\r\n </style>\r\n <link rel=\"stylesheet\" href=\"plugins/xfeed/css/xfeeds.css\" type=\"text/css\" />\r\n <!-- END CPG XFeed Headcode -->\r\n ";
return $header;
}