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.

Auto title

nopresniknopresnik New
edited April 2012 in Vanilla 2.0 - 2.8

How can I make it so when I post in a defined catagory, it will not have a discussion title box. Only a body box,will appear. But when it's posted, the title is the username of the poster.
Please help.

Answers

  • jQuery(document).ready(function($) {
    
    $('a.Title').hide();
    });
    

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

  • So this will hide the title box but will post with the title of the username. Also, where does this go? Index.php?

  • Just hide.

    There was an error rendering this rich post.

  • So what I want is not possible? Also, no one has told me where to put this code :(

  • Of course its possible, i just dont know how.

    There was an error rendering this rich post.

  • Right, but where does this code go?

  • Are you embedded or self hosted ?

    If self hosted throw it in some script tags and plonk it in the bottom of default.master.php

    There was an error rendering this rich post.

  • So how would I get it to just do this on one catagory?

  • i use this code in a plugin....

      $Url = $Sender->SelfUrl;
                if(eregi('discussion/(.*)', $Url)) {
                    if( $Sender->CategoryID <> 8 &&  $Sender->CategoryID <> 29 &&  $Sender->CategoryID <> 38 &&  $Sender->CategoryID <> 40){
                        
                    $Show = true;
                    }
                //  break;
                }
    
  • That looks better! May I ask what plugin this is and is it avaliable for download?

  • nopresnik said:
    That looks better! May I ask what plugin this is and is it avaliable for download?

    It's a custom plugin that i use to insert ad code into various pages in specific places. I do not want to place advertising on certain categories or based on other rules.

    it's not available for download because it isn't really something plug and play. all of the rules and actions are modified in the plugin itself, not through settings. so i won't be releasing it.

    but the code above can be used in any plugin to determine whether you are on a discussion page and if you are what category you are in.

    of course you would need to tweak it for your application. I think you will need to override the add discussion controller to get the behavior you are seeking. in which case im pretty sure the $sender would just be replaced by $this.

    Sorry i can't go into any more detail, since i would have to actually try to write the code to figure out any more.

    There's lots of info on http://vanillawiki.homebrewforums.net that could help you start digging in to this one, and of course feel free to ask questions.

Sign In or Register to comment.