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


PHP Gdn_Format::Display方法代码示例

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


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

示例1: formatContent

 /**
  * Format the content of a log file.
  *
  * @param $Log
  * @return array|string
  */
 public function formatContent($Log)
 {
     $Data = $Log['Data'];
     // TODO: Check for a custom log type handler.
     switch ($Log['RecordType']) {
         case 'Activity':
             $Result = $this->FormatKey('Story', $Data);
             break;
         case 'Discussion':
             $Result = '<b>' . $this->FormatKey('Name', $Data) . '</b><br />' . $this->FormatKey('Body', $Data);
             break;
         case 'ActivityComment':
         case 'Comment':
             $Result = $this->FormatKey('Body', $Data);
             break;
         case 'Configuration':
             $Result = $this->FormatConfiguration($Data);
             break;
         case 'Registration':
         case 'User':
             $Result = $this->FormatRecord(array('Email', 'Name'), $Data);
             if ($DiscoveryText = val('DiscoveryText', $Data)) {
                 $Result .= '<br /><b>' . t('Why do you want to join?') . '</b><br />' . Gdn_Format::Display($DiscoveryText);
             }
             if (val('Banned', $Data)) {
                 $Result .= "<br />" . t('Banned');
             }
             break;
         default:
             $Result = '';
     }
     return $Result;
 }
开发者ID:sitexa,项目名称:vanilla,代码行数:39,代码来源:class.logmodel.php

示例2: InformNotifications

 /**
  * Grabs all new notifications and adds them to the sender's inform queue.
  *
  * This method gets called by dashboard's hooks file to display new
  * notifications on every pageload. 
  *
  * @since 2.0.18
  * @access public
  *
  * @param Gdn_Controller $Sender The object calling this method.
  */
 public static function InformNotifications($Sender)
 {
     $Session = Gdn::Session();
     if (!$Session->IsValid()) {
         return;
     }
     $ActivityModel = new ActivityModel();
     // Get five pending notifications.
     $Where = array('NotifyUserID' => Gdn::Session()->UserID, 'Notified' => ActivityModel::SENT_PENDING);
     // If we're in the middle of a visit only get very recent notifications.
     $Where['DateUpdated >'] = Gdn_Format::ToDateTime(strtotime('-5 minutes'));
     $Activities = $ActivityModel->GetWhere($Where, 0, 5)->ResultArray();
     $ActivityIDs = ConsolidateArrayValuesByKey($Activities, 'ActivityID');
     $ActivityModel->SetNotified($ActivityIDs);
     foreach ($Activities as $Activity) {
         if ($Activity['Photo']) {
             $UserPhoto = Anchor(Img($Activity['Photo'], array('class' => 'ProfilePhotoMedium')), $Activity['Url'], 'Icon');
         } else {
             $UserPhoto = '';
         }
         $Excerpt = Gdn_Format::Display($Activity['Story']);
         $ActivityClass = ' Activity-' . $Activity['ActivityType'];
         $Sender->InformMessage($UserPhoto . Wrap($Activity['Headline'], 'div', array('class' => 'Title')) . Wrap($Excerpt, 'div', array('class' => 'Excerpt')), 'Dismissable AutoDismiss' . $ActivityClass . ($UserPhoto == '' ? '' : ' HasIcon'));
     }
 }
开发者ID:er0k,项目名称:trickno,代码行数:36,代码来源:class.notificationscontroller.php

示例3: Format

 public function Format($String)
 {
     try {
         $Result = parse_bbc($String);
     } catch (Exception $Ex) {
         $Result = '<!-- Error: ' . htmlspecialchars($Ex->getMessage()) . '-->' . Gdn_Format::Display($String);
     }
     return $Result;
 }
开发者ID:SatiricMan,项目名称:addons,代码行数:9,代码来源:class.smfcompatibility.plugin.php

示例4: WriteActivityComment

function WriteActivityComment($Comment, &$Sender, &$Session)
{
    $Author = UserBuilder($Comment, 'Activity');
    $PhotoAnchor = UserPhoto($Author, 'Photo');
    $CssClass = 'Item ActivityComment Condensed ' . $Comment->ActivityType;
    if ($PhotoAnchor != '') {
        $CssClass .= ' HasPhoto';
    }
    ?>
<li id="Activity_<?php 
    echo $Comment->ActivityID;
    ?>
" class="<?php 
    echo $CssClass;
    ?>
">
   <?php 
    if ($PhotoAnchor != '') {
        ?>
   <div class="Author Photo"><?php 
        echo $PhotoAnchor;
        ?>
</div>
   <?php 
    }
    ?>
   <div class="ItemContent ActivityComment">
      <?php 
    echo UserAnchor($Author, 'Title Name');
    ?>
      <div class="Excerpt"><?php 
    echo Gdn_Format::Display($Comment->Story);
    ?>
</div>
      <div class="Meta">
         <span class="DateCreated"><?php 
    echo Gdn_Format::Date($Comment->DateInserted);
    ?>
</span>
         <?php 
    if ($Session->UserID == $Comment->InsertUserID || $Session->CheckPermission('Garden.Activity.Delete')) {
        echo Anchor(T('Delete'), 'dashboard/activity/delete/' . $Comment->ActivityID . '/' . $Session->TransientKey() . '?Return=' . urlencode(Gdn_Url::Request()), 'DeleteComment');
    }
    ?>
      </div>
   </div>
</li>
<?php 
}
开发者ID:seedbank,项目名称:old-repo,代码行数:49,代码来源:helper_functions.php

示例5: foreach

$Alt = FALSE;
foreach ($this->AvailablePlugins as $PluginName => $PluginInfo) {
    // Skip Hidden & Trigger plugins
    if (isset($PluginInfo['Hidden']) && $PluginInfo['Hidden'] === TRUE) {
        continue;
    }
    if (isset($PluginInfo['Trigger']) && $PluginInfo['Trigger'] == TRUE) {
        // Any 'true' value.
        continue;
    }
    $Css = array_key_exists($PluginName, $this->EnabledPlugins) ? 'Enabled' : 'Disabled';
    $State = strtolower($Css);
    if ($this->Filter == 'all' || $this->Filter == $State) {
        $Alt = $Alt ? FALSE : TRUE;
        $Version = Gdn_Format::Display(val('Version', $PluginInfo, ''));
        $ScreenName = Gdn_Format::Display(val('Name', $PluginInfo, $PluginName));
        $SettingsUrl = $State == 'enabled' ? arrayValue('SettingsUrl', $PluginInfo, '') : '';
        $PluginUrl = arrayValue('PluginUrl', $PluginInfo, '');
        $Author = arrayValue('Author', $PluginInfo, '');
        $AuthorUrl = arrayValue('AuthorUrl', $PluginInfo, '');
        $NewVersion = arrayValue('NewVersion', $PluginInfo, '');
        $Upgrade = $NewVersion != '' && version_compare($NewVersion, $Version, '>');
        $RowClass = $Css;
        if ($Alt) {
            $RowClass .= ' Alt';
        }
        $IconPath = '/plugins/' . GetValue('Folder', $PluginInfo, '') . '/icon.png';
        $IconPath = file_exists(PATH_ROOT . $IconPath) ? $IconPath : 'applications/dashboard/design/images/plugin-icon.png';
        ?>
            <tr <?php 
        echo 'id="' . Gdn_Format::url(strtolower($PluginName)) . '-plugin"', ' class="More ' . $RowClass . '"';
开发者ID:karanjitsingh,项目名称:iecse-forum,代码行数:31,代码来源:plugins.php

示例6: foreach

</th>
      </tr>
   </thead>
   <tbody>
<?php 
$Alt = FALSE;
foreach ($this->AvailablePlugins as $PluginName => $PluginInfo) {
    if (isset($PluginInfo['Hidden']) && $PluginInfo['Hidden'] === TRUE) {
        continue;
    }
    $Css = array_key_exists($PluginName, $this->EnabledPlugins) ? 'Enabled' : 'Disabled';
    $State = strtolower($Css);
    if ($this->Filter == 'all' || $this->Filter == $State) {
        $Alt = $Alt ? FALSE : TRUE;
        $Version = Gdn_Format::Display(GetValue('Version', $PluginInfo, ''));
        $ScreenName = Gdn_Format::Display(GetValue('Name', $PluginInfo, $PluginName));
        $SettingsUrl = $State == 'enabled' ? ArrayValue('SettingsUrl', $PluginInfo, '') : '';
        $PluginUrl = ArrayValue('PluginUrl', $PluginInfo, '');
        $Author = ArrayValue('Author', $PluginInfo, '');
        $AuthorUrl = ArrayValue('AuthorUrl', $PluginInfo, '');
        $NewVersion = ArrayValue('NewVersion', $PluginInfo, '');
        $Upgrade = $NewVersion != '' && version_compare($NewVersion, $Version, '>');
        $RowClass = $Css;
        if ($Alt) {
            $RowClass .= ' Alt';
        }
        $IconPath = '/plugins/' . GetValue('Folder', $PluginInfo, '') . '/icon.png';
        $IconPath = file_exists(PATH_ROOT . $IconPath) ? $IconPath : 'applications/dashboard/design/images/plugin-icon.png';
        ?>
      <tr <?php 
        echo 'id="' . Gdn_Format::Url(strtolower($PluginName)) . '-plugin"', ' class="More ' . $RowClass . '"';
开发者ID:seedbank,项目名称:old-repo,代码行数:31,代码来源:plugins.php

示例7: Markdown

 /**
  * Format a string using Markdown syntax. Also purifies the output html.
  *
  * @param mixed $Mixed An object, array, or string to be formatted.
  * @return string
  */
 public static function Markdown($Mixed)
 {
     if (!is_string($Mixed)) {
         return self::To($Mixed, 'Markdown');
     } else {
         $Formatter = Gdn::Factory('HtmlFormatter');
         if (is_null($Formatter)) {
             return Gdn_Format::Display($Mixed);
         } else {
             require_once PATH_LIBRARY . DS . 'vendors' . DS . 'markdown' . DS . 'markdown.php';
             $Mixed = Markdown($Mixed);
             $Mixed = Gdn_Format::Links($Mixed);
             $Mixed = Gdn_Format::Mentions($Mixed);
             return $Formatter->Format($Mixed);
         }
     }
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:23,代码来源:class.format.php

示例8: foreach

      <?php 
$Data = $this->ActivityData;
foreach ($Data->Result() as $Activity) {
    echo '<li class="Activity ' . $Activity->ActivityType . '">';
    // If this was a status update or a wall comment, don't bother with activity strings
    $ActivityType = explode(' ', $Activity->ActivityType);
    // Make sure you strip out any extra css classes munged in here
    $ActivityType = $ActivityType[0];
    $Author = UserBuilder($Activity, 'Activity');
    if (in_array($ActivityType, array('WallComment', 'AboutUpdate'))) {
        echo UserAnchor($Author, 'Name');
        if ($Activity->ActivityType == 'WallComment' && $Activity->RegardingUserID > 0) {
            $Author = UserBuilder($Activity, 'Regarding');
            echo '<span>&rarr;</span>' . UserAnchor($Author, 'Name');
        }
        echo ' ' . Gdn_Format::Display($Activity->Story) . ' ';
        echo '<em>' . Gdn_Format::Date($Activity->DateInserted) . '</em>';
    } else {
        echo Gdn_Format::ActivityHeadline($Activity);
        echo '<em>' . Gdn_Format::Date($Activity->DateInserted) . '</em>';
        if ($Activity->Story != '') {
            echo '<div class="Story">';
            echo $Activity->Story;
            echo '</div>';
        }
    }
    echo '</li>';
}
?>
      <li class="ShowAll"><?php 
echo Anchor(T('↳ Show All'), 'activity/' . implode(',', $this->_RoleID));
开发者ID:tautomers,项目名称:knoopvszombies,代码行数:31,代码来源:recentactivity.php

示例9: Markdown

 /**
  * Format a string using Markdown syntax. Also purifies the output html.
  *
  * @param mixed $Mixed An object, array, or string to be formatted.
  * @return string
  */
 public static function Markdown($Mixed)
 {
     if (!is_string($Mixed)) {
         return self::To($Mixed, 'Markdown');
     } else {
         $Formatter = Gdn::Factory('HtmlFormatter');
         if (is_null($Formatter)) {
             return Gdn_Format::Display($Mixed);
         } else {
             require_once PATH_LIBRARY . '/vendors/markdown/markdown.php';
             $Mixed = Markdown($Mixed);
             $Mixed = $Formatter->Format($Mixed);
             $Mixed = Gdn_Format::Links($Mixed);
             $Mixed = Gdn_Format::Mentions($Mixed);
             $Mixed = Emoji::instance()->translateToHtml($Mixed);
             return $Mixed;
         }
     }
 }
开发者ID:3marproof,项目名称:vanilla,代码行数:25,代码来源:class.format.php

示例10: htmlspecialchars

<div class="User" itemscope itemtype="http://schema.org/Person">
    <h1 class="H"><?php 
echo htmlspecialchars($this->User->Name);
echo '<span class="Gloss">';
Gdn_Theme::BulletRow();
if ($this->User->Title) {
    echo Gdn_Theme::BulletItem('Title');
    echo ' ' . Bullet() . ' ' . Wrap(htmlspecialchars($this->User->Title), 'span', array('class' => 'User-Title'));
}
$this->fireEvent('UsernameMeta');
echo '</span>';
?>
</h1>
    <?php 
if ($this->User->Admin == 2) {
    echo '<div class="DismissMessage InfoMessage">', t('This is a system account and does not represent a real person.'), '</div>';
}
if ($this->User->About != '') {
    echo '<div id="Status" itemprop="description">' . Wrap(Gdn_Format::Display($this->User->About));
    if ($this->User->About != '' && ($Session->UserID == $this->User->UserID || $Session->checkPermission('Garden.Users.Edit'))) {
        echo ' - ' . anchor(t('clear'), '/profile/clear/' . $this->User->UserID, 'Hijack');
    }
    echo '</div>';
}
echo Gdn_Theme::Module('UserBanModule', array('UserID' => $this->User->UserID));
$this->fireEvent('BeforeUserInfo');
echo Gdn_Theme::Module('UserInfoModule');
$this->fireEvent('AfterUserInfo');
?>
</div>
开发者ID:korelstar,项目名称:vanilla,代码行数:30,代码来源:user.php

示例11: WriteActivity

function WriteActivity($Activity, &$Sender, &$Session)
{
    $Activity = (object) $Activity;
    // If this was a status update or a wall comment, don't bother with activity strings
    $ActivityType = explode(' ', $Activity->ActivityType);
    // Make sure you strip out any extra css classes munged in here
    $ActivityType = $ActivityType[0];
    $Author = UserBuilder($Activity, 'Activity');
    $PhotoAnchor = Anchor(Img($Activity->Photo, array('class' => 'ProfilePhoto ProfilePhotoMedium')), $Activity->PhotoUrl, 'PhotoWrap');
    $CssClass = 'Item Activity Activity-' . $ActivityType;
    if ($PhotoAnchor != '') {
        $CssClass .= ' HasPhoto';
    }
    $Format = GetValue('Format', $Activity);
    $Title = '';
    $Excerpt = $Activity->Story;
    if ($Format) {
        $Excerpt = Gdn_Format::To($Excerpt, $Format);
    }
    if (!in_array($ActivityType, array('WallComment', 'WallPost', 'AboutUpdate'))) {
        $Title = '<div class="Title">' . GetValue('Headline', $Activity) . '</div>';
    } else {
        if ($ActivityType == 'WallPost') {
            $RegardingUser = UserBuilder($Activity, 'Regarding');
            $PhotoAnchor = UserPhoto($RegardingUser);
            $Title = '<div class="Title">' . UserAnchor($RegardingUser, 'Name') . ' <span>&rarr;</span> ' . UserAnchor($Author, 'Name') . '</div>';
            if (!$Format) {
                $Excerpt = Gdn_Format::Display($Excerpt);
            }
        } else {
            $Title = UserAnchor($Author, 'Name');
            if (!$Format) {
                $Excerpt = Gdn_Format::Display($Excerpt);
            }
        }
    }
    $Sender->EventArguments['Activity'] =& $Activity;
    $Sender->EventArguments['CssClass'] =& $CssClass;
    $Sender->FireEvent('BeforeActivity');
    ?>
<li id="Activity_<?php 
    echo $Activity->ActivityID;
    ?>
" class="<?php 
    echo $CssClass;
    ?>
">
   <?php 
    if ($Session->IsValid() && ($Session->UserID == $Activity->InsertUserID || $Session->CheckPermission('Garden.Activity.Delete'))) {
        echo '<div class="Options">' . Anchor('×', 'dashboard/activity/delete/' . $Activity->ActivityID . '/' . $Session->TransientKey() . '?Target=' . urlencode($Sender->SelfUrl), 'Delete') . '</div>';
    }
    if ($PhotoAnchor != '') {
        ?>
   <div class="Author Photo"><?php 
        echo $PhotoAnchor;
        ?>
</div>
   <?php 
    }
    ?>
   <div class="ItemContent Activity">
      <?php 
    echo $Title;
    ?>
      <div class="Excerpt"><?php 
    echo $Excerpt;
    ?>
</div>
      <?php 
    $Sender->EventArguments['Activity'] = $Activity;
    $Sender->FireAs('ActivityController')->FireEvent('AfterActivityBody');
    ?>
      <div class="Meta">
         <span class="MItem DateCreated"><?php 
    echo Gdn_Format::Date($Activity->DateUpdated);
    ?>
</span>
         <?php 
    $SharedString = FALSE;
    $ID = GetValue('SharedNotifyUserID', $Activity->Data);
    if (!$ID) {
        $ID = GetValue('CommentNotifyUserID', $Activity->Data);
    }
    if ($ID) {
        $SharedString = FormatString(T('Comments are between {UserID,you}.'), array('UserID' => array($Activity->NotifyUserID, $ID)));
    }
    $AllowComments = $Activity->NotifyUserID < 0 || $SharedString;
    if ($AllowComments && $Session->CheckPermission('Garden.Profiles.Edit')) {
        echo '<span class="MItem AddComment">' . Anchor(T('Activity.Comment', 'Comment'), '#CommentForm_' . $Activity->ActivityID, 'CommentOption');
    }
    if ($SharedString) {
        echo ' <span class="MItem"><i>' . $SharedString . '</i></span>';
    }
    echo '</span>';
    $Sender->FireEvent('AfterMeta');
    ?>
      </div>
   </div>
   <?php 
    $Comments = GetValue('Comments', $Activity, array());
//.........这里部分代码省略.........
开发者ID:rnovino,项目名称:Garden,代码行数:101,代码来源:helper_functions.php

示例12: InformNotifications

 /**
  * Grabs all new notifications and adds them to the sender's inform queue.
  *
  * This method gets called by dashboard's hooks file to display new
  * notifications on every pageload. 
  *
  * @since 2.0.18
  * @access public
  *
  * @param object $Sender The object calling this method.
  */
 public static function InformNotifications($Sender)
 {
     $Session = Gdn::Session();
     if (!$Session->IsValid()) {
         return;
     }
     // Set the user's DateLastInform attribute to now. This value can be used
     // by addons to determine if their inform messages have already been sent.
     $InformLastActivityID = $Session->GetAttribute('Notifications.InformLastActivityID', 0);
     // Allow pluggability
     $Sender->EventArguments['InformLastActivityID'] =& $InformLastActivityID;
     $Sender->FireEvent('BeforeInformNotifications');
     // Retrieve default preferences
     $Preferences = array();
     $DefaultPreferences = C('Preferences.Popup', array());
     foreach ($DefaultPreferences as $Preference => $Val) {
         if ($Val) {
             $Preferences[] = $Preference;
         }
     }
     //		$User = Gdn::Database()->SQL()->Select('Preferences')->From('User')->Where('UserID', $Session->UserID)->Get()->FirstRow();
     //      if ($User) {
     //         $PrefData = Gdn_Format::Unserialize($User->Preferences);
     //			foreach ($PrefData as $Pref => $Val) {
     //				if (substr($Pref, 0, 6) == 'Popup.') {
     //					$Pref = substr($Pref, 6);
     //					if ($Val) {
     //						$Preferences[] = $Pref;
     //					} else {
     //						if (in_array($Pref, $Preferences))
     //							unset($Preferences[array_search($Pref, $Preferences)]);
     //					}
     //				}
     //			}
     //		}
     //		if (count($Preferences) > 0) {
     // Grab the activity type ids for the desired notification prefs.
     $ActivityTypeIDs = array();
     //         $ActivityTypes = array();
     $Data = Gdn::Database()->SQL()->GetWhere('ActivityType', array('Notify' => TRUE))->ResultArray();
     //  ->WhereIn('Name', $Preferences)->Get();
     foreach ($Data as $ActivityType) {
         if (Gdn::Session()->GetPreference("Popup.{$ActivityType['Name']}", C("Preferences.Popup.{$ActivityType['Name']}", TRUE))) {
             $ActivityTypeIDs[] = $ActivityType['ActivityTypeID'];
             //               $ActivityTypes[] = $ActivityType['Name'];
         }
     }
     if (count($ActivityTypeIDs) > 0) {
         // Retrieve new notifications
         $ActivityModel = new ActivityModel();
         $NotificationData = $ActivityModel->GetNotificationsSince($Session->UserID, $InformLastActivityID, $ActivityTypeIDs);
         $InformLastActivityID = -1;
         // Add (no more than 5) notifications to the inform stack
         foreach ($NotificationData->Result() as $Notification) {
             // Make sure the user wants to be notified of this
             //					if (!in_array($Notification->ActivityType, $Preferences)) {
             //                  continue;
             //               }
             $UserPhoto = UserPhoto(UserBuilder($Notification, 'Activity'), 'Icon');
             $ActivityType = explode(' ', $Notification->ActivityType);
             $ActivityType = $ActivityType[0];
             $Excerpt = $Notification->Story;
             if (in_array($ActivityType, array('WallComment', 'AboutUpdate'))) {
                 $Excerpt = Gdn_Format::Display($Excerpt);
             }
             // Inform the user of new messages
             $Sender->InformMessage($UserPhoto . Wrap(Gdn_Format::ActivityHeadline($Notification, $Session->UserID), 'div', array('class' => 'Title')) . Wrap($Excerpt, 'div', array('class' => 'Excerpt')), 'Dismissable AutoDismiss' . ($UserPhoto == '' ? '' : ' HasIcon'));
             // Assign the most recent activity id
             if ($InformLastActivityID == -1) {
                 $InformLastActivityID = $Notification->ActivityID;
             }
         }
     }
     //		}
     if ($InformLastActivityID > 0) {
         Gdn::UserModel()->SaveAttribute($Session->UserID, 'Notifications.InformLastActivityID', $InformLastActivityID);
     }
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:89,代码来源:class.notificationscontroller.php

示例13: foreach

   <ul class="PanelActivity">
      <?php 
foreach ($this->_ActivityData->Result() as $Activity) {
    echo '<li class="Activity ' . $Activity->ActivityType . '">';
    // If this was a status update or a wall comment, don't bother with activity strings
    $ActivityType = explode(' ', $Activity->ActivityType);
    // Make sure you strip out any extra css classes munged in here
    $ActivityType = $ActivityType[0];
    $Author = UserBuilder($Activity, 'Activity');
    if (in_array($ActivityType, array('WallComment', 'AboutUpdate'))) {
        echo UserAnchor($Author, 'Name');
        if ($Activity->ActivityType == 'WallComment' && $Activity->RegardingUserID > 0) {
            $Author = UserBuilder($Activity, 'Regarding');
            echo '<span>&rarr;</span>' . UserAnchor($Author, 'Name');
        }
        echo Gdn_Format::Display($Activity->Story);
        echo '<em>' . Gdn_Format::Date($Activity->DateInserted) . '</em>';
    } else {
        echo Gdn_Format::ActivityHeadline($Activity);
        echo '<em>' . Gdn_Format::Date($Activity->DateInserted) . '</em>';
        if ($Activity->Story != '') {
            echo '<div class="Story">';
            echo $Activity->Story;
            echo '</div>';
        }
    }
    echo '</li>';
}
?>
      <li class="ShowAll"><?php 
echo Anchor(T('↳ Show All'), 'activity');
开发者ID:sipp11,项目名称:Garden,代码行数:31,代码来源:recentactivity.php

示例14: Anchor

<?php

if (!defined('APPLICATION')) {
    exit;
}
$Session = Gdn::Session();
?>
<div class="User">
   <h1><?php 
echo $this->User->Name;
?>
 <a onclick="parent.location='//<?php 
echo DOMAIN;
?>
/account/<?php 
echo $this->User->UserID;
?>
'">(View muzombies.org Profile)</a></h1>
   <?php 
if ($this->User->About != '') {
    echo '<div id="Status">' . Gdn_Format::Display($this->User->About);
    if ($this->User->About != '' && ($Session->UserID == $this->User->UserID || $Session->CheckPermission('Garden.Users.Edit'))) {
        echo ' - ' . Anchor(T('Clear'), '/profile/clear/' . $this->User->UserID . '/' . $Session->TransientKey(), 'Change');
    }
    echo '</div>';
}
?>
</div>
开发者ID:tautomers,项目名称:knoopvszombies,代码行数:28,代码来源:user.php

示例15: Post

 public function Post($Notify = FALSE, $UserID = FALSE)
 {
     if (is_numeric($Notify)) {
         $UserID = $Notify;
         $Notify = FALSE;
     }
     if (!$UserID) {
         $UserID = Gdn::Session()->UserID;
     }
     switch ($Notify) {
         case 'mods':
             $this->Permission('Garden.Moderation.Manage');
             $NotifyUserID = ActivityModel::NOTIFY_MODS;
             break;
         case 'admins':
             $this->Permission('Garden.Settings.Manage');
             $NotifyUserID = ActivityModel::NOTIFY_ADMINS;
             break;
         default:
             $this->Permission('Garden.Profiles.Edit');
             $NotifyUserID = ActivityModel::NOTIFY_PUBLIC;
             break;
     }
     $Activities = array();
     if ($this->Form->IsPostBack()) {
         $Data = $this->Form->FormValues();
         $Data = $this->ActivityModel->FilterForm($Data);
         $Data['Format'] = C('Garden.InputFormatter');
         if ($UserID != Gdn::Session()->UserID) {
             // This is a wall post.
             $Activity = array('ActivityType' => 'WallPost', 'ActivityUserID' => $UserID, 'RegardingUserID' => Gdn::Session()->UserID, 'HeadlineFormat' => T('HeadlineFormat.WallPost', '{RegardingUserID,you} &rarr; {ActivityUserID,you}'), 'Story' => $Data['Comment'], 'Format' => $Data['Format']);
         } else {
             // This is a status update.
             $Activity = array('ActivityType' => 'Status', 'HeadlineFormat' => T('HeadlineFormat.Status', '{ActivityUserID,user}'), 'Story' => $Data['Comment'], 'Format' => $Data['Format'], 'NotifyUserID' => $NotifyUserID);
             $this->SetJson('StatusMessage', Gdn_Format::Display($Data['Comment']));
         }
         $Activity = $this->ActivityModel->Save($Activity, FALSE, array('CheckSpam' => TRUE));
         if ($Activity == SPAM) {
             $this->StatusMessage = T('Your post has been flagged for moderation.');
             $this->Render('Blank', 'Utility');
             return;
         }
         if ($Activity) {
             if ($UserID == Gdn::Session()->UserID && $NotifyUserID == ActivityModel::NOTIFY_PUBLIC) {
                 Gdn::UserModel()->SetField(Gdn::Session()->UserID, 'About', Gdn_Format::PlainText($Activity['Story'], $Activity['Format']));
             }
             $Activities = array($Activity);
             ActivityModel::JoinUsers($Activities);
             $this->ActivityModel->CalculateData($Activities);
         }
     }
     if ($this->DeliveryType() == DELIVERY_TYPE_ALL) {
         Redirect($this->Request->Get('Target', '/activity'));
     }
     $this->SetData('Activities', $Activities);
     $this->Render('Activities');
 }
开发者ID:rnovino,项目名称:Garden,代码行数:57,代码来源:class.activitycontroller.php


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