• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP iaDb类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _getExtraType

 private function _getExtraType($extraName)
 {
     if (is_null(self::$_extraTypes)) {
         $iaCore = iaCore::instance();
         $iaCore->factory('item');
         self::$_extraTypes = $iaCore->iaDb->keyvalue(array('name', 'type'), iaDb::convertIds(iaCore::STATUS_ACTIVE, 'status'), iaItem::getExtrasTable());
     }
     return isset(self::$_extraTypes[$extraName]) ? self::$_extraTypes[$extraName] : null;
 }
开发者ID:kamilklkn,项目名称:subrion,代码行数:9,代码来源:resource.extra.php


示例2: deleteCorrespondingInvoice

 public function deleteCorrespondingInvoice($transactionId)
 {
     if ($invoice = $this->getBy('transaction_id', $transactionId)) {
         $result1 = (bool) $this->iaDb->delete(iaDb::convertIds($invoice['id']), self::getTable());
         $result2 = (bool) $this->iaDb->delete(iaDb::convertIds($invoice['id'], 'invoice_id'), self::$_tableItems);
         return $result1 && $result2;
     }
     return true;
 }
开发者ID:UzielSilva,项目名称:subrion,代码行数:9,代码来源:ia.core.invoice.php


示例3: url

 public function url($action, $data = array(), $generate = false)
 {
     $data['action'] = $action;
     $data['alias'] = isset($data['album_alias']) ? $data['album_alias'] : $data['title_alias'];
     if (!isset($this->patterns[$action])) {
         $action = 'view';
     }
     $url = iaDb::printf($this->patterns[$action], $data);
     return self::get('url') . $url;
 }
开发者ID:nicefirework,项目名称:subrion-lyrics,代码行数:10,代码来源:ia.admin.album.php


示例4: url

 public function url($action, $data = array())
 {
     $data['action'] = $action;
     $data['alias'] = isset($data['genre_alias']) ? $data['genre_alias'] : $data['title_alias'];
     if (!isset($this->_patterns[$action])) {
         $action = 'view';
     }
     $url = iaDb::printf($this->_patterns[$action], $data);
     return $this->iaCore->packagesData[self::PACKAGE_NAME]['url'] . $url;
 }
开发者ID:nicefirework,项目名称:subrion-lyrics,代码行数:10,代码来源:ia.admin.genre.php


示例5: _entryDelete

 protected function _entryDelete($entryId)
 {
     $row = $this->_iaDb->row(array('name', 'item'), iaDb::convertIds($entryId));
     $result = parent::_entryDelete($entryId);
     if ($result && $row) {
         $stmt = iaDb::printf("`key` = 'fieldgroup_:name' OR `key` = 'fieldgroup_description_:item_:name'", $row);
         $this->_iaDb->delete($stmt, iaLanguage::getTable());
     }
     return $result;
 }
开发者ID:kamilklkn,项目名称:subrion,代码行数:10,代码来源:fieldgroups.php


示例6: _deleteFile

 private function _deleteFile($params)
 {
     $result = array('error' => true, 'message' => iaLanguage::get('invalid_parameters'));
     $item = isset($params['item']) ? iaSanitize::sql($params['item']) : null;
     $field = isset($params['field']) ? iaSanitize::sql($params['field']) : null;
     $path = isset($params['path']) ? iaSanitize::sql($params['path']) : null;
     $itemId = isset($params['itemid']) ? (int) $params['itemid'] : null;
     if ($itemId && $item && $field && $path) {
         $tableName = $this->_iaCore->factory('item')->getItemTable($item);
         $itemValue = $this->_iaDb->one($field, iaDb::convertIds($itemId), $tableName);
         $iaAcl = $this->_iaCore->factory('acl');
         if ($iaAcl->isAdmin() && $itemValue) {
             $pictures = $itemValue[1] == ':' ? unserialize($itemValue) : $itemValue;
             $key = null;
             if (is_array($pictures)) {
                 if ($primitive = !is_array($pictures[key($pictures)])) {
                     $pictures = array($pictures);
                 }
                 foreach ($pictures as $k => $v) {
                     if ($path == $v['path']) {
                         $key = $k;
                         break;
                     }
                 }
                 if (!is_null($key)) {
                     unset($pictures[$key]);
                 }
                 $newItemValue = $primitive ? '' : serialize($pictures);
             } else {
                 // single image
                 $newItemValue = '';
                 if ($pictures == $path) {
                     $key = true;
                 }
             }
             if (!is_null($key)) {
                 if ($this->_iaCore->factory('picture')->delete($path)) {
                     if ($this->_iaDb->update(array($field => $newItemValue), iaDb::convertIds($itemId), null, $tableName)) {
                         if (iaUsers::getItemName() == $item) {
                             // update current profile data
                             if ($itemId == iaUsers::getIdentity()->id) {
                                 iaUsers::reloadIdentity();
                             }
                         }
                     }
                     $result['error'] = false;
                     $result['message'] = iaLanguage::get('deleted');
                 } else {
                     $result['message'] = iaLanguage::get('error');
                 }
             }
         }
     }
     return $result;
 }
开发者ID:TalehFarzaliey,项目名称:subrion,代码行数:55,代码来源:actions.php


示例7: _gridUpdate

 protected function _gridUpdate($params)
 {
     $template = $params['id'];
     $this->_iaCore->set($template . '_subject', $params['subject'], true);
     $this->_iaCore->set($template . '_body', $params['body'], true);
     $this->_iaCore->set($template, (int) $params['enable_template'], true);
     $signature = $params['enable_signature'] ? '1' : '';
     $this->_iaDb->update(array('show' => $signature), iaDb::convertIds($template, 'name'));
     $result = 0 == $this->_iaDb->getErrorNumber();
     return array('result' => $result);
 }
开发者ID:kreativmind,项目名称:subrion,代码行数:11,代码来源:email-templates.php


示例8: _gridQuery

 protected function _gridQuery($columns, $where, $order, $start, $limit)
 {
     foreach (array('amount', 'gateway', 'status') as $joinedColumnName) {
         if (false !== stripos($order, $joinedColumnName)) {
             $order = str_replace(' i.`', ' t.`', $order);
             break;
         }
     }
     $sql = 'SELECT SQL_CALC_FOUND_ROWS ' . 'i.`id`, i.`date_created`, i.`fullname`, ' . 't.`plan_id`, t.`operation`, ' . 't.`status`, CONCAT(t.`amount`, " ", t.`currency`) `amount`, t.`currency`, t.`gateway`, ' . "1 `pdf`, 1 `update`, IF(t.`status` != 'passed', 1, 0) `delete` " . 'FROM `:prefix:table_invoices` i ' . 'LEFT JOIN `:prefix:table_transactions` t ON (t.`id` = i.`transaction_id`) ' . 'LEFT JOIN `:prefix:table_members` m ON (m.`id` = t.`member_id`) ' . ($where ? 'WHERE ' . $where . ' ' : '') . $order . ' ' . 'LIMIT :start, :limit';
     $sql = iaDb::printf($sql, array('prefix' => $this->_iaDb->prefix, 'table_invoices' => self::getTable(), 'table_members' => iaUsers::getTable(), 'table_transactions' => 'payment_transactions', 'start' => $start, 'limit' => $limit));
     return $this->_iaDb->getAll($sql);
 }
开发者ID:rentpad,项目名称:subrion,代码行数:12,代码来源:invoices.php


