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.

No support for sticky discussions? (converting from SMF)

I searched and found a few discussions regarding sticky threads/discussions. It seems that v2.1 would support it in the form of an "Announced" discussion?

My problem is I'm converting from SMF 2.x to Vanilla 2.1 and I have quite a few fixed/sticky discussions but none of that converts over to Vanilla. Any way to maybe get this done manually via mysql?

thanks
Ricardo

«1

Comments

  • peregrineperegrine MVP
    edited May 2014

    If you have that many announcements - how will people actually see the other discussions.

    I don't know what others think, but more than a few announcements is over-kill.

    in the discussion table is a field called Announce or something like that.

    when it has a 1 as the value in the field it is an announcement.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine said:
    If you have that many announcements - how will people actually see the other discussions.

    What I meant is that overall (over multiple categories) there is a good number of sticky discussions. In the main discussion forum that I have there are 5 sticky threads that always show up on top, but that forum in itself has more than 80k discussions over almost 10 years of postings :D

    I don't know what others think, but more than a few announcements is over-kill.

    I agree, here I'm talking about 5 on the main forum. But in any case I do need to understand how to manually convert to sticky

    in the discussion table is a field called Announce or something like that.

    when it has a 1 as the value in the field it is an announcement.

    great... do announcements in Vanilla also show up at the top as fixed postings? I guess I'll play around with it to see what it looks like

    thanks for your help
    Ricardo

  • peregrineperegrine MVP
    edited May 2014

    great... do announcements in Vanilla also show up at the top as fixed postings

    yes. there are options to make it stick in category or everywhere. at least in vanilla 2.1

    you can easily edit a discussion and make it an announcement. if you have announcement privs set for your role.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • thanks. I did get a discussion to appear up at the top by setting the announce field to 1 in the database

    SMF has a notion of sticky and also locked discussions. I don't quite understand the difference (maybe the locked ones can't be modified or deleted?). Any guess what the difference might be and how that would translate to Vanilla?

  • peregrineperegrine MVP
    edited May 2014

    this may be silly reasoning. but if you don't know what the purpose was before, why would you care. or are you doing this for a client and they don't have a clue what was what.

    your forum (especially announcements) are what you make of it today, not what it was in the past.

    iirc

    • A category announcement (announcements that stick when viewing a specific category,

      have a value of "2" in the announcements field in discussion table

      these don't stick in the main discussions page (discussions from all categories)

    • But primary Announcments that are announcements in main discussion page (all categories)

      have a value of "1" in the announcements field in discussion table

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine said:
    this may be silly reasoning. but if you don't know what the purpose was before, why would you care. or are you doing this for a client and they don't have a clue what was what.

    your forum (especially announceements) are what you make of it today, not what it was in the past.

    I'm the administrator, I host the forum. I also do participate in it. Although I'm the administrator I'm not one of the moderators, for example. So I'm not really the one taking care or deciding whether certain discussions should be made sticky or locked down. I guess you could say they're "a client" although this is a free service, we've been using this forum for almost 10 years now and I'm looking for a better software

    So what I am doing is "in the background" working to improve the forum by moving from SMF to Vanilla. I first have to make sure everything works before even attempting to do it "in production"

  • peregrineperegrine MVP
    edited May 2014

    see my previous edited comment it may help.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine said:
    see my previous edited comment it may help.

    that's great, thank you.

    would you be able to help with a related question? I now have the announcement fixed on top - that's the first step.

    Now I'm trying to have the announcements shown with a different background color. However I don't see a way to differentiate the discussions. Both the discussion with announcement and any other discussion are within a class block of

    div class="ItemContent Discussion"

    I don't see anything else in the source HTML distinguishing them, so I don't know how to customize the background via CSS. Do you think there's another way?

  • peregrineperegrine MVP
    edited May 2014

    that's great, thank you.

    one possiblity is you could add this via js

    jQuery(document).ready(function($) {
    $("span.Tag-Announcement").parent().parent().css("background", "yellow");
        });
    

    you could look at various plugins to see how to add js and there is also something on the wiki as well.

    to see it in action. cut and paste it in your console and run it on this page.

    http://vanillaforums.org/discussions

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • actually this would be a better script

    jQuery(document).ready(function($) {
    $("span.Tag-Announcement").closest('.Item').css("background", "yellow");
        });
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited May 2014

    here is a sample jquery script plugin

    http://vanillawiki.homebrewforums.net/index.php/Adding_Some_JQuery_to_a_Plugin

    you could also do it via adding to CssClass with php and a css element to change background based on class.

    when you have an entirely different question.

    better to start a new discussion with the title describing what you want and a new descrription of what you want and the version number of vanilla you are using in that new discussion, it will help other people aside from helping you.

    the folllowing are worth the read.

    here is a roundup of some other tips that may help you or other posters.

    I also added these I am sure they will be useful.

    http://vanillaforums.org/discussion/18015/how-to-ask-questions-on-the-internet

    when-asking-a-question http://vanillaforums.org/discussion/25115/how-to-how-can-a-new-user-better-help-the-community-

    and a few other helpful links:

    http://vanillaforums.org/discussion/23130/forum-post-ettikett-etiquette

    http://vanillaforums.org/discussion/17954/food-for-thought-forum-etiquette

    http://vanillaforums.org/discussion/23483/advice-for-all-those-just-starting-out-with-vanilla

    troubleshooting tips: http://vanillaforums.org/discussion/20231/how-to-become-somewhat-adept-at-modifying-vanilla-

    click here: #etiquette to determine posting etiquette

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine said:
    here is a sample jquery script plugin

    http://vanillawiki.homebrewforums.net/index.php/Adding_Some_JQuery_to_a_Plugin

    you could also do it via adding to CssClass with php and a css element to change background based on class.

    when you have an entirely different question.

    Thanks for the pointers. Since all of these questions are related to the Announcements, and the css (or js) question is also related to me trying to make the announcement work in a proper way, I didn't consider this to be an "entirely different question"

    If you would like me to abandon this thread related to Announcements which I did create separately and create a new one to talk about how to customize the look&feel I can do that, but to me it seemed appropriate to continue on the thread.

    In any case, I did follow your js query script suggestion (created a plugin) and enabled it, but that didn't work. I'm not sure how to debug it.

    If it's best for me to create a new discussion to talk specifically about the plugin, I can certainly do that and apologize if this is somehow violating the etiquette, I'm simply just following up on the discussion that I created...

  • peregrineperegrine MVP
    edited May 2014

    rherorical question:

    lets say someone sees the title..

    No support for sticky discussions? (converting from SMF)

    would they assume it has anything to do with changing background color of an announcement.

    to answer my own rhetorical question. no I wouldn't think to look at the discussion.

    so in my mind the more clearly the title relates to the discussion question, the easier it is for someone to determine by the title of the discussion what the entire discussion is about.

    you decide for yourself by reading your own title!

    the gist is making it easier to see for everyone, not just yourself.

    but since we started down this road. I will continue here. and you can link your new discussion to here.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  •  <?php if (!defined('APPLICATION'))  exit();
        // Define the plugin:
        $PluginInfo['AnnouncementColor'] = array(
            'Name' => 'Announcement Color',
            'Description' => 'Change Announcement Item to a different Color.',
            'Version' => '1.0',
            'Author' => "Peregrine-nonsupported"
        );
    
    
    
    class AnnouncementColor extends Gdn_Plugin {
    
         public function DiscussionsController_Render_Before($Sender) {
              $this->AC_Attach_Resources($Sender); 
            }
         public function CategoriesController_Render_Before($Sender) {
                $this->AC_Attach_Resources($Sender); 
            } 
    
         public function AC_Attach_Resources($Sender) {
         $Sender->AddJsFile($this->GetResource('js/ancolor.js', FALSE, FALSE));
            } 
    
    
    
       }
    

    put the above in plugins/AnnouncementColor/default.php


        jQuery(document).ready(function($) {
        $("span.Tag-Announcement").closest('.Item').css("background", "yellow");
        });
    

    put the above in plugins/AnnouncementColor/js/ancolor,js

    tested and works.

    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've created a separate question/discussion

  • peregrineperegrine MVP
    edited May 2014

    well your answer is here. and the code I posted works.

    all you have to do is cut and paste it in the appropriate places without making any changes and giving the foloders and ifles correct permissions.

    you could also update the wiki and replace the code with the above code as an example and you could also make improvements to the wiki if you want, since the link related Adding_Some_JQuery_to_a_Plugin that I provided above is old code that may no longer work in 2.1

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited May 2014
     jQuery(document).ready(function($) {
    $("span.Tag-Announcement").closest('.Item').css("background", "yellow");
    });
    

    put the above in plugins/AnnouncementColor/js/ancolor,js

    should not be comma but a period before the .js

    put the above in plugins/AnnouncementColor/js/ancolor.js

    rmkleemann, glad the code and plugin worked for you. despite the need to change the comma.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • rmkleemann, glad the code and plugin worked for you. despite the need to change the comma.

    thanks to you. :D

    I am playing around with other things right now as well, trying to learn as much as possible.

    Currently trying to find where the appropriate "T(" string is for view and comments in order to translate. For example, where it says below the discussion title,

    "90 views 34 comments"

    The captured.php does have $Definition['comments'] for example, but changing that hasn't worked.

    I tried setting both

    $Definition['comments'] and $Definition['%s comments']

    as found in the locale captured.php but that didn't work. So I'm searching for the appropriate "T(" string in the various php files in order to do the appropriate substitution.

  • peregrineperegrine MVP
    edited June 2014

    you can't fool me this time :) because now one should really start a new discussion or we can play duelling discussions

    but this has been answered a few times before. How come you don't search the forum for answers.

    #Plural   click to the left of me on the hashtag
    
    #views    click to the left of me on the hashtag
    
       or  you could searchcomments definition
    

    I also believe it may be in the tutorial I suggested as well

    or here

    http://vanillaforums.org/discussion/26597/tutorial-how-to-change-wording-how-to-change-text-how-to-change-language-how-to-change-locale

    see if you can spot it :)

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.