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

PHP cmsActions类代码示例

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

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



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

示例1: mod_actions

function mod_actions(array $mod, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    $inActions = cmsActions::getInstance();
    global $_LANG;
    if (!isset($cfg['show_target'])) {
        $cfg['show_target'] = 1;
    }
    if (!isset($cfg['limit'])) {
        $cfg['limit'] = 15;
    }
    if (!isset($cfg['show_link'])) {
        $cfg['show_link'] = 1;
    }
    if (!isset($cfg['action_types'])) {
        echo $_LANG['MODULE_NOT_CONFIGURED'];
        return true;
    }
    if (!$cfg['show_target']) {
        $inActions->showTargets(false);
    }
    $inActions->onlySelectedTypes($cfg['action_types']);
    $inDB->limitIs($cfg['limit']);
    $actions = $inActions->getActionsLog();
    if (!$actions) {
        return false;
    }
    cmsPage::initTemplate('modules', $cfg['tpl'])->assign('actions', $actions)->assign('cfg', $cfg)->assign('user_id', cmsUser::getInstance()->id)->display($cfg['tpl']);
    return true;
}
开发者ID:deltas1,项目名称:icms1,代码行数:30,代码来源:module.php


示例2: deleteQuest

 public function deleteQuest($id)
 {
     $inCore = cmsCore::getInstance();
     $this->inDB->query("DELETE FROM cms_armedlist_quests WHERE id={$id}");
     $inCore->deleteComments('armedlist', $id);
     cmsActions::removeObjectLog('add_quest', $id);
     return true;
 }
开发者ID:4uva4ek,项目名称:svato,代码行数:8,代码来源:model.php


示例3: deleteItem

 public function deleteItem($id)
 {
     $imageurl = $this->getItemImageUrl($id);
     @chmod(PATH . "/images/catalog/{$imageurl}", 0777);
     @chmod(PATH . "/images/catalog/small/{$imageurl}", 0777);
     @chmod(PATH . "/images/catalog/medium/{$imageurl}", 0777);
     @unlink(PATH . '/images/catalog/' . $imageurl);
     @unlink(PATH . '/images/catalog/small/' . $imageurl);
     @unlink(PATH . '/images/catalog/medium/' . $imageurl);
     $this->inDB->query("DELETE FROM cms_uc_items WHERE id= '{$id}'");
     $this->inDB->query("DELETE FROM cms_tags WHERE target='catalog' AND item_id = '{$id}'");
     $this->inDB->query("DELETE FROM cms_uc_ratings WHERE item_id = '{$id}'");
     cmsActions::removeObjectLog('add_catalog', $id);
     cmsCore::deleteComments('catalog', $id);
 }
开发者ID:deltas1,项目名称:icms1,代码行数:15,代码来源:model.php


示例4: install_component_calendar

function install_component_calendar()
{
    $inCore = cmsCore::getInstance();
    $inDB = cmsDatabase::getInstance();
    $inConf = cmsConfig::getInstance();
    include PATH . '/includes/dbimport.inc.php';
    dbRunSQL(PATH . '/components/calendar/install.sql', $inConf->db_prefix);
    if (!cmsActions::getAction('add_event')) {
        cmsActions::registerAction('calendar', array('name' => 'add_event', 'title' => 'Добавление события', 'message' => 'добавляет %s| %s'));
    }
    if (!cmsActions::getAction('add_signup')) {
        cmsActions::registerAction('calendar', array('name' => 'add_signup', 'title' => 'Присоединение к встрече', 'message' => 'будет учавствовать в %s|'));
    }
    if (!cmsActions::getAction('del_signup')) {
        cmsActions::registerAction('calendar', array('name' => 'del_signup', 'title' => 'Отказ от участия во встрече', 'message' => 'не будет учавствовать в %s|'));
    }
    return true;
}
开发者ID:ratmir-by,项目名称:icms-calendar,代码行数:18,代码来源:install.php


示例5: mod_actions_new

function mod_actions_new($module_id)
{
    $inCore = cmsCore::getInstance();
    $inUser = cmsUser::getInstance();
    $inDB = cmsDatabase::getInstance();
    global $_LANG;
    $cfg = $inCore->loadModuleConfig($module_id);
    if (!isset($cfg['show_target'])) {
        $cfg['show_target'] = 1;
    }
    if (!isset($cfg['limit'])) {
        $cfg['limit'] = 15;
    }
    if (!isset($cfg['show_link'])) {
        $cfg['show_link'] = 1;
    }
    if (!isset($cfg['action_types'])) {
        echo $_LANG['MODULE_NOT_CONFIGURED'];
        return true;
    }
    $inActions = cmsActions::getInstance();
    if (!$cfg['show_target']) {
        $inActions->showTargets(false);
    }
    $inActions->onlySelectedTypes($cfg['action_types']);
    $inActions->limitIs($cfg['limit']);
    $actions = $inActions->getActionsLog();
    $new_actions = array();
    foreach ($actions as $action) {
        $user = $inUser->getuserByLogin($action['user_login']);
        $user_id = $user['id'];
        $action['user_online'] = $inUser->isOnline($user['id']);
        $action['user_ava'] = $inDB->get_field('cms_user_profiles', "user_id={$user_id}", 'imageurl');
        $new_actions[] = $action;
    }
    $smarty = $inCore->initSmarty('modules', 'mod_actions_new.tpl');
    $smarty->assign('actions', $new_actions);
    $smarty->assign('cfg', $cfg);
    $smarty->display('mod_actions_new.tpl');
    return true;
}
开发者ID:4uva4ek,项目名称:svato,代码行数:41,代码来源:module.php


示例6: install_component_calendar

function install_component_calendar()
{
    $inCore = cmsCore::getInstance();
    $inDB = cmsDatabase::getInstance();
    $inConf = cmsConfig::getInstance();
    $inDB->query("CREATE TABLE `cms_events` (\n\t\t      `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t      `author_id` int(11) NOT NULL,\n\t\t      `type` varchar(128) NOT NULL,\n\t\t      `category_id` int(11) NOT NULL,\n\t\t      `start_time` int(11) NOT NULL,\n\t\t      `end_time` int(11) NOT NULL,\n\t\t      `title` varchar(128) NOT NULL,\n\t\t      `content` longtext NOT NULL,\n\t\t      `parent_id` int(11) NOT NULL,\n\t\t      `hide` int(1) NOT NULL,\n\t\t      PRIMARY KEY (`id`)\n\t\t      ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1");
    $inDB->query("CREATE TABLE `cms_events_category` (\n\t\t      `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t      `name` text NOT NULL,\n\t\t      `bg` text NOT NULL,\n\t\t      `tx` text NOT NULL,\n\t\t      PRIMARY KEY (`id`)\n\t\t      ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1");
    $inDB->query("CREATE TABLE `cms_events_signup` (\n\t\t      `event_id` int(11) NOT NULL,\n\t\t      `user_id` int(11) NOT NULL,\n\t\t      `time` int(11) NOT NULL\n\t\t      ) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=utf8");
    $inDB->query("CREATE TABLE IF NOT EXISTS `cms_fotolib` (\n\t\t      `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t      `user_id` int(11) NOT NULL,\n\t\t      `type` text NOT NULL,\n\t\t      `photo_id` int(11) NOT NULL,\n\t\t      `name` text NOT NULL,\n\t\t      `time` text NOT NULL,\n\t\t      PRIMARY KEY (`id`)\n\t\t      ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1");
    $inDB->query("INSERT INTO cms_comment_targets (target, component, title)\n\t\t      VALUES ('calendar', 'calendar', 'Календарь')");
    if (!cmsActions::getAction('add_event')) {
        cmsActions::registerAction('calendar', array('name' => 'add_event', 'title' => 'Добавление события', 'message' => 'добавляет %s| %s'));
    }
    if (!cmsActions::getAction('add_signup')) {
        cmsActions::registerAction('calendar', array('name' => 'add_signup', 'title' => 'Присоединение к встрече', 'message' => 'будет учавствовать в %s|'));
    }
    if (!cmsActions::getAction('del_signup')) {
        cmsActions::registerAction('calendar', array('name' => 'del_signup', 'title' => 'Отказ от участия во встрече', 'message' => 'не будет учавствовать в %s|'));
    }
    return true;
}
开发者ID:roman-burachenko,项目名称:icms-calendar,代码行数:21,代码来源:install.php


示例7: clubs


//.........这里部分代码省略.........
                display();

		cmsCore::jsonOutput(array('error' => false,
								  'can_create' => (bool)$can_create,
								  'html' => ob_get_clean()));
    }

    if (cmsCore::inRequest('create')){

        if (!$can_create){ return false; }

        $title    = $inCore->request('title', 'str');
        $clubtype = $inCore->request('clubtype', 'str');

        if (!$title || !in_array($clubtype, array('public','private'))){
			cmsCore::jsonOutput(array('error' => true, 'text' => $_LANG['CLUB_REQ_TITLE']));
		}

		if ($inDB->get_field('cms_clubs', "LOWER(title) = '".mb_strtolower($title)."'", 'id')){
			cmsCore::jsonOutput(array('error' => true, 'text' => $_LANG['CLUB_EXISTS']));
		}

		if(!cmsUser::checkCsrfToken()) { return false; }

		$club_id = $model->addClub(array('admin_id'=>$inUser->id,
										 'title'=>$title,
										 'clubtype'=>$clubtype,
										 'create_karma'=>$inUser->karma,
										 'enabled_blogs'=>$model->config['enabled_blogs'],
										 'enabled_photos'=>$model->config['enabled_photos']));

		if($club_id){
			//регистрируем событие
			cmsActions::log('add_club', array(
						'object' => $title,
						'object_url' => '/clubs/'.$club_id,
						'object_id' => $club_id,
						'target' => '',
						'target_url' => '',
						'target_id' => 0,
						'description' => ''
			));
		}

		cmsCore::addSessionMessage($_LANG['CLUB_IS_CREATED'], 'success');

		cmsCore::jsonOutput(array('error' => false,
								'club_id' => $club_id));

    }

}

///////////////////////// НАСТРОЙКИ КЛУБА //////////////////////////////////////
if ($do == 'config'){

    if (!$inUser->id){ return false; }

    $club = $model->getClub($id);
    if (!$club){ return false; }

    // Инициализируем участников клуба
    $model->initClubMembers($club['id']);
    // настраивать клуб могут только администраторы
    $is_admin = $inUser->is_admin || ($inUser->id == $club['admin_id']);
    if (!$is_admin){ return false; }
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:67,代码来源:frontend.php


示例8: applet_users

function applet_users() {
    $inCore = cmsCore::getInstance();
    cmsCore::loadClass('actions');
    cmsCore::loadModel('users');
    $model = new cms_model_users();

    // подключаем язык компонента регистрации
    cmsCore::loadLanguage('components/registration');

    global $_LANG;
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/users', $adminAccess)) { cpAccessDenied(); }

    cmsCore::c('page')->setTitle($_LANG['AD_USERS']);
    cpAddPathway($_LANG['AD_USERS'], 'index.php?view=users');

    $do = cmsCore::request('do', 'str', 'list');
    $id = cmsCore::request('id', 'int', 0);

    if ($do == 'list') {
        $toolmenu = array(
            array( 'icon' => 'useradd.gif', 'title' => $_LANG['AD_USER_ADD'], 'link' => '?view=users&do=add' ),
            array( 'icon' => 'useredit.gif', 'title' => $_LANG['AD_EDIT_SELECTED'], 'link' => "javascript:checkSel('?view=users&do=edit&multiple=1');" ),
            array( 'icon' => 'userdelete.gif', 'title' => $_LANG['AD_DELETE_SELECTED'], 'link' => "javascript:if(confirm('". $_LANG['AD_IF_USERS_SELECT_REMOVE'] ."')) { checkSel('?view=users&do=delete&multiple=1'); }" ),
            array( 'icon' => 'usergroup.gif', 'title' => $_LANG['AD_USERS_GROUP'], 'link' => '?view=usergroups' ),
            array( 'icon' => 'userbanlist.gif', 'title' => $_LANG['AD_BANLIST'], 'link' => '?view=userbanlist' ),
            array( 'icon' => 'user_go.png', 'title' => $_LANG['AD_USERS_SELECT_ACTIVATE'], 'link' => "javascript:if(confirm('". $_LANG['AD_IF_USERS_SELECT_ACTIVATE'] ."')) { checkSel('?view=users&do=activate&multiple=1'); }" ),
            array( 'icon' => 'help.gif', 'title' => $_LANG['AD_HELP'], 'link' => '?view=help&topic=users' )
        );
        
        cpToolMenu($toolmenu);
        
        $fields = array(
            array( 'title' => 'id', 'field' => 'id', 'width' => '40'  ),
            array( 'title' => $_LANG['LOGIN'], 'field' => 'login', 'width' => '100', 'link' => '?view=users&do=edit&id=%id%', 'filter' => 12 ),
            array( 'title' => $_LANG['NICKNAME'], 'field' => 'nickname', 'width' => '', 'link' => '?view=users&do=edit&id=%id%', 'filter' => 12 ),
            array( 'title' => $_LANG['AD_RATING'], 'field' => array( 'rating', 'id' ), 'width' => '70', 'prc' => 'setRating' ),
            array( 'title' => $_LANG['AD_GROUP'], 'field' => 'group_id', 'width' => '110', 'prc' => 'cpGroupById', 'filter' => 1, 'filterlist' => cpGetList('cms_user_groups') ),
            array( 'title' => $_LANG['EMAIL'], 'field' => 'email', 'width' => '120' ),
            array( 'title' => $_LANG['AD_REGISTRATION_DATE'], 'field' => 'regdate', 'width' => '100' ),
            array( 'title' => $_LANG['AD_LAST_LOGIN'], 'field' => 'logdate', 'width' => '100' ),
            array( 'title' => $_LANG['AD_LAST_IP'], 'field' => 'last_ip', 'width' => '90', 'prc' => 'getIpLink' ),
            array( 'title' => $_LANG['AD_IS_LOCKED'], 'field' => 'is_locked', 'width' => '110', 'prc' => 'viewAct' ),
            array( 'title' => $_LANG['AD_IS_DELETED'], 'field' => 'is_deleted', 'width' => '80', 'prc' => 'viewDel' )
        );
        
        $actions = array(
            array( 'title' => $_LANG['AD_PROFILE'], 'icon' => 'profile.gif', 'link' => '/users/%login%' ),
            array( 'title' => $_LANG['AD_BANNED'], 'icon' => 'ban.gif', 'link' => '?view=userbanlist&do=add&to=%id%' ),
            array( 'title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_IS_USER_DELETE'], 'link' => '?view=users&do=delete&id=%id%' ),
            array( 'title' => $_LANG['AD_FOREVER_USER_DELETE'], 'icon' => 'off.gif', 'confirm' => $_LANG['AD_IF_FOREVER_USER_DELETE'], 'link' => '?view=users&do=delete_full&id=%id%' )
        );
        
        cpListTable('cms_users', $fields, $actions, '1=1', 'regdate DESC');
    }
    
    if ($do == 'rerating') {
        $user_id = cmsCore::request('user_id', 'int');
        if (!$user_id) { cmsCore::redirectBack(); }
        
        $rating = cmsUser::getRating($user_id);

        $user_sql = "UPDATE cms_users
                     SET rating = ". $rating ."
                     WHERE id = '". $user_id ."'";

        cmsCore::c('db')->query($user_sql);
        
        cmsCore::redirectBack();
    }
    
    if ($do == 'activate') {
        $user_ids = cmsCore::request('item', 'array_int');
        if (!$user_ids) { cmsCore::redirectBack(); }

        foreach ($user_ids as $user_id) {
            $code = cmsCore::c('db')->get_field('cms_users_activate', "user_id = '". $user_id ."'", 'code');

            $sql = "UPDATE cms_users SET is_locked = 0 WHERE id = '". $user_id ."'";
            cmsCore::c('db')->query($sql);

            $sql = "DELETE FROM cms_users_activate WHERE code = '". $code ."'";
            cmsCore::c('db')->query($sql);

            cmsCore::callEvent('USER_ACTIVATED', $user_id);

            // Регистрируем событие
            cmsActions::log(
                'add_user',
                array(
                    'object' => '',
                    'user_id' => $user_id,
                    'object_url' => '',
                    'object_id' => $user_id,
                    'target' => '',
                    'target_url' => '',
                    'target_id' => 0,
                    'description' => ''
                )
            );
//.........这里部分代码省略.........
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:101,代码来源:users.php


示例9: unset

    $album_id = cmsCore::request('album_id', 'int', '');
    $album = $model->getPhotoAlbum('private', $album_id);
    if (!$album) {
        cmsCore::error404();
    }
    if ($album['user_id'] != $inUser->id && !$inUser->is_admin) {
        cmsCore::error404();
    }
    unset($album);
    $album['title'] = cmsCore::request('album_title', 'str', $_LANG['PHOTOALBUM'] . ' ' . date('d.m.Y'));
    $album['allow_who'] = cmsCore::request('album_allow_who', 'str', 'all');
    $album['description'] = cmsCore::request('description', 'str', '');
    $album['id'] = $album_id;
    $model->updatePhotoAlbum($album);
    cmsActions::updateLog('add_user_photo', array('target' => $album['title']), 0, $album_id);
    cmsActions::updateLog('add_user_photo_multi', array('target' => $album['title']), 0, $album_id);
    cmsCore::redirect('/users/' . $usr['login'] . '/photos/private' . $album_id . '.html');
}
/////////////////////////////// PHOTO EDIT /////////////////////////////////////////////////////////////////////////////////////////
if ($pdo == 'editphoto') {
    $usr = cmsUser::getShortUserData($id);
    if (!$usr) {
        cmsCore::error404();
    }
    $photo = $model->getPhoto(cmsCore::request('photoid', 'int', ''));
    if (!$photo) {
        cmsCore::error404();
    }
    if ($photo['user_id'] != $inUser->id && !$inUser->is_admin) {
        cmsCore::error404();
    }
开发者ID:vicktorwork,项目名称:cms1,代码行数:31,代码来源:photos.php


示例10: deletePost

 /**
  * Удаляет пост в блоге
  * @param int $post_id
  * @return bool
  */
 public function deletePost($post_id)
 {
     cmsCore::callEvent('DELETE_POST', $post_id);
     $post = $this->getPost($post_id);
     if (!$post) {
         return false;
     }
     // пересчитываем рейтинг блога
     $this->inDB->query("UPDATE cms_blogs SET rating = rating - ({$post['rating']}) WHERE id = '{$post['blog_id']}'");
     $this->inDB->delete('cms_blog_posts', "id = '{$post_id}'", 1);
     cmsCore::deleteRatings($this->getTarget('rating'), $post_id);
     cmsCore::deleteComments($this->getTarget('comments'), $post_id);
     cmsClearTags($this->getTarget('tags'), $post_id);
     cmsCore::deleteUploadImages($post_id, 'blog_post');
     cmsActions::removeObjectLog($this->getTarget('actions_post'), $post_id);
     return true;
 }
开发者ID:deltas1,项目名称:icms1,代码行数:22,代码来源:blog.class.php


示例11: calendar

function calendar()
{
    $inCore = cmsCore::getInstance();
    $inPage = cmsPage::getInstance();
    $inUser = cmsUser::getInstance();
    $inCore->loadModel('calendar');
    $model = new cms_model_calendar();
    $do = $inCore->request('do', 'str', 'view');
    $cfg = $inCore->loadComponentConfig('calendar');
    if ($do == 'view') {
        $inPage->setTitle("Календарь событий");
        $smarty = $inCore->initSmarty('components', 'com_calendar_view.tpl');
        $guest = TRUE;
        if ($inUser->id == 0 and $cfg['calendar_access'] == "all") {
            $guest = FALSE;
        }
        if ($inUser->id != 0 and $cfg['calendar_access'] == "users") {
            $guest = FALSE;
        }
        if ($inUser->is_admin) {
            $guest = FALSE;
        }
        $catigories = $model->getAllCategories();
        $smarty->assign('guest', $guest);
        $smarty->assign('cfg', $cfg);
        $smarty->assign('catigories', $catigories);
        $smarty->assign('category', "all");
        $smarty->display('com_calendar_view.tpl');
        return;
    }
    if ($do == "category_view") {
        $category_id = $inCore->request('category_id', 'int', 0);
        $smarty = $inCore->initSmarty('components', 'com_calendar_view.tpl');
        $guest = TRUE;
        if ($inUser->id == 0 and $cfg['calendar_access'] == "all") {
            $guest = FALSE;
        }
        if ($inUser->id != 0 and $cfg['calendar_access'] == "users") {
            $guest = FALSE;
        }
        if ($inUser->is_admin) {
            $guest = FALSE;
        }
        $category = $model->getCategory($category_id);
        $catigories = $model->getAllCategories();
        if (!$category) {
            //$inCore->redirect("/calendar");
            print mysql_error();
        }
        $inPage->setTitle("Календарь событий:" . $category['title']);
        $smarty->assign('guest', $guest);
        $smarty->assign('cfg', $cfg);
        $smarty->assign('catigories', $catigories);
        $smarty->assign('category', $category_id);
        $smarty->display('com_calendar_view.tpl');
        return;
    }
    if ($do == 'add') {
        $guest = TRUE;
        if ($inUser->id == 0 and $cfg['calendar_access'] == "all") {
            $guest = FALSE;
        }
        if ($inUser->id != 0 and $cfg['calendar_access'] == "users") {
            $guest = FALSE;
        }
        if ($inUser->is_admin) {
            $guest = FALSE;
        }
        if ($guest) {
            $inCore->redirect('/');
            exit;
        }
        $is_send = $inCore->inRequest('title');
        if ($is_send) {
            $title = $inCore->request('title', 'str');
            $type_raw = $inCore->request('type', 'str');
            $date_start = $inCore->request('date_start', 'str');
            $date_end = $inCore->request('date_end', 'str');
            $hour_start = $inCore->request('hour_start', 'str');
            $hour_end = $inCore->request('hour_end', 'str');
            $min_start = $inCore->request('min_start', 'str');
            $min_end = $inCore->request('min_end', 'str');
            $content = $inCore->request('content', 'str');
            if (!$title || !$type_raw || !$date_start || !$hour_start || !$hour_end || !$min_start || !$min_end) {
                cmsCore::addSessionMessage('Ой, что то не было заполнено...', 'error');
                $inCore->redirectBack();
                exit;
            } else {
                $start_time = strtotime($date_start . ' ' . $hour_start . ':' . $min_start);
                $end_time = strtotime($date_end . ' ' . $hour_end . ':' . $min_end);
                if ($data_end == "" or $date_end < $date_start) {
                    $data_end = $data_start;
                }
                $type_data = explode("_", $type_raw);
                $type = $type_data[0];
                $apx = $type_data[1];
                $event_id = $model->addEvent($inUser->id, $type, $apx, $start_time, $end_time, $title, $content);
                if ($event_id) {
                    if ($type != "private") {
                        cmsActions::log('add_event', array('object' => 'событие', 'object_url' => '/calendar/event' . $event_id . '.html', 'object_id' => $event_id, 'target' => $title, 'target_url' => '/calendar/event' . $event_id . '.html', 'target_id' => '0', 'description' => $title));
//.........这里部分代码省略.........
开发者ID:ratmir-by,项目名称:icms-calendar,代码行数:101,代码来源:frontend.php


示例12: deleteAlbum

    /**
     * Удаляет альбом
     * @param int $album_id
     * @param str $differ
     * @param obj $inUploadPhoto
     * @return bool
     */
    public function deleteAlbum($album_id, $differ = '', $inUploadPhoto) {
        $album = cmsCore::c('db')->getNsCategory('cms_photo_albums', $album_id, $differ);
        if(!$album) { return false; }

        cmsCore::callEvent('DELETE_ALBUM', $album_id);

        //устанавливаем нужный альбом и все вложенные
        $this->whereThisAndNestedCats($album['NSLeft'], $album['NSRight']);

        cmsCore::c('db')->addJoin("INNER JOIN cms_photo_albums a ON a.id = f.album_id AND a.NSDiffer = '{$differ}'");

        $photos = $this->getPhotos(true);

        if ($photos){
            foreach($photos as $photo){
                $this->deletePhoto($photo, $inUploadPhoto);
            }
        }

        cmsCore::deleteComments($this->getTarget('comments_album'), $album_id);

        cmsActions::removeTargetLog($this->getTarget('actions_photo'), $album_id);

        return cmsCore::c('db')->deleteNS('cms_photo_albums', $album_id, $differ);
    }
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:32,代码来源:photo.class.php


示例13: users


//.........这里部分代码省略.........
        cmsCore::addSessionMessage($_LANG['MESS_ALL_DEL_OK'], 'info');
        cmsCore::redirectBack();
    }
    //============================================================================//
    //============================= Загрузка аватара  ============================//
    //============================================================================//
    if ($do == 'avatar') {
        if (!$inUser->id || $inUser->id && $inUser->id != $id) {
            cmsCore::error404();
        }
        $inPage->setTitle($_LANG['LOAD_AVATAR']);
        $inPage->addPathway($inUser->nickname, cmsUser::getProfileURL($inUser->login));
        $inPage->addPathway($_LANG['LOAD_AVATAR']);
        if (cmsCore::inRequest('upload')) {
            cmsCore::loadClass('upload_photo');
            $inUploadPhoto = cmsUploadPhoto::getInstance();
            // Выставляем конфигурационные параметры
            $inUploadPhoto->upload_dir = PATH . '/images/';
            $inUploadPhoto->dir_medium = 'users/avatars/';
            $inUploadPhoto->dir_small = 'users/avatars/small/';
            $inUploadPhoto->small_size_w = $model->config['smallw'];
            $inUploadPhoto->medium_size_w = $model->config['medw'];
            $inUploadPhoto->medium_size_h = $model->config['medh'];
            $inUploadPhoto->is_watermark = false;
            $inUploadPhoto->input_name = 'picture';
            $file = $inUploadPhoto->uploadPhoto($inUser->orig_imageurl);
            if (!$file) {
                cmsCore::addSessionMessage('<strong>' . $_LANG['ERROR'] . ':</strong> ' . cmsCore::uploadError() . '!', 'error');
                cmsCore::redirect('/users/' . $id . '/avatar.html');
            }
            $sql = "UPDATE cms_user_profiles SET imageurl = '{$file['filename']}' WHERE user_id = '{$id}' LIMIT 1";
            $inDB->query($sql);
            // очищаем предыдущую запись о смене аватара
            cmsActions::removeObjectLog('add_avatar', $id);
            // выводим сообщение в ленту
            cmsActions::log('add_avatar', array('object' => '', 'object_url' => '', 'object_id' => $id, 'target' => '', 'target_url' => '', 'description' => '<a href="' . cmsUser::getProfileURL($inUser->login) . '" class="act_usr_ava">
								   <img border="0" src="/images/users/avatars/small/' . $file['filename'] . '">
								</a>'));
            cmsCore::redirect(cmsUser::getProfileURL($inUser->login));
        } else {
            cmsPage::initTemplate('components', 'com_users_avatar_upload')->assign('id', $id)->display('com_users_avatar_upload.tpl');
        }
    }
    //============================================================================//
    //============================= Библиотека аватаров  =========================//
    //============================================================================//
    if ($do == 'select_avatar') {
        if (!$inUser->id || $inUser->id && $inUser->id != $id) {
            cmsCore::error404();
        }
        $avatars_dir = PATH . "/images/users/avatars/library";
        $avatars_dir_rel = "/images/users/avatars/library";
        $avatars_dir_handle = opendir($avatars_dir);
        $avatars = array();
        while ($nextfile = readdir($avatars_dir_handle)) {
            if ($nextfile != '.' && $nextfile != '..' && (mb_strstr($nextfile, '.gif') || mb_strstr($nextfile, '.jpg') || mb_strstr($nextfile, '.jpeg') || mb_strstr($nextfile, '.png'))) {
                $avatars[] = $nextfile;
            }
        }
        closedir($avatars_dir_handle);
        if (!cmsCore::inRequest('set_avatar')) {
            $inPage->setTitle($_LANG['SELECT_AVATAR']);
            $inPage->addPathway($inUser->nickname, cmsUser::getProfileURL($inUser->login));
            $inPage->addPathway($_LANG['SELECT_AVATAR']);
            $perpage = 20;
            $total = sizeof($avatars);
开发者ID:deltas1,项目名称:icms1,代码行数:67,代码来源:frontend.php


示例14: applet_main


//.........这里部分代码省略.........
              <td><img src="images/icons/hmenu/users.png" width="16" height="16" /></td>
              <td><?php 
    echo $_LANG['AD_NEW_USERS_THEES_MONTH'];
    ?>
 &mdash; <?php 
    echo (int) $inDB->get_field('cms_users', "regdate >= DATE_SUB(NOW(), INTERVAL 1 MONTH)", 'COUNT(id)');
    ?>
</td>
            </tr>
          </table>
		</div>
	</div>
	<div class="small_box">
		<div class="small_title"><strong><?php 
    echo $_LANG['AD_USERS_ONLINE'];
    ?>
</strong></div>
		<div style="font-size:10px;margin:8px;">
		  <?php 
    echo cpWhoOnline();
    ?>
		</div>
	</div>
	</td>
    <td width="" valign="top" style="">
	<div class="small_box">
		<div class="small_title"><strong><?php 
    echo $_LANG['AD_LATEST_EVENTS'];
    ?>
</strong></div>
	    <div id="actions_box">
            <div id="actions">
                <?php 
    $inActions = cmsActions::getInstance();
    $inActions->showTargets(true);
    $inDB->limitPage(1, 30);
    $actions = $inActions->getActionsLog();
    $tpl_file = 'admin/actions.php';
    $tpl_dir = file_exists(TEMPLATE_DIR . $tpl_file) ? TEMPLATE_DIR : DEFAULT_TEMPLATE_DIR;
    include $tpl_dir . $tpl_file;
    ?>
            </div>
		</div>
	</div>

    </td>
    <td width="325" valign="top" style=""><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="100" valign="top">
        <?php 
    $new_quests = $inDB->rows_count('cms_faq_quests', 'published=0');
    $new_content = $inDB->rows_count('cms_content', 'published=0 AND is_arhive = 0');
    $new_catalog = $inDB->rows_count('cms_uc_items', 'on_moderate=1');
    ?>
        <?php 
    if ($new_quests || $new_content || $new_catalog) {
        ?>
            <div class="small_box">
                <div class="small_title">
                    <span class="attention">
                        <strong><?php 
        echo $_LANG['AD_FROM_MODERATION'];
        ?>
</strong>
                    </span>
                </div>
开发者ID:vicktorwork,项目名称:cms1,代码行数:67,代码来源:main.php


示例15: giveAward

 /**
  * Выдает награду
  * @param array $award
  * @param int $user_id
  * @return int $award_id
  */
 public static function giveAward($award, $user_id)
 {
     if (!$award || !$user_id) {
         return false;
     }
     global $_LANG;
     $inDB = cmsDatabase::getInstance();
     $user = self::getShortUserData($user_id);
     if (!$user) {
         return false;
     }
     if (!file_exists(PATH . '/images/users/awards/' . $award['imageurl'])) {
         return false;
     }
     $award = $inDB->escape_string($award);
     $sql = "INSERT INTO cms_user_awards (user_id, pubdate, title, description, imageurl, from_id, award_id)\n\t\t\t\tVALUES ('{$user_id}', NOW(), '{$award['title']}', '{$award['description']}', '{$award['imageurl']}', '{$award['from_id']}', '{$award['id']}')";
     $inDB->query($sql);
     $award_id = $inDB->get_last_id('cms_user_awards');
     if (!$award_id) {
         return false;
     }
     cmsActions::log('add_award', array('object' => '"' . $award['title'] . '"', 'user_id' => $user_id, 'object_url' => '', 'object_id' => $award['id'], 'target' => '', 'target_url' => '', 'target_id' => 0, 'description' => '<img src="/images/users/awards/' . $award['imageurl'] . '" border="0" alt="' . htmlspecialchars($award['description']) . '">'));
     self::sendMessage(USER_UPDATER, $user_id, '<b>' . $_LANG['RECEIVED_AWARD'] . ':</b> <a href="' . cmsUser::getProfileURL($user['login']) . '#upr_awards">' . $award['title'] . '</a>');
     return cmsCore::callEvent('GIVE_AWARD', $award_id);
 }
开发者ID:vicktorwork,项目名称:cms1,代码行数:31,代码来源:user.class.php


示例16: faq


//.........这里部分代码省略.........
    $published      = ($inUser->is_admin || $cfg['publish']) ? 1 : 0;
    $is_submit      = $inCore->inRequest('message');

    if ($is_submit && !$inUser->id && !cmsCore::checkCaptchaCode()) { $error = $_LANG['ERR_CAPTCHA']; }

	if (!$is_submit || $error){

        if (IS_BILLING && $inUser->id){ cmsBilling::checkBalance('faq', 'add_quest'); }

		cmsPage::initTemplate('components', 'com_faq_add')->
                assign('catslist', $inCore->getListItems('cms_faq_cats', $category_id))->
                assign('user_id', $inUser->id)->
                assign('message', htmlspecialchars($inCore->request('message', 'html', '')))->
                assign('error', $error)->
                display();

	} else {

        //SAVE QUESTION
		$sql = "INSERT INTO cms_faq_quests (category_id, pubdate, published, quest, answer, user_id, answeruser_id, answerdate, hits)
				VALUES ('$category_id', NOW(), '$published', '$message', '', '{$inUser->id}', 0, NOW(), 0)";
		$inDB->query($sql);

		$quest_id = $inDB->get_last_id('cms_faq_quests');

        if (IS_BILLING && $inUser->id){ cmsBilling::process('faq', 'add_quest'); }

		$inPage->setTitle($_LANG['QUESTION_SEND']);
		$inPage->addPathway($_LANG['QUESTION_SEND']);

        if (!$published){
			echo '<div class="con_heading">'.$_LANG['QUESTION_SEND'].'</div>';
            echo '<div style="margin-top:10px">'.$_LANG['QUESTION_PREMODER'].'</div>';
			echo '<div style="margin-top:10px"><a href="/faq">'.$_LANG['CONTINUE'].'</a></div>';
        } elseif ($published) {
			$category = $inDB->get_field('cms_faq_cats', "id={$category_id}", 'title');
            //регистрируем событие
            cmsActions::log('add_quest', array(
                'object' => $_LANG['QUESTION'],
                'object_url' => '/faq/quest'.$quest_id.'.html',
                'object_id' => $quest_id,
                'target' => $category,
                'target_url' => '/faq/'.$category_id,
                'target_id' => $category_id,
                'description' => strip_tags( mb_strlen(strip_tags($message))>100 ? mb_substr($message, 0, 100) : $message )
            ));
            $inCore->redirect('/faq/quest'.$quest_id.'.html');
		} else { $inCore->redirect('/faq/quest'.$quest_id.'.html'); }

	}
}

///////////////////////////////////// DELETE QUEST ////////////////////////////////////////////////////////////////////////////////

if ($do=='delquest'){

    $quest_id 	= $inCore->request('quest_id', 'int', 0);
    $user_id    = $inUser->id;

	$sql    = "SELECT con.id, con.quest, con.category_id
				FROM cms_faq_quests con
				WHERE con.id = '$quest_id' LIMIT 1";

	$result = $inDB->query($sql);
	$quest  = $inDB->fetch_assoc($result);

    if (!$user_id || !$quest_id || !$quest) { $inCore->redirectBack(); }

    if ( !$inCore->inRequest('confirm') ) {

        if (cmsUser::userIsAdmin($user_id)){
			$inPage->setTitle($_LANG['DEL_QUES']);
			$inPage->addPathway($_LANG['DEL_QUES']);
            $confirm['title'] = $_LANG['DELETE_QUES'];
            $confirm['text']  = $_LANG['YOU_REALY_DELETE_QUES'].':<br> "<a href="/faq/quest'.$quest['id'].'.html">'.$quest['quest'].'</a>"<br><br>';
			$confirm['action']                  = $_SERVER['REQUEST_URI'];
			$confirm['yes_button']              = array();
			$confirm['yes_button']['type']      = 'submit';
			$confirm['yes_button']['name']  	= 'confirm';
            cmsPage::initTemplate('components', 'action_confirm')->
                    assign('confirm', $confirm)->
                    display();
        } else {
            $inCore->redirectBack();
        }
	}

    if ( $inCore->inRequest('confirm') ){

        if (cmsUser::userIsAdmin($user_id)){

            $model->deleteQuest($quest_id);

        }
        $inCore->redirect('/faq/'.$quest['category_id']);
    }

}

} //function
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:101,代码来源:frontend.php


示例17: deleteComments

 /**
  * Удаляет все комментарии для указанной цели
  * @param string $target
  * @param int $target_id
  * @return boolean
  */
 public static function deleteComments($target, $target_id)
 {
     $inDB = cmsDatabase::getInstance();
     $comments = $inDB->get_table('cms_comments', "target='{$target}' AND target_id='{$target_id}'", 'id');
     if (!$comments) {
         return false;
     }
     self::loadClass('actions');
     foreach ($comments as $comment) {
         cmsActions::removeObjectLog('add_comment', $comment['id']);
         self::deleteUploadImages($comment['id'], 'comment');
         self::deleteRatings('comment', $comment['id']);
     }
     $inDB->delete('cms_comments', "target='{$target}' AND target_id='{$target_id}'");
     return true;
 }
开发者ID:vityapro,项目名称:cms,代码行数:22,代码来源:cms.php


示例18: cms_model_actions

//                   written by InstantCMS Team, 2007-2011                    //
//                produced by InstantSoft, (www.instantsoft.ru)               //
//                                                                            //
//                        LICENSED BY GNU/GPL v2                              //
//                                                                            //
/******************************************************************************/
$inDB = cmsDatabase::getInstance();
$inUser = cmsUser::getInstance();
$inCore = cmsCore::getInstance();
$inCore->loadModel('actions');
$model = new cms_model_actions();
$inCore->loadClass('actions');
$inActions = cmsActions::getInstance();
$opt = $inCore->request('opt', 'str', 'list');
$id = $inCore->request('id', 'int', 0);
$act_components = cmsActions::getActionsComponents();
$act_component = $inCore->request('act_component', 'str', '');
cpAddPathway('Лента активности', '?view=components&do=config&id=' . $id);
$messages = cmsCore::getSessionMessages();
if ($messages) {
    ?>
	<div class="sess_messages">
		<?php 
    foreach ($messages as $message) {
        echo $message;
    }
    ?>
	</div>
	<?php 
}
//=================================================================================================//
开发者ID:ratmir-by,项目名称:icms-calendar,代码行数:31,代码来源:backend.php


示例19: usermaps

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP cmsConfig类代码示例发布时间:2022-05-23
下一篇:
PHP cmb_Meta_Box类代码示例发布时间: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