当前位置: 首页>>代码示例>>PHP>>正文


PHP XenForo_Helper_File::getExternalDataPath方法代码示例

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


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

示例1: getIconFilePath

 public function getIconFilePath($nodeId, $number, $externalDataPath = null)
 {
     if ($externalDataPath === null) {
         $externalDataPath = XenForo_Helper_File::getExternalDataPath();
     }
     return sprintf('%s/nodeIcons/' . $nodeId . '_' . $number . '.jpg', $externalDataPath);
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:7,代码来源:Icon.php

示例2: deleteThumb

 public function deleteThumb($mediaID)
 {
     $targetLoc = XenForo_Helper_File::getExternalDataPath() . '/media/' . $mediaID . '.jpg';
     if (file_exists($targetLoc)) {
         unlink($targetLoc);
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:7,代码来源:Thumbs.php

示例3: regeneratePublicHtml

 /**
  * @param mixed $overrideMotd set motd pre-cache-update
  * @param mixed $unsync if not due to new message set true
  */
 public function regeneratePublicHtml($overrideMotd = false, $unsync = false)
 {
     $viewParams = array();
     $options = XenForo_Application::get('options');
     $visitor = XenForo_Visitor::getInstance();
     if ($options->dark_taigachat_speedmode == 'Disabled') {
         return;
     }
     if ($unsync) {
         /** @var XenForo_Model_DataRegistry */
         $registryModel = $this->getModelFromCache('XenForo_Model_DataRegistry');
         $lastUnsync = $registryModel->get('dark_taigachat_unsync');
         if (!empty($lastUnsync) && $lastUnsync > time() - 30) {
             return;
         }
         $registryModel->set('dark_taigachat_unsync', time());
     }
     // swap timezone to default temporarily
     $oldTimeZone = XenForo_Locale::getDefaultTimeZone()->getName();
     XenForo_Locale::setDefaultTimeZone($options->guestTimeZone);
     $messages = $this->getMessages(array("page" => 1, "perPage" => $options->dark_taigachat_fullperpage, "lastRefresh" => 0));
     $messagesMini = $this->getMessages(array("page" => 1, "perPage" => $options->dark_taigachat_sidebarperpage, "lastRefresh" => 0));
     $bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base'));
     $motd = new XenForo_BbCode_TextWrapper($overrideMotd !== false ? $overrideMotd : $options->dark_taigachat_motd, $bbCodeParser);
     $onlineUsersTaiga = $this->getActivityUserList($visitor->toArray());
     $viewParams = array('taigachat' => array("messages" => $messages, "sidebar" => false, "editside" => $options->dark_taigachat_editside, "timedisplay" => $options->dark_taigachat_timedisplay, "miniavatar" => $options->dark_taigachat_miniavatar, "lastrefresh" => 0, "numInChat" => $this->getActivityUserCount(), "motd" => $motd, "online" => $onlineUsersTaiga, "route" => $options->dark_taigachat_route, "publichtml" => true, 'canView' => true, 'enabled' => true));
     $dep = new Dark_TaigaChat_Dependencies();
     $dep->preLoadData();
     $viewRenderer = new Dark_TaigaChat_ViewRenderer_JsonInternal($dep, new Zend_Controller_Response_Http(), new Zend_Controller_Request_Http());
     if (!file_exists(XenForo_Helper_File::getExternalDataPath() . '/taigachat')) {
         XenForo_Helper_File::createDirectory(XenForo_Helper_File::getExternalDataPath() . '/taigachat', true);
     }
     $innerContent = $viewRenderer->renderView('Dark_TaigaChat_ViewPublic_TaigaChat_List', $viewParams, 'dark_taigachat_list');
     $filename = XenForo_Helper_File::getExternalDataPath() . '/taigachat/messages.html';
     $yayForNoLocking = mt_rand(0, 10000000);
     if (file_put_contents($filename . ".{$yayForNoLocking}.tmp", $innerContent, LOCK_EX) === false) {
         throw new XenForo_Exception("Failed writing TaigaChat messages to {$filename}.tmp.{$yayForNoLocking}.tmp");
     }
     if (!@rename($filename . ".{$yayForNoLocking}.tmp", $filename)) {
         @unlink($filename . ".{$yayForNoLocking}.tmp");
     }
     XenForo_Helper_File::makeWritableByFtpUser($filename);
     $viewParams['taigachat']['messages'] = $messagesMini;
     $viewParams['taigachat']['sidebar'] = true;
     //$viewParams['taigachat']['online'] = null;
     $innerContent = $viewRenderer->renderView('Dark_TaigaChat_ViewPublic_TaigaChat_List', $viewParams, 'dark_taigachat_list');
     $filename = XenForo_Helper_File::getExternalDataPath() . '/taigachat/messagesmini.html';
     if (file_put_contents($filename . ".{$yayForNoLocking}.tmp", $innerContent, LOCK_EX) === false) {
         throw new XenForo_Exception("Failed writing TaigaChat messages to {$filename}.{$yayForNoLocking}.tmp");
     }
     // The only reason this could fail is if the file is being hammered, hence no worries ignoring failure
     if (!@rename($filename . ".{$yayForNoLocking}.tmp", $filename)) {
         @unlink($filename . ".{$yayForNoLocking}.tmp");
     }
     XenForo_Helper_File::makeWritableByFtpUser($filename);
     // put timezone back to how it was
     XenForo_Locale::setDefaultTimeZone($oldTimeZone);
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:62,代码来源:TaigaChat.php

示例4: actionIndex

 public function actionIndex()
 {
     $file = XenForo_Helper_File::getExternalDataPath() . '/sitemaps/index.xml';
     if (!file_exists($file)) {
         $this->getModelFromCache('EWRutiles_Sitemap_Model_Sitemap')->buildIndex();
     }
     echo file_get_contents($file);
     exit;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:9,代码来源:Sitemap.php

示例5: getDataPath

 public function getDataPath()
 {
     $options = XenForo_Application::get('options');
     if (!$options->dark_taigachat_externaldata) {
         return XenForo_Helper_File::getExternalDataPath();
     } else {
         return 'data';
     }
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:9,代码来源:TaigaChat.php

示例6: _uninstall_0

 protected function _uninstall_0()
 {
     $targetLoc = glob(XenForo_Helper_File::getExternalDataPath() . "/sitemaps/*.xml*");
     foreach ($targetLoc as $file) {
         unlink($file);
     }
     $targetLoc = XenForo_Helper_File::getExternalDataPath() . "/sitemaps";
     if (is_dir($targetLoc)) {
         rmdir($targetLoc);
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:11,代码来源:Install.php

示例7: buildRSSbyMedia

 public function buildRSSbyMedia($document, $media, $local = false)
 {
     $itm_node = $document->createElement('item');
     $itm_node->appendChild($document->createElement('pubDate', date("r", $media['media_date'])));
     $itm_node->appendChild($document->createElement('title', substr(htmlspecialchars($media['media_title']), 0, 100)));
     $itm_node->appendChild($document->createElement('description', substr(htmlspecialchars(XenForo_Helper_String::bbCodeStrip(str_replace("\n", " ", $media['media_description']))), 0, 2048)));
     $itm_node->appendChild($document->createElement('link', XenForo_Link::buildPublicLink('full:media', $media)));
     $itm_node->appendChild($document->createElement('guid', XenForo_Link::buildPublicLink('full:media', $media)));
     $itm_node->appendChild($document->createElement('comments', XenForo_Link::buildPublicLink('full:media/comments', $media)));
     $itm_node->appendChild($cat_node = $document->createElement('category', htmlspecialchars('+' . $media['category_name'])));
     $cat_node->appendChild($dom_node = $document->createAttribute('domain'));
     $dom_node->appendChild($document->createTextNode(XenForo_Link::buildPublicLink('full:media/category', $media)));
     $itm_node->appendChild($usr_node = $document->createElement('category', htmlspecialchars('+' . $media['username'])));
     $usr_node->appendChild($dom_node = $document->createAttribute('domain'));
     $dom_node->appendChild($document->createTextNode(XenForo_Link::buildPublicLink('full:media/user', $media)));
     if (trim($media['media_keywords'])) {
         foreach (explode(',', $media['media_keywords']) as $tag) {
             $itm_node->appendChild($tag_node = $document->createElement('category', htmlspecialchars(trim($tag))));
             $tag_node->appendChild($dom_node = $document->createAttribute('domain'));
             $dom_node->appendChild($document->createTextNode(XenForo_Link::buildPublicLink('full:media/keyword', array('keyword_text' => trim($tag)))));
         }
     }
     if ($local && $media['service_feed'] == 'null') {
         $itm_node->appendChild($thu_node = $document->createElement('enclosure'));
         $thu_node->appendChild($url_node = $document->createAttribute('url'));
         $url_node->appendChild($document->createTextNode($media['content_loc']));
         $thu_node->appendChild($len_node = $document->createAttribute('length'));
         $len_node->appendChild($document->createTextNode(intval(@filesize(XenForo_Helper_File::getExternalDataPath() . '/local/' . $media['service_value']))));
     } else {
         $itm_node->appendChild($thu_node = $document->createElement('enclosure'));
         $thu_node->appendChild($url_node = $document->createAttribute('url'));
         $url_node->appendChild($document->createTextNode(XenForo_Application::get('options')->boardUrl . '/data/media/' . $media['media_id'] . '.jpg'));
         $thu_node->appendChild($len_node = $document->createAttribute('length'));
         $len_node->appendChild($document->createTextNode(intval(@filesize(XenForo_Helper_File::getExternalDataPath() . '/media/' . $media['thumbnail']))));
         $thu_node->appendChild($typ_node = $document->createAttribute('type'));
         $typ_node->appendChild($document->createTextNode('image/jpeg'));
     }
     $itm_node->appendChild($document->createElement('dc:creator', htmlspecialchars($media['username'])));
     return $itm_node;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:40,代码来源:Sitemaps.php

示例8: getRequirementErrors

 public function getRequirementErrors(Zend_Db_Adapter_Abstract $db = null)
 {
     $errors = array();
     $phpVersion = phpversion();
     if (version_compare($phpVersion, '5.2.11', '<')) {
         $errors['phpVersion'] = new XenForo_Phrase('php_version_x_does_not_meet_requirements', array('version' => $phpVersion));
     }
     $safeModeIni = @ini_get('safe_mode');
     if (is_bool($safeModeIni) || intval($safeModeIni)) {
         $isSafeMode = (bool) $safeModeIni;
     } else {
         $isSafeMode = in_array(strtolower($safeModeIni), array('on', 'yes', 'true'));
     }
     if ($isSafeMode) {
         $errors['safe_mode'] = new XenForo_Phrase('php_must_not_be_in_safe_mode');
     }
     if (!function_exists('mysqli_connect')) {
         $errors['mysqlPhp'] = new XenForo_Phrase('required_php_extension_x_not_found', array('extension' => 'MySQLi'));
     }
     if (!function_exists('gd_info')) {
         $errors['gd'] = new XenForo_Phrase('required_php_extension_x_not_found', array('extension' => 'GD'));
     } else {
         if (!function_exists('imagecreatefromjpeg')) {
             $errors['gdJpeg'] = new XenForo_Phrase('gd_jpeg_support_missing');
         }
     }
     if (!function_exists('iconv')) {
         $errors['iconv'] = new XenForo_Phrase('required_php_extension_x_not_found', array('extension' => 'Iconv'));
     }
     if (!function_exists('ctype_alnum')) {
         $errors['ctype'] = new XenForo_Phrase('required_php_extension_x_not_found', array('extension' => 'Ctype'));
     }
     if (!function_exists('preg_replace')) {
         $errors['pcre'] = new XenForo_Phrase('required_php_extension_x_not_found', array('extension' => 'PCRE'));
     } else {
         try {
             preg_match('/./u', 'x');
         } catch (Exception $e) {
             $errors['pcre'] = new XenForo_Phrase('pcre_unicode_support_missing');
         }
     }
     if (!function_exists('spl_autoload_register')) {
         $errors['spl'] = new XenForo_Phrase('required_php_extension_x_not_found', array('extension' => 'SPL'));
     }
     if (!function_exists('json_encode')) {
         $errors['json'] = new XenForo_Phrase('required_php_extension_x_not_found', array('extension' => 'JSON'));
     }
     if (!class_exists('DOMDocument') || !class_exists('SimpleXMLElement')) {
         $errors['xml'] = new XenForo_Phrase('required_php_xml_extensions_not_found');
     }
     if ($db) {
         $mySqlVersion = $db->getServerVersion();
         if ($mySqlVersion && intval($mySqlVersion) < 5) {
             $errors['mysqlVersion'] = new XenForo_Phrase('mysql_version_x_does_not_meet_requirements', array('version' => $mySqlVersion));
         }
     }
     $dataDir = XenForo_Helper_File::getExternalDataPath();
     if (!is_dir($dataDir) || !is_writable($dataDir)) {
         $errors['dataDir'] = new XenForo_Phrase('directory_x_must_be_writable', array('directory' => $dataDir));
     } else {
         foreach (scandir($dataDir) as $file) {
             if ($file[0] == '.') {
                 continue;
             }
             $fullPath = "{$dataDir}/{$file}";
             if (is_dir($fullPath) && !is_writable($fullPath)) {
                 $errors['dataDir'] = new XenForo_Phrase('all_directories_under_x_must_be_writable', array('directory' => $dataDir));
             }
         }
     }
     $internalDataDir = XenForo_Helper_File::getInternalDataPath();
     if (!is_dir($internalDataDir) || !is_writable($internalDataDir)) {
         $errors['internalDataDir'] = new XenForo_Phrase('directory_x_must_be_writable', array('directory' => $internalDataDir));
     } else {
         foreach (scandir($internalDataDir) as $file) {
             if ($file[0] == '.') {
                 continue;
             }
             $fullPath = "{$internalDataDir}/{$file}";
             if (is_dir($fullPath) && !is_writable($fullPath)) {
                 $errors['internalDataDir'] = new XenForo_Phrase('all_directories_under_x_must_be_writable', array('directory' => $internalDataDir));
             }
         }
     }
     return $errors;
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:86,代码来源:Install.php

示例9: getImageFilePath

 /**
  * Get the file path to an image.
  *
  * @param integer $contentId
  * @param string $size Size code
  *
  * @return string
  */
 public function getImageFilePath($contentId, $size)
 {
     return sprintf('%s/threads/%s/%d/%s.jpg', XenForo_Helper_File::getExternalDataPath(), $size, floor($contentId / 100), $contentId);
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:12,代码来源:Image.php

示例10: actionUpdate

    public function actionUpdate()
    {
        //########################################
        // Update each attachment because
        // the pixel width is over maxWidth
        // setting in options.
        //########################################
        // get user group permissions
        if (!XenForo_Visitor::getInstance()->hasPermission('imageResizerGroupID', 'imageResizerID')) {
            throw $this->getNoPermissionResponseException();
        }
        // get options from Admin CP -> Options -> Image Resizer -> Default Image Processor
        $imPecl = XenForo_Application::get('options')->imageLibrary['class'];
        // check option
        if ($imPecl != 'imPecl') {
            return $this->responseError(new XenForo_Phrase('imageresizer_imagemagick_with_pecl_required'));
        }
        // get options from Admin CP -> Options -> Image Resizer -> Maximum Width
        $maximumWidth = XenForo_Application::get('options')->imageResizerMaximumWidth;
        // check option
        if ($maximumWidth == 0) {
            return $this->responseError(new XenForo_Phrase('imageresizer_maximum_width_in_options_not_set'));
        }
        // get options from Admin CP -> Options -> Image Resizer -> Maximum Height
        $maximumHeight = XenForo_Application::get('options')->imageResizerMaximumHeight;
        // check option
        if ($maximumHeight == 0) {
            return $this->responseError(new XenForo_Phrase('imageresizer_maximum_height_in_options_not_set'));
        }
        // get limit
        $limit = $this->_input->filterSingle('limit', XenForo_Input::UINT);
        // verify limit set
        if ($limit == '') {
            return $this->responseError(new XenForo_Phrase('imageresizer_limit_switch_missing_in_url'));
        }
        //########################################
        // start update process
        //########################################
        // get internalDataPath
        $internalDataPath = XenForo_Helper_File::getInternalDataPath();
        // get data path
        $externalDataPath = XenForo_Helper_File::getExternalDataPath();
        // get database
        $db = XenForo_Application::get('db');
        // run query
        $attachments = $db->fetchAll("\n\t\tSELECT xf_attachment_data.*, xf_attachment.*, xf_user.username\n\t\tFROM xf_attachment_data\n\t\tINNER JOIN xf_attachment ON xf_attachment.data_id = xf_attachment_data.data_id\n\t\tINNER JOIN xf_user ON xf_user.user_id = xf_attachment_data.user_id\n\t\tWHERE xf_attachment.unassociated = 0\n\t\tAND xf_attachment.content_type = 'post'\n\t\tAND\t(xf_attachment_data.width > " . $maximumWidth . "\n\t\tOR xf_attachment_data.height > " . $maximumHeight . ")\n\t\tORDER BY xf_attachment_data.width DESC, xf_attachment_data.data_id DESC\n\t\tLIMIT " . $limit . "\n\t\t");
        foreach ($attachments as $k => $v) {
            // clear variable
            $skip = '';
            //#####################################
            // define last folder name
            // 0-999 are stored in the 0 directory
            // 1000-1999 stored in the 1 directory etc
            //#####################################
            $dataId = $v['data_id'];
            $fileHash = $v['file_hash'];
            $lastFolder = floor($dataId / 1000);
            //#####################################
            // define attachment full path
            //#####################################
            // attachment path
            $attachmentFullPath = $internalDataPath . '/attachments/' . $lastFolder . '/' . $dataId . '-' . $fileHash . '.data';
            // throw error if file missing
            if (!file_exists($attachmentFullPath)) {
                throw new XenForo_Exception(new XenForo_Phrase('imageresizer_attachment_missing_from_file_directory') . ' ' . $attachmentFullPath, true);
            }
            //#####################################
            // get file information
            //#####################################
            // get size
            $filesize = filesize($attachmentFullPath);
            // get dimensions
            list($width, $height) = getimagesize($attachmentFullPath);
            //#####################################
            // If file information is different
            // than information in database, update
            // database first.
            //#####################################
            // verify database information is correct
            if ($filesize != $v['file_size'] or $width != $v['width'] or $height != $v['height']) {
                // run query
                $db->query('
				UPDATE xf_attachment_data SET
					file_size = "' . $filesize . '",
					width = "' . $width . '",
					height = "' . $height . '"
				WHERE data_id = ?
				', $dataId);
                // skip resize
                $skip = 'yes';
            }
            // resize if required
            if ($skip != 'yes') {
                //#####################################
                // Database information is correct,
                // resize image.
                //#####################################
                // get options from Admin CP -> Options -> Image Resizer -> Maximum Width
                $maximumWidth = XenForo_Application::get('options')->imageResizerMaximumWidth;
                // get options from Admin CP -> Options -> Image Resizer -> Maximum Height
//.........这里部分代码省略.........
开发者ID:Sywooch,项目名称:forums,代码行数:101,代码来源:ImageResizer.php

示例11: getContentDataLargeThumbnailFile

 public function getContentDataLargeThumbnailFile(array $data, $forceLocal = false, $externalDataPath = null)
 {
     if (empty($data['content_type'])) {
         return null;
     }
     if (!empty($data['bdattachmentstore_engine']) && $forceLocal === false) {
         $fileModel = $this->_bdAttachmentStore_getFileModel();
         $engine = $data['bdattachmentstore_engine'];
         $engineOptions = @unserialize($data['bdattachmentstore_options']);
         $filePath = $this->getStoreContentDataLargeThumbnailFile($data);
         $file = $fileModel->getAccessibleFilePath($engine, $engineOptions, $filePath, true);
         if (is_file($file)) {
             return $file;
         }
     }
     if ($externalDataPath === null) {
         $externalDataPath = XenForo_Helper_File::getExternalDataPath();
     }
     if (!empty($data['content_type']) && $data['content_type'] === sonnb_XenGallery_Model_Video::$contentType) {
         $data['extension'] = self::$videoEmbedExtension;
     }
     return sprintf('%s/' . $data['content_type'] . 's/l/%d/%d-%d-%s.%s', $externalDataPath, floor($data['content_data_id'] / 1000), $data['content_data_id'], $data['upload_date'], md5('l' . $data['file_hash']), $data['extension']);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:23,代码来源:ContentData.php

示例12: _importMedia

    protected function _importMedia(array $item, array $options, $video = false)
    {
        $sDb = $this->_sourceDb;
        $user = $sDb->fetchRow('
			SELECT user_id, username
			FROM xf_user
			WHERE user_id = ?
		', $item['user_id']);
        if (!$user) {
            return false;
        }
        if (!$video) {
            $originalFilePath = sprintf('%s/photos/o/%d/%d-%d-%s.%s', XenForo_Helper_File::getExternalDataPath(), floor($item['content_data_id'] / 1000), $item['content_data_id'], $item['upload_date'], md5('o' . $item['file_hash']), $item['extension']);
            if (!file_exists($originalFilePath)) {
                return false;
            }
            $tempFile = tempnam(XenForo_Helper_File::getTempDir(), 'xfmg');
            copy($originalFilePath, $tempFile);
        } else {
            $tempFile = false;
        }
        $model = $this->_getMediaGalleryImportersModel();
        $albumId = $model->mapAlbumId($item['album_id']);
        list($viewPrivacy, $shareUsers) = $model->getAlbumPrivacyAndShareUsersFromAlbumPrivacyXenGallery($item);
        $lastCommentId = @explode(',', $item['latest_comment_ids']);
        if (is_array($lastCommentId)) {
            $lastCommentId = end($lastCommentId);
        } elseif (is_int($item['latest_comment_ids'])) {
            $lastCommentId = $item['latest_comment_ids'];
        }
        if ($lastCommentId) {
            $lastCommentDate = $model->getLastCommentDateFromContentXenGallery($item['content_id'], $item['content_type']);
        } else {
            $lastCommentDate = 0;
        }
        $noTitle = new XenForo_Phrase('xengallery_imported_item');
        $xengalleryMedia = array('media_title' => $item['title'] ? $item['title'] : $noTitle->render(), 'media_description' => $item['description'], 'media_date' => $item['upload_date'], 'last_edit_date' => XenForo_Application::$time, 'last_comment_date' => $lastCommentDate, 'media_type' => $item['content_type'] == 'photo' ? 'image_upload' : 'video_embed', 'media_state' => $item['content_state'], 'album_id' => $albumId, 'category_id' => 0, 'media_privacy' => $viewPrivacy, 'attachment_id' => 0, 'user_id' => $item['user_id'], 'username' => $item['username'], 'ip_id' => $model->getLatestIpIdFromUserId($item['user_id']), 'likes' => $item['likes'], 'like_users' => unserialize($item['like_users']), 'comment_count' => $item['comment_count'], 'rating_count' => 0, 'media_view_count' => $item['view_count']);
        if ($video) {
            $xengalleryMedia['media_tag'] = '[media=' . $item['video_type'] . ']' . $item['video_key'] . '[/media]';
            $xengalleryMedia['media_embed_url'] = 'n/a';
            $xfAttachment = array();
            $xfAttachmentData = array();
        } else {
            $xfAttachment = array('data_id' => 0, 'content_type' => 'xengallery_media', 'content_id' => 0, 'attach_date' => $item['upload_date'], 'temp_hash' => '', 'unassociated' => 0, 'view_count' => $item['view_count']);
            $xfAttachmentData = array('user_id' => $item['user_id'], 'upload_date' => $item['upload_date'], 'filename' => sprintf('%d-%d-%s.%s', $item['content_data_id'], $item['upload_date'], md5('o' . $item['file_hash']), $item['extension']), 'attach_count' => 1);
        }
        $importedMediaId = $model->importMedia($item['content_id'], $tempFile, 'sonnb_xengallery_' . $item['content_type'], $xengalleryMedia, $xfAttachment, $xfAttachmentData);
        @unlink($tempFile);
        return $importedMediaId;
    }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:50,代码来源:SonnbXenGallery.php

示例13: getAuthorCoverFile

 public function getAuthorCoverFile(array $user, $forceLocal = false, $externalDataPath = null)
 {
     $coverData = $user['sonnb_xengallery_cover'];
     if (!is_array($coverData)) {
         $coverData = @unserialize($coverData);
     }
     if (empty($coverData)) {
         return '';
     }
     if (!empty($coverData['bdattachmentstore_engine']) && $forceLocal === false) {
         $fileModel = $this->_bdAttachmentStore_getFileModel();
         $engine = $coverData['bdattachmentstore_engine'];
         $engineOptions = $coverData['bdattachmentstore_options'];
         $filePath = $this->getAuthorCoverStoreFile($user);
         $file = $fileModel->getAccessibleFilePath($engine, $engineOptions, $filePath, true);
         if ($file) {
             return $file;
         }
     }
     if ($externalDataPath === null) {
         $externalDataPath = XenForo_Helper_File::getExternalDataPath();
     }
     return sprintf('%s/xengallery-covers/%d/%d-%d.%s', $externalDataPath, floor($user['user_id'] / 1000), $user['user_id'], $coverData['upload_date'], $coverData['extension']);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:24,代码来源:Gallery.php

示例14: saveFile

 public function saveFile($document, $type, $loops)
 {
     if (XenForo_Application::get('options')->EWRutiles_Sitemap_gzip) {
         $path = XenForo_Helper_File::getExternalDataPath() . '/sitemaps/' . $type . '_' . $loops . '.xml.gz';
         $file = gzopen($path, 'w');
         gzwrite($file, $document->saveXML());
         fclose($file);
         return XenForo_Application::get('options')->boardUrl . '/data/sitemaps/' . $type . '_' . $loops . '.xml.gz';
     } else {
         $path = XenForo_Helper_File::getExternalDataPath() . '/sitemaps/' . $type . '_' . $loops . '.xml';
         $file = fopen($path, 'w');
         fwrite($file, $document->saveXML());
         fclose($file);
         return XenForo_Application::get('options')->boardUrl . '/data/sitemaps/' . $type . '_' . $loops . '.xml';
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:16,代码来源:Sitemap.php

示例15: getAvatarFilePath

 public function getAvatarFilePath($teamId, $externalDataPath = null)
 {
     if ($externalDataPath === null) {
         $externalDataPath = XenForo_Helper_File::getExternalDataPath();
     }
     return sprintf('%s/nobita/teams/avatars/%d/%d.jpg', $externalDataPath, floor($teamId / 1000), $teamId);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:7,代码来源:Avatar.php


注:本文中的XenForo_Helper_File::getExternalDataPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。