News:

SMF 2.0.19 has been released! Please update. Read more.

Main Menu

Subaccounts

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

Previous topic - Next topic

FireDitto

Still have the same issue happening; it's there to change the account, but not activating the change.
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

FireDitto

I have the code below in a PHP block, and it causes the drop down to appear... with the same issue as previous; it's just not changing the account when selected as it should be.


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'];
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

FireDitto

I got it to work! Finally :D

I had to remove the code from the Theme/default/display.template.php because it was clashing with the code I put in the PHP block. Removing it, cleared it all up, and it works perfectly =D


>_> I hate it when its something really small and "obvious" :P
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

demagpie

I experienced a fail in the same area as this fix (quote below for reference):

Quote from: SlammedDime on November 14, 2009, 06:26:29 PM
Quote from: PalmBeachPreps on November 14, 2009, 11:08:45 AM
This is a great mod!  However, I'm getting an error on installation: 2.  Replace  ./Themes/default/Display.template.php  Test failed.

I went to correct that part manually, and found out that the problem is that the code which is supposed to be replaced is not entirely the same.  Should I just add the edits after it which actually change everything?

Display template is attached.
It's because of the WYSIWYG editor you installed.  Use this edit instead...
Code (Find) Select
<div id="qr_buttons">

Code (Replace) Select
<div id="qr_buttons">';
if (!empty($user_info['subaccounts']))
{
echo '
<strong>', $txt['use_subaccount'], ':</strong> <select name="subaccount">
<option value="', $user_info['id'], '" selected="selected">', $user_info['name'], '</option>';
foreach($user_info['subaccounts'] as $account)
echo '
<option value="', $account['id'], '">', $account['name'], '</option>';
echo '
</select>';
}

echo '


Same problem, different code?  Below is what I'm seeing (in the same area):

Quote20.      Execute Modification      ./Themes/default/Display.template.php      Test failed
        1.     Replace     ./Themes/default/Display.template.php     Test successful
        2.     Replace     ./Themes/default/Display.template.php     Test failed

And below is the code that failed:

Find[Select]
<textarea cols="75" rows="7" style="', $context['browser']['is_ie8'] ? 'max-width: 95%; min-width: 95%' : 'width: 95%', '; height: 100px;" name="message" tabindex="1"></textarea><br />
Replace[Select]
<textarea cols="75" rows="7" style="', $context['browser']['is_ie8'] ? 'max-width: 95%; min-width: 95%' : 'width: 95%', '; height: 100px;" name="message" tabindex="1"></textarea><br />'; if (!empty($user_info['subaccounts'])) { echo ' <strong>', $txt['use_subaccount'], ':</strong> <select name="subaccount"> <option value="', $user_info['id'], '" selected="selected">', $user_info['name'], '</option>'; foreach($user_info['subaccounts'] as $account) echo ' <option value="', $account['id'], '">', $account['name'], '</option>'; echo ' </select>'; } echo '


I attempted to install this mod on 2.0 RC3 but used the option to emulate version 2.0 RC2.  It seemed to work, other than that one fail but I chickened out when the Admin panel warned me I could crash... I haven't actually installed any packages or mods except a theme template ("angel fall first") so I can't think that it would be an incompatibility issue unless there's something else I should have installed first.

If you know what I need to do to overcome this obstacle, I need more than just the proper code: I need to know which file or path (or else what Admin area) to go to, to edit.  Is it the template section of the mod?  Or is it my template that needs fixing?  I searched through the package files.  I have no idea which one failed (even though it's written clearly above haha).

Thanks!

FireDitto

Did you set your forum to emulate RC2 before installation?

Technically, the Sub Account mod isn't workable for a clean-install of RC3; you need to emulate it to an RC2. If it isn't emulated, you'll get errors.

If you used the RC3 fix that can be found somewhere on the last couple of pages... then I honestly have no idea... Sorry.
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Draetheus

Is there any way to set permissions so that only the owner of a subaccount can modify the subaccount profile?

FireDitto

Is there any possible way to have it, so, if the Parent Account purchases a subscription, that the subscription-member-group passes down to all the Child Accounts associated with that Parent??

At the moment, it's requiring manual changing, and I predict that getting very tiresome.

Thank you, =)
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Ncen

About this blankimage-error mentioned some pages back, i thought i should tell you guys a theory i have.

Blank-issue is related to scripts.
I can change back and forth between accounts with no problem, but if i try to hide/open the topmenu and does not update the page i get the blank.gif, if i click back and try to switch again, same error, but if i go click on a link and click the link back to the same page, i can switch again.
Isn't the blank.gif image somehow related to the java(?)scripts used to open/hide topmenus and portalblocks?
If you look at the address-bar you can see that the "action=switchaccount" (or something) loads for a second and then gets replaced by "jsoption;var=collapse_header" (or something). At least that's whats happening on my testforum.

Anyway, it's just a theory i had, and someone might have voiced it already, but considering it's an issue worth investigating at some point, my observations might have some tiny value? If not, at least its another post in this thread ;)

SlammedDime

Sorry guys, I've been so overwhelmed with other things that I had to push this to the back burner... I have however updated it against the current Trunk of SMF so that when RC4 is released, all I have to do is upload the new zip file to the mod site and it'll be all set.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

SlammedDime

Just notes for myself...

Quote from: Caltan on November 17, 2009, 05:08:34 PM
Further testing: using  normal modify on an unregistered user's post attributes to the moderator after saving.  Quick edit on the same post (after original reattribution) worked successfully without attribution, as do both normal modify and quick edit on a registered user's post.  The reattributed guest post still maintains the moderator's subaccount dropdown until the post's record is edited in the smf_messages table.
Fixed in next version...
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

SlammedDime

Quote from: Atomic Blaze on December 14, 2009, 11:02:07 PM
When a linked account is shared between two accounts making the shared account unsharable removes all the linked accounts from the other person(s)
This has been fixed...
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Ncen

Great news :) What about the blank-issues?

SlammedDime

I've never been able to replicate the issue on my site, and every time someone has given me a test site with a test account, it has always worked.  I'm afraid without being able to replicate or see an issue in action, I can't help much with it...
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Ncen

Quote from: Ncen on October 09, 2010, 09:50:07 AM
About this blankimage-error mentioned some pages back, i thought i should tell you guys a theory i have.

Blank-issue is related to scripts.
I can change back and forth between accounts with no problem, but if i try to hide/open the topmenu and does not update the page i get the blank.gif, if i click back and try to switch again, same error, but if i go click on a link and click the link back to the same page, i can switch again.
Isn't the blank.gif image somehow related to the java(?)scripts used to open/hide topmenus and portalblocks?
If you look at the address-bar you can see that the "action=switchaccount" (or something) loads for a second and then gets replaced by "jsoption;var=collapse_header" (or something). At least that's whats happening on my testforum.

Anyway, it's just a theory i had, and someone might have voiced it already, but considering it's an issue worth investigating at some point, my observations might have some tiny value? If not, at least its another post in this thread ;)

If you try clicking open and close on the portal-blocks, and also on the top bar on regular SMF, and then try changing the user, i think you should be able to replicate it. I tried with SimplePortal and regular SMF top bar :)

Edit: On regular i mean the little arrow-thingie that shows the avatar and "Show unread posts since last visit. Show new replies to your posts."

SlammedDime

#254
ah yes, it's related to the 'old_url' in the session variable... the mod knows the last page you visited by the session[old_url] variable, which is changed when that function call is made... last time Eliana and I talked about it, I don't recall an easy way to fix it, but I'll look into it again...

Edit: Fixed it, altered the code to check for a HTTP_REFERER header first, and if that doesn't exist, then use old_url.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Ncen

Really? :o

Thats great! :D I knew you could do it! *insert happy dance here*

FireDitto

Whoo! *dances with Ncen*

That's great, SlammedDime =D
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

FireDitto

Quote from: FireDitto on October 07, 2010, 06:42:08 AM
Is there any possible way to have it, so, if the Parent Account purchases a subscription, that the subscription-member-group passes down to all the Child Accounts associated with that Parent??

At the moment, it's requiring manual changing, and I predict that getting very tiresome.

Thank you, =)

Sorry, I was still wondering if there were a way around this?
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

SlammedDime

It's possible to do, but I don't quite have time at the moment to look at the subscriptions code to modify it.

Mod updated for 2.0 RC4
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

NanoSector

****** yeah!

This is gonna be fun,,,
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Advertisement: