Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorchris
    • CommentTimeJan 24th 2007
     # 1
    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! :)
    • CommentAuthorchris
    • CommentTimeJan 24th 2007
     # 2
    *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...
    •  
      CommentAuthorWallPhone
    • CommentTimeJan 24th 2007 edited
     # 3
    This may help... just add a check for the text mode in that IF block:
    http://lussumo.com/community/discussion/4301/#Item_8
    • CommentAuthorchris
    • CommentTimeJan 25th 2007 edited
     # 4
    erm, i guess it isn't as simple as

    if ($HtmlOn == '1')
    then? :)
    • CommentAuthorchris
    • CommentTimeJan 25th 2007
     # 5
    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!
    • CommentAuthorchris
    • CommentTimeJan 25th 2007
     # 6
    actually, that doesn't work - it'll hide the category's discussions right up until you reload the discussions page...
    • CommentAuthorchris
    • CommentTimeJan 25th 2007
     # 7
    *bump*
    •  
      CommentAuthorWallPhone
    • CommentTimeJan 25th 2007
     # 8
    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.
    • CommentAuthorchris
    • CommentTimeJan 25th 2007
     # 9
    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 :)
    •  
      CommentAuthorWallPhone
    • CommentTimeJan 25th 2007
     # 10
    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") )
    • CommentAuthorchris
    • CommentTimeJan 25th 2007
     # 11
    chris hands wallphone a cigar!

    that's the ticket, thank you very muchly, mr. wallphone!
Add your comments
    Username Password
  • Format comments as