本文整理汇总了PHP中JO_Registry类的典型用法代码示例。如果您正苦于以下问题:PHP JO_Registry类的具体用法?PHP JO_Registry怎么用?PHP JO_Registry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JO_Registry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
if ($this->session->get('successfu_edite')) {
$this->view->successfu_edite = true;
$this->session->clear('successfu_edite');
}
$this->view->page_num = $page = $this->getRequest()->getRequest('page', 1);
$data = array('start' => $page * JO_Registry::get('admin_limit') - JO_Registry::get('admin_limit'), 'limit' => JO_Registry::get('admin_limit'));
$this->view->comments = array();
$comments = Model_Comments::getReportedComments($data);
if ($comments) {
$bbcode_parser = new WM_BBCode_Parser();
$bbcode_parser->loadDefaultCodes();
foreach ($comments as $comment) {
$comment['href'] = WM_Router::create($this->getRequest()->getBaseUrl() . '?controller=items&action=comments&item_id=' . $comment['item_id'] . '&filter=' . ($comment['reply_to'] ? $comment['reply_to'] : $comment['id']));
$bbcode_parser->parse($comment['comment']);
$comment['comment'] = $bbcode_parser->getAsHtml();
$this->view->comments[] = $comment;
}
}
$total_records = Model_Comments::getTotalReportedComments($data);
$this->view->total_pages = ceil($total_records / JO_Registry::get('admin_limit'));
$this->view->total_rows = $total_records;
$pagination = new Model_Pagination();
$pagination->setLimit(JO_Registry::get('admin_limit'));
$pagination->setPage($page);
$pagination->setTotal($total_records);
$pagination->setUrl($this->getRequest()->getModule() . '/comments/?page={page}');
$this->view->pagination = $pagination->render();
}
开发者ID:noikiy,项目名称:PD,代码行数:30,代码来源:CommentsController.php
示例2: indexAction
public function indexAction()
{
$request = $this->getRequest();
if ($this->session->get('successfu_edite')) {
$this->view->successfu_edite = true;
$this->session->clear('successfu_edite');
}
$this->view->page_num = $page = $this->getRequest()->getRequest('page', 1);
$this->view->filter_username = $request->getQuery('filter_username');
$this->view->filter_email = $request->getQuery('filter_email');
$this->view->filter_bulletin_subscribe = $request->getQuery('filter_bulletin_subscribe');
$url = '';
if ($this->view->filter_username) {
$url .= '&filter_username=' . $this->view->filter_username;
}
if ($this->view->filter_email) {
$url .= '&filter_email=' . $this->view->filter_email;
}
if ($this->view->filter_bulletin_subscribe) {
$url .= '&filter_bulletin_subscribe=' . $this->view->filter_bulletin_subscribe;
}
$data = array('start' => $page * JO_Registry::get('admin_limit') - JO_Registry::get('admin_limit'), 'limit' => JO_Registry::get('admin_limit'), 'filter_username' => $this->view->filter_username, 'filter_email' => $this->view->filter_email, 'filter_bulletin_subscribe' => $this->view->filter_bulletin_subscribe);
$this->view->categories = Model_Bulletinemails::getEmails($data);
$total_records = Model_Bulletinemails::getTotalEmails($data);
$this->view->total_pages = ceil($total_records / JO_Registry::get('admin_limit'));
$this->view->total_rows = $total_records;
$pagination = new Model_Pagination();
$pagination->setLimit(JO_Registry::get('admin_limit'));
$pagination->setPage($page);
$pagination->setTotal($total_records);
$pagination->setUrl($this->getRequest()->getModule() . '/categories/?page={page}' . $url);
$this->view->pagination = $pagination->render();
}
开发者ID:noikiy,项目名称:PD,代码行数:33,代码来源:BulletinemailsController.php
示例3: createBoard
public static function createBoard($data)
{
if (!isset($data['category_id']) || !$data['category_id']) {
$data['category_id'] = JO_Registry::get('default_category_id');
}
$db = JO_Db::getDefaultAdapter();
$count_followers = $db->select()->from('users_following_user', 'COUNT(ufu_id)')->where('following_id = ?', isset($data['user_id']) ? (string) $data['user_id'] : JO_Session::get('user[user_id]'));
$db->insert('boards', array('user_id' => isset($data['user_id']) ? (string) $data['user_id'] : JO_Session::get('user[user_id]'), 'title' => $data['title'], 'date_added' => new JO_Db_Expr('NOW()'), 'date_modified' => new JO_Db_Expr('NOW()'), 'public' => 1, 'category_id' => $data['category_id'], 'followers' => new JO_Db_Expr('(' . $count_followers . ')')));
$board_id = $db->lastInsertId();
if (!$board_id) {
return false;
}
$ins = $db->insert('users_boards', array('user_id' => isset($data['user_id']) ? (string) $data['user_id'] : JO_Session::get('user[user_id]'), 'board_id' => $board_id, 'is_author' => 1));
if (isset($data['friends'])) {
foreach ($data['friends'] as $fr) {
$db->insert('users_boards', array('user_id' => $fr, 'board_id' => $board_id));
}
}
if (!$ins) {
$db->delete('boards', array('board_id' => $board_id));
$db->delete('users_boards', array('board_id' => $board_id));
return false;
}
$db->update('users', array('boards' => new JO_Db_Expr("(SELECT COUNT(board_id) FROM boards WHERE user_id = '" . (isset($data['user_id']) ? (string) $data['user_id'] : JO_Session::get('user[user_id]')) . "')")), array('user_id = ?' => isset($data['user_id']) ? (string) $data['user_id'] : JO_Session::get('user[user_id]')));
self::generateBoardQuery($board_id, array('title' => $data['title']));
return array('board_id' => $board_id, 'title' => $data['title']);
}
开发者ID:noikiy,项目名称:amatteur,代码行数:27,代码来源:Boards.php
示例4: translateApiAction
public function translateApiAction()
{
$word = $this->getRequest()->getPost('word');
$from = $this->getRequest()->getPost('from');
$to = $this->getRequest()->getPost('to');
if (!JO_Registry::get('google_translate_key')) {
$this->view->error = 'No Google Translate API key';
} else {
$url = 'https://www.googleapis.com/language/translate/v2?key=' . JO_Registry::get('google_translate_key') . '&q=' . urlencode($word) . '&source=' . $from . '&target=' . $to;
// if (ini_get('allow_url_fopen')) {
// $response = json_decode(@file_get_contents($url), true);
// } else {
// $response = json_decode($this->file_get_contents_curl($url), true);
// }
$response = json_decode($this->file_get_contents_curl($url), true);
if (isset($response['data']['translations'][0]['translatedText'])) {
$this->view->text = $response['data']['translations'][0]['translatedText'];
} elseif ($response['error']['message']) {
$this->view->error = $response['error']['message'];
} else {
$this->view->error = 'Error translate';
}
}
echo $this->renderScript('json');
}
开发者ID:noikiy,项目名称:amatteur,代码行数:25,代码来源:TranslateController.php
示例5: format
public static function format($date, $format = null)
{
if (!$format) {
$format = JO_Registry::get('config_date_format_short');
}
return (string) new JO_Date($date, $format);
}
开发者ID:noikiy,项目名称:amatteur,代码行数:7,代码来源:Date.php
示例6: indexAction
public function indexAction()
{
if ($this->session->get('successfu_edite')) {
$this->view->successfu_edite = true;
$this->session->clear('successfu_edite');
}
if ($this->session->get('error_permision')) {
$this->view->error_permision = $this->session->get('error_permision');
$this->session->clear('error_permision');
}
$request = $this->getRequest();
$this->setViewChange('form');
if ($request->isPost()) {
if (!WM_Users::allow('edit', $this->getRequest()->getController())) {
$this->session->set('error_permision', $this->translate('You do not have permission to this action'));
$this->redirect($this->getRequest()->getBaseUrl() . $this->getRequest()->getModule() . '/settings/');
}
if (JO_Registry::get('license_powered_check') != 'false') {
$request->setParams('config_hide_brand', 0);
}
Model_Settings::updateAll($request->getParams());
$config = $request->getPost('config');
if (isset($config['config_currency_auto_update']) && $config['config_currency_auto_update'] == 1) {
WM_Currency::updateCurrencies($config['config_currency'], true);
}
$this->session->set('successfu_edite', true);
$this->redirect($this->getRequest()->getBaseUrl() . $this->getRequest()->getModule() . '/settings/');
}
$this->getForm();
}
开发者ID:noikiy,项目名称:amatteur,代码行数:30,代码来源:SettingsController.php
示例7: indexAction
public function indexAction()
{
$where = '';
$category = null;
if ($this->getRequest()->getQuery('username')) {
$userinfo = Model_Users::getByUsername($this->getRequest()->getQuery('username'));
if ($userinfo) {
$where = "users.username = '" . $this->getRequest()->getQuery('username') . "'";
}
}
if ($this->getRequest()->getQuery('category')) {
$catinfo = Model_Categories::get($this->getRequest()->getQuery('category'));
if ($catinfo) {
$category = $this->getRequest()->getQuery('category');
}
}
$items = Model_Items::getAll($category, 0, 20, 'id desc', $where);
$this->view->item = array();
if ($items) {
$model_images = new Model_Images();
$categories = Model_Categories::get_all();
foreach ($items as $item) {
$categories_string = '';
if ($category) {
foreach ($item['categories'] as $cats) {
if (in_array($category, $cats)) {
foreach ($cats as $cat) {
if (isset($categories[$cat]['name'])) {
$categories_string .= $categories_string ? ' › ' : '';
$categories_string .= $categories[$cat]['name'];
}
}
break;
}
}
} else {
$cats = array_pop($item['categories']);
if ($cats && is_array($cats)) {
foreach ($cats as $cat) {
if (isset($categories[$cat]['name'])) {
$categories_string .= $categories_string ? ' › ' : '';
$categories_string .= $categories[$cat]['name'];
}
}
}
}
if ((int) JO_Registry::get($item['module'] . '_items_preview_width') && (int) JO_Registry::get($item['module'] . '_items_preview_height')) {
$item['theme_preview_thumbnail'] = $this->getRequest()->getBaseUrl() . $model_images->resize($item['theme_preview_thumbnail'], JO_Registry::forceGet($item['module'] . '_items_preview_width'), JO_Registry::forceGet($item['module'] . '_items_preview_height'), true);
} elseif ((int) JO_Registry::get($item['module'] . '_items_preview_width')) {
$item['theme_preview_thumbnail'] = $this->getRequest()->getBaseUrl() . $model_images->resizeWidth($item['theme_preview_thumbnail'], JO_Registry::forceGet($item['module'] . '_items_preview_width'));
} elseif ((int) JO_Registry::get($item['module'] . '_items_preview_height')) {
$item['theme_preview_thumbnail'] = $this->getRequest()->getBaseUrl() . $model_images->resizeHeight($item['theme_preview_thumbnail'], JO_Registry::forceGet($item['module'] . '_items_preview_height'));
} else {
$item['theme_preview_thumbnail'] = false;
}
$this->view->item[] = array('title' => $item['name'], 'link' => WM_Router::create($this->getRequest()->getBaseUrl() . '?module=' . $item['module'] . '&controller=items&item_id=' . $item['id']), 'description' => html_entity_decode($item['description'], ENT_QUOTES, 'utf-8'), 'author' => $item['username'], 'category' => $categories_string, 'guid' => $item['id'], 'enclosure' => $item['theme_preview_thumbnail'], 'pubDate' => JO_Date::getInstance($item['datetime'], JO_Date::RSS_FULL, true)->toString());
}
}
echo $this->renderScript('rss');
}
开发者ID:noikiy,项目名称:PD,代码行数:60,代码来源:RssController.php
示例8: getPrefixDB
public static function getPrefixDB()
{
if (JO_Registry::get('singlesignon_db_users')) {
return JO_Registry::get('singlesignon_db_users') . '.';
}
return '';
}
开发者ID:noikiy,项目名称:PD,代码行数:7,代码来源:Users.php
示例9: indexAction
public function indexAction()
{
if ($this->session->get('successfu_edite')) {
$this->view->successfu_edite = true;
$this->session->clear('successfu_edite');
}
$this->view->page_num = $page = $this->getRequest()->getRequest('page', 1);
$data = array('start' => $page * JO_Registry::get('admin_limit') - JO_Registry::get('admin_limit'), 'limit' => JO_Registry::get('admin_limit'));
$this->view->contacts = array();
$contacts = Model_Contacts::getContacts($data);
if ($contacts) {
foreach ($contacts as $contact) {
$contact['datetime'] = JO_Date::getInstance($contact['datetime'], 'dd MM yy', true)->toString();
$contact['has_response'] = $contact['answer_datetime'] != '0000-00-00 00:00:00';
if ($contact['answer_datetime'] != '0000-00-00 00:00:00') {
$contact['answer_datetime'] = JO_Date::getInstance($contact['answer_datetime'], 'dd MM yy', true)->toString();
} else {
$contact['answer_datetime'] = '';
}
$this->view->contacts[] = $contact;
}
}
$total_records = Model_Contacts::getTotalContacts($data);
$this->view->total_pages = ceil($total_records / JO_Registry::get('admin_limit'));
$this->view->total_rows = $total_records;
$pagination = new Model_Pagination();
$pagination->setLimit(JO_Registry::get('admin_limit'));
$pagination->setPage($page);
$pagination->setTotal($total_records);
$pagination->setUrl($this->getRequest()->getModule() . '/contacts/?page={page}');
$this->view->pagination = $pagination->render();
}
开发者ID:noikiy,项目名称:PD,代码行数:32,代码来源:ContactsController.php
示例10: indexAction
public function indexAction()
{
if ($this->session->get('successfu_edite')) {
$this->view->successfu_edite = true;
$this->session->clear('successfu_edite');
}
Model_Smiles::initDbInstall();
$this->view->page_num = $page = $this->getRequest()->getRequest('page', 1);
$data = array('start' => $page * JO_Registry::get('admin_limit') - JO_Registry::get('admin_limit'), 'limit' => JO_Registry::get('admin_limit'));
$this->view->smiles = array();
$smiles = Model_Smiles::getSmiles($data);
if ($smiles) {
foreach ($smiles as $country) {
$this->view->smiles[] = $country;
}
}
$total_records = Model_Smiles::getTotalSmiles();
$this->view->total_pages = ceil($total_records / JO_Registry::get('admin_limit'));
$this->view->total_rows = $total_records;
$pagination = new Model_Pagination();
$pagination->setLimit(JO_Registry::get('admin_limit'));
$pagination->setPage($page);
$pagination->setTotal($total_records);
$pagination->setUrl($this->getRequest()->getModule() . '/smiles/?page={page}');
$this->view->pagination = $pagination->render();
}
开发者ID:noikiy,项目名称:PD,代码行数:26,代码来源:SmilesController.php
示例11: indexAction
public function indexAction()
{
$request = $this->getRequest();
//JO_Session::clear('categoria_id');
$page = (int) $request->getRequest('page');
if ($page < 1) {
$page = 1;
}
$data = array('start' => JO_Registry::get('config_front_limit') * $page - JO_Registry::get('config_front_limit'), 'limit' => JO_Registry::get('config_front_limit'), 'filter_marker' => $request->getRequest('marker'));
$this->view->pins = '';
$pins = Model_Pins::getPins($data);
if ($pins) {
$banners = Model_Banners::getBanners(new JO_Db_Expr("`controller` = '" . $request->getController() . "' AND position BETWEEN '" . (int) $data['start'] . "' AND '" . (int) $data['limit'] . "'"));
$pp = JO_Registry::get('config_front_limit');
foreach ($pins as $row => $pin) {
///banners
$key = $row + ($pp * $page - $pp);
if (isset($banners[$key])) {
$this->view->pins .= Helper_Banners::returnHtml($banners[$key]);
}
//pins
$this->view->pins .= Helper_Pin::returnHtml($pin);
}
// JO_Registry::set('marker', Model_Pins::getMaxPin($data));
}
if ($request->isXmlHttpRequest()) {
echo $this->view->pins;
$this->noViewRenderer(true);
} else {
$this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part');
}
}
开发者ID:noikiy,项目名称:amatteur,代码行数:32,代码来源:AllController.php
示例12: indexAction
public function indexAction()
{
if ($this->session->get('successfu_edite')) {
$this->view->successfu_edite = true;
$this->session->clear('successfu_edite');
}
$request = $this->getRequest();
$files = glob(dirname(__FILE__) . '/Extensions/*.php');
$this->view->extensions = array();
if ($files) {
foreach ($files as $file) {
if (preg_match('/^([\\w]{1,})Controller$/i', basename($file, '.php'), $match)) {
$key = mb_strtolower($match[1], 'utf-8');
$name = $match[1];
$controller_name = JO_Front::getInstance()->formatControllerName('extensions_' . $key);
if (!class_exists($controller_name, false)) {
JO_Loader::loadFile($file);
}
if (method_exists($controller_name, 'info')) {
$data = call_user_func(array($controller_name, 'info'));
if (isset($data['name']) && $data['name']) {
$name = $data['name'];
}
}
$this->view->extensions[] = array('key' => $key, 'install' => $request->getModule() . '/extensions/install/?extension=' . $key, 'uninstall' => $request->getModule() . '/extensions/uninstall/?extension=' . $key, 'edit' => $request->getModule() . '/extensions/edit/?extension=' . $key, 'name' => $name, 'sort' => (int) JO_Registry::forceGet($key . '_sort_order'), 'status' => JO_Registry::forceGet($key . '_status') ? $this->translate('Enabled') : $this->translate('Disabled'), 'installed' => Model_Extensions::isInstaled($key));
}
}
}
}
开发者ID:noikiy,项目名称:PD,代码行数:29,代码来源:ExtensionsController.php
示例13: sendContact
public static function sendContact($id, $data = array())
{
$info = self::getContact($id);
if (!$info) {
return false;
}
$db = JO_Db::getDefaultAdapter();
$db->update('contacts', array('answer' => $data['answer'], 'answer_datetime' => new JO_Db_Expr('NOW()')), array('id = ?' => (int) $id));
$request = JO_Request::getInstance();
$domain = $request->getDomain();
$translate = JO_Translate::getInstance();
$mail = new JO_Mail();
if (JO_Registry::get('mail_smtp')) {
$mail->setSMTPParams(JO_Registry::forceGet('mail_smtp_host'), JO_Registry::forceGet('mail_smtp_port'), JO_Registry::forceGet('mail_smtp_user'), JO_Registry::forceGet('mail_smtp_password'));
}
$mail->setFrom('no-reply@' . $domain);
$mail->setSubject("[" . $domain . "] " . $translate->translate('Contact form'));
$html = nl2br($data['answer'] . '
' . $info['name'] . ' ' . $translate->translate('wrote') . ' =======================================
' . $info['short_text']);
$mail->setHTML($html);
$result = (int) $mail->send(array($info['email']), JO_Registry::get('mail_smtp') ? 'smtp' : 'mail');
return $result;
}
开发者ID:noikiy,项目名称:PD,代码行数:25,代码来源:Contacts.php
示例14: indexAction
public function indexAction()
{
$request = $this->getRequest();
$source_id = $request->getRequest('source_id');
$source_info = Model_Source::getSource($source_id);
if (!$source_info) {
$this->forward('error', 'error404');
}
$this->getLayout()->meta_title = $source_info['source'];
$this->view->source = $source_info;
$page = (int) $request->getRequest('page');
if ($page < 1) {
$page = 1;
}
$data = array('start' => JO_Registry::get('config_front_limit') * $page - JO_Registry::get('config_front_limit'), 'limit' => JO_Registry::get('config_front_limit'), 'filter_source_id' => $request->getRequest('source_id'), 'filter_marker' => $request->getRequest('marker'));
// if((int)JO_Session::get('user[user_id]')) {
// $data['following_users_from_user_id'] = JO_Session::get('user[user_id]');
// }
$this->view->pins = '';
$pins = Model_Pins::getPins($data);
if ($pins) {
foreach ($pins as $pin) {
$this->view->pins .= Helper_Pin::returnHtml($pin);
}
// JO_Registry::set('marker', Model_Pins::getMaxPin($data));
}
if ($request->isXmlHttpRequest()) {
echo $this->view->pins;
$this->noViewRenderer(true);
} else {
$this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part');
}
}
开发者ID:noikiy,项目名称:amatteur,代码行数:33,代码来源:SourceController.php
示例15: indexAction
public function indexAction()
{
$request = $this->getRequest();
$page = (int) $request->getRequest('page');
if ($page < 1) {
$page = 1;
}
$data = array('start' => JO_Registry::get('config_front_limit') * $page - JO_Registry::get('config_front_limit'), 'limit' => JO_Registry::get('config_front_limit'), 'filter_marker' => $request->getRequest('marker'), 'filter_price_from' => (int) $request->getRequest('price_from'), 'filter_price_to' => (int) $request->getRequest('price_to'), 'allow_gifts' => true, 'filter_categoria_id' => $request->getRequest('category_id') != 9999 ? $request->getRequest('category_id') : null);
// if((int)JO_Session::get('user[user_id]')) {
// $data['following_users_from_user_id'] = JO_Session::get('user[user_id]');
// }
$category_id = $request->getRequest('category_id');
if ($category_id == 9999) {
$category_id = null;
}
$category_info = Model_Categories::getCategory($category_id);
/*
if($category_info && !$category_info['parent_id']){
$subCats = Model_Categories::getSubcategories($category_id);
if($subCats){
$category_id = '';
foreach($subCats as $sc){
$category_id.= $sc['category_id'].",";
}
$category_id = substr($category_id,0,-1);
}
}
*/
if (!$category_info) {
$category_info["title"] = "Todo";
}
$this->view->category = $category_info;
$this->view->price_from = (int) $request->getRequest('price_from');
$this->view->price_to = (int) $request->getRequest('price_to');
$this->view->pins = '';
$pins = Model_Pins::getPins($data);
if ($pins) {
$banners = Model_Banners::getBanners(new JO_Db_Expr("`controller` = '" . $request->getController() . "' AND position BETWEEN '" . (int) $data['start'] . "' AND '" . (int) $data['limit'] . "'"));
$pp = JO_Registry::get('config_front_limit');
foreach ($pins as $row => $pin) {
///banners
$key = $row + ($pp * $page - $pp);
if (isset($banners[$key])) {
$this->view->pins .= Helper_Banners::returnHtml($banners[$key]);
}
//pins
$this->view->pins .= Helper_Pin::returnHtml($pin);
}
// JO_Registry::set('marker', Model_Pins::getMaxPin($data));
}
if ($request->isXmlHttpRequest()) {
echo $this->view->pins;
$this->noViewRenderer(true);
} else {
$this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part');
}
}
开发者ID:noikiy,项目名称:amatteur,代码行数:60,代码来源:GiftsController.php
示例16: fixExternallinks
public function fixExternallinks($text)
{
static $request = null, $external_urls = null;
if ($request === null) {
$request = JO_Request::getInstance();
}
if ($external_urls === null) {
$external_urls = JO_Registry::get('config_fix_external_urls');
}
if (!$external_urls) {
return $text;
}
$dom = new JO_Html_Dom();
$dom->load($text);
$tags = $dom->find('a[href!^=' . $request->getDomain() . ']');
foreach ($tags as $tag) {
if (stripos(trim($tag->href), 'http') === 0) {
$tag->rel = 'nofollow';
if ($tag->target) {
unset($tag->target);
}
$tag->onclick = ($tag->onclick ? $tag->onclick . ';' : '') . "target='_blank';";
}
}
return (string) $dom;
}
开发者ID:NareshChennuri,项目名称:pyng,代码行数:26,代码来源:Externallinks.php
示例17: indexAction
public function indexAction()
{
if ($this->session->get('successfu_edite')) {
$this->view->successfu_edite = true;
$this->session->clear('successfu_edite');
}
if ($this->session->get('error_permision')) {
$this->view->error_permision = $this->session->get('error_permision');
$this->session->clear('error_permision');
}
$reques = $this->getRequest();
$page = $reques->getRequest('page', 1);
$data = array('start' => $page * JO_Registry::get('config_admin_limit') - JO_Registry::get('config_admin_limit'), 'limit' => JO_Registry::get('config_admin_limit'));
$this->view->words = array();
$words = Model_Banners::getBanners($data);
if ($words) {
foreach ($words as $word) {
$word['text_controller'] = $this->positions($word['controller']);
$this->view->words[] = $word;
}
}
$total_records = Model_Banners::getTotalBanners($data);
$this->view->total_pages = ceil($total_records / JO_Registry::get('config_admin_limit'));
$this->view->total_rows = $total_records;
$pagination = new Model_Pagination();
$pagination->setLimit(JO_Registry::get('config_admin_limit'));
$pagination->setPage($page);
$pagination->setTotal($total_records);
$pagination->setUrl($this->getRequest()->getModule() . '/banners/?page={page}');
$this->view->pagination = $pagination->render();
}
开发者ID:noikiy,项目名称:amatteur,代码行数:31,代码来源:BannersController.php
示例18: getPercentRow
public function getPercentRow($user)
{
$db = JO_Db::getDefaultAdapter();
$query = $db->select()->from(Model_Users::getPrefixDB() . 'users', 'commission_percent')->where('user_id= ?', $user['user_id'])->limit(1, 0);
$user_data = $db->fetchRow($query);
if ($user_data && round($user_data['commission_percent']) > 0) {
return array('percent' => floatval($user_data['commission_percent']), 'to' => 0);
}
$no_exclusive_author_percent = 30;
if (JO_Registry::get('no_exclusive_author_percent')) {
$no_exclusive_author_percent = (int) JO_Registry::get('no_exclusive_author_percent');
}
$exclusive_author_percent = 40;
if (JO_Registry::get('exclusive_author_percent')) {
$exclusive_author_percent = (int) JO_Registry::get('exclusive_author_percent');
}
if ($user['exclusive_author'] == 'false') {
$percent = array('percent' => $no_exclusive_author_percent, 'to' => 0);
} else {
$query = $db->select()->from(Model_Users::getPrefixDB() . 'percents')->where("`from` <= ? AND (`to` > ? OR `to` = 0)", $user['sold']);
$data = $db->fetchRow($query);
if (count($data) == 0) {
$percent = array('percent' => $exclusive_author_percent, 'to' => 0);
} else {
$percent = $data;
}
}
return $percent;
}
开发者ID:noikiy,项目名称:PD,代码行数:29,代码来源:Percentes.php
示例19: send
public static function send($to, $from, $title, $body = '')
{
$mail = new JO_Mailer_Base();
if (JO_Registry::forceGet('config_mail_smtp')) {
$mail->SMTPAuth = true;
$mail->IsSMTP();
$mail->Host = JO_Registry::forceGet('config_mail_smtp_host');
$mail->Port = JO_Registry::forceGet('config_mail_smtp_port');
$mail->Username = JO_Registry::forceGet('config_mail_smtp_user');
$mail->Password = JO_Registry::forceGet('config_mail_smtp_password');
}
$mail->SetFrom($from, '');
$mail->AddReplyTo($from, "");
$mail->Subject = $title;
$mail->AltBody = self::translate("To view the message, please use an HTML compatible email viewer!");
// optional, comment out and test
$mail->MsgHTML($body, BASE_PATH);
$mail->AddAddress($to, "");
$result = $mail->Send();
if ($result) {
return true;
} else {
self::$error = $mail->ErrorInfo;
return false;
}
}
开发者ID:noikiy,项目名称:amatteur,代码行数:26,代码来源:Email.php
示例20: indexAction
public function indexAction()
{
if ($this->session->get('successfu_edite')) {
$this->view->successfu_edite = true;
$this->session->clear('successfu_edite');
}
$this->view->page_num = $page = $this->getRequest()->getRequest('page', 1);
$data = array('start' => $page * JO_Registry::get('admin_limit') - JO_Registry::get('admin_limit'), 'limit' => JO_Registry::get('admin_limit'));
$this->view->withdraws = array();
$withdraws = Model_Users::getWithdraws($data);
if ($withdraws) {
foreach ($withdraws as $withdraw) {
$withdraw['earning'] = WM_Currency::format($withdraw['earning']);
$date = new JO_Date($withdraw['datetime'], 'dd MM yy');
$withdraw['datetime'] = $date->toString();
if ($withdraw['paid'] == 'true') {
$date = new JO_Date($withdraw['paid_datetime'], 'dd MM yy');
$withdraw['paid_datetime'] = $date->toString();
} else {
$withdraw['paid_datetime'] = '';
}
$withdraw['amount'] = WM_Currency::format($withdraw['amount']);
$this->view->withdraws[] = $withdraw;
}
}
$total_records = Model_Users::getTotalWithdraws($data);
$this->view->total_pages = ceil($total_records / JO_Registry::get('admin_limit'));
$this->view->total_rows = $total_records;
$pagination = new Model_Pagination();
$pagination->setLimit(JO_Registry::get('admin_limit'));
$pagination->setPage($page);
$pagination->setTotal($total_records);
$pagination->setUrl($this->getRequest()->getModule() . '/gainpayingup/?page={page}');
$this->view->pagination = $pagination->render();
}
开发者ID:noikiy,项目名称:PD,代码行数:35,代码来源:GainpayingupController.php
注:本文中的JO_Registry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论