Is there a way to change or add some info to the user block.ÂÃ, I would like to be able to show a total membership as well as the membership in a particular user group.ÂÃ, I would think it would be simply adding a line of code just not sure what to call as I am not a great coder.
Thanks in advance for your time
You mean to show what groups the member is in? Primary group + others?
What I am looking for is where you have Members it says total members I would like to add a member group and the numer of members in that group. so something like this:
Members
total members 500
membergroup 105
Also would like to rename Members to Supporters. Fusion Artist is the membergroup name.
Supporters
total supporters 500
Fusion Artists 105
What I think would be great is for there not to be any blocks other than phpblock/htmlblock. When you select the userblock it loads php code into a phpblock which you can then edit if you like.
Quote from: envon on October 19, 2005, 02:28:45 AM
What I am looking for is where you have Members it says total members I would like to add a member group and the numer of members in that group. so something like this:
Members
total members 500
membergroup 105
Also would like to rename Members to Supporters. Fusion Artist is the membergroup name.
Supporters
total supporters 500
Fusion Artists 105
This would require several additional calls to the database..I don't think its good to have all that in just the userblock. Better as a single phpblock I think.
Quote from: eldacar on October 19, 2005, 11:13:16 AM
What I think would be great is for there not to be any blocks other than phpblock/htmlblock. When you select the userblock it loads php code into a phpblock which you can then edit if you like.
Well, yeah..but then I would need to post updates to the userblock-code amd basically support any kind of "custom" version..it will just be too much. Now I can concentrate on getting the specific blocktypes working good, and any updates WILL go come through, by simplay updating.
But of course the php blocktype is versatile, you could easily copy over the code for a "custom" userblock - a lot of the info is drawn from the SMF system, just a few TP related things so its not hard to make your own version at all.
Also, power users could perhaps benefit greatly from this, but others who like to just start and go will be less happy. :)
I think you may be miss understanding what I would like to do. All i would like is to change the word members to Supporters, remove the latest add Fusion Artists (which is a membergroup). The reason for this is the site I am running is for a group of artists working together on various projects. There are sveral people who are part of the group who are just supporters of the project and then there are the actual artists. I would just like to show those numbers. I will look around for the code block used in the userblock and see what I can come up with and post it back here for you to see if its correct.
Thanks for all the hard work Bloc you the best.
Maybe we can get a snippet. Anyone wanna take a crack at it?
I would like it as well..
It's actually not that hard. Just go to www.yoursite.com/forumdirectory/Themes/default/TPortalBlocks.template.php and you'll find all the code for making the blocks there. Just edit the code for the user block.
The code is currently
// Tportal userbox
function TPortal_userbox()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
$bullet = '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet2 = '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
echo'<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>';
echo '<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;">';
if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
echo $context['user']['avatar']['image'] . '<br />';
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '<span class="normaltext">
', $txt['hello_member'], ' <b>', $context['user']['name'], '</b></span>';
// Only tell them about their messages if they can read their messages!
if ($context['allow_pm']){
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';
if($context['user']['unread_messages']>0)
echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';
}
// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=regcenter">'.$txt['tp_unapproved_members'].'<b> '. $context['unapproved_members'] . '</b></a>';
if(isset($context['TPortal']['userbox']['unread'])){
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
<br />'.$bullet.'<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>';
}
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br /><b>' .$bullet.$txt['tp_maintenace']. '</b>';
// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']) && isset($context['TPortal']['userbox']['logged']))
{
echo '<br />'.$bullet.$txt['tp-loggedintime'] . ' ';
echo '<br />'.$context['user']['total_time_logged_in']['days'] . 'd ';
echo $context['user']['total_time_logged_in']['hours'] . 'h ';
echo $context['user']['total_time_logged_in']['minutes'] .'m';
}
if(isset($context['TPortal']['userbox']['time'])){
echo '<br />'.$bullet. $context['current_time'];
}
// can we submit an article?
if(!isset($context['TPortal']['can_submit_article']))
$context['TPortal']['can_submit_article']=0;
if($context['TPortal']['can_submit_article']==1 && !$context['user']['is_admin'])
echo '<br /><b>'.$bullet.'<a href="', $scripturl, '?action=tpmod&sub=submitarticle">' . $txt['tp-submitarticle']. '</a></b>';
echo '</div>';
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />
<form action="', $scripturl, '?action=login2" method="post" >
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="302400">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
<input type="submit" value="', $txt[34], '" /><br />
', $txt['smf52'], '
</form>';
}
if(isset($context['TPortal']['userbox']['stats']))
// add stats in here
echo '
<hr /><img src="'.$settings['images_url'].'/icons/members.gif" style="margin: 0;" align="bottom" alt="" />
<a href="'.$scripturl.'?action=mlist"><b>'.$txt[19].'</b></a>
<br />'.$bullet.$txt[488].': ' , isset($modSettings['totalMembers']) ? $modSettings['totalMembers'] : $modSettings['memberCount'] , '
<br />'.$bullet.$txt[656]. ': <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '"><b>', $modSettings['latestRealName'], '</b></a>';
if(isset($context['TPortal']['userbox']['online'])){
// add online users
echo '<hr /><img src="'.$settings['images_url'].'/icons/online.gif" style="margin: 0;" align="bottom" alt="" />
<a href="'.$scripturl.'?action=who"><b>'.$txt[158].'</b></a><br />';
$online = ssi_whosOnline('array');
echo $bullet.'Users: '.$online['num_users'];
echo '<br />'.$bullet.'Guests: '.$online['guests'];
echo '<br />'.$bullet.'Total: '.$online['total_users'].'<hr />';
foreach($online['users'] as $user){
echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo '<br />';
}
}
echo '<br /></td></tr></table>';
}
Open the index.english.php file in the /Themes/default/languages folder.
Find this line:
Find this line:
$txt[19] = 'Members';
Replace with:
$txt[19] = 'Supporters';
$txt[656] = 'Latest Member';
Replace with:
$txt[656] = 'Fusion Artists';
Quote from: IchBinâââ,¬Å¾Ã,¢ on November 05, 2005, 02:52:10 PM
Open the index.english.php file in the /Themes/default/languages folder.
Find this line:
Find this line:
$txt[19] = 'Members';
Replace with:
$txt[19] = 'Supporters';
$txt[656] = 'Latest Member';
Replace with:
$txt[656] = 'Fusion Artists';
the first one would work, but on the second one you'd also have to edit /Themes/default/TPortalBlocks.template.php and hook it up to a MySQL query to figure out the number of members in the fusion artist group or else it would just show "Fusion Artists:
name of latest member".
PS It also would change total members to supporters and latest members to fusion artist everywhere in the forum (in your case changing total members to supporters might not be a bad thing so the first part of IchBin's suggestion would probobally work, but you'd need to work on the second part. I'll try and figure out how to do this and post some code.
Ok I don't know much php so I don't know how to make it dynamic so you'll just have to update it whenever the number of artists changes but here's what you need to do:
First, the first part of IchBin's suggestion
In /Themes/default/languages/index.english.php
Find this
$txt[19] = 'Members';
And replace with
$txt[19] = 'Total Supporters';
Now my add-on to IchBin's suggestion (note that this is probobally not the most efficient way of doing this but it should work-always make backups of the files you edit):
In /Themes/default/languages/index.english.php
Add this at the end (but before the >?)
$txt['fusion_artists'] = 'Fusion Artists: "number of people"';
(replace "number of people" with the number of fusion artists)
Now in /Themes/default/TPortalBlocks.template.php
Find
<br />'.$bullet.$txt[656]. ': <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '"><b>', $modSettings['latestRealName'], '</b></a>';
And replace with
<br />'.$bullet.$txt['fusion_artists'].'</b></a>';
That should work, but you will have to manually edit the number every time the number of fusion artists changes.
Oops... I just kind of skipped over the fact that it was a member group. :o
Thanks alot guys for working on this you rock.