Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us


Recent activity doeas not work with Vanilla Default multitheme

tmilovantmilovan New
edited November 2010 in Questions
This discussion is related to the RecentActivity addon.
Recent activity plugin does not shows on Vanilla Default multitheme or with Embed Friendly that comes with vanilla 2.0.14 installation. However, it works fine with included default theme.
Tagged:

Comments

  • Ok thanks, I'll try to make it right as soon as I can.
  • remoukremouk New
    edited November 2010
    I'm sorry I can't find what's going on... I can't manage to get it work with any other theme than the default one.

    Any help from a Vanilla dev please?
    @Todd @digibomb @Tim @Mark @Lincoln

    The code is pretty simple:
    (plugin info blabla...)
    class RecentActivityPlugin extends Gdn_Plugin {

    public function Base_Render_Before(&$Sender) {
    $Controller = $Sender->ControllerName;

    if (!InArrayI($Controller, array('categoriescontroller', 'discussioncontroller', 'discussionscontroller', 'messagescontroller', 'profilecontroller'))) return;

    $RecentActivityModule = new RecentActivityModule($Sender);
    $RecentActivityModule->GetData(10);
    $Sender->addModule($RecentActivityModule);
    }

    public function Setup() {
    // No setup required
    }
    }
  • LincolnLincoln Community Instigator Vanilla Staff
    Please don't carpet-bomb mention every developer. Pick 1 or 2 most appropriate and we'll pass it off if necessary. Besides, Tim will throw things at you if he sees you using Base_Render_Before like that. ;)

    Are there any errors?
    Can you check to see if it's even finding the RecentActivity module?
    Can you output something to make sure the plugin is triggering?

    Sr Developer at Vanilla Forums [GitHub, Twitter]

  • remoukremouk New
    edited November 2010
    Sorry I didn't know who was the "most appropriate", so I just picked the first few names I saw...
    Are there any errors?
    No.
    Can you check to see if it's even finding the RecentActivity module?
    Not sure what you mean. The Base_Render_Before() is executed for sure in every theme. Also, I tried to create my own module named NewRecentActivityModule, within a file named class.newrecentactivitymodule.php in which I copy/pasted the code from the core module with a few changes to make it work: it works in the default theme, not in the others (nothing happens).
    Can you output something to make sure the plugin is triggering?
    If I add a var_dump('ok'); in the Base_Render_Before(), it appears.

    Btw, what's wrong with the Base_Render_Before()? I'm not used to Vanilla/Garden at all, but I'd like to make this plugin right.

    Thanks for you answer!
  • LincolnLincoln Community Instigator Vanilla Staff
    edited November 2010
    I'm probably going to need a little more time than my lunch break to figure this out. I'll try to remember to check back later if someone else doesn't get to this.

    Sr Developer at Vanilla Forums [GitHub, Twitter]

  • TimTim Lord of Servers Vanilla Staff
    Couple things off the top of my head:

    - You should probably lower() your $Controller variable before comparing it in InArrayI().
    - $Sender->AddModule(), not addModule()

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

  • TimTim Lord of Servers Vanilla Staff
    Also, when you're developing for Garden you should try to turn on DEBUG. You can do this by adding define('DEBUG', TRUE); at the top of your index.php. This turns on strict mode. Also, change $Configuration['Garden']['Errors']['MasterView'] = 'error.master.php'; to $Configuration['Garden']['Errors']['MasterView'] = 'deverror.master.php'; in your conf/config.php

    This will enable full screen detailed error messages.

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

  • Thanks you two for helping me out!
    - You should probably lower() your $Controller variable before comparing it in InArrayI().
    - $Sender->AddModule(), not addModule()
    Done.
    (...)
    This will enable full screen detailed error messages.
    Already did this, but I have absolutely no error.
  • @Lincoln Did you find time to look at it? I've been trying a lot of things but still haven't found where does the problem comes from... :/
  • @Lincoln @Tim
    I'm desperate, any idea about how to make it work everywhere?
  • TimTim Lord of Servers Vanilla Staff
    I just tested this on my local install with several themes. They all worked. Even Embed (with sidepanel NOT hidden, obviously).

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

  • @Tim I'm more than surprised, I can't get my plugin to show anything, except on the default theme... Version 2.0.14 and everything... What's going on? :D
  • It works in EmbedFriendy theme after upgrading to 2.0.15.
  • @tmilovan Hi. Well, that's strange it still doesn't work for me (2.0.15, flushed the cache and everything...).
  • tmilovantmilovan New
    edited December 2010
    Well, I didn't change anything. Just upgraded vanilla (I have overwritten all themes too) and there It was. Now it also displays box with followed discussions in sidebar which wasn't there before, so maybe that's somehow connected.
  • Damn. I tried and tried again, there's no way it's displayed...
Sign In or Register to comment.