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


PHP fetch_query_sql函数代码示例

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


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

示例1: doAction

 function doAction($action)
 {
     if ($action == 'use') {
         global $vbulletin;
         $itemtypeids = explode(',', $this->itemtype->data['options']['itemtypeids']);
         $newitemids = array();
         if (count($itemtypeids)) {
             foreach ($itemtypeids as $itemtypeid) {
                 $itemtypes[] = newItemType($itemtypeid);
             }
             foreach ($itemtypes as $itemtype_obj) {
                 if ($itemtype_obj) {
                     $itemtype = $itemtype_obj->data;
                     $itemoptions = array();
                     if ($itemtype_obj->options['use_duration']) {
                         $itemoptions['duration'] = $this->data['options']['duration'];
                     }
                     $item_new = array('type' => $itemtype['itemtypeid'], 'name' => "{$itemtype['name']}", 'description' => $vbulletin->db->escape_string($this->data['description']), 'price' => $this->data['price'], 'userid' => $vbulletin->userinfo['userid'], 'creator' => $vbulletin->userinfo['userid'], 'create_time' => TIMENOW, 'expire_time' => $this->data['expire_time'], 'status' => KBANK_ITEM_AVAILABLE, 'options' => serialize($itemoptions));
                     $vbulletin->db->query_write(fetch_query_sql($item_new, 'kbank_items'));
                     $newitemids[] = $vbulletin->db->insert_id();
                 }
             }
         }
         $item_new = array('status' => KBANK_ITEM_USED, 'expire_time' => TIMENOW);
         $vbulletin->db->query_write(fetch_query_sql($item_new, 'kbank_items', "WHERE itemid = {$this->data[itemid]}"));
         if (count($newitemids)) {
             $itemid = $newitemids[count($newitemids) - 1];
             //get the last new itemid
             $vbulletin->url = $vbulletin->kbank['phpfile'] . '?' . $vbulletin->session->vars['sessionurl'] . "do=myitems&itemid={$itemid}#item{$itemid}";
         }
     }
     return parent::doAction($action);
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:33,代码来源:pack.kbank.php

示例2: doAction

 function doAction($action)
 {
     global $kbank, $vbulletin, $bbuserinfo, $permissions, $KBANK_HOOK_NAME;
     if ($action == 'enable') {
         $item = $this->data;
         eval('$tmp = "' . fetch_template('kbank_template_announce_enable') . '";');
         eval(standard_error($tmp));
     }
     if ($action == 'do_enable') {
         if ($this->ready2Enable()) {
             $vbulletin->input->clean_array_gpc('r', array('url' => TYPE_NOHTML, 'text' => TYPE_NOHTML));
             if (strlen($vbulletin->GPC['text']) > $this->itemtypedata['options']['text_max']) {
                 $vbulletin->GPC['text'] = substr($vbulletin->GPC['text'], 0, $this->itemtypedata['options']['text_max']) . '..';
             }
             $url_cutoff = array('javascript:', 'ftp://');
             $vbulletin->GPC['url'] = str_replace($url_cutoff, '', $vbulletin->GPC['url']);
             if (substr($vbulletin->GPC['url'], 0, 7) != 'http://') {
                 $vbulletin->GPC['url'] = 'http://' . $vbulletin->GPC['url'];
             }
             $item_new = array('status' => KBANK_ITEM_ENABLED, 'expire_time' => iif(!$this->data['options']['enabled'], iif($this->data['options']['duration'] > 0, TIMENOW + $this->data['options']['duration'] * 24 * 60 * 60, -1), $this->data['expire_time']), 'options' => serialize(array('url' => $vbulletin->GPC['url'], 'text' => $vbulletin->GPC['text'], 'enabled' => 1)));
             $vbulletin->db->query_write(fetch_query_sql($item_new, 'kbank_items', "WHERE itemid = {$this->data['itemid']}"));
             //Update datastore
             updateAnnounceCache();
         }
     }
     if ($this->data['status'] == KBANK_ITEM_ENABLED and ($action == 'sell' or $action == 'gift')) {
         //Update datastore
         updateAnnounceCache();
     }
     if ($action == 'disable') {
         if ($this->ready2Disable()) {
             $item_new = array('status' => KBANK_ITEM_AVAILABLE);
             $vbulletin->db->query_write(fetch_query_sql($item_new, 'kbank_items', "WHERE itemid = {$this->data[itemid]}"));
             //Update datastore
             updateAnnounceCache();
         }
     }
     if ($action == 'work_real' && $KBANK_HOOK_NAME == KBANK_GLOBAL_START) {
         global $kbank_announces;
         $kbank_announces[] = array('url' => $this->data['options']['url'], 'text' => $vbulletin->kbankBBCodeParser->parse_bbcode($this->data['options']['text'], true), 'owner' => getUsername($this->data));
     }
     return parent::doAction($action);
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:43,代码来源:announce.kbank.php

示例3: post_install


//.........这里部分代码省略.........
                 vbflush();
             }
         }
         // insert any remaining templates
         if (!empty($querybits)) {
             /*insert query*/
             $this->db->query_write("\n\t\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "template\n\t\t\t\t\t\t(styleid, templatetype, title, template, template_un, dateline, username, version, product)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t" . implode(',', $querybits) . "\n\t\t\t\t");
         }
         unset($querybits);
         $rebuild['templates'] = true;
     }
     // ############## import stylevars
     if (!empty($this->productobj['stylevardfns']['stylevargroup']) and is_array($this->productobj['stylevardfns']['stylevargroup'])) {
         xml_import_stylevar_definitions($this->productobj['stylevardfns'], $this->productinfo['productid'], -1);
     }
     if (!empty($this->productobj['stylevars']['stylevar']) and is_array($this->productobj['stylevars']['stylevar'])) {
         xml_import_stylevars($this->productobj['stylevars'], -1);
     }
     if (is_array($this->productobj['stylevardfns_mobile']['stylevargroup'])) {
         xml_import_stylevar_definitions($this->productobj['stylevardfns_mobile'], $this->productinfo['productid'], -2);
     }
     if (is_array($this->productobj['stylevars_mobile']['stylevar'])) {
         xml_import_stylevars($this->productobj['stylevars_mobile'], -2);
     }
     // ############## import hooks/plugins
     if (is_array($this->productobj['plugins']['plugin'])) {
         $plugins =& $this->productobj['plugins']['plugin'];
         if (!isset($plugins[0])) {
             $plugins = array($plugins);
         }
         foreach ($plugins as $plugin) {
             $plugin['product'] = $this->productinfo['productid'];
             unset($plugin['devkey']);
             $this->db->query_write(fetch_query_sql($plugin, 'plugin'));
         }
         $rebuild['plugins'] = true;
     }
     // ############## import phrases
     if (is_array($this->productobj['phrases']['phrasetype'])) {
         require_once DIR . '/includes/adminfunctions_language.php';
         $master_phrasetypes = array();
         $master_phrasefields = array();
         foreach (fetch_phrasetypes_array(false) as $phrasetype) {
             $master_phrasefields["{$phrasetype['fieldname']}"] = true;
         }
         $phrasetypes =& $this->productobj['phrases']['phrasetype'];
         if (!isset($phrasetypes[0])) {
             $phrasetypes = array($phrasetypes);
         }
         foreach ($phrasetypes as $phrasetype) {
             if (empty($phrasetype['phrase'])) {
                 continue;
             }
             if ($phrasetype['fieldname'] == '' or !preg_match('#^[a-z0-9_]+$#i', $phrasetype['fieldname'])) {
                 continue;
             }
             $fieldname = $master_phrasefields["{$phrasetype['fieldname']}"];
             if (!$fieldname) {
                 $this->db->query_write("\n\t\t\t\t\t\tINSERT IGNORE INTO " . TABLE_PREFIX . "phrasetype\n\t\t\t\t\t\t\t(fieldname, title, editrows, product)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t('" . $this->db->escape_string($phrasetype['fieldname']) . "',\n\t\t\t\t\t\t\t'" . $this->db->escape_string($phrasetype['name']) . "',\n\t\t\t\t\t\t\t3,\n\t\t\t\t\t\t\t'" . $this->db->escape_string($this->productinfo['productid']) . "')\n\t\t\t\t\t");
                 // need to add the column to the language table as well
                 require_once DIR . '/includes/class_dbalter.php';
                 $this->db_alter = new vB_Database_Alter_MySQL($this->db);
                 if ($this->db_alter->fetch_table_info('language')) {
                     $this->db_alter->add_field(array('name' => "phrasegroup_{$phrasetype['fieldname']}", 'type' => 'mediumtext'));
                 }
             }
开发者ID:0hyeah,项目名称:yurivn,代码行数:67,代码来源:class_upgrade_product.php

示例4: trim

            $mimetype["{$index}"] = trim($value);
        }
    } else {
        $mimetype = array('Content-type: unknown/unknown');
    }
    $vbulletin->GPC['type']['mimetype'] = serialize($mimetype);
    $contenttypes = array();
    foreach ($vbulletin->GPC['default'] as $contenttypeid => $contenttype) {
        foreach ($contenttype as $key => $value) {
            $contenttypes["{$contenttypeid}"]["{$key}"] = intval($vbulletin->GPC['contenttype']["{$contenttypeid}"]["{$key}"]);
        }
    }
    $vbulletin->GPC['type']['contenttypes'] = serialize($contenttypes);
    define('CP_REDIRECT', 'attachment.php?do=types');
    if ($vbulletin->GPC['extension']) {
        $db->query_write(fetch_query_sql($vbulletin->GPC['type'], 'attachmenttype', 'WHERE extension = \'' . $db->escape_string($vbulletin->GPC['extension']) . '\''));
        build_attachment_permissions();
    } else {
        /*insert query*/
        $db->query_write("\n\t\t\tINSERT INTO " . TABLE_PREFIX . "attachmenttype\n\t\t\t(\n\t\t\t\textension,\n\t\t\t\tsize,\n\t\t\t\theight,\n\t\t\t\twidth,\n\t\t\t\tmimetype,\n\t\t\t\tcontenttypes\n\t\t\t)\n\t\t\tVALUES\n\t\t\t(\n\t\t\t\t'" . $db->escape_string($vbulletin->GPC['type']['extension']) . "',\n\t\t\t\t" . intval($vbulletin->GPC['type']['size']) . ",\n\t\t\t\t" . intval($vbulletin->GPC['type']['height']) . ",\n\t\t\t\t" . intval($vbulletin->GPC['type']['width']) . ",\n\t\t\t\t'" . $db->escape_string($vbulletin->GPC['type']['mimetype']) . "',\n\t\t\t\t'" . $db->escape_string($vbulletin->GPC['type']['contenttype']) . "'\n\t\t\t)\n\t\t");
        build_attachment_permissions();
    }
    print_stop_message('saved_attachment_type_x_successfully', $vbulletin->GPC['type']['extension']);
}
// ###################### Remove File Type ####################
if ($_REQUEST['do'] == 'removetype') {
    $vbulletin->input->clean_array_gpc('r', array('extension' => TYPE_STR));
    print_form_header('attachment', 'killtype', 0, 1, '', '75%');
    construct_hidden_code('extension', $vbulletin->GPC['extension']);
    print_table_header(construct_phrase($vbphrase['confirm_deletion_of_attachment_type_x'], $vbulletin->GPC['extension']));
    print_description_row("\n\t\t<blockquote><br />" . construct_phrase($vbphrase['are_you_sure_you_want_to_delete_the_attachment_type_x'], $vbulletin->GPC['extension']) . "\n\t\t<br /></blockquote>\n\t");
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:attachment.php

示例5: unset

    }
    unset($vbulletin->GPC['promotion']['reputationtype']);
    if (!empty($vbulletin->GPC['userpromotionid'])) {
        // update
        if ($vbulletin->GPC['usergroupid'] == $vbulletin->GPC['promotion']['joinusergroupid']) {
            print_stop_message('promotion_join_same_group');
        }
        $db->query_write(fetch_query_sql($vbulletin->GPC['promotion'], 'userpromotion', "WHERE userpromotionid=" . $vbulletin->GPC['userpromotionid']));
    } else {
        // insert
        $vbulletin->GPC['usergroupid'] = $vbulletin->GPC['promotion']['usergroupid'];
        if ($vbulletin->GPC['usergroupid'] == $vbulletin->GPC['promotion']['joinusergroupid']) {
            print_stop_message('promotion_join_same_group');
        }
        /*insert query*/
        $db->query_write(fetch_query_sql($vbulletin->GPC['promotion'], 'userpromotion'));
    }
    // $title = $db->query_first("SELECT title FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
    // $message = str_replace('{title}', $title['title'], $message);
    define('CP_REDIRECT', "usergroup.php?do=modifypromotion" . ($vbulletin->GPC['returnug'] ? "&returnug=1&usergroupid=" . $vbulletin->GPC['usergroupid'] : ''));
    print_stop_message('saved_promotion_successfully');
}
// ###################### Start Remove #######################
if ($_REQUEST['do'] == 'removepromotion') {
    $vbulletin->input->clean_array_gpc('r', array('userpromotionid' => TYPE_INT, 'returnug' => TYPE_BOOL));
    print_delete_confirmation('userpromotion', $vbulletin->GPC['userpromotionid'], 'usergroup', 'killpromotion', 'promotion_usergroup', array('returnug' => $vbulletin->GPC['returnug']));
}
// ###################### Start Kill #######################
if ($_POST['do'] == 'killpromotion') {
    $vbulletin->input->clean_array_gpc('p', array('userpromotionid' => TYPE_INT, 'returnug' => TYPE_BOOL));
    $promotion = $db->query_first_slave("SELECT usergroupid FROM " . TABLE_PREFIX . "userpromotion WHERE userpromotionid = " . $vbulletin->GPC['userpromotionid']);
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:usergroup.php

示例6: print_stop_message

    if (isset($api['currency'])) {
        if (empty($api['currency'])) {
            print_stop_message('please_complete_required_fields');
        }
    }
    if (isset($api['recurring'])) {
        $api['recurring'] = intval($api['recurring']);
    }
    if (empty($api['title'])) {
        print_stop_message('please_complete_required_fields');
    }
    if (empty($vbulletin->GPC['paymentapiid'])) {
        /*insert query*/
        $db->query_write(fetch_query_sql($api, 'paymentapi'));
    } else {
        $db->query_write(fetch_query_sql($api, 'paymentapi', "WHERE paymentapiid=" . $vbulletin->GPC['paymentapiid']));
    }
    toggle_subs();
    define('CP_REDIRECT', 'subscriptions.php?do=api');
    print_stop_message('saved_paymentapi_x_successfully', $api['title']);
}
// ###################### Start api #######################
if ($_REQUEST['do'] == 'api') {
    $options = array('edit' => $vbphrase['edit']);
    if ($vbulletin->debug) {
        $options['remove'] = $vbphrase['delete'];
    }
    ?>
	<script type="text/javascript">
	function js_forum_jump(pid)
	{
开发者ID:benyamin20,项目名称:vbregistration,代码行数:31,代码来源:subscriptions.php

示例7: array

        $querydata = array('usergroupid' => $vbulletin->GPC['forumpermission']['usergroupid'], 'forumpermissions' => convert_array_to_bits($vbulletin->GPC['forumpermission'], $vbulletin->bf_ugp_forumpermissions, 1));
        ($hook = vBulletinHook::fetch_hook('admin_fperms_save')) ? eval($hook) : false;
        if ($vbulletin->GPC['forumid']) {
            $querydata['forumid'] = $vbulletin->GPC['forumid'];
            $query = fetch_query_sql($querydata, 'forumpermission');
            /*insert query*/
            $db->query_write($query);
            $info['forumid'] = $vbulletin->GPC['forumid'];
            $foruminfo = $db->query_first("\n\t\t\t\tSELECT title\n\t\t\t\tFROM " . TABLE_PREFIX . "forum\n\t\t\t\tWHERE forumid = " . $vbulletin->GPC['forumid']);
            $groupinfo = $db->query_first("\n\t\t\t\tSELECT title\n\t\t\t\tFROM " . TABLE_PREFIX . "usergroup\n\t\t\t\tWHERE usergroupid = " . $vbulletin->GPC['forumpermission']['usergroupid']);
            build_forum_permissions();
            define('CP_REDIRECT', "forumpermission.php?do=modify&f=" . $vbulletin->GPC['forumid']);
            print_stop_message('saved_forum_permissions_successfully');
        } else {
            unset($querydata['usergroupid']);
            $query = fetch_query_sql($querydata, 'forumpermission', "WHERE forumpermissionid = " . $vbulletin->GPC['forumpermissionid']);
            $db->query_write($query);
            build_forum_permissions();
            $info = $db->query_first($infoquery);
            define('CP_REDIRECT', "forumpermission.php?do=modify&f={$info['forumid']}#forum{$info['forumid']}");
            print_stop_message('saved_forum_permissions_successfully');
        }
    }
}
// ###################### Start duplicator #######################
if ($_REQUEST['do'] == 'duplicate') {
    $permgroups = $db->query_read("\n\t\tSELECT usergroup.usergroupid, title, COUNT(forumpermission.forumpermissionid) AS permcount\n\t\tFROM " . TABLE_PREFIX . "usergroup AS usergroup\n\t\tLEFT JOIN " . TABLE_PREFIX . "forumpermission AS forumpermission ON (usergroup.usergroupid = forumpermission.usergroupid)\n\t\tGROUP BY usergroup.usergroupid\n\t\tHAVING permcount > 0\n\t\tORDER BY title\n\t");
    $ugarr = array();
    while ($group = $db->fetch_array($permgroups)) {
        $ugarr["{$group['usergroupid']}"] = $group['title'];
    }
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:forumpermission.php

示例8: eval

            } else {
                if ($apiobj->type == 2) {
                    // transaction is a reversal / refund
                    $subobj->delete_user_subscription($apiobj->paymentinfo['subscriptionid'], $apiobj->paymentinfo['userid'], $apiobj->paymentinfo['subscriptionsubid']);
                } else {
                    // its most likely a re-post of a payment, if we've already dealt with it serve up a redirect
                    if ($apiobj->display_feedback) {
                        $vbulletin->url = $vbulletin->options['bburl'] . '/payments.php';
                        eval(print_standard_redirect('payment_complete', true, true));
                    }
                }
            }
        } else {
            // something went horribly wrong, get $apiobj->error
            $trans = array('state' => 0, 'dateline' => TIMENOW, 'paymentapiid' => $api['paymentapiid'], 'request' => serialize(array('vb_error_code' => $apiobj->error_code, 'GET' => serialize($_GET), 'POST' => serialize($_POST))));
            $db->query_write(fetch_query_sql($trans, 'paymenttransaction'));
            if ($apiobj->display_feedback and !empty($apiobj->error)) {
                //die("<p>{$apiobj->error}</p>");
                // we dont load header / footer, so just show the LITE template
                define('VB_ERROR_LITE', true);
                standard_error($apiobj->error);
            }
        }
    }
} else {
    exec_header_redirect($vbulletin->options['forumhome'] . '.php');
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 22:41, Fri Oct 10th 2008
|| # CVS: $RCSfile$ - $Revision: 26399 $
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:payment_gateway.php

示例9: doAction

 function doAction($action)
 {
     global $vbulletin, $vbphrase, $KBANK_HOOK_NAME;
     if ($action == 'use') {
         if ($this->ready2Enable()) {
             $item_new = array('status' => KBANK_ITEM_USED_WAITING, 'expire_time' => iif($this->data['options']['duration'] > 0, TIMENOW + $this->data['options']['duration'] * 24 * 60 * 60, -1));
             $vbulletin->db->query_write(fetch_query_sql($item_new, 'kbank_items', "WHERE itemid = {$this->data[itemid]}"));
             if ($this->isAvatarItem and !$this->isSigPicItem) {
                 $vbulletin->url = "profile.php?" . $vbulletin->session->vars['sessionurl'] . "do=editavatar";
             } else {
                 if (!$this->isAvatarItem and $this->isSigPicItem) {
                     $vbulletin->url = "profile.php?" . $vbulletin->session->vars['sessionurl'] . "do=editsignature";
                 } else {
                     $vbulletin->url = "profile.php?" . $vbulletin->session->vars['sessionurl'];
                 }
             }
             eval(print_standard_redirect('kbank_use_successful'));
         }
     }
     if ($action == 'work' && $KBANK_HOOK_NAME == KBANK_GLOBAL_START && THIS_SCRIPT == 'profile') {
         global $permissions;
         $this->do_permissions($permissions, $this->itemtypedata['options']);
         //Update for later use (?)
         $vbulletin->userinfo['permissions'] = $permissions;
     }
     if ($action == 'work_expired') {
         global $vbphrase, $kbank_profile_images;
         $donow = true;
         $actionStatus = true;
         echo "Processing item ID#{$this->data[itemid]}<br/>";
         //Search for activating item
         if (!isset($kbank_profile_images[$this->data['userid']])) {
             $kbank_profile_images[$this->data['userid']] = array();
             $itemtypes = $vbulletin->db->query_read("\n\t\t\t\t\t\tSELECT \n\t\t\t\t\t\t\titems.itemid AS itemid\n\t\t\t\t\t\t\t, itemtypes.options AS itemtypeoptions\n\t\t\t\t\t\tFROM `" . TABLE_PREFIX . "kbank_items` AS items\n\t\t\t\t\t\tINNER JOIN `" . TABLE_PREFIX . "kbank_itemtypes` AS itemtypes ON (itemtypes.itemtypeid = items.type)\n\t\t\t\t\t\tWHERE itemtypes.filename = 'profile_images.kbank.php'\n\t\t\t\t\t\t\tAND items.status = " . KBANK_ITEM_USED_WAITING . "\n\t\t\t\t\t\t\tAND (items.expire_time > " . TIMENOW . "\n\t\t\t\t\t\t\t\tOR items.expire_time < 0)\n\t\t\t\t\t\t\tAND items.userid = {$this->data['userid']}\n\t\t\t\t\t");
             while ($itemtype = $vbulletin->db->fetch_array($itemtypes)) {
                 $tmp = unserialize($itemtype['itemtypeoptions']);
                 foreach ($this->vars as $var) {
                     $kbank_profile_images[$this->data['userid']][$var] = max($kbank_profile_images[$this->data['userid']][$var], $tmp[$var]);
                 }
             }
         }
         //Check for activating item
         $donow = false;
         foreach ($this->vars as $var) {
             if ($kbank_profile_images[$this->data['userid']][$var] < $this->itemtypedata['options'][$var]) {
                 $donow = true;
             }
         }
         if (!$donow) {
             //Found other stuff can handle everything
             echo 'User have other item(s), nothing to do now!<br/>';
         }
         $status = array();
         $message = array();
         if ($donow) {
             $owner = fetch_userinfo($this->data['userid']);
             cache_permissions($owner, false);
             //Apply activating options to owner permissions;
             $this->do_permissions($owner['permissions'], $kbank_profile_images[$this->data['userid']]);
             foreach (array('Avatar', 'SigPic') as $type) {
                 //If this item is this type
                 eval('$work = iif($this->is' . $type . 'Item,true,false);');
                 switch ($type) {
                     case 'Avatar':
                         $table = 'customavatar';
                         $fullname = 'avatar';
                         $bits = $vbulletin->bf_ugp_genericpermissions;
                         $permkey = 'genericpermissions';
                         $canuse = 'canuseavatar';
                         $dm = 'Userpic_Avatar';
                         break;
                     case 'SigPic':
                         $table = 'sigpic';
                         $fullname = 'sigpic';
                         $bits = $vbulletin->bf_ugp_signaturepermissions;
                         $permkey = 'signaturepermissions';
                         $canuse = 'cansigpic';
                         $dm = 'Userpic_Sigpic';
                         break;
                 }
                 if ($work) {
                     $removenow = false;
                     $updatedone = false;
                     $message[$type] = '';
                     $status[$type] = 'none';
                     //Check if user using system avatar
                     if ($type == 'Avatar' and $owner['avatarid'] != 0) {
                         //Check for System Avatar (only check with type = avatar)
                         echo 'User using System Avatar, do nothing!<br/>';
                     } else {
                         //Check for custom image
                         if ($customimg = $vbulletin->db->query_first("\n\t\t\t\t\t\t\t\t\tSELECT filedata, dateline, filename, filesize\n\t\t\t\t\t\t\t\t\tFROM `" . TABLE_PREFIX . $table . "`\n\t\t\t\t\t\t\t\t\tWHERE userid = " . intval($owner['userid']) . "\n\t\t\t\t\t\t\t\t\tORDER BY dateline DESC\n\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t")) {
                             $extension = trim(substr(strrchr(strtolower($customimg['filename']), '.'), 1));
                             $tmp_filename = DIR . "/includes/tmp_profile_images_{$customimg['dateline']}.{$extension}";
                             $tmp_file = fopen($tmp_filename, 'w');
                             fwrite($tmp_file, $customimg['filedata']);
                             fclose($tmp_file);
                             require_once DIR . '/includes/class_image.php';
                             $image =& vB_Image::fetch_library($vbulletin);
                             $imginfo = $image->fetch_image_info($tmp_filename);
//.........这里部分代码省略.........
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:profile_images.kbank.php

示例10: logTransfer

function logTransfer($from, $to, $amount, $comment_org, $autopm = true, $tax = 0, $postid = 0)
{
    global $vbulletin, $vbphrase;
    $result = true;
    if (is_array($comment_org)) {
        $comment = serialize($comment_org);
    } else {
        $comment = $comment_org;
    }
    $donation = array('from' => intval($from), 'to' => intval($to), 'amount' => intval($amount), 'tax' => intval($tax), 'time' => TIMENOW, 'comment' => $comment, 'postid' => intval($postid));
    $vbulletin->db->query_write(fetch_query_sql($donation, 'kbank_donations'));
    if ($to > 0 and $autopm and $vbulletin->kbank['PMLimit'] != 0 and abs($amount) > $vbulletin->kbank['PMLimit'] and $userto = $vbulletin->db->query_first("\n\t\t\tSELECT username\n\t\t\tFROM `" . TABLE_PREFIX . "user`\n\t\t\tWHERE userid = {$to}")) {
        //send PM
        $from = $vbulletin->userinfo;
        if (is_array($comment_org)) {
            $comment = $comment_org['comment'];
        }
        $message = construct_phrase($vbphrase['kbank_donate_pm_message'], $amount, $comment, $vbulletin->options['bburl'] . '/' . $vbulletin->kbank['phpfile'] . '?do=history');
        $subject = $vbphrase['kbank_donate_pm_subject'];
        $result = kbank_sendPM($from, $userto, $subject, $message, false);
    }
    return $result;
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:23,代码来源:functions.php

示例11: foreach

     } else {
         $found = false;
     }
     $changed = false;
     foreach ($vbulletin->GPC['points'] as $key => $val) {
         if ($points[$key] != $val) {
             $points[$key] = $vbulletin->input->do_clean($val, TYPE_UNUM);
             $changed = true;
         }
     }
     if ($changed) {
         $datastore_rec = array('title' => 'kbank_salary_options', 'data' => serialize($points), 'unserialize' => 1);
         if ($found) {
             $vbulletin->db->query_write(fetch_query_sql($datastore_rec, 'datastore', "WHERE title = 'kbank_salary_options'"));
         } else {
             $vbulletin->db->query_write(fetch_query_sql($datastore_rec, 'datastore'));
         }
     }
 }
 if ($vbulletin->GPC['from'] and $vbulletin->GPC['to']) {
     $vbulletin->GPC['from'] = vbmktime($vbulletin->GPC['from']['hour'], $vbulletin->GPC['from']['minute'], 0, $vbulletin->GPC['from']['month'], $vbulletin->GPC['from']['day'], $vbulletin->GPC['from']['year']);
     $vbulletin->GPC['to'] = vbmktime($vbulletin->GPC['to']['hour'], $vbulletin->GPC['to']['minute'], 0, $vbulletin->GPC['to']['month'], $vbulletin->GPC['to']['day'], $vbulletin->GPC['to']['year']);
     if ($vbulletin->GPC['from'] == $vbulletin->GPC['to']) {
         print_stop_message('kbank_salary_calc_samelog');
     }
     include_once DIR . '/includes/functions_forumlist.php';
     cache_moderators();
     $mod_activity = array();
     foreach ($imodcache as $forumid => $forummods) {
         if ($forumid > 0) {
             foreach ($forummods as $mod) {
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:kbankadmin.php

示例12: set_postid

 /**
  * Finalizes the cache data by replacing the posthash with the postid after it
  * has been posted.
  * 
  * @param	integer		Postid
  * @param	string		Posthash
  */
 public function set_postid($postid, $posthash)
 {
     $this->registry->db->query_write(fetch_query_sql(array('postid' => $postid, 'posthash' => ''), 'gb_media', "WHERE posthash = '{$posthash}'"));
 }
开发者ID:holandacz,项目名称:nb4,代码行数:11,代码来源:class_goldbrick.php

示例13: log_cron_action

            $cron_logs[] = $message;
        }
    } else {
        if ($message !== false) {
            log_cron_action($message, $nextitem);
        }
    }
}
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
$vbulletin->db->hide_errors();
//Get statistics
$money = getStatistics(true);
$log = array('type' => KBANK_LOGTYPE_STAT, 'userid' => 0, 'timeline' => TIMENOW, 'text1' => '', 'int1' => $money['member'], 'detail' => serialize($money));
$vbulletin->db->query_write(fetch_query_sql($log, 'kbank_logs'));
// log the cron action
kbank_log_cron_action('Cached kBank Information');
//Any KBANK_ITEM_USED_WAITING items?
$items = $vbulletin->db->query_read("\n\tSELECT *\n\tFROM `" . TABLE_PREFIX . "kbank_items` AS items\n\tWHERE items.status = " . KBANK_ITEM_USED_WAITING . "\n\t\tAND items.expire_time <= " . TIMENOW . "\n\t\t\tAND items.expire_time > 0\n");
if (!$vbulletin->kbank_itemtypes) {
    $vbulletin->kbank_itemtypes = updateItemTypeCache();
}
if ($vbulletin->db->num_rows($items)) {
    $itemids = array();
    while ($itemdata = $vbulletin->db->fetch_array($items)) {
        if ($item =& newItem($itemdata['itemid'], $itemdata)) {
            if ($status = $item->doAction('work_expired')) {
                $itemids[] = "#{$itemdata['itemid']} ({$status})";
            }
            $item->destroy();
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:kbank_daily_job.php

示例14: array

     $sell_done[$itemid] = array('itemid' => $itemid, 'name' => $item['name']);
 }
 //Stop sell items
 foreach ($stop_sell_ids as $itemid) {
     $item_obj =& newItem($itemid);
     if (!$item_obj) {
         $errors[$itemid][] = KBANK_ERROR_NO_PERM;
         continue;
     }
     $item = $item_obj->data;
     if (!havePerm($vbulletin->userinfo, $item) or $item['status'] != KBANK_ITEM_SELLING) {
         $errors[$itemid][] = KBANK_ERROR_NO_PERM;
         continue;
     }
     $item_new = array('status' => KBANK_ITEM_AVAILABLE);
     $vbulletin->db->query_write(fetch_query_sql($item_new, 'kbank_items', "WHERE itemid = {$item['itemid']}"));
     $stop_sell_done[$itemid] = array('itemid' => $itemid, 'name' => $item['name']);
 }
 //Place bid for items
 foreach ($bid_ids as $itemid) {
     if ($vbulletin->GPC['bid'][$itemid] == 0) {
         if (count($itemids) == 1) {
             //get here from sell template
             $errors[$itemid][] = fetch_error('kbank_bid_invalid');
         }
         continue;
     }
     $item_obj =& newItem($itemid);
     if (!$item_obj) {
         $errors[$itemid][] = KBANK_ERROR_NO_PERM;
         continue;
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:kbank.php

示例15: print_cp_message

            if ($vbulletin->GPC['orig']['product'] != $vbulletin->GPC['help']['product']) {
                // haven't changed the text, but we changed the product,
                // so we need to reflect that
                $q[] = "\n\t\t\t\tUPDATE " . TABLE_PREFIX . "phrase SET\n\t\t\t\t\tproduct = '" . $db->escape_string($vbulletin->GPC['help']['product']) . "',\n\t\t\t\t\tusername = '" . $db->escape_string($vbulletin->userinfo['username']) . "',\n\t\t\t\t\tdateline = " . TIMENOW . ",\n\t\t\t\t\tversion = '" . $db->escape_string($product_version) . "'\n\t\t\t\tWHERE fieldname = 'cphelptext'\n\t\t\t\t\tAND varname = '{$newphrasename}_text'\n\t\t\t";
            }
        }
    } else {
        $sql = "\n\t\tSELECT * FROM " . TABLE_PREFIX . "adminhelp\n\t\tWHERE script = '" . $db->escape_string($vbulletin->GPC['help']['script']) . "'\n\t\t\tAND action = '" . $db->escape_string($vbulletin->GPC['help']['action']) . "'\n\t\t\tAND optionname = '" . $db->escape_string($vbulletin->GPC['help']['optionname']) . "'";
        if ($check = $db->query_first($sql)) {
            // error message, this already exists
            // why phrase when its only available in debug mode and its meant for us?
            print_cp_message('This help item already exists.');
        }
        unset($sql);
        // insert help item
        $q[] = fetch_query_sql($vbulletin->GPC['help'], 'adminhelp');
        // insert new phrases
        $q[] = "\n\t\t\t### INSERT NEW HELP PHRASES ###\n\t\t\tINSERT INTO " . TABLE_PREFIX . "phrase\n\t\t\t\t(languageid, fieldname, varname, text, product, username, dateline, version)\n\t\t\tVALUES\n\t\t\t\t(\n\t\t\t\t\t{$languageid},\n\t\t\t\t\t'cphelptext',\n\t\t\t\t\t'{$newphrasename}" . "_title',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['title']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['help']['product']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->userinfo['username']) . "',\n\t\t\t\t\t" . TIMENOW . ",\n\t\t\t\t\t'" . $db->escape_string($product_version) . "'\n\t\t\t\t),\n\t\t\t\t(\n\t\t\t\t\t{$languageid},\n\t\t\t\t\t'cphelptext',\n\t\t\t\t\t'{$newphrasename}" . "_text',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['text']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['help']['product']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->userinfo['username']) . "',\n\t\t\t\t\t" . TIMENOW . ",\n\t\t\t\t\t'" . $db->escape_string($product_version) . "'\n\t\t\t\t)\n\t\t";
    }
    foreach ($q as $sql) {
        //echo "<pre>" . htmlspecialchars($sql) . "</pre>";
        /*insert query*/
        $db->query_write($sql);
        //echo $db->affected_rows();
    }
    define('CP_REDIRECT', 'help.php?do=manage&amp;script=' . $vbulletin->GPC['help']['script']);
    print_stop_message('saved_topic_x_successfully', $title);
}
// ############################### start confirmation for deleting a help topic ##############
if ($_REQUEST['do'] == 'delete') {
    $vbulletin->input->clean_array_gpc('r', array('adminhelpid' => TYPE_INT));
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:help.php


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