EzPortal - Portal Software for Forums

EzPortal - Made to Fit Your SMF Forum - Glad You Found Us!
+- +-

UserBox

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

+- Recent Posts

Minor Update for SMF 2.1.x by EzPortal
October 18, 2020, 09:33:09 am

Re: EzPortal unable to be seen by user with primary custom usergroup by EzPortal
October 12, 2020, 07:55:08 am

EzPortal unable to be seen by user with primary custom usergroup by radi27
October 11, 2020, 04:46:32 pm

Show Likes mod by NickT
July 10, 2020, 12:09:44 pm

Re: ezPortal inbuilt module downloaders not working. by EzPortal
March 26, 2020, 08:19:48 am

Re: ezPortal inbuilt module downloaders not working. by Valdivia
March 26, 2020, 08:16:33 am

Re: ezPortal inbuilt module downloaders not working. by EzPortal
February 12, 2020, 10:01:42 pm

Re: ezPortal inbuilt module downloaders not working. by usalabs
February 12, 2020, 05:59:54 pm

+- HTML Menu


Sample HTML Block Usage - You May Custom Code it, as needed!

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

0 Members and 1 Guest are viewing this topic.

Offline FireDitto

  • Posts: 37
  • Karma: 0
  • Gender: Female
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

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

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1227
  • Karma: 66
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.
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline FireDitto

  • Posts: 37
  • Karma: 0
  • Gender: Female
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

  • Posts: 37
  • Karma: 0
  • Gender: Female
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

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

Offline FireDitto

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

Offline FireDitto

  • Posts: 37
  • Karma: 0
  • Gender: Female
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: 1227
  • Karma: 66
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
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline FireDitto

  • Posts: 37
  • Karma: 0
  • Gender: Female
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

  • Posts: 37
  • Karma: 0
  • Gender: Female
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: 1227
  • Karma: 66
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.
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline FireDitto

  • Posts: 37
  • Karma: 0
  • Gender: Female
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.

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
3527 Views
Last post June 17, 2010, 07:24:33 am
by Maxx
2 Replies
10456 Views
Last post March 12, 2011, 04:10:34 am
by FireDitto
1 Replies
10896 Views
Last post August 25, 2012, 11:33:27 am
by amwebby
0 Replies
4697 Views
Last post December 26, 2012, 11:41:58 am
by desi4um
1 Replies
1982 Views
Last post October 12, 2020, 07:55:08 am
by EzPortal

+-SMF Gallery

Quick Menu



Members Online

26 Guests, 0 Users
Powered by EzPortal