/**
  * Run SQL files
  * 
  * @access	public
  * @param	int
  */
 public function _importTemplates()
 {
     $templates = array();
     $this->DB->build(array('select' => '*', 'from' => 'ccs_template_blocks'));
     $outer = $this->DB->execute();
     while ($r = $this->DB->fetch($outer)) {
         if (!preg_match("/_(\\d+)\$/", $r['tpb_name'])) {
             $templates[$r['tpb_name']] = $r;
         }
     }
     $content = file_get_contents(IPSLib::getAppDir('ccs') . '/xml/block_templates.xml');
     require_once IPS_KERNEL_PATH . 'classXML.php';
     $xml = new classXML(IPS_DOC_CHAR_SET);
     $xml->loadXML($content);
     foreach ($xml->fetchElements('template') as $template) {
         $_template = $xml->fetchElementsFromRecord($template);
         if ($_template['tpb_name']) {
             unset($_template['tpb_id']);
             if (array_key_exists($_template['tpb_name'], $templates)) {
                 $this->DB->update("ccs_template_blocks", $_template, "tpb_id={$templates[$_template['tpb_name']]['tpb_id']}");
             } else {
                 $this->DB->insert("ccs_template_blocks", $_template);
             }
         }
     }
 }
Пример #2
0
 /**
  * Main function executed automatically by the controller
  *
  * @param	object		$registry		Registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Get forums class
     //-----------------------------------------
     if (!$this->registry->isClassLoaded('class_forums')) {
         $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums');
         $this->registry->setClass('class_forums', new $classToLoad($this->registry));
         $this->registry->getClass('class_forums')->strip_invisible = 1;
         $this->registry->getClass('class_forums')->forumsInit();
     }
     $this->lang->loadLanguageFile(array('public_search'));
     //-----------------------------------------
     // What to do?
     //-----------------------------------------
     switch ($this->request['do']) {
         default:
         case 'showForumsVncFilter':
             $this->showForm();
             break;
         case 'saveForumsVncFilter':
             $this->saveForm();
             break;
         case 'saveFollow':
             $this->saveFollow();
             break;
     }
 }
Пример #3
0
 /**
  * Main class entry point
  *
  * @access	public
  * @param	object		ipsRegistry reference
  * @return	@e void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Set up stuff
     //-----------------------------------------
     $this->form_code = 'module=settings&section=settings';
     $this->form_code_js = 'module=settings&section=settings';
     //-------------------------------
     // Grab, init and load settings
     //-------------------------------
     $classToLoad = IPSLib::loadActionOverloader(IPSLib::getAppDir('core') . '/modules_admin/settings/settings.php', 'admin_core_settings_settings');
     $settings = new $classToLoad($this->registry);
     $settings->makeRegistryShortcuts($this->registry);
     ipsRegistry::getClass('class_localization')->loadLanguageFile(array('admin_tools'), 'core');
     $settings->html = $this->registry->output->loadTemplate('cp_skin_settings', 'core');
     $settings->form_code = $settings->html->form_code = 'module=settings&section=settings';
     $settings->form_code_js = $settings->html->form_code_js = 'module=settings&section=settings';
     $this->request['conf_title_keyword'] = 'calendar';
     $settings->return_after_save = $this->settings['base_url'] . $this->form_code;
     $settings->_viewSettings();
     //-----------------------------------------
     // Pass to CP output hander
     //-----------------------------------------
     $this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper();
     $this->registry->getClass('output')->sendOutput();
 }
Пример #4
0
 /**
  * Grab the RSS document content and return it
  * 
  * @return	string		RSS document
  */
 public function returnRSSDocument()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $cal_id = intval(ipsRegistry::$request['id']);
     $rss_data = array();
     $to_print = '';
     $this->expires = time();
     $_calendarCache = ipsRegistry::cache()->getCache('calendars');
     //-----------------------------------------
     // Get RSS export
     //-----------------------------------------
     $rss_data = $_calendarCache[$cal_id];
     //-----------------------------------------
     // Got one?
     //-----------------------------------------
     if ($rss_data['cal_id'] and $rss_data['cal_rss_export']) {
         //-----------------------------------------
         // Correct expires time
         //-----------------------------------------
         $this->expires = $rss_data['cal_rss_update_last'] + $rss_data['cal_rss_update'] * 60;
         //-----------------------------------------
         // Need to recache?
         //-----------------------------------------
         if (!$rss_data['cal_rss_cache'] or time() - $rss_data['cal_rss_update'] * 60 > $rss_data['cal_rss_update_last']) {
             $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('calendar') . '/sources/cache.php', 'calendar_cache', 'calendar');
             $rss_export = new $classToLoad(ipsRegistry::instance());
             return $rss_export->rebuildCalendarRSSCache($rss_data['cal_id']);
         } else {
             return $rss_data['cal_rss_cache'];
         }
     }
 }
Пример #5
0
 /**
  * Class entry point
  *
  * @param	object		Registry reference
  * @return	@e void		[Outputs to screen/redirects]
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* Attachment Controller Class */
     $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('core') . '/sources/classes/attach/controller.php', 'classes_attach_controller');
     $controller = new $classToLoad($registry);
     $controller->run($this->request['do']);
 }
Пример #6
0
 public function doExecute(ipsRegistry $registry)
 {
     $this->kunena_prefix = 'kunena_';
     $forSome = array();
     // See if we specified a parent product
     $app = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'conv_apps', 'where' => "name='{$this->settings['conv_current']}'"));
     if (!$app['parent']) {
         $this->usingParent = FALSE;
         $forSome = array('forum_perms' => array(), 'groups' => array('forum_perms'), 'members' => array('groups', 'forum_perms'));
     }
     $forAll = array('forums' => array('forum_perms', 'groups'), 'topics' => array('members', 'forums'), 'posts' => array('members', 'topics'), 'reputation_index' => array('members', 'posts'), 'polls' => array('members', 'topics', 'forums'), 'attachments' => array('members', 'posts'));
     $this->actions = array_merge($forSome, $forAll);
     require_once IPSLib::getAppDir('convert') . '/sources/lib_master.php';
     require_once IPSLib::getAppDir('convert') . '/sources/lib_board.php';
     $this->lib = new lib_board($registry, $html, $this);
     $this->html = $this->lib->loadInterface();
     $this->lib->sendHeader('Kunena 2.x → IP.Board Converter');
     $this->HB = $this->lib->connect();
     if (array_key_exists($this->request['do'], $this->actions)) {
         call_user_func(array($this, 'convert_' . $this->request['do']));
     } else {
         $this->lib->menu();
     }
     $this->sendOutput();
 }
 /**
  * Class entry point
  *
  * @access	public
  * @param	object		Registry reference
  * @return	void		[Outputs to screen/redirects]
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* AJAX Class */
     require_once IPS_KERNEL_PATH . '/classAjax.php';
     $this->ajax = new classAjax($registry);
     /* Attachment Class */
     require_once IPSLib::getAppDir('core') . '/sources/classes/attach/class_attach.php';
     $this->class_attach = new class_attach($registry);
     /* What to do... */
     switch ($this->request['do']) {
         case 'attach_upload_show':
             $this->ajax->returnHtml($this->attachmentUploadShow());
             break;
         case 'attach_upload_process':
             $this->attachmentUploadProcess();
             break;
         case 'attach_upload_remove':
             $this->attachmentUploadRemove();
             break;
             /* IFrame based  upload */
         /* IFrame based  upload */
         case 'attachiFrame':
             $this->attachiFrame();
             break;
         case 'attachUploadiFrame':
             $this->attachUploadiFrame();
             break;
         default:
             $this->showPostAttachment();
             break;
     }
 }
 /**
  * Class entry point
  *
  * @access	public
  * @param	object		Registry reference
  * @return	void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Grab class
     //-----------------------------------------
     require_once IPSLib::getAppDir('members') . '/sources/classes/messaging/messengerFunctions.php';
     $this->messengerFunctions = new messengerFunctions($registry);
     switch ($this->request['do']) {
         case 'addFolder':
             $this->_addFolder();
             break;
         case 'removeFolder':
             $this->_removeFolder();
             break;
         case 'renameFolder':
             $this->_renameFolder();
             break;
         case 'emptyFolder':
             $this->_emptyFolder();
             break;
         case 'getPMNotification':
             $this->_getPMNotification();
             break;
         case 'showQuickForm':
             $this->_showQuickForm();
             break;
         case 'PMSend':
             $this->_PMSend();
             break;
         default:
             break;
     }
 }
Пример #9
0
 /**
  * Show the panel to select your media
  *
  * @return	@e void
  */
 protected function _showPane()
 {
     //-----------------------------------------
     // Loop through apps and collect tabs
     //-----------------------------------------
     $_plugins = array();
     $_tabs = array();
     foreach (IPSLib::getEnabledApplications() as $application) {
         if (is_dir(IPSLib::getAppDir($application['app_directory']) . '/extensions/sharedmedia')) {
             try {
                 foreach (new DirectoryIterator(IPSLib::getAppDir($application['app_directory']) . '/extensions/sharedmedia') as $file) {
                     if (!$file->isDot() && $file->isFile()) {
                         if (preg_match('/^plugin_(.+?)\\.php$/', $file->getFileName(), $matches)) {
                             $classToLoad = IPSLib::loadLibrary($file->getPathName(), 'plugin_' . $application['app_directory'] . '_' . $matches[1], $application['app_directory']);
                             $_plugins[$application['app_directory']][$matches[1]] = new $classToLoad($this->registry);
                             if ($_plugins[$application['app_directory']][$matches[1]]->getTab()) {
                                 $_tabs[] = array('app' => $application['app_directory'], 'plugin' => $matches[1], 'title' => $_plugins[$application['app_directory']][$matches[1]]->getTab());
                             }
                         }
                     }
                 }
             } catch (Exception $e) {
             }
         }
     }
     return $this->returnJsonArray(array('html' => $this->registry->output->getTemplate('editors')->sharedMedia($_tabs)));
 }
Пример #10
0
 /**
  * Serve the iCalendar feed (valid for both download as .ics and webcal:// protocol)
  *
  * @return	@e void
  */
 public function downloadIcalFeed()
 {
     //-----------------------------------------
     // Get main view class
     //-----------------------------------------
     $classToLoad = IPSLib::loadActionOverloader(IPSLib::getAppDir('calendar') . '/modules_public/calendar/view.php', 'public_calendar_calendar_view');
     $calendar = new $classToLoad($this->registry);
     $calendar->makeRegistryShortcuts($this->registry);
     $calendar->initCalendar();
     //-----------------------------------------
     // Load (all) events
     //-----------------------------------------
     $calendar->calendarGetEventsSQL(gmstrftime('%m'), gmstrftime('%Y'), array('timenow' => '1', 'timethen' => '2000000000', 'cal_id' => $this->calendar['cal_id'], 'honor_permissions' => true, 'no_date_convert' => true));
     $events = $calendar->calendarGetAllEvents();
     //-----------------------------------------
     // Load iCalendar class
     //-----------------------------------------
     $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('calendar') . "/sources/icalendar.php", 'app_calendar_classes_icalendarOutput', 'calendar');
     $iCalendar = new $classToLoad($this->registry, $this->calendar['cal_id']);
     //-----------------------------------------
     // Send data to iCalendar class and get output
     //-----------------------------------------
     foreach ($events as $event) {
         $event = $calendar->calendarMakeEventHTML($event, true);
         $iCalendar->addEvent($event);
     }
     $feed = $iCalendar->buildICalendarFeed();
     //-----------------------------------------
     // Output
     //-----------------------------------------
     @header("Content-type: text/calendar; charset=" . IPS_DOC_CHAR_SET);
     @header("Content-Disposition: inline; filename=calendarEvents.ics");
     print $feed;
     exit;
 }
Пример #11
0
 /**
  * Constructor
  * 
  * @return	@e void
  */
 public function __construct(ipsRegistry $registry)
 {
     /* Hard limit - not used in Sphinx but may need to revisit if we bust IN()s */
     //IPSSearchRegistry::set('set.hardLimit', ( ipsRegistry::$settings['search_hardlimit'] ) ? ipsRegistry::$settings['search_hardlimit'] : 200 );
     /* Get class forums, used for displaying forum names on results */
     if (ipsRegistry::isClassLoaded('class_forums') !== TRUE) {
         $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums');
         ipsRegistry::setClass('class_forums', new $classToLoad(ipsRegistry::instance()));
         ipsRegistry::getClass('class_forums')->strip_invisible = 1;
         ipsRegistry::getClass('class_forums')->forumsInit();
     }
     /* Get live or archive */
     $this->searchArchives = ipsRegistry::$request['search_app_filters']['forums']['liveOrArchive'] == 'archive' ? true : false;
     if ($this->searchArchives) {
         /* Load up archive class */
         $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/archive/reader.php', 'classes_archive_reader');
         $this->archiveReader = new $classToLoad();
         $this->archiveReader->setApp('forums');
         $this->table = $this->archiveReader->getFields();
         $this->table['_table_'] = 'forums_archive_posts';
         $this->table['_prefix_'] = 'p.archive_';
         $this->table['forums_search_posts_main'] = 'forums_search_archive_main';
         $this->table['forums_search_posts_delta'] = 'forums_search_archive_delta';
         /* disable max days search */
         $this->settings['search_ucontent_days'] = 0;
     } else {
         $this->table = array('_table_' => 'posts', '_prefix_' => 'p.', 'pid' => 'pid', 'author_id' => 'author_id', 'author_name' => 'author_name', 'ip_address' => 'ip_address', 'post_date' => 'post_date', 'post' => 'post', 'queued' => 'queued', 'topic_id' => 'topic_id', 'new_topic' => 'new_topic', 'post_bwoptions' => 'post_bwoptions', 'post_key' => 'post_key', 'post_htmlstate' => 'post_htmlstate', 'use_sig' => 'use_sig', 'use_emo' => 'use_emo', 'append_edit' => 'append_edit', 'edit_time' => 'edit_time', 'edit_name' => 'edit_name', 'post_edit_reason' => 'post_edit_reason', 'forums_search_posts_main' => 'forums_search_posts_main', 'forums_search_posts_delta' => 'forums_search_posts_delta');
     }
     parent::__construct($registry);
 }
Пример #12
0
 /**
  * Constructor
  *
  */
 public function __construct()
 {
     /* Make registry objects */
     $this->registry = ipsRegistry::instance();
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->lang = $this->registry->getClass('class_localization');
     $this->member = $this->registry->member();
     $this->memberData =& $this->registry->member()->fetchMemberData();
     $this->cache = $this->registry->cache();
     $this->caches =& $this->registry->cache()->fetchCaches();
     /* Check for class_forums */
     if (ipsRegistry::isClassLoaded('class_forums') !== TRUE) {
         $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums');
         $this->registry->setClass('class_forums', new $classToLoad($this->registry));
         $this->registry->class_forums->forumsInit();
     }
     /* Load topic class */
     if (!$this->registry->isClassLoaded('topics')) {
         $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums');
         $this->registry->setClass('topics', new $classToLoad($this->registry));
     }
     /* Language class */
     $this->registry->getClass('class_localization')->loadLanguageFile(array('public_global'), 'core');
     /* Fetch engine class */
     $this->settings['archive_engine'] = $this->settings['archive_engine'] ? $this->settings['archive_engine'] : 'sql';
     /* Load up archive class */
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/archive/reader/' . $this->settings['archive_engine'] . '.php', 'classes_archive_reader_' . $this->settings['archive_engine']);
     $this->engine = new $classToLoad();
     $this->fields = $this->registry->topics->getPostTableFields();
 }
Пример #13
0
 /**
  * Class entry point
  *
  * @param	object		Registry reference
  * @return	@e void		[Outputs to screen/redirects]
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* Friends enabled? */
     if (!$this->settings['friends_enabled']) {
         $this->registry->getClass('output')->showError('friends_not_enabled', 10236, null, null, 403);
     }
     /* Friend Library */
     $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('members') . '/sources/friends.php', 'profileFriendsLib', 'members');
     $this->friend_lib = new $classToLoad($this->registry);
     //-----------------------------------------
     // Get HTML and skin
     //-----------------------------------------
     $this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members');
     switch ($this->request['do']) {
         case 'list':
         default:
             $this->_viewList();
             break;
         case 'add':
             $this->_addFriend();
             break;
         case 'remove':
             $this->_removeFriend();
             break;
         case 'moderate':
             $this->_moderation();
             break;
     }
 }
 /**
  * Checks the attachment and checks for download / show perms
  *
  * @access	public
  * @param	integer		Attachment id
  * @return	array 		Attachment data
  */
 public function getAttachmentData($attach_id)
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $_ok = 0;
     //-----------------------------------------
     // Grab 'em
     //-----------------------------------------
     $this->DB->build(array('select' => 'a.*', 'from' => array('attachments' => 'a'), 'where' => "a.attach_rel_module='" . $this->module . "' AND a.attach_id=" . $attach_id, 'add_join' => array(0 => array('select' => 'bcc.cbcus_id', 'from' => array('blog_custom_cblocks' => 'bcc'), 'where' => "bcc.cbcus_id=a.attach_rel_id", 'type' => 'left'), 1 => array('select' => 'cb.blog_id', 'from' => array('blog_cblocks' => 'cb'), 'where' => "cb.cblock_ref_id=bcc.cbcus_id AND cb.cblock_type='custom'", 'type' => 'left'))));
     $attach_sql = $this->DB->execute();
     $attach = $this->DB->fetch($attach_sql);
     //-----------------------------------------
     // Check..
     //-----------------------------------------
     if (!isset($attach['blog_id']) || !$attach['blog_id']) {
         return FALSE;
     }
     require_once IPSLib::getAppDir('blog') . '/sources/lib/lib_blogfunctions.php';
     $blog_std = new blogFunctions($this->registry);
     $blog_std->buildPerms();
     $blog = $blog_std->loadBlog($attach['blog_id']);
     if (!$blog['blog_id']) {
         return false;
     }
     return $attach;
 }
Пример #15
0
 public function doExecute(ipsRegistry $registry)
 {
     $this->registry = $registry;
     // load libs.
     require_once IPSLib::getAppDir('convert') . '/sources/lib_master.php';
     require_once IPSLib::getAppDir('convert') . '/sources/lib_nexus.php';
     $this->lib = new lib_nexus($registry, $html, $this);
     $this->html = $this->lib->loadInterface();
     $this->lib->sendHeader('vBulletin → IP.Nexus Converter');
     $this->HB = $this->lib->connect();
     // populate actions
     $this->actions = array('nexus_customers' => array('members'), 'nexus_packages' => array('groups'), 'nexus_invoices' => array('nexus_packages', 'members'), 'nexus_purchases' => array('nexus_packages', 'nexus_invoices', 'members'));
     // Check for converted group
     $row = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'nexus_package_groups', 'where' => "pg_name='Converted' and pg_parent=0"));
     $this->convertGroup = $row['pg_id'];
     if (!$row['pg_id']) {
         // Insert conversion group into Nexus
         $this->DB->insert('nexus_package_groups', array('pg_name' => 'Converted', 'pg_seo_name' => 'converted', 'pg_parent' => 0, 'pg_position' => 1));
         $id = $this->DB->getInsertId();
         $this->lib->addLink($id, $id, 'nexus_package_groups');
     }
     if (array_key_exists($this->request['do'], $this->actions)) {
         call_user_func(array($this, 'convert_' . $this->request['do']));
     } else {
         $this->lib->menu();
     }
     $this->sendOutput();
 }
 public function generate()
 {
     $galleryClassFile = IPSLib::getAppDir('gallery') . '/sources/classes/gallery.php';
     if (!IPSLib::appIsInstalled('gallery') || $this->settings['sitemap_priority_gallery_albums'] == 0 || !is_file($galleryClassFile)) {
         return;
     }
     $classToLoad = IPSLib::loadLibrary($galleryClassFile, 'ipsGallery', 'gallery');
     $this->registry->setClass('gallery', new $classToLoad($this->registry));
     $limitCount = 0;
     while (1) {
         if (ipSeo_SitemapGenerator::isCronJob()) {
             sleep(0.5);
         }
         $filters = array('sortOrder' => 'desc', 'sortKey' => 'date', 'offset' => $limitCount, 'limit' => 100, 'isViewable' => true, 'memberData' => array('member_id' => 0));
         $albums = $this->registry->gallery->helper('albums')->fetchAlbumsByFilters($filters);
         foreach ($albums as $album) {
             $url = "{$this->settings['board_url']}/index.php?app=gallery&album={$album['album_id']}";
             $url = ipSeo_FURL::build($url, 'none', $album['album_name_seo'], 'viewalbum');
             $addedCount = $this->sitemap->addUrl($url, $album['album_last_img_date'], $this->settings['sitemap_priority_gallery_albums']);
         }
         $limitCount += 100;
         if (count($albums) < 100) {
             break;
         }
     }
 }
Пример #17
0
 /**
  * Gets the uploader form/data for ajaxy stuffs
  */
 protected function _getForumsAppUploader()
 {
     $this->registry->getClass('class_localization')->loadLanguageFile(array('public_post', 'public_topics'), 'forums');
     $attach_post_key = trim($this->request['attach_post_key']);
     $attach_rel_id = intval($this->request['attach_rel_id']);
     $forum_id = intval($this->request['forum_id']);
     $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('core') . '/sources/classes/attach/class_attach.php', 'class_attach');
     $class_attach = new $classToLoad($this->registry);
     $class_attach->type = 'post';
     $class_attach->attach_post_key = $attach_post_key;
     $class_attach->init();
     $class_attach->getUploadFormSettings();
     $html = $this->registry->getClass('output')->getTemplate('post')->uploadForm($this->post_key, 'post', $class_attach->attach_stats, $attach_rel_id, $forum_id);
     /* Need to make sure they are unique - if we implement, change template to accept a prefix */
     $html = str_replace("id='add_files_attach_", "id='add_files_attach_pu_", $html);
     $html = str_replace("id='nojs_attach_", "id='nojs_attach_pu_", $html);
     $html = str_replace("id='help_msg'", "id='pu_help_msg'", $html);
     $html = str_replace("id='space_info_attach_", "id='space_info_attach_pu_", $html);
     $html = str_replace("<ul id='attachments'>", "<ul id='pu_attachments'>", $html);
     /* Remove help msg */
     /* remove inline execution */
     preg_match_all('#<script type=\'text/javascript\'>(.+?)</script>#is', $html, $matches, PREG_SET_ORDER);
     foreach ($matches as $val) {
         $all = $val[0];
         $javascript = $val[1];
         if (stristr($all, 'ipb.attach.registerUploader')) {
             $html = str_replace($all, '', $html);
         }
     }
     $this->returnHtml($html);
 }
Пример #18
0
 public function generate()
 {
     if (!IPSLib::appIsInstalled('ccs')) {
         return;
     }
     $maxPages = 10000;
     $curPages = 0;
     while ($curPages < $maxPages) {
         $permCheck = $this->DB->buildWherePermission(array($this->caches['group_cache'][$this->settings['guest_group']]['g_perm_id']), 'page_view_perms', true);
         $this->DB->build(array('select' => '*', 'from' => 'ccs_pages', 'where' => "({$permCheck}) AND page_content_type = 'page'", 'order' => 'page_last_edited DESC', 'limit' => array($curPages, 100)));
         $result = $this->DB->execute();
         if ($result) {
             // Add the resulting rows to the sitemap:
             while ($row = $this->DB->fetch($result)) {
                 if (!$this->registry->isClassLoaded('ccsFunctions')) {
                     $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('ccs') . '/sources/functions.php', 'ccsFunctions', 'ccs');
                     $this->registry->setClass('ccsFunctions', new $classToLoad($this->registry));
                 }
                 $url = $this->registry->ccsFunctions->returnPageUrl($row);
                 $priority = $row['page_folder'] == '' && $row['page_seo_name'] == $this->settings['ccs_default_page'] ? $this->settings['sitemap_priority_ccs_index'] : $this->settings['sitemap_priority_ccs_page'];
                 $this->sitemap->addURL($url, $row['page_last_edited'], $priority);
             }
             // If we've got back less rows than expected, we've probably got no more to pull:
             $pulledRows = $this->DB->getTotalRows($result);
             $curPages += $pulledRows;
             if ($pulledRows < 100) {
                 break;
             }
         }
     }
 }
 public function generate()
 {
     $galleryClassFile = IPSLib::getAppDir('gallery') . '/sources/classes/gallery.php';
     if (!IPSLib::appIsInstalled('gallery') || $this->settings['sitemap_priority_gallery_images'] == 0 || !is_file($galleryClassFile)) {
         return;
     }
     $classToLoad = IPSLib::loadLibrary($galleryClassFile, 'ipsGallery', 'gallery');
     $this->registry->setClass('gallery', new $classToLoad($this->registry));
     $max = $this->settings['sitemap_count_gallery_images'];
     if (!ipSeo_SitemapGenerator::isCronJob() && ($max > 10000 || $max == -1)) {
         $max = 10000;
     } elseif (ipSeo_SitemapGenerator::isCronJob() && $max == -1) {
         $max = 500000000;
     }
     $addedCount = 0;
     $limitCount = 0;
     while ($addedCount < $max) {
         if (ipSeo_SitemapGenerator::isCronJob()) {
             sleep(0.5);
         }
         $filters = array('sortOrder' => 'desc', 'sortKey' => 'date', 'offset' => $limitCount, 'limit' => 100, 'getLatestComment' => 1);
         $memberId = 0;
         $images = $this->registry->gallery->helper('image')->fetchImages($memberId, $filters);
         foreach ($images as $image) {
             $url = "{$this->settings['board_url']}/index.php?app=gallery&image={$image['image_id']}";
             $url = ipSeo_FURL::build($url, 'none', $image['image_caption_seo'], 'viewimage');
             $lastMod = is_null($image['comment_post_date']) ? $image['image_date'] : $image['comment_post_date'];
             $addedCount = $this->sitemap->addUrl($url, $lastMod, $this->settings['sitemap_priority_gallery_images']);
         }
         $limitCount += 100;
         if (count($images) < 100) {
             break;
         }
     }
 }
Пример #20
0
 /**
  * Get topics from a forum
  *
  * @return	@e void		[Outputs to screen]
  */
 protected function _getTopics()
 {
     //-----------------------------------------
     // Reset input
     //-----------------------------------------
     $_GET['showforum'] = intval($_GET['f']);
     ipsRegistry::$request['showforum'] = intval(ipsRegistry::$request['f']);
     if ($_GET['showforum'] < 1) {
         $this->returnJsonArray(array('error' => 'incorrect_f'));
     }
     //-----------------------------------------
     // Get the forum controller
     //-----------------------------------------
     $classToLoad = IPSLib::loadActionOverloader(IPSLib::getAppDir('forums') . '/modules_public/forums/forums.php', 'public_forums_forums_forums');
     $forums = new $classToLoad();
     $forums->makeRegistryShortcuts($this->registry);
     $forums->initForums();
     $forums->buildPermissions();
     $data = $forums->renderForum();
     $html = '';
     if (is_array($data['topic_data']) && count($data['topic_data'])) {
         foreach ($data['topic_data'] as $idx => $tdata) {
             $html .= $this->registry->output->getTemplate('forum')->topic($tdata, $data['other_data']['forum_data'], $data['other_data'], 1);
         }
     }
     $this->returnJsonArray(array('topics' => $html, 'pages' => $data['other_data']['forum_data']['SHOW_PAGES'], 'hasMore' => $data['other_data']['hasMore']), true);
 }
Пример #21
0
 /**
  * Construct
  *
  * @param	string		Application (or aai key)
  * @param	string		Area
  * @return	string
  */
 public static function run($app = null, $area = null)
 {
     if (strlen($app) == 32 and $area === null) {
         $test = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'core_tags', 'where' => 'tag_aai_lookup=\'' . ipsRegistry::DB()->addSlashes($app) . '\'', 'limit' => array(0, 1)));
         if ($test['tag_meta_app'] && $test['tag_meta_area']) {
             $app = $test['tag_meta_app'];
             $area = $test['tag_meta_area'];
         }
     }
     if ($app === null or $area === null) {
         trigger_error("App or area missing from classes_like", E_USER_WARNING);
     }
     /* Pointless comment! */
     $_file = IPSLib::getAppDir($app) . '/extensions/tags/' . $area . '.php';
     $_key = $app && $area ? md5($app . $area) : 'default';
     /* Get from cache if already cached */
     if (isset(self::$apps[$_key])) {
         return self::$apps[$_key];
     }
     /* Get other classes */
     require_once IPS_ROOT_PATH . 'sources/classes/tags/abstract.php';
     /*noLibHook*/
     if ($app && $area) {
         /* Otherwise create object and cache */
         if (is_file($_file)) {
             $classToLoad = IPSLib::loadLibrary($_file, 'tags_' . $app . '_' . $area, $app);
             if (class_exists($classToLoad)) {
                 self::$apps[$_key] = new $classToLoad();
                 self::$apps[$_key]->setApp($app);
                 self::$apps[$_key]->setArea($area);
                 self::$apps[$_key]->init();
             } else {
                 throw new Exception("No tags class available for {$app} - {$area}");
             }
         } else {
             /* Allow an application to worry about the 'area' */
             if (is_file(IPSLib::getAppDir($app) . '/extensions/tags/default.php')) {
                 $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir($app) . '/extensions/tags/default.php', 'tags_' . $app . '_default', $app);
                 if (class_exists($classToLoad)) {
                     self::$apps[$_key] = new $classToLoad();
                     self::$apps[$_key]->setApp($app);
                     self::$apps[$_key]->setArea($area);
                     self::$apps[$_key]->init();
                 } else {
                     throw new Exception("No tags class available for {$app} - {$area}");
                 }
             } else {
                 throw new Exception("No tags class available for {$app} - {$area}");
             }
         }
     } else {
         $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/tags/extensions/default.php', 'tags_default');
         self::$apps[$_key] = new $classToLoad();
         self::$apps[$_key]->setApp($app);
         self::$apps[$_key]->setArea($area);
         self::$apps[$_key]->init();
     }
     return self::$apps[$_key];
 }
Пример #22
0
 /**
  * Constructor
  *
  * @param	object		ipsRegistry reference
  * @return	@e void
  */
 public function __construct(ipsRegistry $registry)
 {
     /* Make object */
     $this->registry = $registry;
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->cache = $this->registry->cache();
     $this->caches =& $this->registry->cache()->fetchCaches();
     $this->lang = $this->registry->getClass('class_localization');
     $this->member = $this->registry->member();
     $this->memberData =& $this->registry->member()->fetchMemberData();
     if (IN_ACP) {
         try {
             require_once IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php";
             /*noLibHook*/
             $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums');
             $this->registry->setClass('class_forums', new $classToLoad($registry));
             $this->registry->getClass('class_forums')->strip_invisible = 0;
         } catch (Exception $error) {
             IPS_exception_error($error);
         }
     } else {
         try {
             $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums');
             $this->registry->setClass('class_forums', new $classToLoad($registry));
             $this->registry->getClass('class_forums')->strip_invisible = 1;
         } catch (Exception $error) {
             IPS_exception_error($error);
         }
     }
     //---------------------------------------------------
     // Grab and cache the topic now as we need the 'f' attr for
     // the skins...
     //---------------------------------------------------
     if (!empty($_GET['showtopic'])) {
         /* Load tagging stuff */
         if (!$this->registry->isClassLoaded('tags')) {
             require_once IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php';
             /*noLibHook*/
             $this->registry->setClass('tags', classes_tags_bootstrap::run('forums', 'topics'));
         }
         $this->request['t'] = intval($_GET['showtopic']);
         $this->DB->build(array('select' => 't.*', 'from' => array('topics' => 't'), 'where' => 't.tid=' . $this->request['t'], 'add_join' => array($this->registry->tags->getCacheJoin(array('meta_id_field' => 't.tid')))));
         $this->DB->execute();
         $topic = $this->DB->fetch();
         $this->registry->getClass('class_forums')->topic_cache = $topic;
         $this->request['f'] = $topic['forum_id'];
         /* Update query location */
         $this->member->sessionClass()->addQueryKey('location_2_id', ipsRegistry::$request['f']);
     }
     $this->registry->getClass('class_forums')->forumsInit();
     //-----------------------------------------
     // Set up moderators
     //-----------------------------------------
     $this->memberData = IPSMember::setUpModerator($this->memberData);
     /* Other set up for this app */
     $this->settings['topic_title_max_len'] = $this->settings['topic_title_max_len'] > 2 ? $this->settings['topic_title_max_len'] : 2;
 }
Пример #23
0
 public function onCreateAccount($member)
 {
     if (IN_ACP) {
         require_once IPSLib::getAppDir('PXVip') . '/sources/changeGroup.php';
         $this->registry->setClass('changeGroup', new changeGroup($this->registry));
         $this->registry->changeGroup->change_group($member);
     }
 }
 public function getOutput()
 {
     if (is_file(IPSLib::getAppDir('ipchat') . '/sources/hooks.php')) {
         $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('ipchat') . '/sources/hooks.php', 'hooksApi', 'ipchat');
         $chatting = new $classToLoad($this->registry);
         return $chatting->whosChatting();
     }
 }
Пример #25
0
 /**
  * Class entry point
  *
  * @param	object		Registry reference
  * @return	@e void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $member_id = intval(ipsRegistry::$request['member_id']);
     $md5check = IPSText::md5Clean($this->request['md5check']);
     $CONFIG = array();
     $tab = explode(':', ipsRegistry::$request['tab']);
     $app = substr(IPSText::alphanumericalClean(str_replace('..', '', trim($tab[0]))), 0, 20);
     $tab = substr(IPSText::alphanumericalClean(str_replace('..', '', trim($tab[1]))), 0, 20);
     $this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members');
     //-----------------------------------------
     // MD5 check
     //-----------------------------------------
     if ($md5check != $this->member->form_hash) {
         $this->returnString('error');
     }
     //-----------------------------------------
     // Load member
     //-----------------------------------------
     $member = IPSMember::load($member_id);
     //-----------------------------------------
     // Check
     //-----------------------------------------
     if (!$member['member_id']) {
         $this->returnString('error');
     }
     //-----------------------------------------
     // Load config
     //-----------------------------------------
     if (!is_file(IPSLib::getAppDir($app) . '/extensions/profileTabs/' . $tab . '.conf.php')) {
         $this->returnString('error');
     }
     require IPSLib::getAppDir($app) . '/extensions/profileTabs/' . $tab . '.conf.php';
     /*noLibHook*/
     //-----------------------------------------
     // Active?
     //-----------------------------------------
     if (!$CONFIG['plugin_enabled']) {
         $this->returnString('error');
     }
     //-----------------------------------------
     // Load main class...
     //-----------------------------------------
     if (!is_file(IPSLib::getAppDir($app) . '/extensions/profileTabs/' . $tab . '.php')) {
         $this->returnString('error');
     }
     require IPSLib::getAppDir('members') . '/sources/tabs/pluginParentClass.php';
     /*noLibHook*/
     $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir($app) . '/extensions/profileTabs/' . $tab . '.php', 'profile_' . $tab, $app);
     $plugin = new $classToLoad($this->registry);
     $html = $plugin->return_html_block($member);
     //-----------------------------------------
     // Return it...
     //-----------------------------------------
     $this->returnHtml($html);
 }
Пример #26
0
 /**
  * Main class entry point
  *
  * @param	object		ipsRegistry reference
  * @return	@e void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Load skin
     //-----------------------------------------
     $this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_hooks_export', 'core');
     //-----------------------------------------
     // Load hooks library
     //-----------------------------------------
     $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('core') . '/sources/classes/hooksFunctions.php', 'hooksFunctions');
     $this->hooksFunctions = new $classToLoad($registry);
     //-----------------------------------------
     // Load lang
     //-----------------------------------------
     ipsRegistry::getClass('class_localization')->loadLanguageFile(array('admin_hooks'));
     switch ($this->request['do']) {
         case 'getStrings':
             $this->_getAjaxStrings();
             break;
         case 'getLangFiles':
             $this->_getAjaxFiles();
             break;
         case 'getTemplates':
             $this->_getAjaxTemplates();
             break;
         case 'getSkinFiles':
             $this->_getAjaxSkins();
             break;
             // These are for the add file form
         // These are for the add file form
         case 'getGroupsForAdd':
             $this->_getGroupsForAdd();
             break;
         case 'getTemplatesForAdd':
             $this->_getTemplatesForAdd();
             break;
         case 'getHookIds':
             $this->_getHookIds();
             break;
         case 'getDataLocationsForAdd':
             $this->_getDataLocationsForAdd();
             break;
         case 'getApplications':
             $this->_getApplications();
             break;
         case 'getAppVersions':
             $this->_getAppVersions();
             break;
         case 'save':
             $this->save();
             break;
         case 'show':
         default:
             $this->show();
             break;
     }
 }
 /**
  * Constructor.  Calls parent init() method
  *
  * @access	public
  * @return	void
  */
 public function __construct()
 {
     $this->init();
     //-----------------------------------------
     // Get some classes
     //-----------------------------------------
     require_once IPSLib::getAppDir('forums') . '/app_class_forums.php';
     $appClass = new app_class_forums($this->registry);
 }
 public function __construct()
 {
     /* Make registry objects */
     $this->registry = ipsRegistry::instance();
     if (is_file(IPSLib::getAppDir('ipchat') . '/sources/hooks.php')) {
         $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('ipchat') . '/sources/hooks.php', 'hooksApi', 'ipchat');
         $this->chatting = new $classToLoad($this->registry);
     }
 }
 /**
  * Constructor
  *
  * @access	public
  * @param	object	ipsRegistry
  * @return	void
  */
 public function __construct(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Could potentially be setup from sessions
     //-----------------------------------------
     if (!$registry->isClassLoaded('ccsFunctions')) {
         require_once IPSLib::getAppDir('ccs') . '/sources/functions.php';
         $registry->setClass('ccsFunctions', new ccsFunctions($registry));
     }
 }
Пример #30
-1
 /**
  * Save Settings
  */
 public function saveSettings()
 {
     /* Are we turning off? */
     if (ipsRegistry::$request['off']) {
         IPSLib::updateSettings(array('mandrill_username' => '', 'mandrill_api_key' => ''));
         ipsRegistry::getClass('output')->silentRedirect(ipsRegistry::$settings['_base_url'] . "app=core&amp;module=applications&amp;section=enhancements&amp;do=edit&amp;service=enhancements_members_mandrill");
         return;
     }
     /* Load language files so we have error messages if we need em */
     ipsRegistry::getClass('class_localization')->loadLanguageFile('admin_bulkmail', 'members');
     /* Are we adding new values or just enabling SMTP? */
     if (ipsRegistry::$request['smtp_on']) {
         ipsRegistry::$request['username'] = ipsRegistry::$settings['mandrill_username'];
         ipsRegistry::$request['api_key'] = ipsRegistry::$settings['mandrill_api_key'];
         ipsRegistry::$request['smtp'] = 1;
         $update = array();
     } else {
         /* Trim (like a haircut, but with strings) */
         ipsRegistry::$request['username'] = trim(ipsRegistry::$request['username']);
         ipsRegistry::$request['api_key'] = trim(ipsRegistry::$request['api_key']);
         /* If we don't have anything, tell them off */
         if (!ipsRegistry::$request['username'] or !ipsRegistry::$request['username']) {
             return $this->editSettings('mandrill_setup_noinfo');
         }
         /* Now shoot that over to Mandrill to make sure they're cool with it */
         require_once IPSLib::getAppDir('members') . '/sources/classes/mandrill.php';
         $mandrill = new Mandrill(ipsRegistry::$request['api_key']);
         $info = $mandrill->users_info();
         if ($info === NULL or $info->username != ipsRegistry::$request['username']) {
             return $this->editSettings('mandrill_bad_credentials');
         }
         /* So we're saving at least the API key and the username */
         $update = array('mandrill_username' => ipsRegistry::$request['username'], 'mandrill_api_key' => ipsRegistry::$request['api_key']);
     }
     /* Fire that off to IPS so Mandrill knows it's one of ours */
     $classToLoad = IPSLib::loadLibrary(IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement');
     $file = new $classToLoad();
     $json = NULL;
     /* If they want to use Mandrill for SMTP too, that call will contain the SMTP info,
        so set it if we got it, or if the call failed, throw an error */
     if (ipsRegistry::$request['smtp']) {
         if ($json) {
             $json = json_decode($json, TRUE);
             $update = array_merge($update, $json);
         } else {
             return $this->editSettings('mandrill_error');
         }
     }
     /* Update the settings */
     IPSLib::updateSettings($update);
     /* And boink the hell out of it */
     ipsRegistry::getClass('output')->silentRedirect(ipsRegistry::$settings['_base_url'] . "app=core&amp;module=applications&amp;section=enhancements&amp;do=edit&amp;service=enhancements_members_mandrill");
     return;
 }