News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Subaccounts

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

Previous topic - Next topic

margarett

Quote from: chuman on November 12, 2015, 05:51:43 AM
Not every single one, I only copied the ones that failed. If you need a list of everything on that page i am happy to copy it for you.
Oh, my bad, sorry.

Quote from: Kindred on November 12, 2015, 07:02:53 AM
second...   looks like you have installed other mods which ay have already targeted some of the same code areas.
Yeah, it's this. Eg, for index.php, the MOD looks for
'sticky' => array('LockTopic.php', 'Sticky'),
Which exists in every SMF installation for sure. Yet your file has:
'sticky' => array('LockTopic.php', 'Sticky'), 'staff' => array('Staff2.php', 'Staff'),
So another MOD made a messy edit (it should be in its own line) so this MOD can't install itself cleanly.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

yeah....   unfortunately a number of the SMF Hacks mods do that -- they seem to be missing cr/nl
Слова
Украина

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

chuman

This is really helpful, we were wondering why multiple mods were having issues.

Would I simply have to go in and manually install? I've had to do that with other mods before, however I was concerned that it wouldn't work because I was emulating an older version of SMF, and did not know if it would allow me to manually install it.

Or would I have to fix the code to what the subaccounts mod isl ooking for for it to install? So like put that index.php example on separate lines etc.

Kindred

you ONLY have to "manually" do the bit(s) that failed...
Слова
Украина

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

chuman

Thank you all so much for your help, subaccounts are now in and functional.

The only thing, which isn't the mod itselfs fault is that the drop-down menu to switch between subaccounts is not showing up, I assume this is an issue to do with my theme and I'm not sure where to edit/fix to get it to show up for members.

Eliana Tamerin

Quote from: chuman on November 16, 2015, 09:19:38 AM
Thank you all so much for your help, subaccounts are now in and functional.

The only thing, which isn't the mod itselfs fault is that the drop-down menu to switch between subaccounts is not showing up, I assume this is an issue to do with my theme and I'm not sure where to edit/fix to get it to show up for members.

You'll basically want to do all the edits that the mod would do to the default index.template.php in the theme folder. The $context['subaccount_dropdown'] part can be put just about anywhere you want the dropdown to show up, but the other edits have to be made in the right paces.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

chuman

I just checked the default index.template.php file and it has all the edits from the mod in there and I could not find any errors, I assume my theme may be blocking it?

Eliana Tamerin

Quote from: chuman on November 16, 2015, 10:52:33 AM
I just checked the default index.template.php file and it has all the edits from the mod in there and I could not find any errors, I assume my theme may be blocking it?

Basically, yes. Every theme has an index.template.php and you need to apply the same edits to each one.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

chuman

So the subaccounts work perfectly from my default curve theme, which was to be epxected and I made all the edits to the Omegapurple CSS and Index.template.php file but it still does not show up, I am going to do another check to make sure I did get everything in.


in index.template.php i edited this part

global $context, $settings, $options, $scripturl, $txt, $user_info, $modSettings;


This is what it wanted it to be:
global $context, $settings, $options, $txt, $user_info, $scripturl;

I'm not sure if "modsettings" was a problem

Found this part
/* Set the following variable to true if this theme requires the optional theme strings file to be loaded. */
$settings['require_theme_strings'] = false;


I added this after:
$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>';
}
}


Then this part
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span>', $context['subaccount_dropdown'], '</li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>';


I cannot find an issue with the code unless its the first part and the $Modsettings is messing it up, but I don't know much about code to know anything for sure.

Attaching a copy of the index.template.php incase that is needed


Eliana Tamerin

$modSettings is another variable that shouldn't affect anything.

You're missing $user_info and $scripturl in the template_init() function.

Find this:
function template_init()
{
global $context, $settings, $options, $txt;


Replace with this:
function template_init()
{
global $context, $settings, $options, $txt, $user_info, $scripturl;
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

chuman

Thank you so much that fixed it!! My members are so excited!

chuman

Hello, I installed this mod a few weeks back and it was working fine up until yesterday night.

Now when players try to go to their subaccounts, the page simply refreshes without changing which account they're on. Some players are stuck on subaccounts as well.

The only thing I think might relate to this is we've had a sudden onslaught of spambot failed login attempts the past few days.

zushiba

#552
Hey Guys, it's me again. After eh, like a hundred years.

I have once again updated this mod to install on the latest version of SMF (Which at the time of this posting is SMF 2.0.11)
This very likely will not work on most custom themes that aren't based on the default curve theme (and in some cases even those, who knows?)

This will install on a stock, new version of SMF 2.0.11.

Once again I do not guarantee anything, if this makes your forum explode or melt or causes a death in your family I am not responsible.

zushiba

^Don't download that there's an error in the display template, I would take it down but I can't friggin edit my own posts on this forum anymore for some stupid reason.

Irisado

Attachment removed as requested :).
Soñando con una playa donde brilla el sol, un arco iris ilumina el cielo, y el mar espejea iridescentemente

dolliebaby77

Does anyone have a version of this mod that will work with SMF 2.0.7

Thank you.

Kindred

1- you need to upgrade ASAP. You are 4 versions behind in SMF, including some security and functional patches.
2- This works pretty much find with 2.0.x --- http://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn%27t_work_in_my_SMF_version
Слова
Украина

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

wqrts

#557
Ported as-is to 2.1 Beta 2. It installs successfully and allows subaccounts creation and changes.

Kindred

I don't think that is allowed, per the license...  link removed

NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.
Слова
Украина

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

chuman

I co-own a small roleplaying forum and we've had the sub-accounts mod installed for about a year now. We don't generally have any problems with it but in the last few months the pings caused by the sub-accounts is getting so intense that we're 503-ing and errors, especially when our site is busy.

When people change over to a different account, it crashes our site. Is there any precident for this, and if so is there any quick fix for it? We can't simply remove the subaccounts, they're an integral part of our roleplaying community, but the errors are getting to the point where the site is barely functional at times.

Advertisement: