當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Gdn_Upload::url方法代碼示例

本文整理匯總了PHP中Gdn_Upload::url方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gdn_Upload::url方法的具體用法?PHP Gdn_Upload::url怎麽用?PHP Gdn_Upload::url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Gdn_Upload的用法示例。


在下文中一共展示了Gdn_Upload::url方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: doAttachment

 /**
  * Perform formatting against a string for the attach tag.
  *
  * @param Nbbc $bbcode Instance of Nbbc doing the parsing.
  * @param int $action Value of one of NBBC's defined constants.  Typically, this will be BBCODE_CHECK.
  * @param string $name Name of the tag.
  * @param string $default Value of the _default parameter, from the $params array.
  * @param array $params A standard set parameters related to the tag.
  * @param string $content Value between the open and close tags, if any.
  * @return string Formatted value.
  */
 public function doAttachment($bbcode, $action, $name, $default, $params, $content)
 {
     $medias = $this->media();
     $mediaID = $content;
     if (isset($medias[$mediaID])) {
         $media = $medias[$mediaID];
         $src = htmlspecialchars(Gdn_Upload::url(val('Path', $media)));
         $name = htmlspecialchars(val('Name', $media));
         if (val('ImageWidth', $media)) {
             return "<div class=\"Attachment Image\"><img src=\"{$src}\" alt=\"{$name}\" /></div>";
         } else {
             return anchor($name, $src, 'Attachment File');
         }
     }
     return anchor(t('Attachment not found.'), '#', 'Attachment NotFound');
 }
開發者ID:vanilla,項目名稱:vanilla,代碼行數:27,代碼來源:class.bbcode.php

示例2: index

 /**
  *
  *
  * @param string $ID
  * @param string $ServeFile
  */
 public function index($ID = '', $ServeFile = '0')
 {
     $this->addJsFile('jquery.js');
     // Define the item being downloaded
     if (strtolower($ID) == 'vanilla') {
         $ID = 'vanilla-core';
     }
     $UrlFilename = Gdn::request()->filename();
     $PathInfo = pathinfo($UrlFilename);
     $Ext = val('extension', $PathInfo);
     if ($Ext == 'zip') {
         $ServeFile = '1';
         $ID = $Ext = val('filename', $PathInfo);
     }
     // Find the requested addon
     $this->Addon = $this->AddonModel->getSlug($ID, true);
     $this->setData('Addon', $this->Addon);
     if (!is_array($this->Addon) || !val('File', $this->Addon)) {
         $this->Addon = array('Name' => 'Not Found', 'Version' => 'undefined', 'File' => '');
     } else {
         $AddonID = $this->Addon['AddonID'];
         if ($ServeFile != '1') {
             $this->addJsFile('get.js');
         }
         if ($ServeFile == '1') {
             // Record this download
             $this->Database->sql()->insert('Download', array('AddonID' => $AddonID, 'DateInserted' => Gdn_Format::toDateTime(), 'RemoteIp' => @$_SERVER['REMOTE_ADDR']));
             $this->AddonModel->setProperty($AddonID, 'CountDownloads', $this->Addon['CountDownloads'] + 1);
             if (val('Slug', $this->Addon)) {
                 $Filename = $this->Addon['Slug'];
             } else {
                 $Filename = "{$this->Addon['Name']}-{$this->Addon['Version']}";
             }
             $Filename = Gdn_Format::url($Filename) . '.zip';
             $File = $this->Addon['File'];
             $Url = Gdn_Upload::url($File);
             Gdn_FileSystem::serveFile($Url, $Filename);
         }
     }
     $this->addModule('AddonHelpModule');
     $this->render();
 }
開發者ID:vanilla,項目名稱:community,代碼行數:48,代碼來源:class.getcontroller.php

示例3: writeAddon

/**
 *
 *
 * @param $Addon
 * @param $Alt
 */
