Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Moving Plugins from main menu to side panel
Hi all,
I have two plugins (All Viewed & Members List Enhanced) that I want to remove from the main menu and put into links in a side panel box.
I found out how to insert the box with hyperlinks here: http://vanillaforums.org/discussion/comment/148713/#Comment_148713 - (thanks @Aolee), but I am struggling to insert the plugin links for Mark All Viewed & Members.
Any help & tips would be gratefully received, as always.
I am using Vanilla 2.0.18.1 and have default.master.php (not .tpl)
Thanks,
Lisa.
0
Comments
first step to update your vanilla for security reasons to 2.0.18.8. Remember to back up and follow the upgrade instruction in the documentation.
then we can get on to your question.
grep is your friend.
Thanks @x00, I will do that now
Hi @x00, I've upgraded.
My categories have all disappeared, and I read a few comments, which unfortunately haven't helped.
I'm logged in as Admin, all my permissions have been set, all my cache .ini files have been wiped, I've ftp'd all my plugins & config files, I've uploaded the theme I am using.
Everything is working, just missing categories.
Thanks for your help,
Lisa
My categories are missing from the admin dashboard, not just missing from display
does the GDN_Category table exist in the database?
grep is your friend.
Yes, but it only has a General category in there.
I have got a previous backup that I can run as another database, and import the table across, but was hoping it wasn't lost. Is that the best step for me to take?
Now that I have upgraded will it be easier for me to move the plugin links?
Thanks, your help is much appreciated @x00
well if you ungraded correctly it wouldn't have removed the categories how did you upgrade?
Did you follow the docs?
grep is your friend.
I followed them correctly, as per Vanilla's own instructions in the ReadMe file that comes with the installation files.
I even tried using vanilla2export.php too, but the data was still lost.
It may be because I have a personalised theme, with altered plugins & config.php, and had to also transfer those across.
However, I have started importing the tables across into my database now which solves that problem. Thank you.
Would it now be easier/possible for me to implement the following?
there is no deed to import any data at all, so it wouldn't delete the categories.
http://vanillaforums.org/docs/installation-upgrade
you might have to put your backup database, then run
index.php?p=/utility/update
grep is your friend.
I should have mentioned my forum is still in it's beta phase, so no important data has been risked
ok
grep is your friend.
I tried this too, and it informed me the update was successful.
I have been know to miss the complete obvious in the past, so I'm sure I had done something wrong. Thankfully that bit is all sorted now.
First removing the links
create a file in your themes folder
class.modsthemehooks.php
and insertI don't know which plugin is All Viewed so i can't comment on how to remove the links, till I have this info.
Regarding adding links to the panel. Aolee method will work but it is not how I'd do it. The reason is that is hard coded, it is not making use of the panel asset by adding module, or adding to an existing module.
It actually depends what you wan to do how you would do it.
grep is your friend.
edited - see below comment
Thanks @x00
The All Viewed plugin came with the Vanilla download via Heart Internet hosting. It is no longer in the addons list, but I found a question related to the plugin here: http://vanillaforums.org/discussion/14418/mark-all-link-in-sidebar
It says Mark All Viewed, but in the plugins folder it is just All Viewed.
It only consists of one 'class.allviewed.plugin.php' file (I'm having real difficulty attaching the file to this post, and there is a lot of code).
I'm not set on any hard coding, that's the only solution I have come across so far. As long as there is text or a button in the side panel (and not in the menu) then I'm not too fussed.
<?php if (!defined('APPLICATION')) exit();
/**
* 'All Viewed' plugin for Vanilla Forums.
*
* v1.2
* - Fixed "New" count jumping back to "Total" (rather than 1) after new comment if user hadn't actually viewed a discussion.
* - Removed spurious config checks and &s
*
* @package AllViewed
*/
$PluginInfo['AllViewed'] = array(
'Name' => 'All Viewed',
'Description' => 'Allows users to mark all discussions as viewed.',
'Version' => '1.2',
'Author' => "Matt Lincoln Russell",
'AuthorEmail' => 'lincolnwebs@gmail.com',
'AuthorUrl' => '',
'License' => 'GNU GPLv2',
'MobileFriendly' => TRUE
);
/**
* Allows users to mark all discussions as viewed.
*
* @package AllViewed
*/
class AllViewedPlugin extends Gdn_Plugin {
/**
* Adds "Mark All Viewed" to main menu.
*
* @since 1.0
* @access public
*/
public function Base_Render_Before($Sender) {
// Add "Mark All Viewed" to menu
$Session = Gdn::Session();
if ($Sender->enu && $Session->IsValid()) {
// Comment out this next line if you want to put the link somewhere else manually
$Sender->Menu->AddLink('AllViewed', T('Mark All Viewed'), '/discussions/markallviewed');
}
}
/**
* Allows user to mark all discussions as viewed.
*
* @since 1.0
* @access public
*/
public function DiscussionsController_MarkAllViewed_Create($Sender) {
$UserModel = Gdn::UserModel();
$UserModel->UpdateAllViewed();
Redirect('discussions');
}
/**
* Get the number of comments inserted since the given timestamp.
*
* @since 1.0
* @access public
*/
public function GetCommentCountSince($DiscussionID, $DateAllViewed) {
// Only for members
$Session = Gdn::Session();
if(!$Session->IsValid()) return;
}
/**
* Modify CountUnreadComments to account for DateAllViewed
*
* Required in DiscussionModel->Get() just before the return:
* $this->EventArguments['Data'] = $Data;
* $this->FireEvent('AfterAddColumns');
* @link http://vanillaforums.org/discussion/13227
* @since 1.0
* @access public
*/
public function DiscussionModel_AfterAddColumns_Handler($Sender) {
// Only for members
$Session = Gdn::Session();
if(!$Session->IsValid()) return;
}
/**
* Update user's AllViewed datetime.
*
* @since 1.0
* @access public
*/
public function UserModel_UpdateAllViewed_Create($Sender) {
// Only for members
$Session = Gdn::Session();
if(!$Session->IsValid()) return;
}
/**
* 1-Time on Enable.
*/
public function Setup() {
$this->Structure();
}
/**
* Database changes.
*
* @since 1.0
* @access public
*/
public function Structure() {
$Structure = Gdn::Structure();
$Structure->Table('User')
->Column('DateAllViewed', 'datetime', NULL)
->Set();
}
}
what does it say nr.
->Menu->AddLink
?grep is your friend.
the reason AllViewed is not in plugin section, is because it is
.
part of the plugins distributed in the core
it is not necessary to attempt to post the entire code.
Also it is easier to attach it as a text file if the need was there, which it isn't.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I had a feeling it probably was.
I tried to attach the text file, but it only showed up as an image @peregrine