News:

Wondering if this will always be free?  See why free is better.

Main Menu

Subaccounts

Started by SlammedDime, November 12, 2009, 09:59:09 AM

Previous topic - Next topic

Caltan

You need to both enable it in Core Features and set the permissions for user groups to use and access subaccounts.  If you have no subaccounts, the dropdown won't display; you'll need to create a new subaccount from the profiles page to test.

Mikirin

#421
I installed the mod as I normally would (and it has worked on my past forums) and now I can't find it in the admin panel. It's shown as installed properly but there's still no option to enable it in the features nor is there any permission settings as there normally would be.
Here's how I normally install it:
Emulate to rc4.
Install.
Enable.
Fix permissions up and all that good stuff.

Well, up until "Install" things were going well. I encountered an error at first but that was on the ftp- permissions side. I set the packages folder and contents to writable and made the temp folder within it as well.
What's going wrong?

I figured it out, it's corrupting part of SMF.
It installs, but it doesn't correctly save its state that it IS installed, so uninstallation is impossible.. so if it gets stuck in limbo, can't be uninstalled to reattempt the install.
Possibly the mod gets partially installed, but then cannot move forward for one reason or another, then fails, acts like the mod is fully installed, and it seems this particular mod doesn't have an "uninstall" button so everything craps out.

And fixed

fallen stars

So I got the sub-accounts installed nicely on to my forum, but I'm trying to work it in to one of my other themes. I fixed up the php (copy and pasted it, really) aand now it's telling me that there's "an unexpected "<" on line 236". I fail at php, I don't even know any of it, so I have no idea how to fix this. This is the portion of the code being referred to (the middle line there, in fact.):

<li class="greeting"><b>', $txt['hello_member_ndt'], ' ', $context['user']['name'],'</b>', $context['subaccount_dropdown'], '</li>';
<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>'

Shambles

You copied & pasted incorrectly.


The end of your first line
Code (this) Select
'</li>';

followed on the next line by
Code (this) Select
<li>

.. just ain't gonna work as the "echo" that's producing the first of those is already terminated by the time the next code line arrives (hence the "<" is being complained about).

Probably best if you dump the whole of that file into your next post, and someone can have a ganders, unless you want to have another go at editing it yourself?



A quick fix would be to:

Code (find) Select
<li class="greeting"><b>', $txt['hello_member_ndt'], ' ', $context['user']['name'],'</b>', $context['subaccount_dropdown'], '</li>';
<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>'


Code (replace) Select
<li class="greeting"><b>', $txt['hello_member_ndt'], ' ', $context['user']['name'],'</b>', $context['subaccount_dropdown'], '</li>';
echo '<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>'

fallen stars

I tried, and then it came up with another error x.x

"Parse error: syntax error, unexpected T_IF, expecting ',' or ';' in .../Themes/The_Killing_SMF2/index.template.php on line 240"

Bleh. I attached the file to this post if anyone would be wonderful enough to hep me figure out what's wrong xD

Shambles

Quote from: fallen stars on November 04, 2012, 05:22:26 PM
I tried, and then it came up with another error x.x

You have quite a few errors in there - all fixed for you (see attached)


fallen stars

Thank you for that~ I tried it and it worked (:

FireDitto

#427
IF you remove the code from the 'display.template.php' and the 'index.template.php' and put the following code in a Portal block (eg, Simple Portal, Tiny Portal, EzPortal, PortaMX) you don't have to worry about adding the code to new themes every time you install one.

Code (Block Code) Select
global $context, $settings, $options, $txt, $user_info, $scripturl;


$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>';
}

echo $context['subaccount_dropdown'];


However -- if there is any switcher code left on the main index, this WILL NOT WORK, the scripts will cancel one another out. Post changing dropdowns will be fine.
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Captain_Morrigan

#428
Just wanted to let you lot know this mod will auto install on 2.0.3, the only thing I see is missing is the drop down up top but everything else installs if all you do is change the install pack version.

Just for you lot I edited it for you and it should test successfully for the default theme:


Attachment removed by Colin due to copyright violation

Shambles

Quote from: Captain_Morrigan on January 05, 2013, 01:50:34 PM
Just for you lot I edited it for you and it should test successfully for the default theme:

Are you allowed to edit then redistribute someone else's mod?

Arantor

Given that the mod's page says it's under a No Derivatives licence, the answer to that question would probably be a resounding NO.

Captain_Morrigan

I edited a line so people don't have to fight with it to install it, first of all. I didn't edit it the mod itself and I'm not redistributing it. I posted it in this thread, nothing has been changed except 2 lines, and all original authors copyrights are in tact.

If you lot have a problem with that then perhaps this thread should be shut down since the author has apparently abandoned this mod and everything within this thread is modifying it to work with newer versions of SMF. I was just giving everyone a time saver.

I'm sorry for being nice enough to share a simple fix for a popular mod.

That notwithstanding other people have edited parts of this mod and posted it so I don't know why I'm getting flack for getting a single file with one file edited to get it to work and posting the whole thing so that a single file doesn't have to be replaced, it can simply be uploaded like any other SMF mod.

This hasn't been posted anywhere else. I'm literally handing it to the content author and I'm getting flack.

I guess I don't have to remember why I left SMF.... this is why. Thank god for IPB.

Arantor

QuoteI edited a line so people don't have to fight with it to install it, first of all. I didn't edit it the mod itself and I'm not redistributing it.

It wasn't called out for redistribution. It was more called out for the fact the mod's own page says that derivative packages - including your minor modification - can't be made. That's the deal the mod author gave, you can use the mod, for free, subject to those terms. Don't like it? Take it up with him, he's the author, and other than the licence he's granted, nothing in any law says you have any right to use the mod.

It sucks, no question, but unfortunately the licence is the only thing granting you any right whatsoever, since the law of the land doesn't.

Arantor

I should add, the person above has taken to Twitter to call SMF retards and jerks, without apparently realising that I'm not part of the team.

Here's the deal, and I'll be sure to use small words so there's no confusion, unlike what you've been shouting on Twitter.

Without a licence, you have zero right whatsoever to use the mod. That's copyright law. Can't argue on that score.

With a licence, you have rights granted by that licence. Using it is one of them. But you're not given the right to make a modified version, not even one line changed only. Even with the very best intentions in the world, it doesn't matter, you can't do it.

As I said to you, it sucks, but that's what it is. Don't get all huffy with anyone, because your good deed is undone - it was avoidable by reading the mod's page and seeing the little 'no-derivs' wording there. No good deed goes unpunished anyway.

I'm not disputing that it sucks, either. But the only person who can fix it is the mod author, by changing his licence or updating the mod, in the meantime the rest of us have to use version emulation.

Colin

I am afraid I had to remove the attachment as it is a direct violation of the mod authors license. As it may seem silly since you graciously made a small improvement we are forced to abide international copyright law. I encourage you to contact the mod author directly to apply for a waiver or a change of the current license. Thanks for your understanding.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

babsbatgirlfan

Quote from: FireDitto on June 06, 2012, 04:55:42 AM
Babs; you need to emulate it to the correct version so that it accepts the modification. As far as I'm aware, there is not a recent edition of it.

How do I emulate it to the correct version?? I have it working on my previous site but I had downloaded it before 2.0 hit. So it still works but it doesnt on either of my other sites. Could anyone help me??



Arantor


jenny loo who?!

Greetings!

I am doing this on behalf of a friend, but I can't seem to get the subaccounts mod show a dropdown, in anyway, shape or form. It't really aggravating.

I have installed it correctly, modified the templates, but still, nothing.

Can someone help? I'm willing to give the index.template.php file as well as the index.css file.

Caltan

A dropdown won't show unless you actually have subaccounts created.  Make sure the mod is turned on in core features and all the user permissions are set as they should and then try actually creating an account through the Manage Subaccounts profile area.  If that works, then you know it's just something with the dropdown code itself, which is easy to fix.

sarahwhite42

#439
okay, i've got almost everything working on the sub account mod thanks to you wonderful people.  I have just one small problem...

on our chosen theme (bad company 3 edited to fit our needs) the sub accounts don't show on the profile summary.  They do show on the other themes, just not on this one.  Can anyone help me out please

edit: I finally figure this out

Advertisement: