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.
    •  
      CommentAuthorMax_B
    • CommentTimeDec 16th 2006 edited
     # 1
    Add a way to define distinct roles level for adding comment and opening a new discussion in a given category.

    This extension adds two more, role based, category "level"; where Vanilla has 2:

    • invisible/blocked : in Vanilla
    • read-only
    • read and add comment but no "open a new discussion"
    • full access: in Vanilla

    ****NEEDS TWO MODIFIED THEME FILES****
    A pseudo-theme is packed with the extension.

    Version 0.1 initial release
    Version 0.2 add the code to check and add the necessary column to the Category table
    Version 0.3 corrected error on new category
    --------- corrected bug on index when removing categories from select.
    Version 0.4 Corrected a misuse of DicussionID rather than CategoryID
    0.5 set Cat_filter column to NULL for better MySQL compat
    added $Context->Database->GetConnection() in case an implementation use several connections
    0.6 Added a check on setting values for unitialized categories.
    0.7 Readme reflects addition of delegate to the core.
    Replaced "LUM_" with $Configuration['DATABASE_TABLE_PREFIX']
    • CommentAuthorquoo
    • CommentTimeMar 13th 2007
     # 2
    I'm getting an error with the latest version of vanilla on pretty much all my pages:


    Notice: unserialize(): Argument is not an string in /var/www/vhosts/myurl.com/subdomains/forum/httpdocs/extensions/CategoryRoles/default.php on line 78
    •  
      CommentAuthorMax_B
    • CommentTimeMar 13th 2007
     # 3
    Did you add the required delegate, as explained in the readme?
  1.  # 4
    was the delegate eventually added to vanilla
    •  
      CommentAuthorMax_B
    • CommentTimeApr 6th 2007
     # 5
    Nope.
    Mark never commented this delegate request and I don't know if he forgot to add it or what…
    Anyway, I'm planning to rewrite part of this extension to use the object factory instead of delegate, mostly because this would allow a much better database optimization, but I don't know when I'll have time for.
  2.  # 6
    How will object factory solve ur problem. can u explain.
    I'm trying to make a blog extension and i really need this functionality, Ability to be commented and read by all, but posted by just one role
    •  
      CommentAuthorDinoboff
    • CommentTimeApr 8th 2007
     # 7
    •  
      CommentAuthorMax_B
    • CommentTimeApr 8th 2007
     # 8
    About your need: use CategoryRoles, adding the delegate is only a single line edit.

    About the object factory: by overloading the standard class by a custom one, I'd be able to add the required database join and save the delegate need. Also a single database request is much better than 2 or 3.
  3.  # 9
    how will overloading a class affect future changes in the class.
    if mark adds some additional stuff to the class?
    •  
      CommentAuthorMax_B
    • CommentTimeApr 8th 2007
     # 10
    …the custom class must be updated accordingly. Every feature has a cost.
    •  
      CommentAuthorMr Do
    • CommentTimeApr 8th 2007 edited
     # 11
    could this work?
    if ($Context->SelfUrl == "post.php") {

    function discussionform_hidecategory($DiscussionForm) {
    unset($cs->aOptions[$Configuration['APPLICATION_PATH']]);
    }
    $Context->AddToDelegate('DiscussionForm','DiscussionForm_PreCategoryRender','discussionform_hidecategory');
    }


    well i obviously tried and it doesnt. probably because i dont get the $cs object. is this why you didnt use delegate?
  4.  # 12
    $cs is a select box. in this case its a categoryselect box <select>
    $cs->aOptions are the options <option>
    plus its a 2D array
    aOptions = array (0 => array( idValue => "ID", DisplayValue => "Display", Attributes => ""), 1=>..........

    you should start using a php debugger.
    • CommentAuthordrweyant
    • CommentTimeApr 10th 2007
     # 13
    Great add-on - greatly needed! I'm having a bit of a problem, tho - I am getting the same error messages as quoo above. I've added the delegate, as instructed, and am using the theme included with the package. I've cmod all CategoryRoles files/folder to 777 "just in case", and I'm still having the error messages thrown in the manage Categories pages, and where you actually read the discussions inside the Categories. I'm a bit stumped... any insight? I'd greatly appreciate it! Thanks in advance, drw
    •  
      CommentAuthorMax_B
    • CommentTimeApr 11th 2007
     # 14
    @drweyant: Its probably because setting are not initialized. Did you see this post?
    Anyway, I MUST correct this for long now. I'll try to do it today.
  5.  # 15
    Uploaded version 0.6 of CategoryRoles.
    •  
      CommentAuthorMax_B
    • CommentTimeApr 12th 2007
     # 16
    The 0.6 version correct the initialization bug and merge with Vanilla 1.1.2 theme file.
  6.  # 17
    Uploaded version 0.6 of CategoryRoles.
    • CommentAuthorMark W
    • CommentTimeJun 24th 2007 edited
     # 18
    edit: <oops, didn't add the delegate>
    • CommentAuthorAlty
    • CommentTimeFeb 17th 2008
     # 19
    I'd love to get this working on my installation if someone could give me a hand? I've installed the pseudotheme, but the delegate keeps giving me errors when I add it.

    There's also a post by MySchizoBuddy in the other discussion thread that says the delegate was added into the Vanilla core? I can't see the new role based controls at all.

    Any ideas?
    •  
      CommentAuthorMax_B
    • CommentTimeFeb 17th 2008
     # 20
    @Alty: The delegate is already there in 1.1.4 (since ?) you do not need add it.
    Did you enable the extension?
    • CommentAuthorAlty
    • CommentTimeFeb 18th 2008
     # 21
    Yep, the extension is enabled. I am running 1.1.4 and I've removed the delegate so the forums still run. Where should I be looking for the category roles options? I assumed within the Categories page, and then clicking on a specific category. But the only options in there are Read only access // Read & Write access // No access.
    •  
      CommentAuthorMax_B
    • CommentTimeFeb 18th 2008
     # 22
    @Alty: yes you should find it there, is the custom theme enabled also?
    • CommentAuthorAlty
    • CommentTimeFeb 18th 2008
     # 23
    The theme I'm using is the one included with the download, so CategoryRoles-theme and I've tried it with both the default and vaneablack styles. The theme is applied to all users (since I've found that if I don't apply a theme to all users that theme is not actually applied).
    •  
      CommentAuthorMax_B
    • CommentTimeFeb 18th 2008
     # 24
    Well, if the theme is correctly installed, please double check it, go to Settings->Categories, click to edit one category. You should find two more selectors down the page.
    Or else something is not correctly installed. We need more info.
    • CommentAuthortimfire
    • CommentTimeFeb 19th 2008
     # 25
    Hi Max,

    It's minor, but the current readme still says you need add that delegate to CategoryForm.php, despite the fact that it was added in v.1.1.4. It would be nice if you took that out, or changed it to something along the line of "For versions below v.1.1.4, add this delegate..."
    • CommentAuthortimfire
    • CommentTimeFeb 19th 2008
     # 26
    Oh, and another thing---you hard-code the db prefix as "LUM_". For those of us that use an alternative prefix, it would be nice if you switched that to something like:

    [ln 30] $DatabasePrefix = $Context->Configuration['DATABASE_TABLE_PREFIX'];
    $res = mysql_query("DESCRIBE ".$DatabasePrefix."Category Cat_filter", $Context->Database->GetConnection())

    // Etc, etc. There are a few spots that hard-code "LUM_"
    •  
      CommentAuthorMax_B
    • CommentTimeFeb 19th 2008
     # 27
    @timfire: will do.
  7.  # 28
    is the pseudo theme file only for editing the roles, or is it required even to limit the role comment/discussion abilities

    basically how hard would it be to use this with a different theme?
    •  
      CommentAuthorMax_B
    • CommentTimeMar 2nd 2008
     # 29
    @fysicsluvr:
    1 - discussion_form.php is required to limit abilities. settings_category_edit.php for editing roles.

    2 - from the readme (!):
    If you want to use the extension with another theme, you can copy the two php files of this folder to you theme folder.
    If this other theme also has modification to these files, you should merge the few lines necessary to the extension.
    They are clearly marked by //CategoryRole comments.

    Only a single line (two in source because split for readability) is necessary for user side.
  8.  # 30
    oh, i should've read the readme first! oops...
    • CommentAuthortannerc
    • CommentTimeMar 28th 2008
     # 31
    trying to set one of my categories to read only for a certain role"members" ( and read only on all discussion under that cat.)
    .. ( can view the category and all discussions..but can't add comments)
    but( im missing something really obivious.. iknow.)
    im perplexed
    in settings:
    under selected category, i check the roles , including "member" ( otherwise its not even visible)-
    -in the first dropdown i choose a higher role than member,"teamPuscifer" -// wishing i could leave it there..

    But..here is my issue.. the next drop down nulls my objective: it allows any checked role to add comments.( so if visibile - that role can always add comments?
    scuse my slowness.thanks
    •  
      CommentAuthorMax_B
    • CommentTimeMar 28th 2008
     # 32
    you want to set the second dropdown to same or higher privileged role than the first. In your case "teamPuscifer" (great name btw)
    • CommentAuthortannerc
    • CommentTimeMar 30th 2008
     # 33
    thanks you max_b
    • CommentAuthorJohnnyFive
    • CommentTimeMay 7th 2008 edited
     # 34
    This did exactly what I wanted - thanks so much for this. Maybe i'm just crazy, but this should be built into the core. I can see a lot of situations where this functionality would be absolutely required!

    *edit* New Category Roles default.php file that allows for database prefixes other than "LUM" :)
    • CommentAuthortannerc
    • CommentTimeMay 21st 2008 edited
     # 35
    i m sorry to bug again but i m having trouble withthis extension.
    i have this catagory: news. which i want readable only. (excpet for admins)
    so i check all the roles that i want to be able toview it.( all except the unathenticated or banned)
    then i select admin in the two drop downs.thinking ( hoping) then anyone below this cannot start a new discussion or post to the cat.
    It stops posting comments. but they ( checked roles)can still start new discussions.
    "Any user with a role below this setting is allowed to post in an existing discussion, but cannot create a new discussion in this category."
    i dont understand this part.
    i ve atempted all differnt kinds of options. what can i do?

    i know it's something im not/doing -ive searched .. i even tried to go into into the databse and understand my prefrences..but i cant seem to grasp it.
    anyones help is appreciated..again sorry and thank you.
    •  
      CommentAuthorMax_B
    • CommentTimeMay 28th 2008
     # 36
    @tannerc
    Did you check the roles order, in the "Roles & Permission" settings form?
    The role are sorted in ascending priority order, so the "admin" role should be BELOW the "member" role in that list.
  9.  # 37
    Uploaded version 0.7 of CategoryRoles.
  10.  # 38
    CategoryRoles 0.7 contains __MACOSX folder.
  11.  # 39
    Uploaded version 0.7 of CategoryRoles.
    •  
      CommentAuthorMax_B
    • CommentTimeJun 6th 2008
     # 40
    0.7 zip file corrected
  12.  # 41
    I've set up a category called "Announcements" where Members are allowed to comment but not start discussions.

    If I log in as a Member and try to start a new discussion, the Announcements category is not visible in the dropdown menu. However, if I edit that dropdown menu (via Firebug, for example), and change one of the option values to the ID of the Announcements category, then I can post a new discussion without any further errors.

    I would love it if the add-on actually checked, at post time, if the user has permission to start a new discussion. While I'm still going to use it as-is (because it works cosmetically), this would be a marked security improvement.
Add your comments
    Username Password
  • Format comments as