Пример #1
0
 function onInstall()
 {
     $this->_addContentEventProfile();
     $this->_addContentMemberHome();
     $this->_addContentMemberProfile();
     parent::onInstall();
 }
Пример #2
0
 function onInstall()
 {
     // member homepage
     $db = $this->getDb();
     $select = new Zend_Db_Select($db);
     $select->from('engine4_core_pages')->where('name = ?', 'user_index_home')->limit(1);
     $page_id = $select->query()->fetchObject()->page_id;
     // Check if it's already been placed
     $select = new Zend_Db_Select($db);
     $select->from('engine4_core_content')->where('page_id = ?', $page_id)->where('type = ?', 'widget')->where('name = ?', 'social-connect.call-popup-invite');
     $info = $select->query()->fetch();
     if (empty($info)) {
         // container_id (will always be there)
         $select = new Zend_Db_Select($db);
         $select->from('engine4_core_content')->where('page_id = ?', $page_id)->where('type = ?', 'container')->limit(1);
         $container_id = $select->query()->fetchObject()->content_id;
         // middle_id (will always be there)
         $select = new Zend_Db_Select($db);
         $select->from('engine4_core_content')->where('parent_content_id = ?', $container_id)->where('type = ?', 'container')->where('name = ?', 'middle')->limit(1);
         $middle_id = $select->query()->fetchObject()->content_id;
         // tab on profile
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'social-connect.call-popup-invite', 'parent_content_id' => $middle_id, 'params' => '', 'order' => 999));
     }
     parent::onInstall();
 }
Пример #3
0
 public function onInstall()
 {
     //$this->_addComposePage();
     $this->_addInboxPage();
     $this->_addOutboxPage();
     parent::onInstall();
 }
Пример #4
0
 public function onInstall()
 {
     $this->_addBrowsePage();
     $this->_addCreatePage();
     $this->_addEditPage();
     $this->_addDetailPage();
     parent::onInstall();
 }
 public function onInstall()
 {
     $this->_addUserProfileContent();
     $this->_addForumIndexPage();
     $this->_addForumViewPage();
     $this->_addGenericPage('forum_forum_topic-create', 'Post Topic', 'Forum Topic Create Page', 'This is the forum topic create page.');
     parent::onInstall();
 }
 public function onInstall()
 {
     $this->_addUserProfileContent();
     $this->_addPollBrowsePage();
     $this->_addPollViewPage();
     $this->_addPollCreatePage();
     $this->_addPollManagePage();
     parent::onInstall();
 }
Пример #7
0
 public function onInstall()
 {
     $this->_addComposePage();
     $this->_addInboxPage();
     $this->_addOutboxPage();
     $this->_addSearchPage();
     $this->_addViewPage();
     parent::onInstall();
 }
 public function onInstall()
 {
     $this->_addUserProfileContent();
     $this->_addMusicBrowsePage();
     $this->_addMusicViewPage();
     $this->_addMusicCreatePage();
     $this->_addMusicManagePage();
     parent::onInstall();
 }
Пример #9
0
 public function onInstall()
 {
     if (method_exists($this, '_addGenericPage')) {
         $this->_addGenericPage('invite_index_index', 'Invite', 'Invite Page', '');
     } else {
         $this->_error('Missing _addGenericPage method');
     }
     parent::onInstall();
 }
 public function onInstall()
 {
     $this->_checkFfmpegPath();
     $this->_addUserProfileContent();
     $this->_addVideoViewPage();
     $this->_addVideoBrowsePage();
     $this->_addVideoCreatePage();
     $this->_addVideoManagePage();
     parent::onInstall();
 }
 public function onInstall()
 {
     $this->_addUserProfileContent();
     $this->_addBlogListPage();
     $this->_addBlogViewPage();
     $this->_addBlogBrowsePage();
     $this->_addBlogCreatePage();
     $this->_addBlogManagePage();
     parent::onInstall();
 }
 public function onInstall()
 {
     $this->_addUserProfileContent();
     $this->_addGroupProfilePage();
     $this->_addMobileGroupProfilePage();
     $this->_addGroupBrowsePage();
     $this->_addGroupCreatePage();
     $this->_addGroupManagePage();
     parent::onInstall();
 }
 public function onInstall()
 {
     $this->_albumPhotoViewPage();
     $this->_albumViewPage();
     $this->_albumBrowsePage();
     $this->_userProfileAlbums();
     $this->_albumCreatePage();
     $this->_albumManagePage();
     parent::onInstall();
 }
