Skip to content

Issues-93, Issues-112, Issues-121 #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ RUN cp -r debugbar /vanillapp/plugins
RUN composer install --working-dir /vanillapp/plugins/Topcoder
# Install Filestack dependencies
RUN composer install --working-dir /vanillapp/plugins/Filestack
# Install Groups dependencies
RUN composer install --working-dir /vanillapp/plugins/Groups
# Copy Vanilla configuration files
COPY ./config/vanilla/. /vanillapp/conf/.
# Copy Topcoder Vanilla files
Expand Down
2 changes: 1 addition & 1 deletion config/vanilla/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

// Feature
$Configuration['Feature']['NewFlyouts']['Enabled'] = true;
$Configuration['Vanilla']['EnableCategorygiFollowing'] = true;
$Configuration['Vanilla']['EnableCategoryFollowing'] = true;

// Garden
$Configuration['Garden']['Title'] = 'Vanilla';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,13 +490,14 @@ public function post(array $body) {
public function put_follow($id, array $body) {
$this->permission('Garden.SignIn.Allow');

$schema = ['followed:b' => 'The category-follow status for the current user.'];
$schema = ['followed:b' => 'The category-follow status for the current user.',
'userID:i?' => 'User ID.'];
$in = $this->schema($schema, 'in');
$out = $this->schema($schema, 'out');

$category = $this->category($id);
$body = $in->validate($body);
$userID = $this->getSession()->UserID;
$userID = $body['userID'] > 0? $body['userID'] : $this->getSession()->UserID;
$followed = $this->categoryModel->getFollowed($userID);

// Is this a new follow?
Expand Down
97 changes: 97 additions & 0 deletions vanilla/applications/vanilla/views/discussion/discussion.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php
/**
* @copyright 2009-2019 Vanilla Forums Inc.
* @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
*/

if (!defined('APPLICATION')) {
exit();
}
$UserPhotoFirst = c('Vanilla.Comment.UserPhotoFirst', true);

$Discussion = $this->data('Discussion');
$Author = Gdn::userModel()->getID($Discussion->InsertUserID); // userBuilder($Discussion, 'Insert');

// Prep event args.
$CssClass = cssClass($Discussion, false);
$this->EventArguments['Discussion'] = &$Discussion;
$this->EventArguments['Author'] = &$Author;
$this->EventArguments['CssClass'] = &$CssClass;

// DEPRECATED ARGUMENTS (as of 2.1)
$this->EventArguments['Object'] = &$Discussion;
$this->EventArguments['Type'] = 'Discussion';

// Discussion template event
$this->fireEvent('BeforeDiscussionDisplay');
?>
<div id="<?php echo 'Discussion_'.$Discussion->DiscussionID; ?>" class="<?php echo $CssClass; ?>">
<div class="Discussion">
<div class="Item-Header DiscussionHeader">
<div class="AuthorWrap">
<span class="Author">
<?php
if ($UserPhotoFirst) {
echo userPhoto($Author);
echo userAnchor($Author, 'Username');
} else {
echo userAnchor($Author, 'Username');
echo userPhoto($Author);
}
echo formatMeAction($Discussion);
?>
</span>
<span class="AuthorInfo">
<?php
echo wrapIf(htmlspecialchars(val('Title', $Author)), 'span', ['class' => 'MItem AuthorTitle']);
echo wrapIf(htmlspecialchars(val('Location', $Author)), 'span', ['class' => 'MItem AuthorLocation']);
$this->fireEvent('AuthorInfo');
?>
</span>
</div>
<div class="Meta DiscussionMeta">
<span class="MItem DateCreated">
<?php
echo anchor(Gdn_Format::date($Discussion->DateInserted, 'html'), $Discussion->Url, 'Permalink', ['rel' => 'nofollow']);
?>
</span>
<?php
echo dateUpdated($Discussion, ['<span class="MItem">', '</span>']);
?>
<?php
// Include source if one was set
if ($Source = val('Source', $Discussion)) {
echo ' '.wrap(sprintf(t('via %s'), t($Source.' Source', $Source)), 'span', ['class' => 'MItem MItem-Source']).' ';
}
// Category
if (c('Vanilla.Categories.Use')) {
echo ' <span class="MItem Category">';
echo ' '.t('in').' ';
echo anchor(htmlspecialchars($this->data('Discussion.Category')), categoryUrl($this->data('Discussion.CategoryUrlCode')));
echo '</span> ';
}

$this->fireEvent('DiscussionInfo');
$this->fireEvent('AfterDiscussionMeta'); // DEPRECATED
?>
</div>
</div>
<?php $this->fireEvent('BeforeDiscussionBody'); ?>
<div class="Item-BodyWrap">
<div class="Item-Body">
<div class="Message userContent">
<?php
echo formatBody($Discussion);
?>
</div>
<?php
$this->fireEvent('AfterDiscussionBody');
writeReactions($Discussion);
if (val('Attachments', $Discussion)) {
writeAttachments($Discussion->Attachments);
}
?>
</div>
</div>
</div>
</div>
Loading