本文整理汇总了PHP中ipsRegistry::DB方法的典型用法代码示例。如果您正苦于以下问题:PHP ipsRegistry::DB方法的具体用法?PHP ipsRegistry::DB怎么用?PHP ipsRegistry::DB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipsRegistry
的用法示例。
在下文中一共展示了ipsRegistry::DB方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContentUrl
/**
* Get Content URL
*
* @param array $warning Row from members_warn_logs
* @return @e array array( url => URL to the content the warning came from, title => Title )
*/
public function getContentUrl($warning)
{
ipsRegistry::getClass('class_localization')->loadLanguageFile(array('public_profile'), 'members');
if ($warning['wl_content_id1']) {
$post = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'message_posts', 'where' => "msg_id=" . intval($warning['wl_content_id1'])));
if (!empty($post['msg_topic_id'])) {
$topic = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'message_topics', 'where' => "mt_id={$post['msg_topic_id']}"));
if (!empty($topic['mt_id'])) {
ipsRegistry::DB()->build(array('select' => '*', 'from' => 'message_topic_user_map', 'where' => "map_topic_id={$post['msg_topic_id']}"));
ipsRegistry::DB()->execute();
while ($row = ipsRegistry::DB()->fetch()) {
if ($row['map_user_id'] == ipsRegistry::member()->getProperty('member_id')) {
return array('url' => ipsRegistry::getClass('output')->buildUrl("app=members&module=messaging&section=view&do=findMessage&topicID={$topic['mt_id']}&msgID={$post['msg_id']}"), 'title' => $topic['mt_title']);
}
}
return array('url' => ipsRegistry::getClass('output')->buildUrl("app=core&module=reports§ion=reports&do=showMessage&topicID={$topic['mt_id']}&msg={$post['msg_id']}"), 'title' => $topic['mt_title']);
}
}
} else {
$member = IPSMember::load($warning['wl_member']);
if (!empty($member['member_id'])) {
return array('url' => ipsRegistry::getClass('output')->buildSEOUrl("showuser={$member['member_id']}", 'public', $member['members_seo_name'], 'showuser'), 'title' => ipsRegistry::getClass('class_localization')->words['warnings_profile']);
}
}
}
示例2: onDelete
/**
* This method is called after a member account has been removed
*
* @param string $ids SQL IN() clause
* @return @e void
*/
public function onDelete($mids)
{
/* Delete Status Updates - note, we can't do this via memberStatus class, since we no longer have the member data */
ipsRegistry::DB()->delete('member_status_updates', "status_member_id" . $mids);
ipsRegistry::DB()->delete('member_status_actions', "action_member_id" . $mids);
ipsRegistry::DB()->delete('member_status_replies', "reply_member_id" . $mids);
}
示例3: returnRSSDocument
/**
* Grab the RSS document content and return it
*
* @return string RSS document
*/
public function returnRSSDocument()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval(ipsRegistry::$request['member_id']);
$secure_key = IPSText::md5Clean(ipsRegistry::$request['rss_key']);
$rss_data = array();
$to_print = '';
if ($secure_key and $member_id) {
if ($member_id == ipsRegistry::member()->getProperty('member_id')) {
//-----------------------------------------
// Get RSS export
//-----------------------------------------
$rss_data = ipsRegistry::DB()->buildAndFetch(array('select' => 'rss_cache', 'from' => 'rc_modpref', 'where' => "mem_id=" . $member_id . " AND rss_key='" . $secure_key . "'"));
//-----------------------------------------
// Got one?
//-----------------------------------------
if ($rss_data['rss_cache']) {
return $rss_data['rss_cache'];
}
}
//-----------------------------------------
// Create a dummy one
//-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile(array('public_reports'), 'core');
$classToLoad = IPSLib::loadLibrary(IPS_KERNEL_PATH . 'classRss.php', 'classRss');
$rss = new $classToLoad();
$channel_id = $rss->createNewChannel(array('title' => ipsRegistry::getClass('class_localization')->words['rss_feed_title'], 'link' => ipsRegistry::$settings['board_url'], 'description' => ipsRegistry::getClass('class_localization')->words['reports_rss_desc'], 'pubDate' => $rss->formatDate(time())));
$rss->createRssDocument();
return $rss->rss_document;
}
}
示例4: __construct
/**
* Constructor
*
* @access public
* @param object Registry reference
* @return void
*/
public function __construct(ipsRegistry $registry)
{
//-----------------------------------------
// Make shortcuts
//-----------------------------------------
$this->registry = $registry;
$this->DB = $registry->DB();
$this->settings = $registry->fetchSettings();
$this->member = $registry->member();
$this->cache = $registry->cache();
$this->caches =& $registry->cache()->fetchCaches();
$this->request = $registry->fetchRequest();
$this->lang = $registry->class_localization;
if (IN_ACP) {
//-----------------------------------------
// Load HTML
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_blocks_custom');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=blocks&section=wizard';
$this->form_code_js = $this->html->form_code_js = 'module=blocks§ion=wizard';
}
}
示例5: runTask
public function runTask()
{
ipsRegistry::DB()->build(array('select' => '*', 'from' => 'members'));
$members_vip = $this->DB->execute();
while ($m = $this->DB->fetch($members_vip)) {
$vipValido = false;
ipsRegistry::DB()->build(array('select' => '*', 'from' => 'vips'));
$vips = ipsRegistry::DB()->execute();
while ($vip = $this->DB->fetch($vips)) {
if ($vip['nome'] == $m['name']) {
if ($vip[$vip['usando']] > 0) {
if ($m['member_group_id'] != $this->settings['pxvip_GrupoVip']) {
$this->DB->update('members', array('member_group_id' => $this->settings['pxvip_GrupoVip']), 'member_id=' . $m['member_id']);
}
$vipValido = true;
}
}
}
if ($vipValido == false && $m['member_group_id'] == $this->settings['pxvip_GrupoVip']) {
$this->DB->update('members', array('member_group_id' => 3), 'member_id=' . $m['member_id']);
}
}
$this->class->appendTaskLog($this->task, $this->lang->words['my_task_log_lang_string']);
$this->class->unlockTask($this->task);
}
示例6: fetch
/**
* Database Query to get results
*
* @param string 'given' if we want to return items as user has liked
* 'received' if we want to fetch items a user has posted that others have liked
* NULL to get highest rated
* @param array Member this applies to
* NULL to get highest rated
*
* @return array Parameters to pass to ipsRegistry::DB()->build
* Must return at least the data from reputation_index
* limit and order will be applied automatically
*/
public function fetch($type = NULL, $member = NULL)
{
//-----------------------------------------
// Get our allowed calendars
//-----------------------------------------
$allowedCalendarIds = array();
ipsRegistry::DB()->build(array('select' => 'perm_type_id as calendar_id', 'from' => 'permission_index', 'where' => "app='calendar' AND " . ipsRegistry::DB()->buildRegexp("perm_view", ipsRegistry::member()->perm_id_array)));
ipsRegistry::DB()->execute();
while ($r = ipsRegistry::DB()->fetch()) {
$allowedCalendarIds[] = $r['calendar_id'];
}
//-----------------------------------------
// Return query
//-----------------------------------------
$userGiving = 'r';
$extraWhere = '';
$extraJoin = array();
if ($type == 'most') {
return array('type' => 'event_id', 'inner' => array('select' => 'e.event_id', 'from' => array('cal_events' => 'e'), 'where' => empty($allowedCalendarIds) ? '1=0' : ipsRegistry::DB()->buildWherePermission($allowedCalendarIds, 'e.event_calendar_id', FALSE)), 'joins' => array(array('select' => 'rc.*', 'from' => array('reputation_cache' => 'rc'), 'where' => "rc.app='calendar' AND rc.type='event_id' AND rc.type_id=r.type_id"), array('select' => 'c.*', 'from' => array('cal_event_comments' => 'c'), 'where' => 'r.type="comment_id" AND r.type_id=c.comment_id', 'type' => 'left'), array('select' => 'e.*', 'from' => array('cal_events' => 'e'), 'where' => 'e.event_id = IFNULL(c.comment_eid, r.type_id)')));
} else {
if ($type !== NULL) {
$extraWhere = ($type == 'given' ? "r.member_id={$member['member_id']}" : "( ( r.type='event_id' AND e.event_member_id={$member['member_id']} ) OR ( r.type='comment_id' AND c.comment_mid={$member['member_id']} ) )") . ' AND ';
} else {
$userGiving = 'r2';
$extraJoin = array(array('from' => array('reputation_index' => 'r2'), 'where' => "r2.app=r.app AND r2.type=r.type AND r2.type_id=r.type_id AND r2.member_id=" . ipsRegistry::member()->getProperty('member_id')));
}
return array('select' => "r.*, rc.*, {$userGiving}.member_id as repUserGiving, e.*, c.*", 'from' => array('reputation_index' => 'r'), 'add_join' => array_merge($extraJoin, array(array('from' => array('reputation_cache' => 'rc'), 'where' => "rc.app=r.app AND rc.type=r.type AND rc.type_id=r.type_id"), array('from' => array('cal_event_comments' => 'c'), 'where' => 'r.type="comment_id" AND r.type_id=c.comment_id', 'type' => 'left'), array('from' => array('cal_events' => 'e'), 'where' => 'e.event_id = IFNULL(c.comment_eid, r.type_id)', 'type' => 'left'))), 'where' => "r.app='calendar' AND " . $extraWhere . " e.event_id<>0 AND " . (empty($allowedCalendarIds) ? '1=0' : ipsRegistry::DB()->buildWherePermission($allowedCalendarIds, 'e.event_calendar_id', FALSE)));
}
}
示例7: run
/**
* Construct
*
* @param string Application (or aai key)
* @param string Area
* @return string
*/
public static function run($app = null, $area = null)
{
if (strlen($app) == 32 and $area === null) {
$test = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'core_tags', 'where' => 'tag_aai_lookup=\'' . ipsRegistry::DB()->addSlashes($app) . '\'', 'limit' => array(0, 1)));
if ($test['tag_meta_app'] && $test['tag_meta_area']) {
$app = $test['tag_meta_app'];
$area = $test['tag_meta_area'];
}
}
if ($app === null or $area === null) {
trigger_error("App or area missing from classes_like", E_USER_WARNING);
}
/* Pointless comment! */
$_file = IPSLib::getAppDir($app) . '/extensions/tags/' . $area . '.php';
$_key = $app && $area ? md5($app . $area) : 'default';
/* Get from cache if already cached */
if (isset(self::$apps[$_key])) {
return self::$apps[$_key];
}
/* Get other classes */
require_once IPS_ROOT_PATH . 'sources/classes/tags/abstract.php';
/*noLibHook*/
if ($app && $area) {
/* Otherwise create object and cache */
if (is_file($_file)) {
$classToLoad = IPSLib::loadLibrary($_file, 'tags_' . $app . '_' . $area, $app);
if (class_exists($classToLoad)) {
self::$apps[$_key] = new $classToLoad();
self::$apps[$_key]->setApp($app);
self::$apps[$_key]->setArea($area);
self::$apps[$_key]->init();
} else {
throw new Exception("No tags class available for {$app} - {$area}");
}
} else {
/* Allow an application to worry about the 'area' */
if (is_file(IPSLib::getAppDir($app) . '/extensions/tags/default.php')) {
$classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir($app) . '/extensions/tags/default.php', 'tags_' . $app . '_default', $app);
if (class_exists($classToLoad)) {
self::$apps[$_key] = new $classToLoad();
self::$apps[$_key]->setApp($app);
self::$apps[$_key]->setArea($area);
self::$apps[$_key]->init();
} else {
throw new Exception("No tags class available for {$app} - {$area}");
}
} else {
throw new Exception("No tags class available for {$app} - {$area}");
}
}
} else {
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/tags/extensions/default.php', 'tags_default');
self::$apps[$_key] = new $classToLoad();
self::$apps[$_key]->setApp($app);
self::$apps[$_key]->setArea($area);
self::$apps[$_key]->init();
}
return self::$apps[$_key];
}
示例8: __construct
public function __construct()
{
$this->settings = ipsRegistry::fetchSettings();
$this->lang = ipsRegistry::getClass('class_localization');
$this->caches =& ipsRegistry::cache()->fetchCaches();
$this->cache = ipsRegistry::cache();
$this->DB = ipsRegistry::DB();
}
示例9: __construct
/**
* Constructor
*
* @return @e void
*/
public function __construct(ipsRegistry $registry)
{
$this->registry = $registry;
$this->DB = $registry->DB();
$this->settings =& $registry->fetchSettings();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
}
示例10: __construct
/**
* Constructor
*
* @param object $registry Registry object
* @param object $class Task manager class object
* @param array $task Array with the task data
* @return @e void
*/
public function __construct(ipsRegistry $registry, $class, $task)
{
/* Make registry objects */
$this->registry = $registry;
$this->DB = $registry->DB();
$this->lang = $this->registry->getClass('class_localization');
$this->class = $class;
$this->task = $task;
}
示例11: __construct
/**
* Constructor
*
* @access public
* @param object ipsRegistry reference
* @return @e void
*/
public function __construct(ipsRegistry $registry)
{
$this->DB = $registry->DB();
$this->settings = $registry->settings();
$this->member = $registry->member();
$this->memberData =& $registry->member()->fetchMemberData();
$this->cache = $registry->cache();
$this->caches =& $registry->cache()->fetchCaches();
$this->request = $registry->request();
}
示例12: parseOnlineEntries
/**
* Parse/format the online list data for the records
*
* @author Brandon Farber
* @param array Online list rows to check against
* @return array Online list rows parsed
*/
public function parseOnlineEntries($rows)
{
if (!is_array($rows) or !count($rows)) {
return $rows;
}
$final = array();
$profiles = array();
$members = array();
//-----------------------------------------
// Extract the topic/forum data
//-----------------------------------------
foreach ($rows as $row) {
if ($row['current_appcomponent'] != 'members' or !$row['current_module']) {
continue;
}
if ($row['current_module'] == 'profile') {
$profiles[] = $row['location_1_id'];
}
}
if (count($profiles)) {
ipsRegistry::DB()->build(array('select' => 'member_id, members_display_name, members_seo_name, member_banned, members_bitoptions', 'from' => 'members', 'where' => 'member_id IN(' . implode(',', $profiles) . ')'));
$pr = ipsRegistry::DB()->execute();
while ($r = ipsRegistry::DB()->fetch($pr)) {
/* Setup bitwise option to check for banned/spammer members */
$r = IPSMember::buildBitWiseOptions($r);
if (!IPSMember::isInactive($r) || ipsRegistry::member()->getProperty('g_is_supmod')) {
$members[$r['member_id']] = array('members_display_name' => $r['members_display_name'], 'members_seo_name' => $r['members_seo_name']);
}
}
}
foreach ($rows as $row) {
if ($row['current_appcomponent'] == 'members') {
if ($row['current_module'] == 'online') {
$row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_online'];
}
if ($row['current_module'] == 'list') {
$row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_members'];
}
if ($row['current_module'] == 'messaging') {
$row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_msg'];
}
if ($row['current_module'] == 'profile') {
if (isset($members[$row['location_1_id']])) {
$row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_profile'];
$row['where_line_more'] = $members[$row['location_1_id']]['members_display_name'];
$row['where_link'] = 'showuser=' . $row['location_1_id'];
$row['_whereLinkSeo'] = ipsRegistry::getClass('output')->buildSEOUrl($row['where_link'], 'public', $members[$row['location_1_id']]['members_seo_name'], 'showuser');
}
}
}
$final[$row['id']] = $row;
}
return $final;
}
示例13: change_group
public function change_group($member)
{
$vips = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'vips'));
$isVip = false;
foreach ($vips as $vip) {
if ($vip = $member['members_display_name']) {
$isVip = true;
}
}
if ($isVip) {
$this->DB->update('members', array('member_group_id' => $this->settings['pxvip_GrupoVip']), 'member_id=' . $member['member_id']);
}
}
示例14: __construct
/**
* Constructor
*
* @access public
* @param object Registry reference
* @return void
*/
public function __construct(ipsRegistry $registry)
{
//-----------------------------------------
// Make shortcuts
//-----------------------------------------
$this->registry = $registry;
$this->DB = $registry->DB();
$this->settings = $registry->fetchSettings();
$this->member = $registry->member();
$this->cache = $registry->cache();
$this->caches =& $registry->cache()->fetchCaches();
$this->request = $registry->fetchRequest();
$this->lang = $registry->class_localization;
}
示例15: parseOnlineEntries
/**
* Parse/format the online list data for the records
*
* @access public
* @author Brandon Farber
* @param array Online list rows to check against
* @return array Online list rows parsed
*/
public function parseOnlineEntries($rows)
{
if (!is_array($rows) or !count($rows)) {
return $rows;
}
$final = array();
$profiles = array();
$names = array();
//-----------------------------------------
// Extract the topic/forum data
//-----------------------------------------
foreach ($rows as $row) {
if ($row['current_appcomponent'] != 'members' or !$row['current_module']) {
continue;
}
if ($row['current_module'] == 'profile') {
$profiles[] = $row['location_1_id'];
}
}
if (count($profiles)) {
ipsRegistry::DB()->build(array('select' => 'member_id, members_display_name, members_seo_name', 'from' => 'members', 'where' => 'member_id IN(' . implode(',', $profiles) . ')'));
$pr = ipsRegistry::DB()->execute();
while ($r = ipsRegistry::DB()->fetch($pr)) {
$names[$r['member_id']] = array('members_display_name' => $r['members_display_name'], 'members_seo_name' => $r['members_seo_name']);
}
}
foreach ($rows as $row) {
if ($row['current_appcomponent'] == 'members') {
if ($row['current_module'] == 'online') {
$row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_online'];
}
if ($row['current_module'] == 'list') {
$row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_members'];
}
if ($row['current_module'] == 'profile') {
if (isset($names[$row['location_1_id']])) {
$row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_profile'];
$row['where_line_more'] = $names[$row['location_1_id']]['members_display_name'];
$row['where_link'] = 'showuser=' . $row['location_1_id'];
$row['_whereLinkSeo'] = ipsRegistry::getClass('output')->buildSEOUrl($row['where_link'], 'public', $names[$row['location_1_id']]['members_seo_name'], 'showuser');
}
}
}
$final[$row['id']] = $row;
}
return $final;
}