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

New built in translations for six langauges! by EzPortal
March 26, 2024, 11:15:32 pm

Smiley missing in shoutbox 2.1.4 by hustreamload
July 26, 2023, 08:14:02 am

Re: Theme Select Box question? by Shades
March 15, 2023, 06:49:49 pm

Re: Theme Select Box question? by Shades
March 09, 2023, 02:09:24 pm

Re: Theme Select Box question? by Shades
March 09, 2023, 01:55:53 pm

Re: Theme Select Box question? by EzPortal
March 09, 2023, 01:47:42 pm

Re: Theme Select Box question? by Shades
March 09, 2023, 01:34:07 pm

Re: Theme Select Box question? by EzPortal
March 09, 2023, 12:20:17 pm

+- HTML Menu


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

Recent Topics ezBlock

New built in translations for six langauges! by EzPortal
March 26, 2024, 11:15:32 pm

Smiley missing in shoutbox 2.1.4 by hustreamload
July 26, 2023, 08:14:02 am

Theme Select Box question? by Shades
March 15, 2023, 06:49:49 pm

Where is the facebook button color? by EzPortal
February 28, 2023, 06:45:09 pm

Display on Mobile - SMF 2.1.3 and EZ 5.5.2 by BugginIn
December 29, 2022, 04:07:13 pm

Blocks Help by Riggs1973
November 20, 2022, 12:59:30 pm

Surface ol lite theme release Free! by Steffen K.
November 18, 2022, 03:57:24 am

Undefined index: href by EzPortal
October 04, 2022, 08:49:59 pm

SMF-ezportal_column_5.cache): failed to open stream: No such file or directory by EzPortal
June 04, 2022, 11:40:13 am

Arcade block error: failed to open stream: No such file or directory by Shades
May 20, 2022, 02:47:13 pm

Author Topic: Add to User Block...  (Read 17304 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: 1299
  • Karma: 67
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: 1299
  • Karma: 67
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: 1299
  • Karma: 67
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
4603 Views
Last post June 17, 2010, 07:24:33 am
by Maxx
2 Replies
12413 Views
Last post March 12, 2011, 04:10:34 am
by FireDitto
1 Replies
13609 Views
Last post August 25, 2012, 11:33:27 am
by amwebby
0 Replies
6966 Views
Last post December 26, 2012, 11:41:58 am
by desi4um
1 Replies
31119 Views
Last post October 12, 2020, 07:55:08 am
by EzPortal

+-SMF Gallery

Quick Menu


Powered by EzPortal