Fork me on GitHub
Current Releases are 2.1 stable (major release) and 2.0.18.11 (security patch for 2.0)
We've also rebooted our GitHub repo, docs, and more!

PostBox

nopresniknopresnik New
edited April 2012 in Questions

Okay. No one understood what i wanted. All i want is for one catagory called "Ban Appeals" to have a special post discussion box. I want it to have it so that the "Discussion Title"box is hidden, only showing the discussion body box. But when the user posts the discussion, the title of the discussion will become the discussion posters UserName on the forum. Thank you.

Best Answer

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited April 2012 Answer ✓

    The old version didn't work exactly the way I wanted so this version should be suitable. version 1.1 that actually works and is configurable with config.php. Instructions in details at addon.

    disregard the $notitle in previous message and use these instructions:

    instructions: to suppress titles in the "Good Food" category.

    add this to config.php under //plugins

    in the file /vanilla/config.php

    $Configuration['Plugins']['HideTitle']['NoTitleCat'] = 'Good Food';

    or if the category to suppress titles is named Questions

    $Configuration['Plugins']['HideTitle']['NoTitleCat'] = 'Questions';

    note: it will only suppress the title when you choose that specific category to view. In General Discussions which includes all categories it keeps the title even for that category. I didn't know what you wanted.

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

Answers

  • jspautschjspautsch Themester ✭✭✭

    That doesn't sound too hard, are you asking for tips on how to make your own plugin or looking for someone to design it for you?

  • I would love for someone to do it for me (sorry). I have no clue how to mod vanilla.

  • Sorry, this is something I do not want to pay for. If its going to cost me money, I may aswell get tips and help to make it myself.

  • x00x00 MVP
    edited April 2012

    tips read up plugins.

    you are going to have hook the post controller, and check it applies, then replace the field as appropriate. To disable the title the only way you would be able to do this realistically is with a javascript, supplying the lookup, through a definition, which could be easily parsed like JSON. then disable based on change on the category dropdown.

    that is pretty much it in terms of tips.

    grep is your friend.

  • Well. I think im not going to worry about it anymore. Just too hard.

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited April 2012

    Sometimes I wonder why people don't look at hbf's wonderful documentation on vanilla.

    change

    $noTitle = strtolower("My Category Name");

    to

    $noTitle = strtolower("Ban Appeals");

    in the plugin I created special for you

    http://vanillaforums.org/addon/hidetitle-plugin

    I sure hope you click the like button.

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

    422nopresnik
  • 422422 Developer MVP

    Clicked LIKE

    goodonya

    422 Real Estate Australia , now open Check it out

    peregrine
  • peregrine said: The old version didn't work exactly the way I wanted so this version should be suitable. version 1.1 that actually works and is configurable with config.php. Instructions in details at addon.

    disregard the $notitle in previous message and use these instructions:

    instructions: to suppress titles in the "Good Food" category.

    add this to config.php under //plugins

    in the file /vanilla/config.php

    $Configuration['Plugins']['HideTitle']['NoTitleCat'] = 'Good Food';

    or if the category to suppress titles is named Questions

    $Configuration['Plugins']['HideTitle']['NoTitleCat'] = 'Questions';

    note: it will only suppress the title when you choose that specific category to view. In General Discussions which includes all categories it keeps the title even for that category. I didn't know what you wanted.

    Seeing the title is hidden. Is it posible to accually when they're posting to remove the title box and post the discussion with a title of "Good Food" automaticly? If you dont understand let me know.

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited April 2012

    I am not sure what you are after - it now seems to be changing.

    You seem to indicate you want the same subject for all the discussions in a particular category.

    if you are looking to have one category - that has only one subject in it, where people can only add comments.

    Use x00's Category Heading plugin - create a category - start a discussion and then lock it. users can still add comments to the category they just can't add a new discussion in the category. Or you could create multiple categories that are nested and start one discussion in each and lock them down - that would probably give you what you want. as far as modifying the plugin - maybe some day in the future but not right now, unless it appears to be a simple thing to figure out.

    Or now you have a start in learning how to write or modify a plugin (also see the documentation).

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • Sorry, I mean when the discussion is posted I wouldd like the title to come out as "Good Food" instead of nothing.

  • hbfhbf wiki guy? MVP

    peregrine said: Sometimes I wonder why people don't look at hbf's wonderful documentation on vanilla.

    Thanks... but I want everyone to treat it as Thier documentation... I need all you up and coming Vanilla coders and themers to start capturing all of your great tips and tricks over there, I can't do it alone (nor should I, im not really an expert at any of this).

    and on that note here's the address for reference http://vanillawiki.homebrewforums.net

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP

    nopresnik said: Sorry, I mean when the discussion is posted I wouldd like the title to come out as "Good Food" instead of nothing.

    So you want every discussion to have the same title as the category? Is that right. Can I ask why and how it will help the users.

    there could be 100's of discussions with the same title as the category name. You must have a reason, but it seems really confusing.

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • Because this will keep it tidy for the stuff im going to be using this for. It may sound confusing but really its not. I origianaly wanted the title of each discusssion to be "Ban Appeal [username]. [username] being the username of the poster on the forum. If thats possible it would be great.

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited April 2012

    I haven't researched the posting information, so it may be awhile, if I can figure it out at all. I don't like to muck with writing to the vanilla database with a plugin because it has to be absolutely correct, with no room for error.

    In the meantime check out http://vanillaforums.org/addon/categoryheadings-plugin

    I can't promise you anything.

    Maybe somebody else will chime in with an answer or a mod.

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • x00x00 MVP
    edited April 2012

    One of the mistakes people make is fixation on the first solution that comes to mind.

    it a good idea to go back think about what you want to achieve in the broadest terms with ban appeals.

    If you are goign to be producing plugins, then you need php knowledge as a prerequisite. So get a book or do a course.

    grep is your friend.

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited April 2012

    @nopresnik

    this is the what I can do at the time - give it a try. It will only deal with titles in the "Banned appeals Category" while viewing within the "Banned appeals Category". I don't like the idea of writing to the database this modifies on the fly no matter what the user posted in the discussion title and will retain the original title in the database.

    replace line 26 with the following in the plugin - file is called default.php

      echo sprintf(' <a  href="/vanilla/index.php?p=/discussion/'  . $did . '/x/p1' . '">' . $urlCategory .' = ' . $Object->FirstName . '</a>');
              }
    

    and follow x00's suggestion on reading up on php, css, and jQuery.

    If essentially you want the originator of the message you could use either of these two plugins which as above will display the originator of the discussion.

    it will display the originator of the discussion in addition to the last replier.

    http://vanillaforums.org/addon/authortimeview-plugin or

    http://vanillaforums.org/addon/showdiscussionauthor-plugin

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • @peregrine this is what i get

    PHP Error Message Parse error: syntax error, unexpected '}' in /home/a1968065/public_html/forum/plugins/HideTitle/default.php on line 26

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited April 2012

    start from original file and replace this line (the post above had an unintentional bracket)

    echo sprintf(' <a href="/vanilla/index.php?p=/discussion/' . $did . '/x/p1' . '">' .$urlCategory .' = ' . $Object->FirstName . '</a>');

    the entire function should look like this

        public function DiscussionsController_BeforeDiscussionMeta_Handler($Sender) {
                 $Object = ($Sender->EventArguments['Discussion']);
                 $did = $Object->DiscussionID;
                 $noTitle = strtolower(C('Plugins.HideTitle.NoTitleCat'));
                 $noTitle = preg_replace('/\s+/','-',$noTitle);
                 $urlCategory = $this->getcategory();
                  if ($noTitle ==  $urlCategory){
              echo sprintf(' <a href="/vanilla/index.php?p=/discussion/' . $did . '/x/p1' . '">' . $urlCategory .' = ' . $Object->FirstName . '</a>');
                  }
             }
    

    @nopresnik

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited April 2012

    This may be helpful to

    if you haven't seen this and @nopresnik != @superstunts

    http://vanillaforums.org/discussion/comment/157931#Comment_157931

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

Sign In or Register to comment.