示例9: _approveClaim

 private function _approveClaim(array $data)
 {
     $claim = $this->getById($data['id']);
     $iaItem = $this->_iaCore->factory('item');
     $result = (bool) $this->_iaDb->update(array('member_id' => $claim['member_id']), iaDb::convertIds($claim['item_id']), null, $iaItem->getItemTable($claim['item']));
     $this->_iaDb->update(array('status' => 'approved'), iaDb::convertIds($claim['id']));
     if ($result && $this->_iaCore->get('claim_approved')) {
         $iaMailer = $this->_iaCore->factory('mailer');
         $iaMailer->loadTemplate('claim_approved');
         $iaMailer->addAddress($claim['email'], $claim['name']);
         $iaMailer->setReplacements(array('listing_title' => $claim['item_title'], 'listing_url' => $claim['item_url']));
         $iaMailer->send();
     }
 }
开发者ID:intelliants,项目名称:subrion-plugin-claim_listing,代码行数:14,代码来源:index.php


示例10: updateTrackingRecords

 public function updateTrackingRecords($trackingSalt, $memberId, $productId, $visitorReferrer)
 {
     // set cookie for 10 years
     setcookie('IA_AFF_TRACKING', $trackingSalt, time() + 315360000, '', $visitorReferrer, 0);
     $tracking = array('salt' => $trackingSalt, 'member_id' => $memberId, 'product_id' => $productId, 'referrer' => $visitorReferrer);
     // log visitor
     $this->iaDb->setTable(self::getTable());
     if ($this->iaDb->exists('`salt` = :salt', array('salt' => $trackingSalt))) {
         $this->iaDb->update($tracking, iaDb::convertIds($trackingSalt, 'salt'), array('datetime' => iaDb::FUNCTION_NOW));
     } else {
         $this->iaDb->insert($tracking, array('datetime' => iaDb::FUNCTION_NOW));
     }
     $this->iaDb->resetTable();
     return true;
 }
开发者ID:nicefirework,项目名称:subrion-elitius,代码行数:15,代码来源:ia.front.visitor.php


示例11: _gridRead

 protected function _gridRead($params)
 {
     if (isset($_POST['action'])) {
         $output = array();
         switch ($_POST['action']) {
             case 'get':
                 $output['code'] = $this->_iaDb->one_bind('`code`', iaDb::convertIds((int) $_POST['id']));
                 break;
             case 'set':
                 $output['result'] = (bool) $this->_iaDb->update(array('code' => $_POST['code']), iaDb::convertIds($_POST['id']));
                 $output['message'] = iaLanguage::get($output['result'] ? 'saved' : 'db_error');
         }
         return $output;
     }
     return parent::_gridRead($params);
 }
开发者ID:nicefirework,项目名称:subrion,代码行数:16,代码来源:hooks.php


示例12: _gridRead

 protected function _gridRead($params)
 {
     $output = array();
     switch ($this->_iaCore->requestPath[0]) {
         case 'get':
             $output['code'] = $this->_iaDb->one_bind('`code`', iaDb::convertIds((int) $_GET['id']));
             break;
         case 'set':
             $this->_iaDb->update(array('code' => $_POST['code']), iaDb::convertIds($_POST['id']));
             $output['result'] = 0 == $this->_iaDb->getErrorNumber();
             $output['message'] = iaLanguage::get($output['result'] ? 'saved' : 'db_error');
             break;
         default:
             $output = parent::_gridRead($params);
     }
     return $output;
 }
开发者ID:rentpad,项目名称:subrion,代码行数:17,代码来源:hooks.php


示例13: run

 /**
  * Execute cron job with the given id (optional)
  *
  * @param int $jobId job id
  *
  * @return array
  */
 public function run($jobId = null)
 {
     $this->iaDb->setTable(self::getTable());
     $stmt = is_null($jobId) ? '`active` = 1 AND `date_next_launch` <= UNIX_TIMESTAMP() ORDER BY `date_next_launch`' : iaDb::convertIds($jobId);
     $job = $this->iaDb->row(iaDb::ALL_COLUMNS_SELECTION, $stmt);
     if (!$job) {
         return;
     }
     $data = $this->_parse($job['data']);
     if (is_file(IA_HOME . $data[self::C_CMD])) {
         if ($this->iaDb->update(array('date_next_launch' => $data['lastScheduled']), iaDb::convertIds($job['id']), array('date_prev_launch' => 'UNIX_TIMESTAMP()'))) {
             $this->_launchFile($data[self::C_CMD]);
         }
     } else {
         $this->iaDb->update(array('active' => false), iaDb::convertIds($job['id']));
     }
     $this->iaDb->resetTable();
 }
开发者ID:kamilklkn,项目名称:subrion,代码行数:25,代码来源:ia.core.cron.php


示例14: delete

 public function delete($id)
 {
     $result = false;
     $this->iaDb->setTable(self::getTable());
     // if item exists, then remove it
     if ($row = $this->iaDb->row_bind(array('title', 'image'), '`id` = :id', array('id' => $id))) {
         $result = (bool) $this->iaDb->delete(iaDb::convertIds($id), self::getTable());
         if ($row['image'] && $result) {
             $iaPicture = $this->iaCore->factory('picture');
             $iaPicture->delete($row['image']);
         }
         if ($result) {
             $this->iaCore->factory('log')->write(iaLog::ACTION_DELETE, array('module' => 'portfolio', 'item' => 'portfolio', 'name' => $row['title'], 'id' => (int) $id));
         }
     }
     $this->iaDb->resetTable();
     return $result;
 }
开发者ID:NIXAP,项目名称:subrion-plugin-portfolio,代码行数:18,代码来源:ia.admin.portfolio.php


示例15: url

 public function url($action, $data = array(), $generate = false)
 {
     $data['action'] = $action;
     $data['alias'] = isset($data['genre_alias']) ? $data['genre_alias'] : $data['title_alias'];
     if (!isset($this->patterns[$action])) {
         $action = 'view';
     }
     if ($generate) {
         iaCore::util();
         if (!defined('IA_NOUTF')) {
             iaUtf8::loadUTF8Core();
             iaUtf8::loadUTF8Util('ascii', 'validation', 'bad', 'utf8_to_ascii');
         }
         if (!utf8_is_ascii($data['alias'])) {
             $data['alias'] = $iaCore->convertStr(utf8_to_ascii($data['alias']));
         }
     }
     $url = iaDb::printf($this->patterns[$action], $data);
     return $this->iaCore->packagesData[self::PACKAGE_NAME]['url'] . $url;
 }
开发者ID:nicefirework,项目名称:subrion-lyrics,代码行数:20,代码来源:ia.admin.lyric.php


示例16: url

 public function url($action, $data = array(), $generate = false)
 {
     $data['action'] = $action;
     $data['alias'] = isset($data['artist_alias']) ? $data['artist_alias'] : $data['title_alias'];
     if (!isset($this->patterns[$action])) {
         $action = 'view';
     }
     if ($generate) {
         $iaUtil = $iaCore->factory('core', 'util');
         if (!defined('IA_NOUTF')) {
             iaUtf8::loadUTF8Core();
             iaUtf8::loadUTF8Util('ascii', 'validation', 'bad', 'utf8_to_ascii');
         }
         if (!utf8_is_ascii($data['alias'])) {
             $data['alias'] = $iaCore->convertStr(utf8_to_ascii($data['alias']));
         }
     }
     $url = iaDb::printf($this->patterns[$action], $data);
     return self::get('url') . $url;
 }
开发者ID:nicefirework,项目名称:subrion-lyrics,代码行数:20,代码来源:ia.admin.artist.php


示例17: delete

 public function delete($id)
 {
     $result = false;
     $this->iaDb->setTable(self::getTable());
     // if item exists, then remove it
     if ($row = $this->iaDb->row_bind(array('title', 'image'), '`id` = :id', array('id' => $id))) {
         $result[] = (bool) $this->iaDb->delete(iaDb::convertIds($id), self::getTable());
         if ($row['image'] && $result) {
             $iaPicture = $this->iaCore->factory('picture');
             $iaPicture->delete($row['image']);
         }
         $result[] = (bool) $this->iaDb->delete(iaDb::convertIds($id, 'blog_id'), $this->_tableBlogEntriesTags);
         $sql = 'DELETE ' . 'FROM `:prefix:table_blog_tags` ' . 'WHERE `id` NOT IN (' . 'SELECT DISTINCT `tag_id` ' . 'FROM `:prefix:table_blog_entries_tags`)';
         $sql = iaDb::printf($sql, array('prefix' => $this->_iaDb->prefix, 'table_blog_entries_tags' => 'blog_entries_tags', 'table_blog_tags' => 'blog_tags'));
         $result[] = (bool) $this->iaDb->query($sql);
         if ($result) {
             $this->iaCore->factory('log')->write(iaLog::ACTION_DELETE, array('module' => 'blog', 'item' => 'blog', 'name' => $row['title'], 'id' => (int) $id));
         }
     }
     $this->iaDb->resetTable();
     return $result;
 }
开发者ID:bohmszi,项目名称:kdbe_cms,代码行数:22,代码来源:ia.admin.blog.php


示例18: getTags

 public function getTags($id)
 {
     $sql = 'SELECT GROUP_CONCAT(`title`) ' . 'FROM `:prefix:table_blog_tags` bt ' . 'WHERE `id` IN (' . 'SELECT `tag_id` ' . 'FROM `:prefix:table_blog_entries_tags` ' . 'WHERE `blog_id` = :id)';
     $sql = iaDb::printf($sql, array('prefix' => $this->_iaDb->prefix, 'table_blog_tags' => $this->_tableBlogTags, 'table_blog_entries_tags' => $this->_tableBlogEntriesTags, 'id' => $id));
     return $this->_iaDb->getOne($sql);
 }
开发者ID:kreativmind,项目名称:subrion,代码行数:6,代码来源:ia.admin.blog.php


示例19: empty

        $iaView->assign('tags', $blogTags);
        $iaView->assign('blog_entry', $blogEntry);
    } else {
        $page = empty($_GET['page']) ? 0 : (int) $_GET['page'];
        $page = $page < 1 ? 1 : $page;
        $pageUrl = $iaCore->factory('page', iaCore::FRONT)->getUrlByName('blog');
        $pagination = array('start' => ($page - 1) * $iaCore->get('blog_number'), 'limit' => (int) $iaCore->get('blog_number'), 'template' => $pageUrl . '?page={page}');
        $order = 'date' == $iaCore->get('blog_order') ? 'ORDER BY `date_added` DESC' : 'ORDER BY `title` ASC';
        $stmt = '`status` = :status AND `lang` = :language';
        $iaDb->bind($stmt, array('status' => iaCore::STATUS_ACTIVE, 'language' => $iaView->language));
        $sql = 'SELECT SQL_CALC_FOUND_ROWS ' . 'b.`id`, b.`title`, b.`date_added`, b.`body`, b.`alias`, b.`image`, m.`fullname` ' . 'FROM `:prefix:table_blog_entries` b ' . 'LEFT JOIN `:prefix:table_members` m ON (b.`member_id` = m.`id`) ' . 'WHERE b.' . $stmt . $order . ' LIMIT :start, :limit';
        $sql = iaDb::printf($sql, array('prefix' => $iaDb->prefix, 'table_blog_entries' => 'blog_entries', 'table_members' => 'members', 'start' => $pagination['start'], 'limit' => $pagination['limit']));
        $rows = $iaDb->getAll($sql);
        $pagination['total'] = $iaDb->foundRows();
        $sql = 'SELECT bt.`title`, bt.`alias`, bet.`blog_id` ' . 'FROM `:prefix:table_blog_tags` bt ' . 'LEFT JOIN `:prefix:table_blog_entries_tags` bet ON (bt.`id` = bet.`tag_id`) ' . 'ORDER BY bt.`title`';
        $sql = iaDb::printf($sql, array('prefix' => $iaDb->prefix, 'table_blog_entries_tags' => 'blog_entries_tags', 'table_blog_tags' => 'blog_tags'));
        $blogTags = $iaDb->getAll($sql);
        $iaView->assign('tags', $blogTags);
        $iaView->assign('blog_entries', $rows);
        $iaView->assign('pagination', $pagination);
    }
    $pageActions[] = array('icon' => 'rss', 'title' => '', 'url' => IA_URL . 'blog.xml', 'classes' => 'btn-warning');
    $iaView->set('actions', $pageActions);
    $iaView->display('index');
}
if (iaView::REQUEST_XML == $iaView->getRequestType()) {
    $output = array('title' => $iaCore->get('site') . ' :: ' . $iaView->title(), 'description' => '', 'url' => IA_URL . 'blog', 'item' => array());
    $listings = $iaDb->all(iaDb::ALL_COLUMNS_SELECTION, "`lang`= '" . $iaView->language . "'", 0, 20);
    $pageUrl = $iaCore->factory('page', iaCore::FRONT)->getUrlByName('blog');
    foreach ($listings as $entry) {
        $output['item'][] = array('title' => $entry['title'], 'link' => $pageUrl . $entry['id'] . '-' . $entry['alias'], 'pubDate' => date('D, d M Y H:i:s T', strtotime($entry['date_modified'])), 'description' => iaSanitize::tags($entry['body']));
开发者ID:TalehFarzaliey,项目名称:subrion,代码行数:31,代码来源:index.php


示例20: array

 * Subrion is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Subrion. If not, see <http://www.gnu.org/licenses/>.
 *
 *
 * @link http://www.subrion.org/
 *
 ******************************************************************************/
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    if ($iaView->blockExists('blogroll') || $iaView->blockExists('new_blog_posts')) {
        $stmt = 'b.`status` = :status AND `lang` = :language ORDER BY b.`date_added` DESC';
        $iaDb->bind($stmt, array('status' => iaCore::STATUS_ACTIVE, 'language' => $iaView->language));
        $sql = 'SELECT b.`id`, b.`title`, b.`date_added`, b.`alias`, b.`body`, b.`image`, m.`fullname` ' . 'FROM `:prefix:table_blog_entries` b ' . 'LEFT JOIN `:prefix:table_members` m ON (b.`member_id` = m.`id`) ' . 'WHERE :condition ' . 'LIMIT :start, :limit';
        $sql = iaDb::printf($sql, array('prefix' => $iaDb->prefix, 'table_blog_entries' => 'blog_entries', 'table_members' => 'members', 'condition' => $stmt, 'start' => 0, 'limit' => $iaCore->get('blog_number_block')));
        $array = $iaDb->getAll($sql);
        $iaView->assign('block_blog_entries', $array);
    }
    if ($iaView->blockExists('blogs_archive')) {
        $data = array();
        if ($array = $iaDb->all('DISTINCT(MONTH(`date_added`)) `month`, YEAR(`date_added`) `year`', "`status` = 'active' GROUP BY `date_added` ORDER BY `date_added` DESC", 0, 6, 'blog_entries')) {
            foreach ($array as $date) {
                $data[] = array('url' => IA_URL . 'blog/date/' . $date['year'] . IA_URL_DELIMITER . $date['month'] . IA_URL_DELIMITER, 'month' => $date['month'], 'year' => $date['year']);
            }
        }
        $iaView->assign('blogs_archive', $data);
    }
}
开发者ID:kamilklkn,项目名称:subrion,代码行数:31,代码来源:hook.blocks-load.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP iaLanguage类代码示例发布时间:2022-05-23
下一篇:
PHP iaCore类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap