1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.



Smf- Guest Posting And Sub-Account Mod

Discussion in 'Software & Hosting' started by Jedi Knight Muse, May 7, 2012.

  1. Offline

    Jedi Knight Muse A muse that's a...Jedi?

    Member Since:
    Jan 8, 2008
    Total Posts:
    1,329
    Likes Received:
    240
    Gender:
    Female
    Location:
    A long time ago, in a galaxy far, far away
    Dunno if I'm posting this in exactly the right place or not, but I don't have any specific coding or anything that I'm having trouble with. Please feel free to move it to the right place if necessary.

    Guest posting
    Thanks to an awesome 'D member, I have the opportunity to move my Star Wars role play onto a hosted site, and onto an SMF board. However, I'm having issues with the permissions for the boards. Basically, there are a total of four sections on my board that I need to make it so that they're guest friendly. However, from what I can tell the only option it seems to give is something that allows guest posting in -every- board, not just certain boards that I set the permissions for like on Invisionfree or JCink. I can make it so that the posts have to be approved before they post, but I'd rather not do that- I don't want to be one of those role play admins who makes people who advertise have to wait to see whether or not their ad is approved, and I don't want guests with questions to think their post is not going through or to have to wait to see if they get a response or whatever. Does anyone know of the steps I'd need to take to make it so that guests can only post in those sections?

    Sub-account mod
    Apparently the current sub-accounts mod on the modifications website doesn't work for SMF 2.0. Does anyone know what it is I need to do in order to make it work, or if there's another version of it that I can upload and have it actually work when I install it? (I'm hoping it's not overly complicated, 'cause I'm not super familiar with fiddling around with SMF, especially 2.0.)

    Edit: I just found this, which I'm assuming is what I need in order to make the subaccounts work. Hopefully I'll be able to do it without screwing things up too much.
  2. Offline

    sellaphix formerly dinn

    • Community Challenger
    Member Since:
    Nov 25, 2008
    Total Posts:
    981
    Likes Received:
    503
    Location:
    Iowa
    Oh golly, let's see. I know this! Walk ya through it.

    Guest Posting
    You must create a permissions profile. Admin > Members > Permissions > Edit Profiles
    Create a New Profile Now it's in the list. Click the title to edit.
    Here you can go through the list of membergroups and assign them permissions for boards with that permissions profile.
    Now that you have created a Permission Profile, you assign it to the boards you want.
    Go to Board Permissions now, Click on the name of the board to change its Permission Profile. It's the fourth or fifth one down.
    Sub Accounts
    You CAN use Sub-Accounts on SMF 2.0, but it takes a touch of figuring. I've forgotten exactly how. I wonder if Cal is going to swoop in and help. :) Here is something I found: http://www.seiryuu.org/index.php?topic=935.0 I wonder if that helps. Hmm...
  3. Offline

    Jedi Knight Muse A muse that's a...Jedi?

    Member Since:
    Jan 8, 2008
    Total Posts:
    1,329
    Likes Received:
    240
    Gender:
    Female
    Location:
    A long time ago, in a galaxy far, far away
    Okay, I will try that!

    Hm. I will try that, too, and let you know if it works. Hopefully it does and it doesn't screw up my entire board.
  4. Offline

    xexes 'D Contributor

    • Rapid Reviewer
    • 'D Contributor
    • Community Devoted
    Member Since:
    Feb 20, 2011
    Total Posts:
    3,688
    Likes Received:
    5,670
    Gender:
    Male
    Location:
    USA
    • Awards
    That is why you can make backups. ; ]
  5. Offline

    Jedi Knight Muse A muse that's a...Jedi?

    Member Since:
    Jan 8, 2008
    Total Posts:
    1,329
    Likes Received:
    240
    Gender:
    Female
    Location:
    A long time ago, in a galaxy far, far away
    Haha, true.

    o.o Okay, I tried the thing for guest posting and I either somehow misunderstood the directions oooor it just simply didn't work. :|
  6. Offline

    Aki Banned

    Member Since:
    Jan 10, 2007
    Total Posts:
    2,939
    Likes Received:
    1,662
    Gender:
    Male
    • Awards
    SubAccounts is a manual template edit. It takes a bit of time to analyze the code. You have to go through each new theme and try to find the perfect spot for it and not interfere with the PHP. A lot of the Find / Add Afters, etc don't work on custom templates sadly. So addons in SMF becomes something of learning to do it yourself. It's simple enough once you get used to it. :D
  7. Offline

    TheOracle I keep cereal in my pocket. To feed them.

    Member Since:
    Dec 12, 2011
    Total Posts:
    478
    Likes Received:
    606
    Gender:
    Female
    Location:
    California
    • Awards
    For Guest Posting -

    Admin Center >> Members >> Permissions >> Edit Profiles
    Create a new profile
    Profile Name: Guest Posting Enabled
    Copy Permissions From: Default
    Click "Create"
    Click the hyperlink for "Guest Posting Enabled" (the profile you just created)
    Click the hyperlink for "Modify"
    Select the actions you want guests to do
    I chose "Post new topics," "Post replies to any topics," "View Polls"
    Because you chose default, your members should be able to post as usual, but you may want to check on the permissions for members, etc.

    Admin Center >> Forum >> Boards >> Modify Boards
    Choose the board you want to edit (e.g., Advertisements)
    Click on the hyperlink for "Modify"
    Permission Profile: Guest Posting Enabled
    Allowed Groups: Make sure guests is ticked, and whatever other groups need access

    For the SubAccounts Mod -

    I'm assuming you're using SMF 2.0.2 and the SubAcounts mod 1.0.1; if not, your mileage may vary widely

    I'm also assuming that the install probably broke when it was trying to edit "$themedir/index.template.php," which is usually the case when you're using anything other than the default theme, so you'll need to edit this; I recommend downloading it and using FTP (or something like shiftEDIT if you have Chrome or FireFTP for Firefox), but you can also edit it from within SMF

    Admin Center >> Configuration >> Themes and Layout >> Modify Themes
    Choose the hyperlink for "Browse the templates and files in this theme."
    Choose the hyperlink for "index.template.php"

    Find:

    Code: Select
    global $context, $settings, $options, $txt;
    Replace with:
    Code: Select
    global $context, $settings, $options, $txt, $user_info, $scripturl;
    Find:
    Code: Select
    /* Set the following variable to true if this theme requires the optional theme strings file to be loaded. */
    There will be a line after it that might say: "$settings['require_theme_strings'] = false;" or "$settings['require_theme_strings'] = true;"
    After that line, add:
    Code: Select
    	$context['subaccount_dropdown'] = '';
    if (!empty($user_info['subaccounts']))
    {
    $context['subaccount_dropdown'] = '
    <form style="display: inline; margin-left: 1em;" class="smalltext" action="' . $scripturl . '?action=switchsubaccount" method="post" name="subaccount_drop" id="subaccount_drop" enctype="multipart/form-data">
    <select name="subaccount" size="1" onchange="document.subaccount_drop.submit()">
    <option selected="selected">' . $txt['change_subaccount'] . '</option>';
    foreach($user_info['subaccounts'] as $id => $subaccount)
    $context['subaccount_dropdown'] .= '
    <option value="' . $id . '">' . $subaccount['name'] . '</option>';
    $context['subaccount_dropdown'] .= '
    </select>
    <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
    </form>';
    }
    Now you need a place to actually put the dropdown. You're usually looking to find something like "hello_member." I usually just look for "hello," but you may also need to look for "greeting" or something like that. What it's called may depend on your theme. "hello" usually works best. Once you find it, it will look something like:
    Code: Select
    <li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
    You need to decide where to add:
    Code: Select
    $context['subaccount_dropdown']
    This is the dropdown menu. In the above example, I use:
    Code: Select
    <li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span>', $context['subaccount_dropdown'], '</li>
    You may need to do some finagling to get it to look nice. You can technically put it about anywhere on that index.template.php page, but I like to put it near the "hello."


    Admin Center >> Configuration >> Themes and Layout >> Modify Themes
    Choose the hyperlink for "Edit this theme's stylesheets."
    Choose the hyperlink for "index.css"

    Find:
    Code: Select
    div#profile_success
    {
    border-color: green;
    color: green;
    background: #efe;
    }
    You can also find "div#profile_success" if you have trouble with multi-line finds, just choose the second time it appears.

    Add after:
    Code: Select
    #subaccount_list .subaccount
    {
    width: 200px;
    margin: .3em;
    padding: .5em;
    float: left;
    }
    
    #subaccount_list ul li
    {
    line-height: 1em;
    height: 1em;
    margin: 2px 0;
    overflow: hidden;
    padding: 5px;
    text-align: center;
    border: 1px solid #ccc;
    }
    
    #subaccount_list  .name
    {
    font-size: 1.3em;
    }
    
    #subaccount_list .profile_buttons li, #subaccount_list .action_buttons li, .subaccount_icons li
    {
    border: none;
    float: left;
    margin: 0 .3em;
    padding: 0;
    height: 20px;
    }
    
    .subaccount_icons img
    {
    vertical-align: middle;
    }
    
    #subaccount_list .action_buttons
    {
    height: 1.5em;
    }
    
    Everything else should install fine, unless you have a really really custom theme (or altered memberlist or post templates). In which case... I can give you the find/replace for it.
  8. Offline

    Jedi Knight Muse A muse that's a...Jedi?

    Member Since:
    Jan 8, 2008
    Total Posts:
    1,329
    Likes Received:
    240
    Gender:
    Female
    Location:
    A long time ago, in a galaxy far, far away
    Okay, I'll try the guest thing again.

    The person who's hosting me (Aki) is going to install the sub-accounts for me, so I should be all set with the coding.

    New question:

    Does anyone know if this is a good mod for a gallery? The host has softalucus (or however you spell it) and I tried a bunch of the gallery stuff they have but none of them do what I want it to. Basically I wanted to use it for my "who's who?" page and have albums for each faction, and then have pictures for characters within that faction and a brief description for that character. I tried a Wiki, and I got confused right away. I'm thinking I might need to try using the Wordpress thing to do it and see if I can figure out a way to use that to make a gallery, but I figured I'd ask if anyone else has a solution. If that doesn't work I'll just use that mod and hopefully it'll at least partially do what I want.

    Edit: so I tried the guest posting thing and I either did something wrong oooor it's just not really working. I mean, it works, but they can post in any forum, not just the selected ones I wanted. I guess it shouldn't matter TOO much, because unless we get a ton of bots or something I don't think guests will start posting on the board in sections they shouldn't...but I could be wrong about that.
  9. Offline

    sellaphix formerly dinn

    • Community Challenger
    Member Since:
    Nov 25, 2008
    Total Posts:
    981
    Likes Received:
    503
    Location:
    Iowa
    You'll get bots. :/ If you can't find help from us here on SMF, you should go to SMF's support forums. I get good advice there.

    And I have been looking for a good gallery tool for SMF and I haven't found one. Don't much care for the one you linked. Too cumbersome!
  10. Offline

    Aki Banned

    Member Since:
    Jan 10, 2007
    Total Posts:
    2,939
    Likes Received:
    1,662
    Gender:
    Male
    • Awards
    Hey, titania! Nicely done! That's exactly how I edit it in SMF too. You should post it in the guides section to help people! For the CSS just stick it anywhere in the primary css file really. It doesn't matter.
  11. Offline

    TheOracle I keep cereal in my pocket. To feed them.

    Member Since:
    Dec 12, 2011
    Total Posts:
    478
    Likes Received:
    606
    Gender:
    Female
    Location:
    California
    • Awards
    Thanks. :)

    And yeah, I just put it there on the .css 'cause that's where the installer puts it.

    I'll try to get it cleaned up and posted as a guide. I know there was a guide on the 'D for a while, but I guess it could use an update. The tricky part really is just getting the dropdown menu into a pretty place on a theme; I guess I've got enough themes installed to give quite a few examples by now. :p
  12. Offline

    wynnyelle Member

    Member Since:
    Apr 27, 2008
    Total Posts:
    1,680
    Likes Received:
    450
    You can set some boards differently for guests and any other member groups by creating new board permission profiles in SMF and setting the permissions separately. Only do this if you have to, because some SMF mods can get a bit wonky with custom made board permissions.

    I have guest posts on my site set to require moderator approval. That catches any bots etc. spamming the site.

Share This Page