News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Subaccounts

Started by SlammedDime, November 12, 2009, 09:59:09 AM

Previous topic - Next topic

babsbatgirlfan

ok cool will try, just need to find the portal php, so new at this lol. here goes everything heh.

babsbatgirlfan

Okay I think I found the section to place it into: PortalAdminBlocks.template.php

But which section does it get placed into??

Beginning on line 1
Beginning on line 3
Beginning on line 59
Beginning on line 469

Quote from: FireDitto on June 18, 2013, 04:59:35 AM
Babs -- Stick this in a Portal PHP Block. It will NOT work on the default theme (due to the code already being installed on the theme itself), but it will work on any other theme, and means you don't have to do any edits. It creates a dropdown option within the block.

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


$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>';
}
echo $context['subaccount_dropdown'];
echo show_alerts();


Burke ♞ Knight

Do this by going into Admin, then blocks under Simple Portal, then add block, custom php.

babsbatgirlfan

ok I did the custom php option added in the code and I created the block and got this error message:


An Error Has Occurred!
Database error in block code. Please check the code.

babsbatgirlfan

Okay got it to work somehow :) Thanks :)

FireDitto

You don't need to edit any files.

The idea is to create a block with your Portal system - as you did wtih the other portals - and to choose "Custom PHP" then enter that code into the new block.

That is all you have to do. No file edits.
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

elf_fu

#466
EDIT: I created a test forum with all the current mods and tweaks I have on my live forum and basically applied all of the edits to any errors by hand.

Nothing exploded, success!


This installs fantastically on Argentum2 Enhanced theme.
In Back n' Black, the drop down menu doesn't show correctly because I am a dunce.



echo '
<li id="name">' $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span>', $context['subaccount_dropdown'], '</li>';
else
echo '
<li id="name">', $txt['hello_guest'], ' <em>', $txt['guest'], '</em></li>';



Would anyone be able to point out how I might be able to have this work in the Back n' Black theme by Crip?

Thanks again. I really hope the mod author can come back to this, for an RP or RPG site this is invaluable and really great!

GR

elf_fu

Also! I hate to be a pest but I am hoping anyone can help me with this:Whenever someone creates a new subaccount, the profile of their main account ends up being copied into their new subaccount profile.

For instance, if Jack1 put, "I like pickles," in his original profile, and made a subaccount of Jack2, "I like pickles," shows up in his profile for Jack2.

Is there a way to fix this so new subaccounts have blank profiles?

Thank you for any help!

GR

wingedorange

Hello!

We're having an issue with our forum that I've tried - quite unsuccessfully - to fix on my own. I know this group is a wealth of knowledge and I'm really very much a coding/SMF beginning, so I'm hoping someone with more knowledge than I have can help.

For about two years, we've had SMF 2.0 + subaccounts installed on our site, and everything's worked beautifully. We've also had a subscription program that allows members to increase the number of subaccounts they can create, which means that each membergroup has a subaccount limit - this is not new; it's worked wonderfully for as long as we've had it.

Recently, we've begun having issues whereby members who have reached their subaccount limits can no longer access the Manage Subaccounts page from their profiles. We get a very nondescript error on the site, and the following error in the error log:

Quote8: Undefined index: cannot_subaccounts_browse_own
Apply Filter: Only show the errors from this file
File: /home/hogwarts/public_html/sortinghat/Sources/Errors.php
Line: 203

It also seems paired with this error:
Quote8: Undefined index: enable_website_url
Apply Filter: Only show the errors from this file
File: /home/hogwarts/public_html/sortinghat/Sources/Profile-Modify.php
Line: 768

Line 768 looks like this:

Quote766: '),
767:    'link_with' => 'website',
==>768:    'enabled' => $context['enable_website_url'],

It looks okay to me, but as I said - I'm very new to this. If anyone has any thoughts about why this might be occurring, I'd really appreciate any feedback. Thanks!

elf_fu

#469
Hello!


I just wanted to update that a friend of mine who knows what they are doing was able to help with the copying of profiles. Profiles from Parent accounts no longer copy to childs. Great!


But.


My members of my RP board are kind of private folk. They like to keep their subaccounts/characters who they play private. Unfortunately, if you visit the profile of a subaccount, it CLEARLY says at the top of the page, for example, like so:

       
  • Summary »Princesspants »SubAccount: Princepants
Is there a way we can REMOVE the mention that it is a subaccount please, so that it just reads: Summary>>Princepants?

For another example (as I don't mind sharing my own subaccounts) if you look at my subaccount profile here:http://gr.2phatgeeks.com/index.php?action=profile;u=92it clearly shows that it is a subaccount of GreaterRealms. I would like it to show as if it were just another normal account.

Please and thank you, any help would me most kind I will hug you and squeeze you and even call you George!

Fixed by a co-admin, I will ask if he wants to share how he did it :3

GR

margarett

I don't know the MOD but somewhere in Profile.php, the linktree should be updated with that info. It should be possible to remove the "excess" of information you require.
Try to search in that file for "linktree".
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Burke ♞ Knight

In this mod, it shows the sub-accounts in the member list in the primary member's info.

There is no way to do this, as it is coded, and the original author has not been around in a long time.

If do not want others knowing about the sub-accounts, then unlink them, and have the members log in/out on each alt account.

elf_fu

Quote from: BurkeKnight on September 03, 2013, 06:03:39 PM
In this mod, it shows the sub-accounts in the member list in the primary member's info.

There is no way to do this, as it is coded, and the original author has not been around in a long time.

If do not want others knowing about the sub-accounts, then unlink them, and have the members log in/out on each alt account.

One of our admins, who fixed the parent account copying profiles to subaccounts, has actually fixed the issue. So this can be done actually--I simply do not know how he did it/how to do it myself.

GR

margarett

Quote from: margarett on September 03, 2013, 05:27:23 PM
...somewhere in Profile.php, the linktree should be updated with that info. It should be possible to remove the "excess" of information you require.
Try to search in that file for "linktree".

Of course it is possible. It's just a matter of changing code where needed ;)

Note: still haven't look at the code, but I'm quite sure this is how it's made. So it is with other actions ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Burke ♞ Knight

There are 4 main settings for this mod. Go to Admin.
Under the Members section, there should be: Manage SubAccounts...
That Should have Settings and View SubAccounts.

Under Settings there are 2 settings that may help:

SubAccounts show on memberlist
SubAccounts show in user's profiles

The other problem you had faced, that was fixed, is the second setting on the page:

New subaccounts inherit parent membergroup

elf_fu

Quote from: BurkeKnight on September 04, 2013, 04:44:36 PM
There are 4 main settings for this mod. Go to Admin.
Under the Members section, there should be: Manage SubAccounts...
That Should have Settings and View SubAccounts.

Under Settings there are 2 settings that may help:

SubAccounts show on memberlist
SubAccounts show in user's profiles

The other problem you had faced, that was fixed, is the second setting on the page:

New subaccounts inherit parent membergroup

New subaccounts inherit parent membergroup = That was not the issue I was having :) I had that unchecked. It wasn't copying the parentgroup, it was copying the entire member profile. But, my super duper awesome co-admin who is more familiar with code was able to fix parent account profile information copying over.

Thank you, got it figured out. I am so sorry for bugging all of you and appreciate your responses! Yay for help!

GR

Ahadawan

Elf_fu, do you know how it was done? Could you ask your co-admin?
Have been trying to figure that one out myself.

elf_fu

Quote from: Ahadawan on September 12, 2013, 01:32:54 PM
Elf_fu, do you know how it was done? Could you ask your co-admin?
Have been trying to figure that one out myself.

Hi there! My co-admin said he did this:


File:  Sources/SubAccount.php
There's a loop in there that grabs all the "options" fields from the master character and copies them over.

Line 331

foreach ($cur_profile['options'] as $var => $value)
      $regOptions['theme_vars'][$var] = $value;


Added a clause to exclude anything that starts with "cust", which would be most (if not all) custom profile fields

foreach ($cur_profile['options'] as $var => $value)
  if(!preg_match("/^cust/",$var)){
    $regOptions['theme_vars'][$var] = $value;
}                       }   

GR

Ahadawan

Quote from: elf_fu on September 14, 2013, 08:22:34 AM
Hi there! My co-admin said he did this:

File:  Sources/SubAccount.php
There's a loop in there that grabs all the "options" fields from the master character and copies them over.

Line 331

foreach ($cur_profile['options'] as $var => $value)
      $regOptions['theme_vars'][$var] = $value;


Added a clause to exclude anything that starts with "cust", which would be most (if not all) custom profile fields

foreach ($cur_profile['options'] as $var => $value)
  if(!preg_match("/^cust/",$var)){
    $regOptions['theme_vars'][$var] = $value;
}                       }   


Thank you!
(And also, please thank your co-admin from me)

I found those lines before I read your reply and just removed it for the time being, not knowing if that was needed for other options, but of course that clause your co-admin added is way better so i'll be using that instead.

It seems there is a "}" too many in the code, I excluded the last and got that working.

littlenicki

Hello, this looks like a very interesting mod. Could you please port it back to SMF 1.1.18? Thank you
Fomer SMF user. Switched to Invision Power Board and VBulletin

Advertisement: