예제 #1
0
파일: date.php 프로젝트: kamilklkn/subrion
                     $fullDate = explode('-', $fullDate);
                     if ($fullDate[1] == $j && $fullDate[0] == $y) {
                         if (isset($iaCore->requestPath[0]) && $iaCore->requestPath[0] == $y) {
                             $months[$j]['blogs'] = true;
                             $show['months'] = true;
                         } elseif (!isset($iaCore->requestPath[0]) && !isset($iaCore->requestPath[1])) {
                             $years[$y]['months'][$j]['blogs'] = true;
                             $show['years'] = true;
                         }
                     }
                 }
             }
         }
         if (isset($iaCore->requestPath[0]) && !isset($iaCore->requestPath[1])) {
             iaBreadcrumb::preEnd('Blog Archive', 'blog/date');
             iaBreadcrumb::replaceEnd($iaCore->requestPath[0], IA_SELF);
             $iaView->title($iaCore->requestPath[0]);
         }
         $iaView->assign('show', $show);
         $iaView->assign('years', $years);
         $iaView->assign('months', $months);
     } else {
         $iaView->setMessages(iaLanguage::get('no_blog_entries'), iaView::ALERT);
     }
 } elseif (isset($iaCore->requestPath[0]) && isset($iaCore->requestPath[1])) {
     $page = empty($_GET['page']) ? 0 : (int) $_GET['page'];
     $page = $page < 1 ? 1 : $page;
     $pageUrl = $iaCore->factory('page', iaCore::FRONT)->getUrlByName('blog_date');
     $pagination = array('start' => ($page - 1) * $iaCore->get('blog_number'), 'limit' => (int) $iaCore->get('blog_number'), 'template' => $pageUrl . '?page={page}');
     $stmt = "`status` = 'active' AND MONTH(b.`date_added`) = '" . $iaCore->requestPath[1] . "' AND YEAR(b.`date_added`) = '" . $iaCore->requestPath[0] . "' ";
     $order = 'date' == $iaCore->get('blog_order') ? 'ORDER BY b.`date_added` DESC' : 'ORDER BY b.`title` ASC';
예제 #2
0
 protected function _setBreadcrumb()
 {
     if (self::REQUEST_HTML != $this->getRequestType()) {
         return;
     }
     $this->iaCore->factory('breadcrumb');
     if (iaBreadcrumb::total() > 0 || $this->isHomepage() && empty($this->iaCore->requestPath)) {
         return;
     }
     iaCore::ACCESS_FRONT == $this->iaCore->getAccessType() ? iaBreadcrumb::root($this->iaCore->get('bc_home'), IA_URL) : iaBreadcrumb::root(iaLanguage::get('dashboard'), IA_ADMIN_URL);
     $pluginName = $this->get('extras');
     switch ($this->iaCore->getAccessType()) {
         case iaCore::ACCESS_FRONT:
             $parents = array();
             $iaPage = $this->iaCore->factory('page', iaCore::FRONT);
             $iaPage->getParents($this->get('parent'), $parents);
             if ($parents) {
                 iaBreadcrumb::addChain($parents);
             } elseif ($pluginName && 'package' == $this->get('type') && $pluginName . '_home' != $this->name()) {
                 if ($this->iaCore->get('default_package') != $pluginName) {
                     iaBreadcrumb::add(iaLanguage::get($pluginName), IA_PACKAGE_URL);
                 }
             }
             if ($url = $iaPage->getUrlByName($this->name())) {
                 iaBreadcrumb::toEnd(iaLanguage::get('page_title_' . $this->name(), $this->name()), $url);
             }
             break;
         case iaCore::ACCESS_ADMIN:
             $iaPage = $this->iaCore->factory('page', iaCore::ADMIN);
             if ($pluginName) {
                 if ('package' == $this->get('type')) {
                     $title = iaLanguage::get($pluginName . '_package');
                     $url = IA_ADMIN_URL . $pluginName . IA_URL_DELIMITER;
                     $pluginName . '_stats' != $this->name() ? iaBreadcrumb::add($title, $url) : iaBreadcrumb::replaceEnd($title, $url);
                 }
             }
             $url = $iaPage->getUrlByName($this->name());
             iaBreadcrumb::add($this->get('title', $this->name()), $url);
             if (in_array($this->get('action'), array(iaCore::ACTION_ADD, iaCore::ACTION_EDIT))) {
                 iaBreadcrumb::toEnd(iaLanguage::get($this->get('action')), IA_SELF);
             }
     }
 }
예제 #3
0
 protected function _assignValues(&$iaView, array &$entryData)
 {
     iaBreadcrumb::replaceEnd(iaLanguage::get('add_usergroup'), IA_SELF);
     $iaView->assign('groups', $this->_iaDb->keyvalue(array('id', 'name')));
 }
            			{
            				$iaLog = $iaCore->factory('log');
            				foreach ($_POST['id'] as $id)
            				{
            					$iaLog->write(iaLog::ACTION_DELETE, array('item' => 'guestbook', 'name' => '', 'id' => (int)$id));
            				}
            			}*/
    }
    $iaView->assign($output);
}
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    if (iaCore::ACTION_EDIT == $pageAction && isset($iaCore->requestPath[0])) {
        if (iaCore::ACTION_EDIT == $pageAction && !isset($iaCore->requestPath[0])) {
            return iaView::errorPage(iaView::ERROR_NOT_FOUND);
        }
        iaBreadcrumb::replaceEnd(iaLanguage::get('edit'));
        $guestbook = array('status' => iaCore::STATUS_ACTIVE);
        if (iaCore::ACTION_EDIT == $pageAction) {
            $id = (int) $iaCore->requestPath[0];
            $guestbook = $iaDb->row(iaDb::ALL_COLUMNS_SELECTION, iaDb::convertIds($id));
        }
        $guestbook = array('id' => isset($id) ? $id : 0, 'author_name' => iaUtil::checkPostParam('author_name', $guestbook), 'email' => iaUtil::checkPostParam('email', $guestbook), 'member_id' => iaUtil::checkPostParam('member_id', $guestbook), 'author_url' => iaUtil::checkPostParam('author_url', $guestbook), 'body' => iaUtil::checkPostParam('body', $guestbook), 'status' => iaUtil::checkPostParam('status', $guestbook), 'avatar' => iaUtil::checkPostParam('avatar', $guestbook), 'date' => iaUtil::checkPostParam('date', $guestbook));
        if (isset($_POST['save'])) {
            iaUtil::loadUTF8Functions('ascii', 'validation', 'bad');
            $error = false;
            $messages = array();
            $guestbook['avatar'] = iaSanitize::html($guestbook['avatar']);
            if (utf8_is_valid($guestbook['author_name'])) {
                $guestbook['author_name'] = utf8_bad_replace($guestbook['author_name']);
            }
            if (isset($_FILES['image']['tmp_name']) && $_FILES['image']['tmp_name']) {
예제 #5
0
     // increment views counter
     $iaGenre->incrementViewsCounter($genre['id']);
     // get artists by genre
     $iaArtist = $iaCore->factoryPackage('artist', IA_CURRENT_PACKAGE);
     $artists = $iaArtist->getArtistsByGenre($genre['id']);
     if ($artists) {
         // update favorites icon
         $artists = $iaItem->updateItemsFavorites($artists, $iaArtist->getItemName());
         // filter fields
         $fields = iaField::filterFields($artists, $iaArtist->getItemName());
         $iaView->assign('fields', $fields);
     }
     $iaView->assign('artists', $artists);
     // breadcrumb formation
     iaBreadcrumb::add(_t('genres'), $iaCore->packagesData['lyrics']['url'] . 'genres/');
     iaBreadcrumb::replaceEnd($genre['title'], '');
     // set meta keywords and description
     $iaView->set('description', $genre['meta_description']);
     $iaView->set('keywords', $genre['meta_keywords']);
     $iaView->title($genre['title']);
     $iaView->display('genreview');
     break;
 case 'genres':
     $per_page = $iaCore->get('lyrics_per_page', 10);
     $page = isset($_GET['page']) && 1 < $_GET['page'] ? (int) $_GET['page'] : 1;
     $start = ($page - 1) * $per_page;
     $where = false;
     // gets current page and defines start position
     $num_index = 20;
     $page = !empty($_GET['page']) ? (int) $_GET['page'] : 1;
     $start = (max($page, 1) - 1) * $num_index;
예제 #6
0
            $start = ($page - 1) * $per_page;
            $search_alphas = iaUtil::getLetters();
            $alpha = isset($iaCore->requestPath[0]) && in_array($iaCore->requestPath[0], $search_alphas) ? $iaCore->requestPath[0] : false;
            $cause = $alpha ? '0-9' == $alpha ? "(`title` REGEXP '^[0-9]') AND " : "(`title` LIKE '{$alpha}%') AND " : '';
            $iaView->assign('search_alphas', $search_alphas);
            $iaView->assign('alpha', $alpha);
            $iaArtist->where = $cause . "`status`='active' ORDER BY `title` ASC ";
            $artists = $iaArtist->getArtists(false, $start, $per_page);
            $total_artists = $iaArtist->count;
            if ($artists) {
                $iaItem = $iaCore->factory('item');
                $artists = $iaItem->updateItemsFavorites($artists, $iaArtist->getItemName());
                // filter fields
                $fields = iaField::filterFields($artists, 'artists');
                $iaView->assign('fields', $fields);
            }
            $iaView->assign('artists', $artists);
            $iaView->assign('aTotal', $total_artists);
            $iaView->assign('aItemsPerPage', $per_page);
            if ($alpha) {
                iaBreadcrumb::add(_t('artists'), IA_PACKAGE_URL . 'artists/');
                iaBreadcrumb::replaceEnd($alpha, '');
                $iaView->assign('aTemplate', IA_URL . 'artists/' . $alpha . '/?page={page}');
            } else {
                $iaView->assign('aTemplate', IA_URL . 'artists/?page={page}');
            }
            break;
        default:
            break;
    }
}