1. Structure. Add primary key on UserID field. 2. DiscussionsController_Render_Before, DiscussionController_Render_Before, CategoriesController_Render_Before are sameness in body. Try this way: public function Base_Render_Before(&$Sender) {
if( !In_Array($Sender->ControllerName, array('categoriescontroller', 'discussioncontroller', 'discussionscontroller')))
return;
$ConfigItem = Gdn::Config('WhosOnline.Location.Show', 'every');
// .... 3. For any not logged-in users $Session->UserID = 0, but WhosOnlineModule::GetData() ($SQL->Replace) is called every time in *_Render_Before. 4. Dislike this construction: $Parts = explode("/", Gdn_Url::Request()); Maybe better to check this vars $Sender->ControllerName, $Sender->ApplicationFolder ?
Providing you have vanilla 2, you just have to copy the whosonline folder to the plugins directory. Then on your forum go Dashboard > Plugins > and click enable on the whos online one.
Some issues with the vanilla2 version I've got (tarball from 17/09):
In default.php it adds in css: /plugins/whosonline/whosonline.css
But the zip decompress to WhosOnline/ so it doesn't work on unix based host.
Furthermore, when trying to access the configuration page (http://vanilla2/plugin/whosonline), I've got: Fatal error: Class 'Form' not found in /var/www/vanilla2/plugins/WhosOnline/default.php on line 22
With Todd's modification today (that helped with the path issues, I think I opened an issue for that, or at least I mentionned it in the forum (cssthemes/CssThemes wasn't working), and I didn't, I should have ), you just need to change:
Many thanks for creating this add-on, I'm not entirely sure of what's involved to bring this back in line with the latest version, but it is currently the most popular Vanilla 2 add on with 806 downloads, not sure if anyone else is planning on picking up development? Thanks
@bean I tried it, but its not the same as previous it appears and rendered it differently. I think some of the css has changed, so i moved it back to Panel.
I've set the Foot Asset, after the "powered by vanilla", maybe it was above before? You can try to put it before (that's in there: applications/garden/views/default.master.php)
Comments
2. DiscussionsController_Render_Before, DiscussionController_Render_Before, CategoriesController_Render_Before are sameness in body.
Try this way:
public function Base_Render_Before(&$Sender) { if( !In_Array($Sender->ControllerName, array('categoriescontroller', 'discussioncontroller', 'discussionscontroller'))) return; $ConfigItem = Gdn::Config('WhosOnline.Location.Show', 'every'); // ....
3. For any not logged-in users $Session->UserID = 0, but WhosOnlineModule::GetData() ($SQL->Replace) is called every time in *_Render_Before.
4. Dislike this construction:
$Parts = explode("/", Gdn_Url::Request());
Maybe better to check this vars $Sender->ControllerName, $Sender->ApplicationFolder ?
In default.php it adds in css:
/plugins/whosonline/whosonline.css
But the zip decompress to WhosOnline/ so it doesn't work on unix based host.
Furthermore, when trying to access the configuration page (http://vanilla2/plugin/whosonline), I've got:
Fatal error: Class 'Form' not found in /var/www/vanilla2/plugins/WhosOnline/default.php on line 22
$Sender->Form = new Form();
to
$Sender->Form = new Gdn_Form();
in default.php
Fatal error: Cannot pass parameter 1 by reference in /home/web/public/plugins/WhosOnline/default.php on line 24
I've "fixed" it. I don't know how well though
But, apparantly the "Foot" AssetTarget doesn't work anymore so I've replaced it with Panel.
It's there: http://bitbucket.org/bean/whosonline/
You can try to put it before (that's in there: applications/garden/views/default.master.php)