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.

[Solved] Announcements and Tags don't play together well (TaggingEnhanced)

brainolutionbrainolution ✭✭
edited March 2012 in Vanilla 2.0 - 2.8

If I have an announcement with a tag called Tag1, and I click on Tag1 in the tag list, the announcement tagged with Tag1 doesn't show up (in fact none of the announcements show up) when a Category or Tag page is pulled up. Is there a way to show the announcements with Tag1 to also show up when Tag1 is clicked? I'm using Vanilla 2.0.18.3, and all my plugins are downloaded in the last 7 days.

Tagged:

Answers

  • UnderDogUnderDog MVP
    edited March 2012

    Oh boy... :-S

    I cannot give you a solution, but I can give you how I found what you need to change:
    Open this file:
    vanilla\plugins\Tagging\views\taggeddiscussions.php
    You'll see the text : Questions tagged with so this is the main view file for tags
    This is the important piece of code:

      <?php include($this->FetchViewLocation('discussions')); ?>

    Then open this file:
    vanilla\plugins\Tagging\class.tagging.plugin.php

    editSorry, was away from my PC for a while

  • Thank you.

    I'm looking at those files now, but haven't been able to find what to update. Anyway, I'll continue to dig in. I thought maybe if someone has done it before, I can get some quick help.

  • brainolutionbrainolution ✭✭
    edited March 2012

    I'm able to make some progress but not without some unwanted side-effects :)

    I changed the following line in applications/vanilla/models/class.discussionmodel.php :

    Original:

    $IncludeAnnouncements = FALSE;
    

    New

    $IncludeAnnouncements = TRUE;
    

    and was able to get the relevant announcements to appear when a tag was clicked. But there's a problem. Back on the main discussions page, the announcements are appearing twice - once at the top (as expected), and once again in the discussion list sorted as per the date they were posted.

    So, the search continues ...

  • Ok
    Also in vanilla\plugins\Tagging\class.tagging.plugin.php

    Look for line 100-102

    $Sender->AnnounceData = FALSE;
            $Sender->SetData('Announcements', array(), TRUE);

    Maybe set announcedata to TRUE. Keep trying and make backups, so you can easily put back what you've changed.

    I don't know if the TaggingEnhanced plugin will give you what you need, but you might want to look at that one too.

  • Actually what you suggested was the first thing I tried, but it didn't seem to make any difference. Let me look at TaggingEnhanced. Thanks again.

  • brainolutionbrainolution ✭✭
    edited March 2012

    On the TaggedEnhanced plugin page, it says:

    PS: Bug where announcements are not shown when tag filter is on

    This bug can be solved by editing a line in the vanilla\models\class.discussionmodel.php

    Change this line from:
    CODE START
    if (!isset($Wheres['w.Bookmarked']) && !isset($Wheres['d.InsertUserID'])) $this->RemoveAnnouncements($Data);
    CODE END

    to

    CODE START
    if (!isset($Wheres['w.Bookmarked']) && !isset($Wheres['d.InsertUserID']) &&!property_exists($this, 'FilterToTagID')) $this->RemoveAnnouncements($Data);
    CODE END

    But it didn't work. I'm wondering what FilterToTagID property is. Do I need to set this in the configuration file? Maybe this fix works only with TaggingEnhanced.

    My issue seems similar to this:vanillaforums.org/discussion/14572/issue-no-items-tagged-with

  • brainolutionbrainolution ✭✭
    edited March 2012

    OK, problem solved with TaggingEnhanced. The above code change works only with TaggingEnhanced.

    @UnderDog - thanks for your help.

  • I'm wondering what FilterToTagID property is

    You'll find out someday and then you'll be able to add it to the Vanilla Wiki, I presume.
    Just a hint : Look in the MySQL database for the tagging tables.

Sign In or Register to comment.