Пример #14
0
 function onInstall()
 {
     $db = $this->getDb();
     $tableObj = $db->query("SHOW TABLES LIKE 'engine4_core_comments'")->fetch();
     if (!empty($tableObj)) {
         $parent_comment_id = $db->query("SHOW COLUMNS FROM engine4_core_comments LIKE 'parent_comment_id' ")->fetch();
         if (empty($parent_comment_id)) {
             $db->query("ALTER TABLE  `engine4_core_comments` ADD  `parent_comment_id` int( 11 ) NOT NULL DEFAULT  '0';");
         }
         $params = $db->query("SHOW COLUMNS FROM engine4_core_comments LIKE 'params' ")->fetch();
         if (empty($params)) {
             $db->query("ALTER TABLE  `engine4_core_comments` ADD  `params` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL;");
         }
         $attachment_type = $db->query("SHOW COLUMNS FROM engine4_core_comments LIKE 'attachment_type' ")->fetch();
         if (empty($attachment_type)) {
             $db->query("ALTER TABLE  `engine4_core_comments` ADD  `attachment_type` VARCHAR( 64 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL;");
         }
         $attachment_id = $db->query("SHOW COLUMNS FROM engine4_core_comments LIKE 'attachment_id' ")->fetch();
         if (empty($attachment_id)) {
             $db->query("ALTER TABLE  `engine4_core_comments` ADD  `attachment_id` INT( 11 ) NULL DEFAULT  '0';");
         }
     }
     $tableObj = $db->query("SHOW TABLES LIKE 'engine4_activity_comments'")->fetch();
     if (!empty($tableObj)) {
         $parent_comment_id = $db->query("SHOW COLUMNS FROM engine4_activity_comments LIKE 'parent_comment_id' ")->fetch();
         if (empty($parent_comment_id)) {
             $db->query("ALTER TABLE  `engine4_activity_comments` ADD  `parent_comment_id` int( 11 ) NOT NULL DEFAULT  '0';");
         }
         $attachment_type = $db->query("SHOW COLUMNS FROM engine4_activity_comments LIKE 'attachment_type' ")->fetch();
         if (empty($attachment_type)) {
             $db->query("ALTER TABLE  `engine4_activity_comments` ADD  `attachment_type` VARCHAR( 64 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL;");
         }
         $attachment_id = $db->query("SHOW COLUMNS FROM engine4_activity_comments LIKE 'attachment_id' ")->fetch();
         if (empty($attachment_id)) {
             $db->query("ALTER TABLE  `engine4_activity_comments` ADD  `attachment_id` INT( 11 ) NULL DEFAULT  '0';");
         }
         $params = $db->query("SHOW COLUMNS FROM engine4_activity_comments LIKE 'params' ")->fetch();
         if (empty($params)) {
             $db->query("ALTER TABLE  `engine4_activity_comments` ADD  `params` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL;");
         }
     }
     $table_engine4_album_albums_exist = $db->query("SHOW TABLES LIKE 'engine4_album_albums'")->fetch();
     if ($table_engine4_album_albums_exist) {
         $column = $db->query("SHOW COLUMNS FROM `engine4_album_albums` LIKE 'type'")->fetch();
         if (!empty($column)) {
             $type = $column['Type'];
             if (!strpos($type, "'profile','message','comment',")) {
                 $type = str_replace("'profile','message',", "'profile','message','comment', ", $type);
                 $db->query("ALTER TABLE `engine4_album_albums` CHANGE `type` `type` {$type} CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL");
             }
         }
     }
     $this->setActivityFeeds();
     parent::onInstall();
 }
 public function onInstall()
 {
     $this->_addMobiSiteHeader();
     $this->_addMobiSiteFooter();
     $this->_addMobiHomePage();
     $this->_addMobiUserHomePage();
     $this->_addMobiUserProfilePage();
     $this->_addMobiEventProfilePage();
     $this->_addMobiGroupProfilePage();
     parent::onInstall();
 }
 public function onInstall()
 {
     $this->_addMobileEventProfileContent();
     $this->_addContentEventProfile();
     $this->_addContentMemberHome();
     $this->_addContentMemberProfile();
     $this->_addEventBrowsePage();
     $this->_addEventCreatePage();
     $this->_addEventManagePage();
     parent::onInstall();
 }
Пример #17
0
 public function onInstall()
 {
     $this->_addHomePage();
     $this->_addCreatePage();
     $this->_addEditPage();
     $this->_addManageScreenshotsPage();
     $this->_addManageFilesPage();
     $this->_addListingPage();
     $this->_addManagePage();
     $this->_addManageFollowPage();
     $this->_addDetailPage();
     parent::onInstall();
 }
Пример #18
0
 public function onInstall()
 {
     $this->_addCampaignsPage();
     $this->_addAccountPage();
     $this->_addAccountVirtualMoneyPage();
     $this->_addFaqsPage();
     $this->_addAdDetailPage();
     $this->_addMyAdsPage();
     $this->_addReportPage();
     $this->_addCreateAdPage();
     $this->_addAdEditPage();
     $this->_addCreateAdPageStepOne();
     parent::onInstall();
 }
Пример #19
0
 public function onInstall()
 {
     $this->_addAdvancedMemberBrowseReviewsPage();
     $this->_addAdvancedMemberReviewDetailPage();
     $this->_addAdvancedMemberUserPage();
     $this->_addAdvancedMemberHomePage();
     $this->_addAdvancedMemberPrivacyPage();
     $this->_addAdvancedMemberMyFriendPage();
     $this->_addAdvancedMemberFeaturePage();
     $this->_addAdvancedMemberRatingPage();
     $this->_addAdvancedMemberBirthDayPage();
     $this->_editProfilePage();
     $this->_editCoverPhotoUser();
     parent::onInstall();
 }
Пример #20
0
 public function onInstall()
 {
     parent::onInstall();
     $this->_ynBuildStructure();
     $db_adapter = Engine_Db_Table::getDefaultAdapter();
     if ($this->checkModuleExisted('ynidea')) {
         $sql = "ALTER TABLE  `engine4_ynidea_ideas` CHANGE  `title`  `title` VARCHAR( 256 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL";
         $db_adapter->query($sql);
     }
     if ($this->checkModuleExisted('ynwiki')) {
         $sql = "ALTER TABLE  `engine4_ynwiki_pages` CHANGE  `title`  `title` VARCHAR( 256 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL";
         $db_adapter->query($sql);
     }
     //Updating for old version
     $sql = "UPDATE `engine4_ynmoderation_modules` SET `report_query` = 'SELECT report_id, user_id, `type` AS `category`, `content` AS `description`, \\'ynwiki_page\\' AS `subject_type`, `page_id` AS `subject_id`, creation_date, \\'ynwiki_report\\' AS `report_type` FROM engine4_ynwiki_reports' WHERE `name`='Wiki' AND `object_type`='ynwiki_page'";
     $db_adapter->query($sql);
 }
Пример #21
0
 function onInstall()
 {
     parent::onInstall();
     $db = $this->getDb();
     $select = new Zend_Db_Select($db);
     $select->from('engine4_core_content')->where('name = ?', 'ynnotification.displays-notification')->limit(1);
     $widget = $select->query()->fetch();
     if (empty($widget)) {
         //$db = $this -> getDb();
         $selectPage = new Zend_Db_Select($db);
         $selectPage->from('engine4_core_pages')->where('name = ?', 'header')->limit(1);
         $page = $selectPage->query()->fetch();
         $db->insert('engine4_core_content', array('page_id' => $page['page_id'], 'type' => 'widget', 'name' => 'ynnotification.displays-notification', 'parent_content_id' => 100, 'order' => 999));
     }
     $db2 = Engine_Db_Table::getDefaultAdapter();
     $select = "INSERT IGNORE INTO `engine4_core_settings` (`name`, `value`) VALUES ('ynnotification.current.time','" . date('Y-m-d H:i:s') . "');";
     $data = $db2->query($select);
 }
Пример #22
0
 function onInstall()
 {
     //
     // install content areas
     //
     $db = $this->getDb();
     $select = new Zend_Db_Select($db);
     // BROWSE STORE
     $select = new Zend_Db_Select($db);
     $select->from('engine4_core_pages')->where('name = ?', 'ynadvsearch_search_index')->limit(1);
     $info = $select->query()->fetch();
     if (!empty($info)) {
         $db->query("DELETE FROM `engine4_core_content` WHERE `page_id` = " . $info['page_id']);
         $db->query("DELETE FROM `engine4_core_pages` WHERE `page_id` = " . $info['page_id']);
     }
     $db->insert('engine4_core_pages', array('name' => 'ynadvsearch_search_index', 'displayname' => 'YouNet Advanced Search Page', 'title' => 'YouNet Advanced Search Page', 'description' => 'YouNet Advanced Search Page'));
     $page_id = $db->lastInsertId('engine4_core_pages');
     // containers
     $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'container', 'name' => 'top', 'parent_content_id' => null, 'order' => 1, 'params' => ''));
     $top_id = $db->lastInsertId('engine4_core_content');
     $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'container', 'name' => 'middle', 'parent_content_id' => $top_id, 'order' => 6, 'params' => ''));
     $middle_id = $db->lastInsertId('engine4_core_content');
     //Insert menu
     $db->insert('engine4_core_content', array('type' => 'widget', 'name' => 'ynadvsearch.main-menu', 'page_id' => $page_id, 'parent_content_id' => $middle_id, 'order' => 1));
     $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'ynadvsearch.search-field', 'parent_content_id' => $middle_id, 'order' => 2, 'params' => ''));
     $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'container', 'name' => 'main', 'parent_content_id' => null, 'order' => 2, 'params' => ''));
     $container_id = $db->lastInsertId('engine4_core_content');
     $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'container', 'name' => 'middle', 'parent_content_id' => $container_id, 'order' => 6, 'params' => ''));
     $middle_id = $db->lastInsertId('engine4_core_content');
     $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'container', 'name' => 'left', 'parent_content_id' => $container_id, 'order' => 5, 'params' => ''));
     $left_id = $db->lastInsertId('engine4_core_content');
     // middle column
     $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'ynadvsearch.search-results', 'parent_content_id' => $middle_id, 'order' => 6, 'params' => ''));
     $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'ynadvsearch.modules-list', 'parent_content_id' => $left_id, 'order' => 1, 'params' => ''));
     $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'ynadvsearch.top-keywords', 'parent_content_id' => $left_id, 'order' => 2, 'params' => '{"title":"Top Keywords"}'));
     //TODO add new page here
     $this->_addFaqsPage();
     $this->addMemberPage();
     $this->addAlbumPage();
     $this->addEventPage();
     $this->addGroupPage();
     parent::onInstall();
 }
Пример #23
0
 public function onInstall()
 {
     $db = $this->getDb();
     // Run upgrades first to prevent issues with upgrading from older versions
     parent::onInstall();
     try {
         // Check for engine4_storage_servicetypes.enabled
         $cols = $db->describeTable('engine4_storage_servicetypes');
         if (empty($cols['enabled'])) {
             $db->query("\n          ALTER TABLE `engine4_storage_servicetypes`\n            ADD COLUMN `enabled` tinyint(1) NOT NULL default '1'\n        ");
             $db->query("\n          UPDATE `engine4_storage_servicetypes`\n            SET `enabled` = 0\n            WHERE `plugin` IN('Storage_Service_Db', 'Storage_Service_RoundRobin', 'Storage_Service_Mirrored')\n        ");
         }
         // Check for engine4_core_menuitems WHERE name=core_admin_main_settings_storage
         $exists = (bool) $db->select()->from('engine4_core_menuitems', new Zend_Db_Expr('TRUE'))->where('`name` = ?', 'core_admin_main_settings_storage')->limit(1)->query()->fetchColumn();
         if (!$exists) {
             $db->query("\n          INSERT IGNORE INTO `engine4_core_menuitems` (`name`, `module`, `label`, `plugin`, `params`, `menu`, `submenu`, `order`) VALUES\n          ('core_admin_main_settings_storage', 'core', 'Storage System', '', '{\"route\":\"admin_default\",\"module\":\"storage\",\"controller\":\"services\",\"action\":\"index\"}', 'core_admin_main_settings', '', 11)\n        ");
         }
     } catch (Exception $e) {
         $this->_error('Query failed with error: ' . $e->getMessage());
     }
 }
Пример #24
0
 public function onInstall()
 {
     $db = $this->getDb();
     // Add some pages
     if (method_exists($this, '_addGenericPage')) {
         $this->_addGenericPage('user_auth_login', 'Sign-in', 'Sign-in Page', 'This is the site sign-in page.');
         $this->_addGenericPage('user_signup_index', 'Sign-up', 'Sign-up Page', 'This is the site sign-up page.');
     } else {
         $this->_error('Missing _addGenericPage method');
     }
     // Run upgrades first to prevent issues with upgrading from older versions
     parent::onInstall();
     // Update all ip address to ipv6
     try {
         $this->_convertToIPv6($db, 'engine4_users', 'creation_ip', false);
         $this->_convertToIPv6($db, 'engine4_users', 'lastlogin_ip', true);
         $this->_convertToIPv6($db, 'engine4_user_logins', 'ip', false);
     } catch (Exception $e) {
         $this->_error('Query failed with error: ' . $e->getMessage());
     }
 }
Пример #25
0
 function onInstall()
 {
     //
     // install content areas
     //
     $db = $this->getDb();
     $select = new Zend_Db_Select($db);
     //INSERT INTO `engine4_core_content` (`content_id`, `page_id`, `type`, `name`, `parent_content_id`, `order`, `params`) VALUES
     // profile page
     $select->from('engine4_core_pages')->where('name = ?', 'user_profile_index')->limit(1);
     $page_id = $select->query()->fetchObject()->page_id;
     // forum.profile-forum-posts
     // Check if it's already been placed
     $select = new Zend_Db_Select($db);
     $select->from('engine4_core_content')->where('page_id = ?', $page_id)->where('type = ?', 'widget')->where('name = ?', 'forum.profile-forum-posts');
     $info = $select->query()->fetch();
     if (empty($info)) {
         // container_id (will always be there)
         $select = new Zend_Db_Select($db);
         $select->from('engine4_core_content')->where('page_id = ?', $page_id)->where('type = ?', 'container')->limit(1);
         $container_id = $select->query()->fetchObject()->content_id;
         // middle_id (will always be there)
         $select = new Zend_Db_Select($db);
         $select->from('engine4_core_content')->where('parent_content_id = ?', $container_id)->where('type = ?', 'container')->where('name = ?', 'middle')->limit(1);
         $middle_id = $select->query()->fetchObject()->content_id;
         // tab_id (tab container) may not always be there
         $select->reset('where')->where('type = ?', 'widget')->where('name = ?', 'core.container-tabs')->where('page_id = ?', $page_id)->limit(1);
         $tab_id = $select->query()->fetchObject();
         if ($tab_id && @$tab_id->content_id) {
             $tab_id = $tab_id->content_id;
         } else {
             $tab_id = null;
         }
         // tab on profile
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'forum.profile-forum-posts', 'parent_content_id' => $tab_id ? $tab_id : $middle_id, 'order' => 9, 'params' => '{"title":"Forum Posts","titleCount":true}'));
     }
     parent::onInstall();
 }
Пример #26
0
 function onInstall()
 {
     parent::onInstall();
     $this->_addEventSearchListingPage();
 }
Пример #27
0
 public function onDisable()
 {
     parent::onDisable();
     $db = $this->getDb();
     $db->query("UPDATE `engine4_core_modules` SET `enabled`= 1 WHERE `engine4_core_modules`.`name` = 'group';");
     $this->updateGroupConfiguration('0');
 }
 public function onInstall()
 {
     $this->_addMainPage();
     parent::onInstall();
 }
Пример #29
0
 function onInstall()
 {
     //
     // install content areas
     //
     $db = $this->getDb();
     $select = new Zend_Db_Select($db);
     //INSERT INTO `engine4_core_content` (`content_id`, `page_id`, `type`, `name`, `parent_content_id`, `order`, `params`) VALUES
     // profile page
     $select->from('engine4_core_pages')->where('name = ?', 'user_profile_index')->limit(1);
     $page_id = $select->query()->fetchObject()->page_id;
     // group.profile-groups
     // Check if it's already been placed
     $select = new Zend_Db_Select($db);
     $select->from('engine4_core_content')->where('page_id = ?', $page_id)->where('type = ?', 'widget')->where('name = ?', 'group.profile-groups');
     $info = $select->query()->fetch();
     if (empty($info)) {
         // container_id (will always be there)
         $select = new Zend_Db_Select($db);
         $select->from('engine4_core_content')->where('page_id = ?', $page_id)->where('type = ?', 'container')->limit(1);
         $container_id = $select->query()->fetchObject()->content_id;
         // middle_id (will always be there)
         $select = new Zend_Db_Select($db);
         $select->from('engine4_core_content')->where('parent_content_id = ?', $container_id)->where('type = ?', 'container')->where('name = ?', 'middle')->limit(1);
         $middle_id = $select->query()->fetchObject()->content_id;
         // tab_id (tab container) may not always be there
         $select->reset('where')->where('type = ?', 'widget')->where('name = ?', 'core.container-tabs')->where('page_id = ?', $page_id)->limit(1);
         $tab_id = $select->query()->fetchObject();
         if ($tab_id && @$tab_id->content_id) {
             $tab_id = $tab_id->content_id;
         } else {
             $tab_id = null;
         }
         // tab on profile
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'group.profile-groups', 'parent_content_id' => $tab_id ? $tab_id : $middle_id, 'order' => 9, 'params' => '{"title":"Groups","titleCount":true}'));
     }
     //
     // Group main page
     //
     // page
     // Check if it's already been placed
     $select = new Zend_Db_Select($db);
     $select->from('engine4_core_pages')->where('name = ?', 'group_profile_index')->limit(1);
     $info = $select->query()->fetch();
     if (empty($info)) {
         $db->insert('engine4_core_pages', array('name' => 'group_profile_index', 'displayname' => 'Group Profile', 'title' => 'Group Profile', 'description' => 'This is the profile for an group.', 'custom' => 0));
         $page_id = $db->lastInsertId('engine4_core_pages');
         // containers
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'container', 'name' => 'main', 'parent_content_id' => null, 'order' => 1, 'params' => ''));
         $container_id = $db->lastInsertId('engine4_core_content');
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'container', 'name' => 'middle', 'parent_content_id' => $container_id, 'order' => 3, 'params' => ''));
         $middle_id = $db->lastInsertId('engine4_core_content');
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'container', 'name' => 'left', 'parent_content_id' => $container_id, 'order' => 1, 'params' => ''));
         $left_id = $db->lastInsertId('engine4_core_content');
         // middle column
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'core.container-tabs', 'parent_content_id' => $middle_id, 'order' => 2, 'params' => '{"max":"6"}'));
         $tab_id = $db->lastInsertId('engine4_core_content');
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'group.profile-status', 'parent_content_id' => $middle_id, 'order' => 1, 'params' => ''));
         // left column
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'group.profile-photo', 'parent_content_id' => $left_id, 'order' => 1, 'params' => ''));
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'group.profile-options', 'parent_content_id' => $left_id, 'order' => 2, 'params' => ''));
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'group.profile-info', 'parent_content_id' => $left_id, 'order' => 3, 'params' => ''));
         // tabs
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'activity.feed', 'parent_content_id' => $tab_id, 'order' => 1, 'params' => '{"title":"Updates"}'));
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'group.profile-members', 'parent_content_id' => $tab_id, 'order' => 2, 'params' => '{"title":"Members","titleCount":true}'));
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'group.profile-photos', 'parent_content_id' => $tab_id, 'order' => 3, 'params' => '{"title":"Photos","titleCount":true}'));
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'group.profile-discussions', 'parent_content_id' => $tab_id, 'order' => 4, 'params' => '{"title":"Discussions","titleCount":true}'));
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'core.profile-links', 'parent_content_id' => $tab_id, 'order' => 5, 'params' => '{"title":"Links","titleCount":true}'));
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'group.profile-events', 'parent_content_id' => $tab_id, 'order' => 6, 'params' => '{"title":"Events","titleCount":true}'));
     }
     parent::onInstall();
 }
Пример #30
0
 function onInstall()
 {
     //
     // install content areas
     //
     $db = $this->getDb();
     $select = new Zend_Db_Select($db);
     // profile page
     $select->from('engine4_core_pages')->where('name = ?', 'user_profile_index')->limit(1);
     $page_id = $select->query()->fetchObject()->page_id;
     // video.profile-videos
     // Check if it's already been placed
     $select = new Zend_Db_Select($db);
     $select->from('engine4_core_content')->where('page_id = ?', $page_id)->where('type = ?', 'widget')->where('name = ?', 'video.profile-videos');
     $info = $select->query()->fetch();
     if (empty($info)) {
         // container_id (will always be there)
         $select = new Zend_Db_Select($db);
         $select->from('engine4_core_content')->where('page_id = ?', $page_id)->where('type = ?', 'container')->limit(1);
         $container_id = $select->query()->fetchObject()->content_id;
         // middle_id (will always be there)
         $select = new Zend_Db_Select($db);
         $select->from('engine4_core_content')->where('parent_content_id = ?', $container_id)->where('type = ?', 'container')->where('name = ?', 'middle')->limit(1);
         $middle_id = $select->query()->fetchObject()->content_id;
         // tab_id (tab container) may not always be there
         $select->reset('where')->where('type = ?', 'widget')->where('name = ?', 'core.container-tabs')->where('page_id = ?', $page_id)->limit(1);
         $tab_id = $select->query()->fetchObject();
         if ($tab_id && @$tab_id->content_id) {
             $tab_id = $tab_id->content_id;
         } else {
             $tab_id = null;
         }
         // tab on profile
         $db->insert('engine4_core_content', array('page_id' => $page_id, 'type' => 'widget', 'name' => 'video.profile-videos', 'parent_content_id' => $tab_id ? $tab_id : $middle_id, 'order' => 12, 'params' => '{"title":"Videos","titleCount":true}'));
     }
     // Check ffmpeg path for correctness
     if (function_exists('exec') && function_exists('shell_exec')) {
         // Api is not available
         //$ffmpeg_path = Engine_Api::_()->getApi('settings', 'core')->video_ffmpeg_path;
         $ffmpeg_path = $db->select()->from('engine4_core_settings', 'value')->where('name = ?', 'video.ffmpeg.path')->limit(1)->query()->fetchColumn(0);
         $output = null;
         $return = null;
         if (!empty($ffmpeg_path)) {
             exec($ffmpeg_path . ' -version', $output, $return);
         }
         // Try to auto-guess ffmpeg path if it is not set correctly
         $ffmpeg_path_original = $ffmpeg_path;
         if (empty($ffmpeg_path) || $return > 0 || stripos(join('', $output), 'ffmpeg') === false) {
             $ffmpeg_path = null;
             // Windows
             if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
                 // @todo
             } else {
                 $output = null;
                 $return = null;
                 @exec('which ffmpeg', $output, $return);
                 if (0 == $return) {
                     $ffmpeg_path = array_shift($output);
                     $output = null;
                     $return = null;
                     exec($ffmpeg_path . ' -version', $output, $return);
                     if (0 == $return) {
                         $ffmpeg_path = null;
                     }
                 }
             }
         }
         if ($ffmpeg_path != $ffmpeg_path_original) {
             $count = $db->update('engine4_core_settings', array('value' => $ffmpeg_path), array('name = ?' => 'video.ffmpeg.path'));
             if ($count === 0) {
                 try {
                     $db->insert('engine4_core_settings', array('value' => $ffmpeg_path, 'name' => 'video.ffmpeg.path'));
                 } catch (Exception $e) {
                 }
             }
         }
     }
     parent::onInstall();
 }