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


PHP Format::ActivityHeadline方法代码示例

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


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

示例1: Url

        echo $Activity->ActivityID;
        ?>
" class="Activity<?php 
        echo ' ' . $Activity->ActivityType;
        ?>
"><?php 
        if ($Activity->ActivityPhoto != '' && $Activity->ShowIcon == '1') {
            if ($Activity->InsertUserID == $Session->UserID) {
                echo '<a href="' . Url('/garden/profile/' . urlencode($Activity->ActivityName)) . '">' . $this->Html->Image('uploads/n' . $Activity->ActivityPhoto) . '</a>';
            } else {
                echo $this->Html->Image('uploads/n' . $Activity->ActivityPhoto);
            }
        }
        ?>
<h3><strong><?php 
        echo Format::ActivityHeadline($Activity, $Session->UserID);
        ?>
<em><?php 
        echo Format::Date($Activity->DateInserted);
        ?>
</em></strong></h3>
      <?php 
        if ($Activity->Story != '') {
            ?>
<blockquote><?php 
            echo Format::Html($Activity->Story);
            ?>
</blockquote>
      <?php 
        }
        ?>
开发者ID:Beyzie,项目名称:Garden,代码行数:31,代码来源:notifications.php

示例2: WriteActivityComment

function WriteActivityComment($Comment, &$Sender, &$Session)
{
    ?>
<li id="Activity_<?php 
    echo $Comment->ActivityID;
    ?>
" class="<?php 
    echo $Comment->ActivityType;
    ?>
"><?php 
    if ($Comment->ActivityPhoto != '') {
        if ($Comment->InsertUserID == $Session->UserID) {
            echo '<a href="' . Url('/garden/profile/' . urlencode($Comment->ActivityName)) . '">' . $Sender->Html->Image('uploads/n' . $Comment->ActivityPhoto) . '</a>';
        } else {
            echo $Sender->Html->Image('uploads/n' . $Comment->ActivityPhoto);
        }
    }
    ?>
<h3><?php 
    echo $Session->UserID == $Comment->InsertUserID || $Session->CheckPermission('Garden.Activity.Delete') ? Anchor('Delete', 'garden/activity/delete/' . $Comment->ActivityID . '/' . $Session->TransientKey() . '?Return=' . urlencode(Gdn_Url::Request()), 'Delete') : '';
    ?>
<strong><?php 
    echo Format::ActivityHeadline($Comment, $Sender->ProfileUserID);
    ?>
<em><?php 
    echo Format::Date($Comment->DateInserted);
    ?>
</em></strong></h3>
   <blockquote><?php 
    echo Format::Display($Comment->Story);
    ?>
</blockquote>
</li>
<?php 
}
开发者ID:kidmax,项目名称:Garden,代码行数:35,代码来源:helper_functions.php

示例3: SendNotification

 public function SendNotification($ActivityID, $Story = '')
 {
     $Activity = $this->GetID($ActivityID);
     if (!is_object($Activity)) {
         return;
     }
     $Story = Format::Text($Story == '' ? $Activity->Story : $Story);
     // If this is a comment on another activity, fudge the activity a bit so that everything appears properly.
     if (is_null($Activity->RegardingUserID) && $Activity->CommentActivityID > 0) {
         $CommentActivity = $this->GetID($Activity->CommentActivityID);
         $Activity->RegardingUserID = $CommentActivity->RegardingUserID;
         $Activity->Route = '/profile/' . $CommentActivity->RegardingUserID . '/' . Format::Url($CommentActivity->RegardingName) . '/#Activity_' . $Activity->CommentActivityID;
     }
     $User = $this->SQL->Select('Name, Email, Preferences')->From('User')->Where('UserID', $Activity->RegardingUserID)->Get()->FirstRow();
     if ($User) {
         $Preferences = Format::Unserialize($User->Preferences);
         $Preference = ArrayValue('Email.' . $Activity->ActivityType, $Preferences, Gdn::Config('Preferences.Email.' . $Activity->ActivityType));
         if ($Preference) {
             $ActivityHeadline = Format::Text(Format::ActivityHeadline($Activity, $Activity->ActivityUserID, $Activity->RegardingUserID));
             $Email = new Gdn_Email();
             $Email->Subject(sprintf(T('[%1$s] %2$s'), Gdn::Config('Garden.Title'), $ActivityHeadline));
             $Email->To($User->Email, $User->Name);
             $Email->From(Gdn::Config('Garden.SupportEmail'), Gdn::Config('Garden.SupportName'));
             $Email->Message(sprintf(T($Story == '' ? 'EmailNotification' : 'EmailStoryNotification'), $ActivityHeadline, Url($Activity->Route == '' ? '/' : $Activity->Route, TRUE), $Story));
             try {
                 $Email->Send();
             } catch (Exception $ex) {
                 // Don't do anything with the exception.
             }
         }
     }
 }
开发者ID:nbudin,项目名称:Garden,代码行数:32,代码来源:class.activitymodel.php

示例4: explode

    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>→</span>' . UserAnchor($Author, 'Name');
        }
        echo Format::Display($Activity->Story);
        echo '<em>' . Format::Date($Activity->DateInserted) . '</em>';
    } else {
        echo Format::ActivityHeadline($Activity);
        echo '<em>' . 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');
?>
</li>
   </ul>
开发者ID:nbudin,项目名称:Garden,代码行数:31,代码来源:recentactivity.php

示例5: WriteActivity

function WriteActivity($Activity, &$Sender, &$Session, $Comment)
{
    ?>
<li id="Activity_<?php 
    echo $Activity->ActivityID;
    ?>
" class="Activity<?php 
    echo ' ' . $Activity->ActivityType;
    if ($Activity->ActivityPhoto != '' && $Activity->ShowIcon == '1') {
        echo ' HasPhoto';
    }
    ?>
"><?php 
    if ($Session->IsValid() && ($Session->UserID == $Activity->InsertUserID || $Session->CheckPermission('Garden.Activity.Delete'))) {
        echo Anchor('Delete', 'garden/activity/delete/' . $Activity->ActivityID . '/' . $Session->TransientKey() . '?Return=' . urlencode(Gdn_Url::Request()), 'Delete');
    }
    // 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];
    if (in_array($ActivityType, array('WallComment', 'AboutUpdate'))) {
        if ($Activity->ActivityPhoto != '') {
            echo '<a href="' . Url('/garden/profile/' . urlencode($Activity->ActivityName)) . '" class="Photo">' . $Sender->Html->Image('uploads/n' . $Activity->ActivityPhoto) . '</a>';
        }
        echo '<div>';
        echo UserAnchor($Activity->ActivityName, 'Name');
        if ($Activity->ActivityType == 'WallComment' && $Activity->RegardingUserID > 0 && (!property_exists($Sender, 'ProfileUserID') || $Sender->ProfileUserID != $Activity->RegardingUserID)) {
            echo '<span>&gt;</span>' . UserAnchor($Activity->RegardingName, 'Name');
        }
        echo Format::Display($Activity->Story);
        echo '<div class="Meta">';
        echo Format::Date($Activity->DateInserted);
        echo $Activity->AllowComments == '1' && $Session->IsValid() ? '<span>&bull;</span>' . Anchor('Comment', '#CommentForm_' . $Activity->ActivityID, 'CommentOption') : '';
        echo '</div>';
        echo '</div>';
    } else {
        if ($Activity->ActivityPhoto != '' && $Activity->ShowIcon == '1') {
            echo '<a href="' . Url('/garden/profile/' . urlencode($Activity->ActivityName)) . '" class="Photo">' . $Sender->Html->Image('uploads/n' . $Activity->ActivityPhoto) . '</a>';
        }
        echo '<div>';
        echo Format::ActivityHeadline($Activity, $Sender->ProfileUserID);
        echo '<div class="Meta">';
        echo Format::Date($Activity->DateInserted);
        echo $Activity->AllowComments == '1' && $Session->IsValid() ? '<span>&bull;</span>' . Anchor('Comment', '#CommentForm_' . $Activity->ActivityID, 'CommentOption') : '';
        if ($Activity->Story != '') {
            echo '<div class="Story">';
            echo $Activity->Story;
            // story should be cleaned before being saved.
            echo '</div>';
        }
        echo '</div>';
        echo '</div>';
    }
    if ($Activity->AllowComments == '1') {
        // If there are comments, show them
        $FoundComments = FALSE;
        if (property_exists($Sender, 'CommentData') && is_object($Sender->CommentData)) {
            foreach ($Sender->CommentData->Result() as $Comment) {
                if (is_object($Comment) && $Comment->CommentActivityID == $Activity->ActivityID) {
                    if ($FoundComments == FALSE) {
                        echo '<ul class="Comments">';
                    }
                    $FoundComments = TRUE;
                    WriteActivityComment($Comment, $Sender, $Session);
                }
            }
        }
        if ($FoundComments == FALSE) {
            echo '<ul class="Comments Hidden">';
        }
        if ($Session->IsValid()) {
            ?>
         <li class="CommentForm">
         <?php 
            echo Anchor('Write a comment', '/garden/activity/comment/' . $Activity->ActivityID, 'CommentLink');
            $CommentForm = Gdn::Factory('Form');
            $CommentForm->SetModel($Sender->ActivityModel);
            $CommentForm->AddHidden('ActivityID', $Activity->ActivityID);
            $CommentForm->AddHidden('Return', Gdn_Url::Request());
            echo $CommentForm->Open(array('action' => Url('/garden/activity/comment'), 'class' => 'Hidden'));
            echo $CommentForm->TextBox('Body', array('MultiLine' => TRUE, 'value' => ''));
            echo $CommentForm->Close('Comment');
            ?>
</li>
      <?php 
        }
        ?>
      </ul>
   <?php 
    }
    ?>
</li>
<?php 
}
开发者ID:jhampha,项目名称:Garden,代码行数:94,代码来源:helper_functions.php

示例6: WriteActivity

function WriteActivity($Activity, &$Sender, &$Session, $Comment)
{
    // 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 = UserPhoto($Author, 'Photo');
    $CssClass = 'Item Activity ' . $ActivityType;
    if ($PhotoAnchor != '') {
        $CssClass .= ' HasPhoto';
    }
    if (in_array($ActivityType, array('WallComment', 'AboutUpdate'))) {
        $CssClass .= ' Condensed';
    }
    $Title = '';
    $Excerpt = $Activity->Story;
    if (!in_array($ActivityType, array('WallComment', 'AboutUpdate'))) {
        $Title = '<div class="Title">' . Format::ActivityHeadline($Activity, $Sender->ProfileUserID) . '</div>';
    } else {
        if ($Activity->ActivityType == 'WallComment' && $Activity->RegardingUserID > 0 && (!property_exists($Sender, 'ProfileUserID') || $Sender->ProfileUserID != $Activity->RegardingUserID)) {
            $RegardingUser = UserBuilder($Activity, 'Regarding');
            $Title = '<div class="Title">' . UserAnchor($Author, 'Title Name') . ' <span>→</span> ' . UserAnchor($RegardingUser, 'Name') . '</div>';
            $Excerpt = Format::Display($Excerpt);
        } else {
            $Title = UserAnchor($Author, 'Title Name');
            $Excerpt = Format::Display($Excerpt);
        }
    }
    ?>
<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="OptionButton">' . Anchor(T('Delete'), 'garden/activity/delete/' . $Activity->ActivityID . '/' . $Session->TransientKey() . '?Return=' . urlencode(Gdn_Url::Request()), 'Delete') . '</div>';
    }
    if ($PhotoAnchor != '') {
        ?>
   <div class="Photo"><?php 
        echo $PhotoAnchor;
        ?>
</div>
   <?php 
    }
    ?>
   <div class="ItemContent Activity">
      <?php 
    echo $Title;
    ?>
      <div class="Excerpt"><?php 
    echo $Excerpt;
    ?>
</div>
      <div class="Meta">
         <span class="DateCreated"><?php 
    echo Format::Date($Activity->DateInserted);
    ?>
</span>
         <?php 
    if ($Activity->AllowComments == '1' && $Session->IsValid()) {
        echo '<span class="AddComment">' . Anchor(T('Comment'), '#CommentForm_' . $Activity->ActivityID, 'CommentOption') . '</span>';
    }
    ?>
      </div>
   </div>
   <?php 
    if ($Activity->AllowComments == '1') {
        // If there are comments, show them
        $FoundComments = FALSE;
        if (property_exists($Sender, 'CommentData') && is_object($Sender->CommentData)) {
            foreach ($Sender->CommentData->Result() as $Comment) {
                if (is_object($Comment) && $Comment->CommentActivityID == $Activity->ActivityID) {
                    if ($FoundComments == FALSE) {
                        echo '<ul class="DataList ActivityComments">';
                    }
                    $FoundComments = TRUE;
                    WriteActivityComment($Comment, $Sender, $Session);
                }
            }
        }
        if ($FoundComments == FALSE) {
            echo '<ul class="DataList ActivityComments Hidden">';
        }
        if ($Session->IsValid()) {
            ?>
         <li class="CommentForm">
         <?php 
            echo Anchor(T('Write a comment'), '/garden/activity/comment/' . $Activity->ActivityID, 'CommentLink');
            $CommentForm = Gdn::Factory('Form');
            $CommentForm->SetModel($Sender->ActivityModel);
            $CommentForm->AddHidden('ActivityID', $Activity->ActivityID);
            $CommentForm->AddHidden('Return', Gdn_Url::Request());
            echo $CommentForm->Open(array('action' => Url('/garden/activity/comment'), 'class' => 'Hidden'));
            echo $CommentForm->TextBox('Body', array('MultiLine' => TRUE, 'value' => ''));
            echo $CommentForm->Close('Comment');
//.........这里部分代码省略.........
开发者ID:nbudin,项目名称:Garden,代码行数:101,代码来源:helper_functions.php


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