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


PHP db_single函数代码示例

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


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

示例1: SitepresenterEditSlideForm

    function SitepresenterEditSlideForm()
    {
        parent::MailForm();
        $this->parseSettings('inc/app/sitepresenter/forms/edit/slide/settings.php');
        page_add_script('
			function cms_cancel (f) {
				if (arguments.length == 0) {
					window.location.href = "/index/cms-app";
				} else {
					if (f.elements["_return"] && f.elements["_return"].value.length > 0) {
						window.location.href = f.elements["_return"].value;
					} else {
						window.location.href = "/index/sitepresenter-app";
					}
				}
				return false;
			}
		');
        $this->widgets['submit_button']->buttons[1]->extra = 'onclick="return cms_cancel (this.form)"';
        global $cgi;
        page_title(intl_get('Adding Slide to Presentation') . ': ' . db_shift('select title from sitepresenter_presentation where id = ?', $cgi->presentation));
        $res = db_single('select * from sitepresenter_slide where id = ?', $cgi->id);
        foreach (get_object_vars($res) as $k => $v) {
            $this->widgets[$k]->setValue($v);
        }
    }
开发者ID:vojtajina,项目名称:sitellite,代码行数:26,代码来源:index.php

示例2: SiteblogCommentForm

 function SiteblogCommentForm()
 {
     parent::MailForm();
     global $cgi;
     $this->parseSettings('inc/app/siteblog/forms/comment/settings.php');
     if (isset($cgi->_key) && !empty($cgi->_key)) {
         //edit a comment
         page_title('Editing Comment');
         $comment = db_single('select * from siteblog_comment where id = ?', $cgi->_key);
         $this->widgets['name']->setValue($comment->author);
         $this->widgets['email']->setValue($comment->email);
         $this->widgets['url']->setValue($comment->url);
         $this->widgets['body']->setValue($comment->body);
     } elseif (!isset($cgi->post)) {
         header('Location: ' . site_prefix() . '/index');
         exit;
     } else {
         if (session_valid()) {
             $this->widgets['name']->setValue(session_username());
             $user = session_get_user();
             $this->widgets['email']->setValue($user->email);
             $this->widgets['url']->setValue($user->website);
         }
         $this->widgets['post']->setValue($cgi->post);
         //page_title ('Post a Comment');
     }
     if (!appconf('comments_security')) {
         unset($this->widgets['security_test']);
     }
 }
开发者ID:vojtajina,项目名称:sitellite,代码行数:30,代码来源:index.php

示例3: SiteblogPropertiesForm

 function SiteblogPropertiesForm()
 {
     parent::MailForm();
     global $cgi;
     if (empty($cgi->blog)) {
         return;
     }
     $this->parseSettings('inc/app/siteblog/forms/properties/settings.php');
     page_title('Editing Category Properties: ' . $cgi->blog);
     $category = db_single('select * from siteblog_category where id = ?', $cgi->blog);
     $set = array();
     if ($category->comments == 'on') {
         $set[] = 'Enable Comments';
     }
     if ($category->poster_visible == 'yes') {
         $set[] = 'Author Visible';
     }
     if ($category->display_rss == 'yes') {
         $set[] = 'Include RSS Links';
     }
     if ($category->status == 'on') {
         $set[] = 'Enabled';
     }
     $this->widgets['blog_properties']->setValue($set);
     $this->widgets['blog']->setValue($cgi->blog);
     $this->widgets['refer']->setValue($_SERVER['HTTP_REFERER']);
 }
开发者ID:vojtajina,项目名称:sitellite,代码行数:27,代码来源:index.php

示例4: SiteglossaryEditForm

    function SiteglossaryEditForm()
    {
        parent::MailForm();
        $this->parseSettings('inc/app/siteglossary/forms/edit/settings.php');
        global $cgi;
        page_title(intl_get('Editing Glossary Term') . ': ' . $cgi->_key);
        page_add_script('
			function cms_cancel (f) {
				if (arguments.length == 0) {
					window.location.href = "/index/cms-app";
				} else {
					if (f.elements["_return"] && f.elements["_return"].value.length > 0) {
						window.location.href = f.elements["_return"].value;
					} else {
						window.location.href = "/index/siteglossary-app";
					}
				}
				return false;
			}
		');
        // add cancel handler
        $this->widgets['submit_button']->buttons[1]->extra = 'onclick="return cms_cancel (this.form)"';
        $res = db_single('select * from siteglossary_term where word = ?', $cgi->_key);
        foreach (get_object_vars($res) as $k => $v) {
            $this->widgets[$k]->setValue($v);
        }
    }
开发者ID:vojtajina,项目名称:sitellite,代码行数:27,代码来源:index.php

示例5: flickr_places_get_by_woeid

function flickr_places_get_by_woeid($woeid, $more = array())
{
    if (!isset($more['force'])) {
        if (isset($GLOBALS['flickr_places_cache'][$woeid])) {
            return $GLOBALS['flickr_places_cache'][$woeid];
        }
        # filter by date too?
        $enc_woeid = AddSlashes($woeid);
        $sql = "SELECT * FROM Places WHERE woeid='{$enc_woeid}'";
        if ($row = db_single(db_fetch($sql))) {
            $place = json_decode($row['flickr_data'], "as hash");
            $GLOBALS['flickr_places_cache'][$woeid] = $place;
            return $place;
        }
    }
    $rsp = _flickr_places_getinfo($woeid);
    if (!$rsp['ok']) {
        return null;
    }
    $place = $rsp['rsp']['place'];
    $insert = array('woeid' => AddSlashes($woeid), 'flickr_data' => AddSlashes(json_encode($place)), 'date_created' => time());
    $rsp = db_insert('Places', $insert);
    $GLOBALS['flickr_places_cache'][$woeid] = $place;
    return $place;
}
开发者ID:nilswalk,项目名称:parallel-flickr,代码行数:25,代码来源:lib_flickr_places.php

示例6: flickr_push_subscriptions_get_by_user_and_topic

function flickr_push_subscriptions_get_by_user_and_topic(&$user, $topic_id, $topic_args = null)
{
    if ($topic_args) {
        $topic_args = json_encode($topic_args);
    }
    $cache_key = "flickr_push_subscriptions_user_{$user['id']}_{$topic_id}";
    if ($topic_args) {
        $cache_key .= "#" . md5($topic_args);
    }
    $cache = cache_get($cache_key);
    if ($cache['ok']) {
        $row = $cache['data'];
    } else {
        $enc_id = AddSlashes($user['id']);
        $enc_topic = AddSlashes($topic_id);
        $enc_args = $topic_args ? AddSlashes($topic_args) : "";
        $sql = "SELECT * FROM FlickrPushSubscriptions WHERE user_id='{$enc_id}' AND topic_id='{$enc_topic}' AND topic_args='{$enc_args}'";
        $rsp = db_fetch($sql);
        $row = db_single($rsp);
        if ($row) {
            cache_set($cache_key, $row, "cache locally");
        }
    }
    return $row;
}
开发者ID:rdhyee,项目名称:parallel-flickr,代码行数:25,代码来源:lib_flickr_push_subscriptions.php

示例7: getCurrentIndex

 /**
  * Retrieves the info from the most recent indexing.
  */
 function getCurrentIndex()
 {
     $res = db_single('select * from sitesearch_index order by mtime desc limit 1');
     if (!$res) {
         $this->error = db_error();
     }
     return $res;
 }
开发者ID:vojtajina,项目名称:sitellite,代码行数:11,代码来源:Logger.php

示例8: flickr_contacts_get_contact

function flickr_contacts_get_contact($user_id, $contact_id)
{
    $user = users_get_by_id($user_id);
    $cluster_id = $user['cluster_id'];
    $enc_user = AddSlashes($user_id);
    $enc_contact = AddSlashes($contact_id);
    $sql = "SELECT * FROM FlickrContacts WHERE user_id='{$enc_user}' AND contact_id='{$enc_contact}'";
    $rsp = db_fetch_users($cluster_id, $sql);
    return db_single($rsp);
}
开发者ID:nilswalk,项目名称:parallel-flickr,代码行数:10,代码来源:lib_flickr_contacts.php

示例9: foursquare_users_random_user

function foursquare_users_random_user()
{
    $sql = "SELECT COUNT(user_id) AS count FROM FoursquareUsers";
    $rsp = db_single(db_fetch($sql));
    $count = $rsp['count'];
    $offset = $count == 1 ? 0 : rand(1, $count - 1);
    $sql = "SELECT * FROM FoursquareUsers LIMIT 1 OFFSET {$offset}";
    $rsp = db_single(db_fetch($sql));
    return $rsp;
}
开发者ID:nilswalk,项目名称:privatesquare,代码行数:10,代码来源:lib_foursquare_users.php

示例10: DeadlinesEditForm

 function DeadlinesEditForm()
 {
     parent::MailForm();
     $this->parseSettings('inc/app/deadlines/forms/edit/settings.php');
     page_title('Deadlines - Edit Item');
     global $cgi;
     $res = db_single('select * from deadlines where id = ?', $cgi->id);
     foreach ((array) $res as $k => $v) {
         $this->widgets[$k]->setValue($v);
     }
 }
开发者ID:vojtajina,项目名称:sitellite,代码行数:11,代码来源:index.php

示例11: SiteinvoiceEditClientForm

 function SiteinvoiceEditClientForm()
 {
     parent::MailForm();
     $this->parseSettings('inc/app/siteinvoice/forms/edit/client/settings.php');
     global $cgi;
     page_title('SiteInvoice - Editing Client: ' . $cgi->id);
     $client = db_single('select * from siteinvoice_client where id = ?', $cgi->id);
     foreach (get_object_vars($client) as $k => $v) {
         $this->widgets[$k]->setValue($v);
     }
 }
开发者ID:vojtajina,项目名称:sitellite,代码行数:11,代码来源:index.php

示例12: flickr_faves_count_for_user

function flickr_faves_count_for_user(&$user, $more = array())
{
    $defaults = array('viewer_id' => 0);
    $more = array_merge($defaults, $more);
    $cluster_id = $user['cluster_id'];
    $enc_user = AddSlashes($user['id']);
    # TO DO: perms
    $sql = "SELECT COUNT(photo_id) AS cnt FROM FlickrFaves WHERE user_id='{$enc_user}' {$extra}";
    $row = db_single(db_fetch_users($cluster_id, $sql));
    return $row['cnt'];
}
开发者ID:nilswalk,项目名称:parallel-flickr,代码行数:11,代码来源:lib_flickr_faves.php

示例13: TodoEditForm

 function TodoEditForm()
 {
     parent::MailForm();
     $this->parseSettings('inc/app/todo/forms/edit/settings.php');
     global $cgi;
     $f = db_single('select * from todo_list where id = ?', $cgi->id);
     $this->widgets['todo']->setValue($f->todo);
     $this->widgets['priority']->setValue($f->priority);
     $this->widgets['project']->setValue($f->project);
     $this->widgets['person']->setValue($f->person);
 }
开发者ID:vojtajina,项目名称:sitellite,代码行数:11,代码来源:index.php

示例14: SitememberHomepageForm

 function SitememberHomepageForm()
 {
     parent::MailForm();
     $this->parseSettings('inc/app/sitemember/forms/homepage/settings.php');
     page_title(intl_get('Editing') . ' ' . session_username() . '\'s ' . intl_get('Homepage'));
     $res = db_single('select * from sitellite_homepage where user = ?', session_username());
     if (is_object($res)) {
         $this->widgets['title']->setValue($res->title);
         $this->widgets['template']->setValue($res->template);
         $this->widgets['body']->setValue($res->body);
     }
 }
开发者ID:vojtajina,项目名称:sitellite,代码行数:12,代码来源:index.php

示例15: timetracker_filter_username

function timetracker_filter_username($user)
{
    $info = db_single('select firstname, lastname from sitellite_user where username = ?', $user);
    if (!empty($info->lastname)) {
        $out = $info->lastname;
        if (!empty($info->firstname)) {
            $out .= ', ' . $info->firstname;
        }
    } else {
        $out = $user;
    }
    return $out;
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:13,代码来源:Filters.php


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