Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

text-only mode to block a category too

edited January 2007 in Vanilla 1.0 Help
how easy would this be? i would like that when someone clicks the 'text-only' mode link, that the app switches to text-only mode, and a particular category gets blocked. this would then be reversed when turning text-only mode off again.

i have relabeled 'text-only' to 'work-safe', so i would like the link to also block the 'nsfw' category.

thanks in advance! :)

Comments

  • *bump* it's probably possible with a little js - it's not like i need an admin backend for it, or even to change it after it's done once...
  • edited January 2007
    This may help... just add a check for the text mode in that IF block: http://lussumo.com/community/discussion/4301/#Item_8
  • edited January 2007
    erm, i guess it isn't as simple as

    if ($HtmlOn == '1')
    then? :)
  • nm, it was... heh

    this is a snippet from your code, mangled slightly...

    if ( ('index.php' == $Context->SelfUrl) && !in_array(ForceIncomingString('CategoryID', '') , array('4')) && ($HtmlOn == '0'))

    4 is the category that i wish to hide, this can be an array (as it was originally - '1, 3, 6' etc).

    thanks, mister!
  • actually, that doesn't work - it'll hide the category's discussions right up until you reload the discussions page...
  • *bump*
  • Hmm... You did change the IF correctly... There are two places in my code that need the array changed but I expect that was already done correctly. (for some reason storing the array as a variable didin't work... but its beta code anyway) I will have to install the text mode switch and try this out tonight.
  • ah right. yes, i changed both array statements. like i said - it worked fine, until you reload the page (without resending the ?h=0 in the url, obviously). anyway, thanks for the help. i'll keep plugging away at it, maybe i'll strike it lucky now :)
  • Oy! The ?h=0 appears when changing the text mode, not the actual status of the text mode...

    Try this:if ( ('index.php' == $Context->SelfUrl) && !in_array(ForceIncomingString('CategoryID', '') , array('4')) && !$Context->Session->User->Preference("HtmlOn") )
  • /me hands wallphone a cigar! that's the ticket, thank you very muchly, mr. wallphone!
This discussion has been closed.