EzPortal - Portal Software for Forums
EzPortal Forums => Feature Request => Topic started by: FireDitto on June 16, 2010, 11:46:11 pm
-
What I'd like to be able to do, is add the drop down option from SlammedDime's Sub Account (http://www.simplemachines.org/community/index.php?topic=347710.0) mod so that it is sitting in the User Box, as indicated in this image:
(https://www.ezportal.com/proxy.php?request=http%3A%2F%2Fimages.fusilladeink.org%2Frequest.png&hash=31b37f15ecabf5aef1cd173f47bc6006ce1e1ae5)
Is this possible? And if so, how would I go about it?
-
*bumps*
-
You would need to modify the code in Sources/Subs-ezportal-main.php and find the userbox display code.
-
Okay, thank you!
... I'll let you know how I go :P
-
*grimace* I can't for the life of me find the userbox display code... Or at least, I do not think I have managed to find it.
I've been in the Subs-EzPortalMain2.php in which I found the Userbox information, and I put the code where I think it should go. However, I cannot bring it to make the drop down option appear. When I try, it simply results in the page becoming blank; it doesn't tell me there is an error in the code, but it also doesn't show anything [basically an URL in the address bar, and pretty white screen where the webpage itself should be].
I'm not sure what to do, in order to correct this and get it to show up.
I am running SMF 2.0 RC3, by the way.
-
*bump* Help would be deeply appreciated.
-
Still need help...
-
Okay, I think this is the EzPortal User info area that I want to add the Dropdown menu in:
<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;
}
And this is the code for the dropdown menu:
$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>';
}
And the piece that calls it up:
$context['subaccount_dropdown'],
But no matter what manner I try to put it in there, I just can't manage to get it to work.
Could I get some more help, please??
-
You would put the first block of code first.
Then add
echo $context['subaccount_dropdown'];
And that should display the dropdown
-
Ahh, thank you. Got it now. Was missing the 'echo'
-
Hrm. It's definitely visible, and the drop down works, but when selected, it doesn't change the account. It just sits there on that option...
-
Most likely you have a form tag inside another form tag make sure the code you have added is outside of the last form tag.
-
// Show drop down?
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>';
}
else
{
echo $context['subaccount_dropdown'];
}
Is what I have; and I added it after a } and before the // of the next block of code [so that it is between the "my files" and the "log out" options of the User Block.
As I said, it is showing up, and the options are there, but it won't let me actually change accounts.