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

NanoSector

Hm?

When emulating it shows the Stop Spam mod instead of the Subaccounts mod readme....
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."

FireDitto

Quote from: jkrlvgn on November 25, 2009, 10:35:00 PM
Quote from: Afro on November 19, 2009, 07:35:06 AM
Quote from: poolhall on November 17, 2009, 07:59:05 PM
Great mod, SlammedDime, congratulations!

I have a minor problem with the mod: when I switch to or from a subaccount on the forum index page, I am being redirected to /Themes/default/images/blank.gif. This doesn't happen if I switch from other locations.

i get the same error if i want to role back to the parent/admin account

Just to mention, it seems as if this issue occurs for me when installed with the "Member Color Link" mod installed.  Something doesn't jive well...still investigating, but...narrowed it down to that.


Could we please get some help with this? I'd really love to fix it up, as it's driving me insane ><;; and I've thus far been unable to find out what needs fixing.
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

zushiba

I've packed the RC3 fix into an installable mod. I obviously take no responsibility if for this thing and if it lights your server on fire and kills god then your kind of SOL. It worked for me in 2 tests, and as always the dropdown refuses to work in any custom themes so you'll have to do that yourself.


Got tired of waiting for someone else to do this and modding it myself every install :P

FireDitto

Quote from: zushiba on July 26, 2010, 12:37:11 PM
I've packed the RC3 fix into an installable mod. I obviously take no responsibility if for this thing and if it lights your server on fire and kills god then your kind of SOL. It worked for me in 2 tests, and as always the dropdown refuses to work in any custom themes so you'll have to do that yourself.


Got tired of waiting for someone else to do this and modding it myself every install :P


Awesome... But does it avoid the blank.gif issue? :P :P
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

zushiba

Considering I haven't been following the thread other than to find the fix for RC3 so I don't know what that is. I'm going to say no, it doesn't. All it does is act like a valid RC3 mod and install to the point of being functional.

FireDitto

*laughs* I was just teasing you.

I do appreciate the update though, it'll make things that little bit easier.
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

C4G-TK

I've been trying to work out this one little kink with the mod, but can't get it to work.
The mod itself is working, but because of the color of the textarea, it just makes it difficult to use.

1) When creating a new account, the Account Name is correct until you tab.  Then, it changes the box to white with a white font making the input not seen.

2) The password and confirm password boxes are white with a white font from the beginning which once again makes the info you type unable to be seen.  Then, it stays white once you tab.

I've solved this problem with a different mod, but can't seem to work it out with this one.  I would really appreciate some help if someone has the time.

Thanks.


-img removed-

Enforcer83

#227
Here is an interesting problem.  Why is the table for the Subaccount doing what it is doing in the attached screenshot?  Is there something I need to modify to correct it?

Board Version: 2.0 RC3
Theme: default Curve


zushiba

Usually that's a problem with custom themes, the CSS not being installed correctly. Without access to the actual page I can't really say much more.

NanoSector

Quote from: zushiba on August 18, 2010, 01:43:35 PM
Usually that's a problem with custom themes, the CSS not being installed correctly. Without access to the actual page I can't really say much more.
It also happened to me.
It is the default theme: Curve.
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."

Enforcer83

My site is: community.starfleetintel.eu

I have created a basic level account for use by those wanting to help me troubleshoot (PM me for details) or I can post any files that may be needed to this thread.

FireDitto

I believe this [below] is the code where I should be putting some code from the Subaccounts mod, in order to have the drop down menu appear in it... however, none of the combinations and attempts I've made have been even slightly successful...

Any help would be deeply appreciated.

<span class="smalltext">
<a href="', $scripturl, '?action=reminder">',$txt['ezp_loginbox_forgot'],'</a>
</span>
';
}
else
{
// Show basic member information

// Avatar
if (!empty($context['user']['avatar']))
echo $context['user']['avatar']['image'], '<br />';

/// Member Name
echo $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , '</b><br />';


// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>', $txt['ezp_maintain_mode'], '</b><br />';


echo $txt['ezp_userbox_pm'] . ' <a href="', $scripturl, '?action=pm">' . $context['user']['messages'] . '</a> ' .  ($context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . ' ' . $txt['ezp_userbox_pm_new'] .  '</strong>]' : '') . '<br />';


if (!empty($context['unapproved_members']))
echo '
', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';

echo '
<a href="', $scripturl, '?action=unread">', $txt['ezp_userbox_unread_posts'], '</a> <br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['ezp_userbox_unread_replies'] , '</a><br />';

if (isset($modSettings['gallery_max_filesize']))
{
// My Images Link
echo '<a href="', $scripturl, '?action=gallery;sa=myimages;u=' . $user_info['id'] . '">', $txt['ezp_userbox_myimages'], '</a><br />';
}
if (isset($modSettings['down_set_files_per_page']))
{
// My Files Link
echo '<a href="', $scripturl, '?action=downloads;sa=myfiles;u=' . $user_info['id'] . '">', $txt['ezp_userbox_myfiles'] , '</a><br />';
}

if (isset($modSettings['class_set_listings_per_page']))
{
// My Listings Link
echo '<a href="', $scripturl, '?action=classifieds;sa=mylistings;u=' . $user_info['id'] . '">', $txt['ezp_userbox_mylistings'] , '</a><br />';
}

echo '<br />';

// Show logout link
if ($userbox  == false)
echo '<a href="', $scripturl, '?action=logout;sesc=', $sc, '">', $txt['ezp_built_logout'], '</a>';

}

echo  $endHtml;

}
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

zushiba

#232
You've got to add  $user_info to your global variables at the top of your index.template.php

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

To be more precise.... I make the following changes.

In function template_init()
global $context, $settings, $options, $txt;
changed to
global $context, $settings, $options, $txt, $user_info;

At the bottom of function template_init() before the closing bracket add.

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



Somewhere in function template_body_above()
In the line welcomes your user by name. Looks something like
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
Change to
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span>', $context['subaccount_dropdown'], '</li>

I hope that is helpful.

ishy

.
Quote from: jkrlvgn on November 25, 2009, 10:35:00 PM
Quote from: Afro on November 19, 2009, 07:35:06 AM
Quote from: poolhall on November 17, 2009, 07:59:05 PMI have a minor problem with the mod: when I switch to or from a subaccount on the forum index page, I am being redirected to /Themes/default/images/blank.gif. This doesn't happen if I switch from other locations.
i get the same error if i want to role back to the parent/admin account
Just to mention, it seems as if this issue occurs for me when installed with the "Member Color Link" mod installed.  Something doesn't jive well...still investigating, but...narrowed it down to that.
I figured out this problem.  For me, it actually looks like the shop mod is conflicting. The problem is in the Sources/Load.php file.

Here are the two edits:

Find: [Select]
CASE WHEN mem.id_group = 0 OR mg.stars = {string:blank_string} THEN pg.stars ELSE mg.stars END AS stars, mem.password_salt, mem.pm_prefs'Replace With: [Select]         
CASE WHEN mem.id_group = 0 OR mg.stars = {string:blank_string} THEN pg.stars ELSE mg.stars END AS stars, mem.password_salt, mem.passwd, mem.pm_prefs';

My original page had a "mem.money," extra code in there, and it never did the second edit and added "mem.passwd,".
         

FireDitto

Okay; I have an HTML block, a PHP block and a Script block in which I can put coding;

What I'd like to know, is exactly how much/what code do I put in it, to cause the drop-down option to appear in the box?

So far I mostly either end up with the coding being visible, or just a plain empty box.

Any help would be magnificent; I've been trying to figure this out for several hours now ><;
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

zushiba

Can you attach your index.template.php? I can show you directly.

FireDitto

#236
I don't want it in the Index template. I have it there already, but it's redundant, since I've hidden the upper information center in favour of a PortaMx User Box.

Above the User Box, I can have any of the three I listed: HTML, PHP or Script, in which I want to know what coding i need to put, to have the Drop Down appear in that box.


I tried putting the Drop Down under the User Box [see attached; line 205 start] but all I've gotten is the Drop Down menu available, but it won't change the account. So I'd either like it to work, or for someone to help me find what kind of coding has to be put in a HTML/PHP/Script box.


The Screen Shot shows the Script Box and the code I have within it, and what it looks like in the upper corner, above the User Box.

The Drop down that can be seen above the LOG OUT option, is what the coding in the user_login.php has created, but it won't allow for changing. It doesn't activate the change when the "Switch Account" is changed...
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

zushiba

Well offhand I don't see you passing $user_info into your globals for pmxc_ShowContent and I'm not really sure what you're doing with the elseafter the code to build $user_info['subaccounts']. Is that actually echoing out the dropdown at all? Cause it doesn't look like it.

FireDitto

... that all went totally over my head.


I don't know how to code. I just copy other portions of code, and adjust it until it works for what I want; hence, all I've done is copy the layout of previous coding in that php document, and the SubAccount coding -- Getting it to show up is as far as I've manged to go, which would be awesome, if all it had to do was sit there and look pretty.
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

zushiba

I've never used PortaMx so I can't be 100% positive about any of this but the first thing I'd try is changing
global $context, $scripturl, $boardurl, $modSettings, $txt;
to
global $context, $scripturl, $boardurl, $modSettings, $txt, $user_info;

Then your "echo $context['subaccount_dropdown']; " should work assuming you place it somewhere correctly.

Since I don't really know what all is going on in this script I don't think
{
echo $context['subaccount_dropdown'];
}

This is actually doing anything for you.

Advertisement: