Not sure how but would like to also have the paging on the top and not just the bottom for topic and discussion view. Any way to safely and quickly accomplish this?
I *think* that's all I needed to do to do the trick, but I've stopped working with Vanilla2 until the plugins available (and the core code itself) stabilize some more, and it's been a while since I looked at it.
@stavthewonderchicken hi, you could help to make this paging before the discussions(or rather after the first post topic of author) I really need it, I tried both your code, but unfortunately they do not work.
When I try to replace the contents of the file with your first code in index.php ( /views/discussions) then an error and the home page of site does not work Fatal error: Call to undefined method PagerModule::Write() in /public_html/applications/vanilla/views/discussions/index.php on line 11 the other pages work without changes
When I try to replace the contents of the file with your second code in index.php ( /views/discussion) that site is working partly; This means when you open the site as a guest (not registered), the site is down, and breaks the whole design (like on the picture) But when you open the discussion as a registered user, then no error, the site is working and paging appears at the top before the first message of the author.
You could fix this code, and preferably make the paging after the first message of the author(like on picture)?
i use 2.0.17.9 version plugins: AboutMe Anonymouse 2 EasyReply Emotify :) Flagging Following Gravatar Magic Mark All Viewed Pockets Post Count Quotes RecentActivity RussianPlural Signatures Thankful People TopPosters Twitter User List Voting Web Title
Hi! Tested @stavthewonderchicken 's solution, was not able to get it to work. I'd like to add paging to top on discussion and a single discussion view. My vanilla version is 2.0.18.4.
Anybody willing to help? This would increase usability.
Sorry for the bump, but I'm really looking to have this feature since I feel it is something that increases usability. I'm using slightly modified (mostly colours) default theme but I'm not just able to solve this by my self.
Besides paging at the top I'd like to add 'Back to the top' link at the end of each single conversation thread.
Besides paging at the top I'd like to add 'Back to the top' link at the end of each single conversation thread.
In answer to your Besides paging at the top I'd like to add 'Back to the top' link at the end of each single conversation thread. The pagenavigator plugin provide a top link, you could modify it to what you want to do.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
for the discussion you could try changing adding echo $this->Pager->ToString('more');
in /var/www/vanilla/applications/vanilla/views/discussion/index.php
around line 15.
e.g.
just for laughs try using the default theme that came with vanilla. Then you can prove to yourself it works. It may be that your theme is overriding the default. In that case you need to add it to your theme views folder in the appropriate places.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
Answers
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •<?php if (!defined('APPLICATION')) exit();
$Session = Gdn::Session();
include($this->FetchViewLocation('helper_functions', 'discussions', 'vanilla'));
if ($this->DiscussionData->NumRows() > 0 || (isset($this->AnnounceData) && is_object($this->AnnounceData) && $this->AnnounceData->NumRows() > 0)) {
$PagerOptions = array('RecordCount' => $this->Data('CountDiscussions'));
if ($this->Data('_PagerUrl')) {
$PagerOptions['Url'] = $this->Data('_PagerUrl');
}
echo PagerModule::Write($PagerOptions);
WriteFilterTabs($this);
?>
<ul class="DataList Discussions">
<?php include($this->FetchViewLocation('discussions')); ?>
</ul>
<?php
$PagerOptions = array('RecordCount' => $this->Data('CountDiscussions'));
if ($this->Data('_PagerUrl')) {
$PagerOptions['Url'] = $this->Data('_PagerUrl');
}
echo PagerModule::Write($PagerOptions);
} else {
?>
<div class="Empty"><?php echo T('No discussions were found.'); ?></div>
<?php
}
I *think* that's all I needed to do to do the trick, but I've stopped working with Vanilla2 until the plugins available (and the core code itself) stabilize some more, and it's been a while since I looked at it.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •<?php if (!defined('APPLICATION')) exit();
$Session = Gdn::Session();
$DiscussionName = Gdn_Format::Text($this->Discussion->Name);;
if ($DiscussionName == '')
$DiscussionName = T('Blank Discussion Topic');
if (!function_exists('WriteComment'))
include($this->FetchViewLocation('helper_functions', 'discussion'));
if ($Session->IsValid()) {
// Bookmark link
echo Anchor(
'<span>*</span>',
'/vanilla/discussion/bookmark/'.$this->Discussion->DiscussionID.'/'.$Session->TransientKey().'?Target='.urlencode($this->SelfUrl),
'Bookmark' . ($this->Discussion->Bookmarked == '1' ? ' Bookmarked' : ''),
array('title' => T($this->Discussion->Bookmarked == '1' ? 'Unbookmark' : 'Bookmark'))
);
}
$PageClass = '';
if($this->Pager->FirstPage())
$PageClass = 'FirstPage';
?>
<div class="Tabs HeadingTabs DiscussionTabs <?php echo $PageClass; ?>">
<ul>
<li><?php
if (C('Vanilla.Categories.Use') == TRUE) {
echo Anchor($this->Discussion->Category, 'categories/'.$this->Discussion->CategoryUrlCode);
} else {
echo Anchor(T('All Discussions'), 'discussions');
}
?></li>
</ul>
<div class="SubTab"><?php echo $DiscussionName; ?></div>
</div>
<?php echo $this->Pager->ToString('more');?>
<?php $this->FireEvent('BeforeDiscussion'); ?>
<ul class="MessageList Discussion <?php echo $PageClass; ?>">
<?php echo $this->FetchView('comments'); ?>
</ul>
<?php
$this->FireEvent('AfterDiscussion');
if($this->Pager->LastPage()) {
$LastCommentID = $this->AddDefinition('LastCommentID');
if(!$LastCommentID || $this->Data['Discussion']->LastCommentID > $LastCommentID)
$this->AddDefinition('LastCommentID', (int)$this->Data['Discussion']->LastCommentID);
$this->AddDefinition('Vanilla_Comments_AutoRefresh', Gdn::Config('Vanilla.Comments.AutoRefresh', 0));
}
echo $this->Pager->ToString('more');
// Write out the comment form
if ($this->Discussion->Closed == '1') {
?>
<div class="Foot Closed">
<div class="Note Closed"><?php echo T('This discussion has been closed.'); ?></div>
<?php echo Anchor(T('← All Discussions'), 'discussions', 'TabLink'); ?>
</div>
<?php
} else if ($Session->IsValid() && $Session->CheckPermission('Vanilla.Comments.Add', TRUE, 'Category', $this->Discussion->PermissionCategoryID)) {
echo $this->FetchView('comment', 'post');
} else if ($Session->IsValid()) { ?>
<div class="Foot Closed">
<div class="Note Closed"><?php echo T('Commenting not allowed.'); ?></div>
<?php echo Anchor(T('← All Discussions'), 'discussions', 'TabLink'); ?>
</div>
<?php
} else {
?>
<div class="Foot">
<?php
echo Anchor(T('Add a Comment'), SignInUrl($this->SelfUrl.(strpos($this->SelfUrl, '?') ? '&' : '?').'post#Form_Body'), 'TabLink'.(SignInPopup() ? ' SignInPopup' : ''));
?>
</div>
<?php
}
<?php <br />}
</
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •When I try to replace the contents of the file with your first code in index.php ( /views/discussions) then an error and the home page of site does not work
Fatal error: Call to undefined method PagerModule::Write() in /public_html/applications/vanilla/views/discussions/index.php on line 11the other pages work without changes
When I try to replace the contents of the file with your second code in index.php ( /views/discussion) that site is working partly; This means when you open the site as a guest (not registered), the site is down, and breaks the whole design (like on the picture)
But when you open the discussion as a registered user, then no error, the site is working and paging appears at the top before the first message of the author.
You could fix this code, and preferably make the paging after the first message of the author(like on picture)?
i use 2.0.17.9 version
plugins:
AboutMe
Anonymouse 2
EasyReply
Emotify :)
Flagging
Following
Gravatar
Magic
Mark All Viewed
Pockets
Post Count
Quotes
RecentActivity
RussianPlural
Signatures
Thankful People
TopPosters
Twitter
User List
Voting
Web Title
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Hi! Tested @stavthewonderchicken 's solution, was not able to get it to work. I'd like to add paging to top on discussion and a single discussion view. My vanilla version is 2.0.18.4.
Anybody willing to help? This would increase usability.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Sorry for the bump, but I'm really looking to have this feature since I feel it is something that increases usability. I'm using slightly modified (mostly colours) default theme but I'm not just able to solve this by my self.
Besides paging at the top I'd like to add 'Back to the top' link at the end of each single conversation thread.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Too tired to mess with a plugin but if you want to modify the index.php
this would do it for the discussions view.
vanilla/applications/vanilla/views/discussions/index.php
In answer to your Besides paging at the top I'd like to add 'Back to the top' link at the end of each single conversation thread. The pagenavigator plugin provide a top link, you could modify it to what you want to do.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •for the discussion you could try changing adding echo $this->Pager->ToString('more');
in /var/www/vanilla/applications/vanilla/views/discussion/index.php around line 15. e.g.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •Great, thanks again :)
Implemented both, and a bit weird since I see nothing new happening. It might be a good idea thou for me to give it another try tomorrow.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •just for laughs try using the default theme that came with vanilla. Then you can prove to yourself it works. It may be that your theme is overriding the default. In that case you need to add it to your theme views folder in the appropriate places.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •Oh, yes, naturally. Made the changes again, but within theme folder. Feel like a total idiot now... :D
No wonder I didn't see any changes previously. Works like a charm!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •