+-

UserBox

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

Sponsored Links

+- Recent Posts

Re: Code being stripped in HTML block by negative_energy
February 06, 2012, 06:30:36 pm

Re: Code being stripped in HTML block by EzPortal
February 06, 2012, 06:25:25 pm

Re: Code being stripped in HTML block by negative_energy
February 06, 2012, 06:23:16 pm

Re: Flash EzBlock by negative_energy
February 06, 2012, 06:18:40 pm

Re: Code being stripped in HTML block by EzPortal
February 06, 2012, 06:08:49 pm

Code being stripped in HTML block by negative_energy
February 06, 2012, 06:01:55 pm

Re: EzPortal 0.5.1 and Russian encoding by Retrouser
February 04, 2012, 12:59:13 am

Re: Flash EzBlock by negative_energy
January 23, 2012, 12:56:04 am

Re: Flash EzBlock by EzPortal
January 22, 2012, 11:08:10 pm

Flash EzBlock by negative_energy
January 22, 2012, 05:29:23 pm

Author Topic: Add to User Block...  (Read 5056 times)

0 Members and 1 Guest are viewing this topic.

Offline FireDitto

  • Newbie
  • *
  • Posts: 37
  • Karma: 0
    • View Profile
Add to User Block...
« 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 mod so that it is sitting in the User Box, as indicated in this image:




Is this possible? And if so, how would I go about it?

Offline FireDitto

  • Newbie
  • *
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Add to User Block...
« Reply #1 on: July 12, 2010, 04:30:15 am »
*bumps*

Offline EzPortal

  • Administrator
  • *****
  • Posts: 624
  • Karma: 42
    • View Profile
Re: Add to User Block...
« Reply #2 on: July 12, 2010, 06:33:12 pm »
You would need to modify the code in Sources/Subs-ezportal-main.php and find the userbox display code.

Offline FireDitto

  • Newbie
  • *
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Add to User Block...
« Reply #3 on: July 24, 2010, 01:39:29 am »
Okay, thank you!

... I'll let you know how I go :P

Offline FireDitto

  • Newbie
  • *
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Add to User Block...
« Reply #4 on: July 24, 2010, 05:39:55 am »
*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.

Offline FireDitto

  • Newbie
  • *
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Add to User Block...
« Reply #5 on: July 30, 2010, 12:35:33 am »
*bump* Help would be deeply appreciated.

Offline FireDitto

  • Newbie
  • *
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Add to User Block...
« Reply #6 on: August 28, 2010, 12:47:36 am »
Still need help...

Offline FireDitto

  • Newbie
  • *
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Add to User Block...
« Reply #7 on: September 10, 2010, 03:32:33 am »
Okay, I think this is the EzPortal User info area that I want to add the Dropdown menu in:

Code: [Select]
<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:

Code: [Select]
$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:
Code: [Select]
$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??

Offline EzPortal

  • Administrator
  • *****
  • Posts: 624
  • Karma: 42
    • View Profile
Re: Add to User Block...
« Reply #8 on: September 10, 2010, 09:00:25 am »
You would put the first block of code first.

Then add
echo $context['subaccount_dropdown'];
And that should display the dropdown

Offline FireDitto

  • Newbie
  • *
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Add to User Block...
« Reply #9 on: September 10, 2010, 05:52:46 pm »
Ahh, thank you. Got it now. Was missing the 'echo'

Offline FireDitto

  • Newbie
  • *
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Add to User Block...
« Reply #10 on: September 19, 2010, 05:13:50 pm »
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...

Offline EzPortal

  • Administrator
  • *****
  • Posts: 624
  • Karma: 42
    • View Profile
Re: Add to User Block...
« Reply #11 on: September 19, 2010, 05:25:11 pm »
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.

Offline FireDitto

  • Newbie
  • *
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Add to User Block...
« Reply #12 on: September 19, 2010, 06:28:25 pm »
Code: [Select]
// 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.

 

Powered by EzPortal