function writeAddon($Addon, $Alt)
{
    $Url = '/addon/' . AddonModel::slug($Addon, FALSE);
    ?>
    <li class="Item AddonRow<?php 
    echo $Alt;
    ?>
">
        <?php 
    if ($Addon->Icon != '') {
        echo '<a class="Icon" href="' . url($Url) . '"><div class="IconWrap"><img src="' . Gdn_Upload::url($Addon->Icon) . '" /></div></a>';
    }
    ?>
        <div class="ItemContent">
            <?php 
    echo anchor(htmlspecialchars($Addon->Name), $Url, 'Title');
    echo '<div class="Description">', anchor(htmlspecialchars(sliceString(Gdn_Format::text($Addon->Description), 300)), $Url), '</div>';
    ?>
            <div class="Meta">
                <span class="TypeTag"><?php 
    echo $Addon->Type;
    ?>
</span>
                <?php 
    if ($Addon->Type === 'Locale') {
        ?>
                    <?php 
        if (!is_null($Addon->EnName)) {
            ?>
                <span class="EnName">
                    Name (en)
                    <span><?php 
            echo htmlspecialchars($Addon->EnName);
            ?>
</span>
                </span>
                    <?php 
        }
        ?>
                    <?php 
        if (!is_null($Addon->PercentComplete)) {
            ?>
                <span class="PercentComplete">
                    Translated
                    <span><?php 
            echo (int) $Addon->PercentComplete . '%';
            ?>
</span>
                </span>
                    <?php 
        }
        ?>
                <?php 
    } else {
        ?>
                <span class="Version">
                    Version
                    <span><?php 
        echo htmlspecialchars($Addon->Version);
        ?>
</span>
                </span>
                <?php 
    }
    ?>
                <span class="Author">
                    Author
                    <span><?php 
    echo val('Official', $Addon) ? t('Vanilla Staff') : htmlspecialchars($Addon->InsertName);
    ?>
</span>
                </span>
                <span class="Downloads">
                    Downloads
                    <span><?php 
    echo number_format($Addon->CountDownloads);
    ?>
</span>
                </span>
                <span class="Updated">
                    Updated
                    <span><?php 
    echo Gdn_Format::date($Addon->DateUpdated, 'html');
    ?>
</span>
                </span>
            </div>
        </div>
    </li>
<?php 
}
開發者ID:vanilla,項目名稱:community,代碼行數:97,代碼來源:helper_functions.php

示例4: userPhotoUrl

 /**
  * Take a user object an return the URL to their photo.
  *
  * @param object|array $User
  */
 function userPhotoUrl($User)
 {
     $FullUser = Gdn::userModel()->getID(val('UserID', $User), DATASET_TYPE_ARRAY);
     $Photo = val('Photo', $User);
     if ($FullUser && $FullUser['Banned']) {
         $Photo = 'https://c3409409.ssl.cf0.rackcdn.com/images/banned_100.png';
     }
     if ($Photo) {
         if (!isUrl($Photo)) {
             $PhotoUrl = Gdn_Upload::url(changeBasename($Photo, 'n%s'));
         } else {
             $PhotoUrl = $Photo;
         }
         return $PhotoUrl;
     }
     return UserModel::getDefaultAvatarUrl($User);
 }
開發者ID:mcnasby,項目名稱:datto-vanilla,代碼行數:22,代碼來源:functions.render.php

示例5: mobileLogo

 /**
  * Returns the mobile banner logo. If there is no mobile logo defined then this will just return
  * the regular logo or the mobile title.
  *
  * @return string
  */
 public static function mobileLogo()
 {
     $Logo = C('Garden.MobileLogo', C('Garden.Logo'));
     $Title = C('Garden.MobileTitle', C('Garden.Title', 'Title'));
     if ($Logo) {
         return Img(Gdn_Upload::url($Logo), array('alt' => $Title));
     } else {
         return $Title;
     }
 }
開發者ID:mcnasby,項目名稱:datto-vanilla,代碼行數:16,代碼來源:class.theme.php

示例6: renderMaster

 /**
  *
  */
 public function renderMaster()
 {
     // Build the master view if necessary
     if (in_array($this->_DeliveryType, array(DELIVERY_TYPE_ALL))) {
         $this->MasterView = $this->masterView();
         // Only get css & ui components if this is NOT a syndication request
         if ($this->SyndicationMethod == SYNDICATION_NONE && is_object($this->Head)) {
             $CssAnchors = AssetModel::getAnchors();
             $this->EventArguments['CssFiles'] =& $this->_CssFiles;
             $this->fireEvent('BeforeAddCss');
             $ETag = AssetModel::eTag();
             $CombineAssets = c('Garden.CombineAssets');
             $ThemeType = isMobile() ? 'mobile' : 'desktop';
             // And now search for/add all css files.
             foreach ($this->_CssFiles as $CssInfo) {
                 $CssFile = $CssInfo['FileName'];
                 if (!array_key_exists('Options', $CssInfo) || !is_array($CssInfo['Options'])) {
                     $CssInfo['Options'] = array();
                 }
                 $Options =& $CssInfo['Options'];
                 // style.css and admin.css deserve some custom processing.
                 if (in_array($CssFile, $CssAnchors)) {
                     if (!$CombineAssets) {
                         // Grab all of the css files from the asset model.
                         $AssetModel = new AssetModel();
                         $CssFiles = $AssetModel->getCssFiles($ThemeType, ucfirst(substr($CssFile, 0, -4)), $ETag);
                         foreach ($CssFiles as $Info) {
                             $this->Head->addCss($Info[1], 'all', true, $CssInfo);
                         }
                     } else {
                         $Basename = substr($CssFile, 0, -4);
                         $this->Head->addCss(url("/asset/css/{$ThemeType}/{$Basename}-{$ETag}.css", '//'), 'all', false, $CssInfo['Options']);
                     }
                     continue;
                 }
                 $AppFolder = $CssInfo['AppFolder'];
                 $LookupFolder = !empty($AppFolder) ? $AppFolder : $this->ApplicationFolder;
                 $Search = AssetModel::CssPath($CssFile, $LookupFolder, $ThemeType);
                 if (!$Search) {
                     continue;
                 }
                 list($Path, $UrlPath) = $Search;
                 if (isUrl($Path)) {
                     $this->Head->AddCss($Path, 'all', val('AddVersion', $Options, true), $Options);
                     continue;
                 } else {
                     // Check to see if there is a CSS cacher.
                     $CssCacher = Gdn::factory('CssCacher');
                     if (!is_null($CssCacher)) {
                         $Path = $CssCacher->get($Path, $AppFolder);
                     }
                     if ($Path !== false) {
                         $Path = substr($Path, strlen(PATH_ROOT));
                         $Path = str_replace(DS, '/', $Path);
                         $this->Head->addCss($Path, 'all', true, $Options);
                     }
                 }
             }
             // Add a custom js file.
             if (arrayHasValue($this->_CssFiles, 'style.css')) {
                 $this->addJsFile('custom.js');
                 // only to non-admin pages.
             }
             $Cdns = array();
             if (!c('Garden.Cdns.Disable', false)) {
                 $Cdns = array('jquery.js' => "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js");
             }
             // And now search for/add all JS files.
             $this->EventArguments['Cdns'] =& $Cdns;
             $this->fireEvent('AfterJsCdns');
             $this->Head->addScript('', 'text/javascript', false, array('content' => $this->definitionList(false)));
             foreach ($this->_JsFiles as $Index => $JsInfo) {
                 $JsFile = $JsInfo['FileName'];
                 if (!is_array($JsInfo['Options'])) {
                     $JsInfo['Options'] = array();
                 }
                 $Options =& $JsInfo['Options'];
                 if (isset($Cdns[$JsFile])) {
                     $JsFile = $Cdns[$JsFile];
                 }
                 $AppFolder = $JsInfo['AppFolder'];
                 $LookupFolder = !empty($AppFolder) ? $AppFolder : $this->ApplicationFolder;
                 $Search = AssetModel::JsPath($JsFile, $LookupFolder, $ThemeType);
                 if (!$Search) {
                     continue;
                 }
                 list($Path, $UrlPath) = $Search;
                 if ($Path !== false) {
                     $AddVersion = true;
                     if (!isUrl($Path)) {
                         $Path = substr($Path, strlen(PATH_ROOT));
                         $Path = str_replace(DS, '/', $Path);
                         $AddVersion = val('AddVersion', $Options, true);
                     }
                     $this->Head->addScript($Path, 'text/javascript', $AddVersion, $Options);
                     continue;
                 }
//.........這裏部分代碼省略.........
開發者ID:battaglia01,項目名稱:vanilla,代碼行數:101,代碼來源:class.controller.php

示例7: setCalculatedFields

 /**
  * Set fields that need additional manipulation after retrieval.
  *
  * @param $User
  * @throws Exception
  */
 public function setCalculatedFields(&$User)
 {
     if ($v = val('Attributes', $User)) {
         if (is_string($v)) {
             setValue('Attributes', $User, @unserialize($v));
         }
     }
     if ($v = val('Permissions', $User)) {
         if (is_string($v)) {
             setValue('Permissions', $User, @unserialize($v));
         }
     }
     if ($v = val('Preferences', $User)) {
         if (is_string($v)) {
             setValue('Preferences', $User, @unserialize($v));
         }
     }
     if ($v = val('Photo', $User)) {
         if (!isUrl($v)) {
             $PhotoUrl = Gdn_Upload::url(changeBasename($v, 'n%s'));
         } else {
             $PhotoUrl = $v;
         }
         setValue('PhotoUrl', $User, $PhotoUrl);
     }
     if ($v = val('AllIPAddresses', $User)) {
         if (is_string($v)) {
             $IPAddresses = explode(',', $v);
             foreach ($IPAddresses as $i => $IPAddress) {
                 $IPAddresses[$i] = ForceIPv4($IPAddress);
             }
             setValue('AllIPAddresses', $User, $IPAddresses);
         }
     }
     setValue('_CssClass', $User, '');
     if ($v = val('Banned', $User)) {
         setValue('_CssClass', $User, 'Banned');
     }
     $this->EventArguments['User'] =& $User;
     $this->fireEvent('SetCalculatedFields');
 }
開發者ID:RodSloan,項目名稱:vanilla,代碼行數:47,代碼來源:class.usermodel.php

示例8: array

        <?php 
echo $this->Form->label('Description', 'Description');
echo $this->Form->textBox('Description', array('MultiLine' => TRUE));
?>
    </li>
    <li>
        <?php 
echo $this->Form->label('Css Class', 'CssClass');
echo $this->Form->textBox('CssClass', array('MultiLine' => FALSE));
?>
    </li>
    <li>
        <?php 
echo $this->Form->label('Photo', 'PhotoUpload');
if ($Photo = $this->Form->getValue('Photo')) {
    echo img(Gdn_Upload::url($Photo));
    echo '<br />' . anchor(t('Delete Photo'), CombinePaths(array('vanilla/settings/deletecategoryphoto', $this->Category->CategoryID, Gdn::session()->TransientKey())), 'SmallButton Danger PopConfirm');
}
echo $this->Form->Input('PhotoUpload', 'file');
?>
    </li>
    <?php 
echo $this->Form->Simple($this->data('_ExtendedFields', array()), array('Wrap' => array('', '')));
?>
    <li>
        <?php 
echo $this->Form->label('Display As', 'DisplayAs');
echo $this->Form->DropDown('DisplayAs', array('Default' => 'Default', 'Categories' => 'Categories', 'Discussions' => 'Discussions', 'Heading' => 'Heading'));
?>
    </li>
    <li>
開發者ID:caidongyun,項目名稱:vanilla,代碼行數:31,代碼來源:editcategory.php

示例9: img

// Define the current profile picture
$Picture = '';
if ($this->User->Photo != '') {
    if (IsUrl($this->User->Photo)) {
        $Picture = img($this->User->Photo, array('class' => 'ProfilePhotoLarge'));
    } else {
        $Picture = img(Gdn_Upload::url(changeBasename($this->User->Photo, 'p%s')), array('class' => 'ProfilePhotoLarge'));
    }
}
// Define the current thumbnail icon
$Thumbnail = $this->User->Photo;
if (!$Thumbnail && function_exists('UserPhotoDefaultUrl')) {
    $Thumbnail = UserPhotoDefaultUrl($this->User);
}
if ($Thumbnail && !isUrl($Thumbnail)) {
    $Thumbnail = Gdn_Upload::url(changeBasename($Thumbnail, 'n%s'));
}
$Thumbnail = img($Thumbnail, array('alt' => t('Thumbnail')));
?>
<div class="SmallPopup FormTitleWrapper">
    <h1 class="H"><?php 
echo $this->data('Title');
?>
</h1>
    <?php 
echo $this->Form->open(array('enctype' => 'multipart/form-data'));
echo $this->Form->errors();
?>
    <ul>
        <?php 
if ($Picture != '') {
開發者ID:karanjitsingh,項目名稱:iecse-forum,代碼行數:31,代碼來源:picture.php

示例10: setCalculatedFields

 /**
  * Finish setting up data for the retrieved addon(s).
  *
  * @param $Data
  */
 public function setCalculatedFields(&$Data)
 {
     if (!$Data) {
         return;
     }
     if (is_a($Data, 'Gdn_DataSet')) {
         $this->setCalculatedFields($Data->result());
     } elseif (is_object($Data) || isset($Data['Icon'])) {
         $File = val('File', $Data);
         setValue('Url', $Data, Gdn_Upload::url($File));
         $Icon = val('Icon', $Data, null);
         if ($Icon !== null) {
             // Fix the icon path.
             if ($Icon && strpos($Icon, '/') == false) {
                 $Icon = 'ai' . $Icon;
                 setValue('Icon', $Data, $Icon);
             }
             if (empty($Icon)) {
                 setValue('IconUrl', $Data, 'foo');
             } else {
                 setValue('IconUrl', $Data, Gdn_Upload::url($Icon));
             }
         } else {
             // Set a default icon.
             setValue('Icon', $Data, url('/applications/dashboard/design/images/eyes.png', true));
         }
         if (val('AddonKey', $Data) && val('Checked', $Data)) {
             $Slug = strtolower(val('AddonKey', $Data) . '-' . val('Type', $Data) . '-' . val('Version', $Data));
             setValue('Slug', $Data, $Slug);
         }
         // Set the requirements.
         if (val('Checked', $Data)) {
             $Requirements = val('Requirements', $Data);
             try {
                 $Requirements = unserialize($Requirements);
                 if (is_array($Requirements)) {
                     setValue('Requirements', $Data, $Requirements);
                 }
             } catch (Exception $Ex) {
             }
         }
     } elseif (is_array($Data)) {
         foreach ($Data as &$Row) {
             $this->setCalculatedFields($Row);
         }
     }
 }
開發者ID:vanilla,項目名稱:community,代碼行數:52,代碼來源:class.addonmodel.php

示例11: wrap

echo wrap(t('FaviconDescription', "Your site's favicon appears in your browser's title bar. It will be scaled to 16x16 pixels."), 'div', array('class' => 'Info'));
$Favicon = $this->data('Favicon');
if ($Favicon) {
    echo wrap(img(Gdn_Upload::url($Favicon)), 'div');
    echo wrap(Anchor(t('Remove Favicon'), '/dashboard/settings/removefavicon/' . $Session->TransientKey(), 'SmallButton'), 'div', array('style' => 'padding: 10px 0;'));
    echo wrap(t('FaviconBrowse', 'Browse for a new favicon if you would like to change it:'), 'div', array('class' => 'Info'));
} else {
    echo wrap(t('FaviconDescription', "The shortcut icon that shows up in your browser's bookmark menu (16x16 px)."), 'div', array('class' => 'Info'));
}
echo $this->Form->Input('Favicon', 'file');
?>
                </li>
                <li>
                    <?php 
echo $this->Form->label('Share Image', 'ShareImage');
echo wrap(t('ShareImageDescription', "When someone shares a link from your site we try and grab an image from the page. If there isn't an image on the page then we'll use this image instead. The image should be at least 50&times;50, but we recommend 200&times;200."), 'div', array('class' => 'Info'));
$ShareImage = $this->data('ShareImage');
if ($ShareImage) {
    echo wrap(img(Gdn_Upload::url($ShareImage), array('style' => 'max-width: 300px')), 'div');
    echo wrap(Anchor(t('Remove Image'), '/dashboard/settings/removeshareimage', 'SmallButton Hijack'), 'div', array('style' => 'padding: 10px 0;'));
    echo wrap(t('FaviconBrowse', 'Browse for a new favicon if you would like to change it:'), 'div', array('class' => 'Info'));
}
echo $this->Form->Input('ShareImage', 'file');
?>
                </li>
            </ul>
        </div>
    </div>
<?php 
echo '<div class="Buttons">' . $this->Form->button('Save') . '</div>';
echo $this->Form->close();
開發者ID:caidongyun,項目名稱:vanilla,代碼行數:31,代碼來源:banner.php

示例12: calculateRow

 /**
  *
  *
  * @param $Row
  */
 public function calculateRow(&$Row)
 {
     $ActivityType = self::GetActivityType($Row['ActivityTypeID']);
     $Row['ActivityType'] = val('Name', $ActivityType);
     if (is_string($Row['Data'])) {
         $Row['Data'] = @unserialize($Row['Data']);
     }
     $Row['PhotoUrl'] = url($Row['Route'], true);
     if (!$Row['Photo']) {
         if (isset($Row['ActivityPhoto'])) {
             $Row['Photo'] = $Row['ActivityPhoto'];
             $Row['PhotoUrl'] = userUrl($Row, 'Activity');
         } else {
             $User = Gdn::userModel()->getID($Row['ActivityUserID'], DATASET_TYPE_ARRAY);
             if ($User) {
                 $Photo = $User['Photo'];
                 $Row['PhotoUrl'] = userUrl($User);
                 if (!$Photo || stringBeginsWith($Photo, 'http')) {
                     $Row['Photo'] = $Photo;
                 } else {
                     $Row['Photo'] = Gdn_Upload::url(changeBasename($Photo, 'n%s'));
                 }
             }
         }
     }
     $Data = $Row['Data'];
     if (isset($Data['ActivityUserIDs'])) {
         $Row['ActivityUserID'] = array_merge(array($Row['ActivityUserID']), $Data['ActivityUserIDs']);
         $Row['ActivityUserID_Count'] = val('ActivityUserID_Count', $Data);
     }
     if (isset($Data['RegardingUserIDs'])) {
         $Row['RegardingUserID'] = array_merge(array($Row['RegardingUserID']), $Data['RegardingUserIDs']);
         $Row['RegardingUserID_Count'] = val('RegardingUserID_Count', $Data);
     }
     $Row['Url'] = ExternalUrl($Row['Route']);
     if ($Row['HeadlineFormat']) {
         $Row['Headline'] = formatString($Row['HeadlineFormat'], $Row);
     } else {
         $Row['Headline'] = Gdn_Format::activityHeadline($Row);
     }
 }
開發者ID:bahill,項目名稱:vanilla,代碼行數:46,代碼來源:class.activitymodel.php

示例13: c

    $BannedPhoto = c('Garden.BannedPhoto', 'http://cdn.vanillaforums.com/images/banned_large.png');
    if ($BannedPhoto) {
        $Photo = Gdn_Upload::url($BannedPhoto);
    }
}
if ($Photo) {
    ?>
    <div class="Photo PhotoWrap PhotoWrapLarge <?php 
    echo val('_CssClass', $User);
    ?>
">
        <?php 
    if (IsUrl($Photo)) {
        $Img = img($Photo, array('class' => 'ProfilePhotoLarge'));
    } else {
        $Img = img(Gdn_Upload::url(changeBasename($Photo, 'p%s')), array('class' => 'ProfilePhotoLarge'));
    }
    if (!$User->Banned && c('Garden.Profile.EditPhotos', true) && (Gdn::session()->UserID == $User->UserID || Gdn::session()->checkPermission('Garden.Users.Edit'))) {
        echo anchor(Wrap(t('Change Picture')), '/profile/picture?userid=' . $User->UserID, 'ChangePicture');
    }
    echo $Img;
    ?>
    </div>
<?php 
} else {
    if ($User->UserID == Gdn::session()->UserID || Gdn::session()->checkPermission('Garden.Users.Edit')) {
        ?>
    <div
        class="Photo"><?php 
        echo anchor(t('Add a Profile Picture'), '/profile/picture?userid=' . $User->UserID, 'AddPicture BigButton');
        ?>
開發者ID:karanjitsingh,項目名稱:iecse-forum,代碼行數:31,代碼來源:userphoto.php

示例14: htmlspecialchars

if (!defined('APPLICATION')) {
    exit;
}
?>
<h1><?php 
if ($this->Addon['File'] == '') {
    echo 'The requested addon could not be found';
} else {
    echo 'Downloading: ' . htmlspecialchars($this->Addon['Name']) . ' version ' . $this->Addon['Version'];
    ?>
</h1>
<div class="Box DownloadInfo">
    <strong>Your download should begin shortly</strong>
    <p>If your download does not begin right away, <a href="<?php 
    echo Gdn_Upload::url($this->Addon['File']);
    ?>
">click here to download now</a>.</p>

    <strong>Need help installing this addon?</strong>
    <p>There should be a readme file in the addon with more specific instructions on how to install it. If you are still having problems, <a href="//vanillaforums.org/discussions">ask for help on the community forums</a>.</p>

    <strong>Note</strong>
    <p>Vanilla Forums Inc cannot be held liable for issues that arise from the download or use of these addons.</p>

    <strong>Now what?</strong>
    <p>Head on back to the <a href="<?php 
    echo url('/addon/' . $this->Addon['AddonID']);
    ?>
"><?php 
    echo $this->Addon['Name'];
開發者ID:vanilla,項目名稱:community,代碼行數:30,代碼來源:index.php

示例15: calculate

 /**
  * Calculate the dynamic fields of a category.
  *
  * @param array &$category The category to calculate.
  */
 private static function calculate(&$category)
 {
     $category['CountAllDiscussions'] = $category['CountDiscussions'];
     $category['CountAllComments'] = $category['CountComments'];
     $category['Url'] = self::categoryUrl($category, false, '/');
     if (val('Photo', $category)) {
         $category['PhotoUrl'] = Gdn_Upload::url($category['Photo']);
     } else {
         $category['PhotoUrl'] = '';
     }
     self::calculateDisplayAs($category);
     if (!val('CssClass', $category)) {
         $category['CssClass'] = 'Category-' . $category['UrlCode'];
     }
     if (isset($category['AllowedDiscussionTypes']) && is_string($category['AllowedDiscussionTypes'])) {
         $category['AllowedDiscussionTypes'] = dbdecode($category['AllowedDiscussionTypes']);
     }
 }
開發者ID:vanilla,項目名稱:vanilla,代碼行數:23,代碼來源:class.categorymodel.php


注:本文中的Gdn_Upload::url方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。