Results 1 to 1 of 1

Thread: How to layout the primary plugin file for many menu options

  1. #1
    Member
    Join Date
    Apr 2012
    Posts
    73
    Thanks
    20
    Thanked 20 Times in 11 Posts

    Default How to layout the primary plugin file for many menu options

    So I feel a bit like an idiot but, after spending a few days on it, I think it's time I reach out for help.

    I've designed a bunch of functions that, if the user has been granted moderator status within a particular category, he is going to be able to perform certain actions only within that category (e.g., change the posted rules of the category, add other users as moderators, ban users from posting in that particular category). Candidly, and with no offense intended regarding the base design, I preferred this method over what appears to be the Hotaru default (which is that a moderator has control across all communities and has access to the admin panel to perform those actions).

    My ideal is to have a drop-down box as a widget on the side panel that lists the communities he's a moderator for and then, underneath each category, the actions he's allowed. For example, the drop-down would look something like this:

    Cars
    -- Ban a user
    -- Unban a user
    News
    -- Change category rules
    -- Remove spam
    -- Ban a user
    -- Unban a user
    Politics
    -- Remove spam

    In other words, within each category that he's a moderator, he has different authorities.

    To me, the easy part was writing the functions to do those actions and creating the widget dropdown. With my head hung low, the hard part is figuring out how to best put these all into a plugin that displays the widget on the side and then accesses the various form (i.e., template) pages where the user will provide the necessary data. For example, if my dropdown looks something like:

    <option>Cars</option>
    <option>--Ban a user</option>
    <option>--Unban a user</option>

    ...I can't figure out what URLs to provide to each of those so that they go to the appropriate forms in the mod plugin templates directory (e.g., if the user chooses ban a user under the Cars category, how do I send him to the ban_a_user.php template within the /mod/templates directory?).

    To further complicate it, I'd like the URL to display something like /category/cars/ban_a_user or /category/news/remove_spam.

    I just don't know how to best layout the primary plugin file (e.g., mod.php, within the mod plugin directory). For example, what does the "case" in the theme_index_top function look like (which would have a category variable and an action variable)? I tried to use the submit plugin as a template, but submit follows more a step-by-step process, whereas what I want to do here doesn't. It also doesn't put the category name in the URL, which I'd like to do.

    Would anyone be able to offer some direction here please? Many thanks.

    Edit: Never mind. I'm just going to parse the URI and redirect based upon that.
    Last edited by valMETNG; 04-28-2012 at 04:35 PM. Reason: Figured it out

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how / where to add picture to the layout of posts ? ?
    By krankdroid in forum How-To and Troubleshooting
    Replies: 3
    Last Post: 03-27-2011, 11:55 AM
  2. Shopping Cart & Ecommerce Options
    By angolanmade in forum Plugin Suggestion Box
    Replies: 1
    Last Post: 09-30-2010, 08:11 PM
  3. Layout problem after Upgrade
    By landshark in forum How-To and Troubleshooting
    Replies: 4
    Last Post: 09-23-2010, 07:32 AM
  4. links too long, breaking layout
    By norby500 in forum How-To and Troubleshooting
    Replies: 7
    Last Post: 07-27-2010, 01:44 AM
  5. Flag Options Don't Show Up
    By nothingman in forum How-To and Troubleshooting
    Replies: 2
    Last Post: 06-25-2010, 04:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •