Hey all. I have been thinking lately that I wanted to move my forum stats and users stats into a horizontal block. Since I'm no PHP guru I came here of course. I searched and what I found was http://www.tinyportal.net/index.php?topic=15083.0 which is fine for just the forum stats, but I couldn't find anything for the user stats at all.
Did I overlook it? Not use the right search words?
I think this could be a very useful block.
What does everyone else think?
Link to my site: http://www.Daddyplace.com
SMF version: SMF 1.1.10
TP version: TP 1.0 Beta 4
Theme name and version: Daddyplace Theme
Browser Name and Version: FireFox 3.0.14
Mods installed: Several, if I really need to list them I will.
Related Error messages: None
Well, I didn't look through the code or even try it so I don't know exactly what it does, but if you want both in the same block, it's just a matter of deciding how you want it formatted and adjust your table accordingly. It's kind of an old snippet but it probably still works OK.
If it was me, and I wanted a link to the Forum stats on the FrontPage, I would just setup a menu item with the Forum stats in a menu block and leave the user stats in it's own left or right block, especially since the Forum stats is something that most members aren't going to be interested in. With all that being said, if you still want something like this, write about how you would like this block to look or how it should be formatted in your next post, and perhaps one of our coders will take a look at it and write something for you. Also, they will need additional information about your site so Please Read and Follow the Posting Guidelines (http://www.tinyportal.net/index.php/topic,581), and edit the inforamtion requested into your first post at the top of this topic.
ZarPrime
Quote from: ZarPrime on October 28, 2009, 02:40:31 PM
Well, I didn't look through the code or even try it so I don't know exactly what it does, but if you want both in the same block, it's just a matter of deciding how you want it formatted and adjust your table accordingly. It's kind of an old snippet but it probably still works OK.
The above code that I mentioned does work fine. However, I'm more interested in the user stats (and forum stats to keep it together). I would just like them in a center block (horizontal) on all pages up top. I think it would look really good that way.
What I'm thinking is just to take the blocks the way they are now and just convert them to be horizontal blocks. I don't believe that is an option right now. But I do believe that people would like the option to do so. I know I would.
I hope all of that makes sense.
Are you sure you want the Forum Stats in a block on every page on your Forum. Do you realize how big it is? Take a look at this ...
http://www.tinyportal.net/index.php?action=stats
You say you want it in a center block rather than an upper or lower block which leads me to believe that you are using TP 0.98. A block like this would sit right below the tabs in the header and your members would have to scroll quite a distance down the page just to see the rest of the content on each page that the block is on.
ZarPrime
I am with ZP, to me it doesn't sounds like a good idea. How many people are really interested in stats apart from admins ? The stats page is only one click away, is that not sufficient ?
Oh, wait. Are you talking about what is normally in the Stats block type beside what's in the user block type in the same block (see attached screenshot below from your site)? If so, that is more reasonable.
ZarPrime
Quote from: ZarPrime on October 28, 2009, 03:33:30 PM
Oh, wait. Are you talking about what is normally in the Stats block type beside what's in the user block type in the same block (see attached screenshot below from your site)? If so, that is more reasonable.
ZarPrime
Yes. That is the block along with the user stats block. LOL I bet you guys thought I was going crazy wanting the forum stats page in a block. LOL
LOL :2funny: :2funny:
<Heh> It wouldn't be the first time I thought someone was crazy. ;)
OK, that can probably be done. I'm working on something for another member right now so if freddy doesn't pop back in here by the time I finish I'll have a look at it. However, I'm not nearly the coder that he is, so it would be better if he pops back in.
ZarPrime
Thanks guys. I do appreciate it!
Ok now I get you :)
Yes I can take a look at this, but I am pushed for time this evening - I will probably be able to get you something for tomorrow.
Sounds great Freddy. I appreciate it and thank you!
Had some time to start on this, all the info takes up a lot of space - see what you think. Might be better to reduce the font to the smaller one :
All I did was copy Bloc's code and rearrange how it displays...
global $context, $settings, $options, $scripturl, $txt, $modSettings;
$bullet = '<img src="Themes/default/images/tinyportal/TPdivider.gif" style="margin-right: 5px; margin-left: 5px" />';
echo'
<div class="tp_userblock">';
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<h4>', $txt['hello_member'], ' ', $context['user']['name'], '</h4>
';
// Only tell them about their messages if they can read their messages!
if ($context['allow_pm']){
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';
if($context['user']['unread_messages']>0)
echo '
' , $bullet , '<a 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 '
' , $bullet , '<a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">'.$txt['tp_unapproved_members'].' '. $context['unapproved_members'] . '</a>';
if(isset($context['TPortal']['userbox']['unread']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=showcomments">'.$txt['tp-showcomments'].'</a><br />
';
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
' , $bullet , $txt['tp_maintenace'];
// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']) && isset($context['TPortal']['userbox']['logged']))
{
echo '
' , $bullet , $txt['tp-loggedintime'] , $context['user']['total_time_logged_in']['days'] . $txt['tp-acronymdays']. $context['user']['total_time_logged_in']['hours'] . $txt['tp-acronymhours']. $context['user']['total_time_logged_in']['minutes'] .$txt['tp-acronymminutes'];
}
echo '
' , $bullet , $context['current_time'] , '<br />';
// admin parts etc.
if(!isset($context['TPortal']['can_submit_article']))
$context['TPortal']['can_submit_article']=0;
// do not show if none is availalable
if($context['TPortal']['can_submit_article']==1 || allowedTo(array('tp_dlupload','tp_dlmanager','tp_settings','tp_articles','tp_blocks','tp_submithtml','tp_submitbbc')))
{
// can we submit an article?
if(!allowedTo('tp_articles'))
{
if(allowedTo('tp_submithtml'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a>';
if(allowedTo('tp_submitbbc'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle;bbc">' . $txt['tp-submitarticlebbc']. '</a>';
}
// upload a file?
if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a>';
// tpadmin checks
if (allowedTo('tp_settings'))
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=settings">' . $txt['permissionname_tp_settings'] . '</a>';
if (allowedTo('tp_blocks'))
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=blocks">' . $txt['permissionname_tp_blocks'] . '</a>';
if (allowedTo('tp_articles'))
{
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=articles">' . $txt['permissionname_tp_articles'] . '</a>';
// any submissions?
if($context['TPortal']['submitcheck']['articles']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=submission"><b>' . $context['TPortal']['submitcheck']['articles'] . ' ' .$txt['tp-articlessubmitted'] . '</b></a>';
}
if (allowedTo('tp_dlmanager'))
{
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=admin">' . $txt['permissionname_tp_dlmanager'] . '</a>';
// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a>';
}
}
// add adminhooks
if(sizeof($context['TPortal']['tpmodules']['adminhook'])>0)
{
foreach($context['TPortal']['tpmodules']['adminhook'] as $link)
echo $bullet , '<a href="' . $scripturl . '?'.$link['action'].'">' . $link['title']. '</a>';
}
}
// Otherwise they're a guest - so politely ask them to register or login.
else{
echo '
<div>', $txt['welcome_guest'], '</div>
<div class="smalltext">', $context['current_time'], '</div>
<form style="margin-top: 5px;" action="', $scripturl, '?action=login2" method="post" >
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" /><br />
<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], '" />
</form>
<span class="smalltext">', $txt['smf52'], '</span>
<br />';
}
if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
echo '<p>' , $context['user']['avatar']['image'] , '</p>';
echo '
</div>';
// STATS....
echo'
<div class="tp_statsblock">';
if(isset($context['TPortal']['userbox']['stats']))
// members stats
echo '
<h5 class="mlist"><a href="'.$scripturl.'?action=mlist">'.$txt[19].'</a></h5>
' , $bullet , $txt[488].': ' , isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'] , '
' , $bullet , $txt['tp-latest']. ': <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '"><strong>', $modSettings['latestRealName'], '</strong></a>
';
if(isset($context['TPortal']['userbox']['stats_all']))
// more stats
echo '
<h5 class="stats"><a href="'.$scripturl.'?action=stats">'.$txt['tp-stats'].'</a></h5>
' , $bullet , $txt[489].': '.$modSettings['totalMessages']. '
' , $bullet , $txt[490].': '.$modSettings['totalTopics']. '
' , $bullet , $txt['tp-mostonline-today'].': '.$modSettings['mostOnlineToday'].'
' , $bullet , $txt['tp-mostonline'].': '.$modSettings['mostOnline'].'
('.timeformat($modSettings['mostDate']).')';
if(isset($context['TPortal']['userbox']['online']))
{
// add online users
echo '
<h5 class="online"><a href="'.$scripturl.'?action=who">'.$txt[158].'</a></h5>
<div>';
$online = ssi_whosOnline('array');
echo $bullet , $txt['tp-users'].': '.$online['num_users']. '
' , $bullet , $txt['tp-guests'].': '.$online['guests'].'
' , $bullet , $txt['tp-total'].': '.$online['total_users'].'
<div style="max-height: 23em; overflow: auto;">';
foreach($online['users'] as $user)
{
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo ' ';
}
echo '
</div></div>';
}
echo '
</div>';
Nice freddy. Good job. I haven't tried it but I assume it's :up: :up:
Keith, if you try this, It might be nice to take a screenshot and modify you original post in this topic to attach it so that others can see what it looks like in case they want to use it.
ZarPrime
Great job Freddy! I truly appreciate it.
I have attached a pic of it like Prime suggested.
I will probably make a few changes with it so it will fit better into my site. For instance move the Avatar to the left of PM. Remove the stats area all together. Remove total logged in time and the date and time.
That should shrink it enough to where it would fit better. What do you think?
Yeah sure, do whatever you think works - it's pretty easy to adjust now you have the code. I think I would remove the avatar myself - and maybe surround the whole thing in a DIV and try out smaller text using the class 'smalltext' I think it is.
Otherwise I am glad you found it useful :)
Thanks again Freddy. I'm not good at all with code. How hard would it be to do this.
Hey User,
Avatar New posts Upload file
Show replies Manage Settings
Show own replies Manage Blocks
Show latest comments All of the other ones.
Users Online List here with more space between the names.
Would that be too hard? Also have bullet points on each of the Links. For instance New posts, show replies, upload files, manage blocks. All of those. Would that be too hard?
So you want to remove the 'Members' bit and the 'Stats' bit ?
Looks easy enough....I'll see what I can come up with. You are sure this is what you want ?
Quote from: freddy888 on October 31, 2009, 03:16:23 PM
So you want to remove the 'Members' bit and the 'Stats' bit ?
Looks easy enough....I'll see what I can come up with. You are sure this is what you want ?
LOL I think so. Can it be formatted the way I showed in the previous post?
Okay then, try this :
global $context, $settings, $options, $scripturl, $txt, $modSettings;
$bullet = '<img src="Themes/default/images/tinyportal/TPdivider.gif" style="margin-right: 5px; margin-left: 5px" />';
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<table>
<tr>
<td colspan="3">
<strong>', $txt['hello_member'], ' ', $context['user']['name'], '</strong>
</td>
</tr>
<tr>
<td>';
// Avatar
if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
echo '<p>' , $context['user']['avatar']['image'] , '</p>';
echo '
</td>
<td>';
// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
{
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a><br />';
if($context['user']['unread_messages']>0)
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a><br />';
}
// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">'.$txt['tp_unapproved_members'].' '. $context['unapproved_members'] . '</a><br />';
if(isset($context['TPortal']['userbox']['unread']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a><br />
' , $bullet , '<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a><br />
' , $bullet , '<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a><br />
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=showcomments">'.$txt['tp-showcomments'].'</a><br />';
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
' , $bullet , $txt['tp_maintenace'] , '<br />';
echo '
</td>
<td>';
// admin parts etc.
if(!isset($context['TPortal']['can_submit_article']))
$context['TPortal']['can_submit_article']=0;
// do not show if none is availalable
if($context['TPortal']['can_submit_article']==1 || allowedTo(array('tp_dlupload','tp_dlmanager','tp_settings','tp_articles','tp_blocks','tp_submithtml','tp_submitbbc')))
{
// can we submit an article?
if(!allowedTo('tp_articles'))
{
if(allowedTo('tp_submithtml'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a><br />';
if(allowedTo('tp_submitbbc'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle;bbc">' . $txt['tp-submitarticlebbc']. '</a><br />';
}
// upload a file?
if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a><br />';
// tpadmin checks
if (allowedTo('tp_settings'))
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=settings">' . $txt['permissionname_tp_settings'] . '</a><br />';
if (allowedTo('tp_blocks'))
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=blocks">' . $txt['permissionname_tp_blocks'] . '</a><br />';
if (allowedTo('tp_articles'))
{
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=articles">' . $txt['permissionname_tp_articles'] . '</a><br />';
// any submissions?
if($context['TPortal']['submitcheck']['articles']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=submission"><b>' . $context['TPortal']['submitcheck']['articles'] . ' ' .$txt['tp-articlessubmitted'] . '</b></a><br />';
}
if (allowedTo('tp_dlmanager'))
{
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=admin">' . $txt['permissionname_tp_dlmanager'] . '</a><br />';
// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a><br />';
}
}
// add adminhooks
if(sizeof($context['TPortal']['tpmodules']['adminhook'])>0)
{
foreach($context['TPortal']['tpmodules']['adminhook'] as $link)
echo $bullet , '<a href="' . $scripturl . '?'.$link['action'].'">' . $link['title']. '</a><br />';
}
echo '
</td>
</tr>';
// Stats....
echo '
<tr>
<td colspan="3">';
if(isset($context['TPortal']['userbox']['online']))
{
// add online users
echo '
<strong><a href="'.$scripturl.'?action=who">'.$txt[158].'</a></strong>
<div>';
$online = ssi_whosOnline('array');
echo $bullet , $txt['tp-users'].': '.$online['num_users']. '
' , $bullet , $txt['tp-guests'].': '.$online['guests'].'
' , $bullet , $txt['tp-total'].': '.$online['total_users'].'
<div style="max-height: 23em; overflow: auto;">';
foreach($online['users'] as $user)
{
echo $user['hidden'] ? '<span style="margin-left: 5px"><i>' . $user['link'] . '</i></span>' : '<span style="margin-left: 5px">' . $user['link'] . '</span>';
echo ' ';
}
echo '
</div>
</div>';
}
echo '
</td>
</tr>
</table>';
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
<div>', $txt['welcome_guest'], '</div>
<div class="smalltext">', $context['current_time'], '</div>
<form style="margin-top: 5px;" action="', $scripturl, '?action=login2" method="post" >
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" /><br />
<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], '" />
</form>
<span class="smalltext">', $txt['smf52'], '</span>
<br />';
}
Perfect Freddy! That is much better and great! I sure do appreciate your hard work on it. If there is anything I can do for you, just ask!
One more question.. The empty space on the right, is there a way that I can add an ad to that blank space? For instance maybe add (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.publicworksgroup.com%2Fblog%2Fwp-content%2Fthemes%2FPassionDuo_Blue%2Fimages%2Fad.jpg&hash=94848d9390399ba7472c09b58e87f91564baa5ee) to that space?
What do you think?
Looks great. Good job Freddy :up:
oh.. er, can we move this to Snippet Requests, or Block Code Snippets?
Yes Zetan, I was thinking that too - do you want to transfer the whole thread ?
Keith - I will take a look at this ad space for you. Back later...
Thanks Freddy!
Okay try this out. Depending on screen size you could probably get a longer advert in there too. You will need to align it as you see fit. I used your example image to demonstrate it in action.
Also, you could wrap the whole table in a DIV and centralise it if you wanted.
global $context, $settings, $options, $scripturl, $txt, $modSettings;
$bullet = '<img src="Themes/default/images/tinyportal/TPdivider.gif" style="margin-right: 5px; margin-left: 5px" />';
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<table>
<tr>
<td colspan="3">
<strong>', $txt['hello_member'], ' ', $context['user']['name'], '</strong>
</td>
<td rowspan="2">';
// Advert area...
echo '
<img style="margin: 5px" src="http://www.publicworksgroup.com/blog/wp-content/themes/PassionDuo_Blue/images/ad.jpg" alt="" title="title" height="125" width="125" />';
// Advert end.
echo '
</td>
</tr>
<tr>
<td>';
// Avatar
if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
echo '<p>' , $context['user']['avatar']['image'] , '</p>';
echo '
</td>
<td>';
// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
{
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a><br />';
if($context['user']['unread_messages']>0)
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a><br />';
}
// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">'.$txt['tp_unapproved_members'].' '. $context['unapproved_members'] . '</a><br />';
if(isset($context['TPortal']['userbox']['unread']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a><br />
' , $bullet , '<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a><br />
' , $bullet , '<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a><br />
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=showcomments">'.$txt['tp-showcomments'].'</a><br />';
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
' , $bullet , $txt['tp_maintenace'] , '<br />';
echo '
</td>
<td>';
// admin parts etc.
if(!isset($context['TPortal']['can_submit_article']))
$context['TPortal']['can_submit_article']=0;
// do not show if none is availalable
if($context['TPortal']['can_submit_article']==1 || allowedTo(array('tp_dlupload','tp_dlmanager','tp_settings','tp_articles','tp_blocks','tp_submithtml','tp_submitbbc')))
{
// can we submit an article?
if(!allowedTo('tp_articles'))
{
if(allowedTo('tp_submithtml'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a><br />';
if(allowedTo('tp_submitbbc'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle;bbc">' . $txt['tp-submitarticlebbc']. '</a><br />';
}
// upload a file?
if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a><br />';
// tpadmin checks
if (allowedTo('tp_settings'))
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=settings">' . $txt['permissionname_tp_settings'] . '</a><br />';
if (allowedTo('tp_blocks'))
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=blocks">' . $txt['permissionname_tp_blocks'] . '</a><br />';
if (allowedTo('tp_articles'))
{
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=articles">' . $txt['permissionname_tp_articles'] . '</a><br />';
// any submissions?
if($context['TPortal']['submitcheck']['articles']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=submission"><b>' . $context['TPortal']['submitcheck']['articles'] . ' ' .$txt['tp-articlessubmitted'] . '</b></a><br />';
}
if (allowedTo('tp_dlmanager'))
{
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=admin">' . $txt['permissionname_tp_dlmanager'] . '</a><br />';
// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a><br />';
}
}
// add adminhooks
if(sizeof($context['TPortal']['tpmodules']['adminhook'])>0)
{
foreach($context['TPortal']['tpmodules']['adminhook'] as $link)
echo $bullet , '<a href="' . $scripturl . '?'.$link['action'].'">' . $link['title']. '</a><br />';
}
echo '
</td>
</tr>';
// Stats....
echo '
<tr>
<td colspan="4">';
if(isset($context['TPortal']['userbox']['online']))
{
// add online users
echo '
<strong><a href="'.$scripturl.'?action=who">'.$txt[158].'</a></strong>
<div>';
$online = ssi_whosOnline('array');
echo $bullet , $txt['tp-users'].': '.$online['num_users']. '
' , $bullet , $txt['tp-guests'].': '.$online['guests'].'
' , $bullet , $txt['tp-total'].': '.$online['total_users'].'
<div style="max-height: 23em; overflow: auto;">';
foreach($online['users'] as $user)
{
echo $user['hidden'] ? '<span style="margin-left: 5px"><i>' . $user['link'] . '</i></span>' : '<span style="margin-left: 5px">' . $user['link'] . '</span>';
echo ' ';
}
echo '
</div>
</div>';
}
echo '
</td>
</tr>
</table>';
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
<div>', $txt['welcome_guest'], '</div>
<div class="smalltext">', $context['current_time'], '</div>
<form style="margin-top: 5px;" action="', $scripturl, '?action=login2" method="post" >
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" /><br />
<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], '" />
</form>
<span class="smalltext">', $txt['smf52'], '</span>
<br />';
}
That looks great Freddy! Thanks for your hard work. I appreciate it!
Job well done!
Welcome :)
I really do like this block alot. It's working great. Just one small cosmetic problem.
When viewing the block in the forum, homepage and unread screens everything is fine, but when you go to a post, the bullets disappear. Anyone know why this may be happening?
The code below is what we are using, we have tweaked it just alittle. I will post screen shots of the problem too.
Thanks for the screen shots. I don't know why this is happening - I tried it on my test forum and it works fine in all sections. Perhaps there is another mod interfering with it, but I can't see how it would.
It might be helpful to see this on your site live and then maybe we can figure it out that way, it would let me see the source code...
Once you have it up and running post us a link to a page where it is not working please.
Anyone else have any thoughts ?
You have a temp account we can look at this with Keith?
Sure.
Try changing the $bullet line near the top to this :
$bullet = '<img src="http://www.daddyplace.com/Themes/default/images/tinyportal/TPdivider.gif" style="margin-right: 5px; margin-left: 5px" />';
I think it is the format of the URL that is screwing with it.
It looks to be working now. Thanks again Freddy. Your great at what you do!
Hehe, thanks Keith, I'm glad we got you sorted out :) All the best with the site.
Thanks Freddy.
Hey Freddy. One more thing. LOL
It appears now, and I don't know why, that after we put the above code into place now the avatar appears on the main page and the forum page, but when you go to the post screen or unread screen the avatar is now gone.
LOL Did I do something wrong?
Changing that bit of code would be unlikely to cause this problem. I would go back over your code and check you didn't alter something by mistake.
Is this part necessary?
&& isset($context['TPortal']['userbox']['avatar'])
I haven't looked at the code or anything. But does that array/variable exists through each page load?
It should do, I tested it and it worked fine here. The code is a rip from Bloc's code - pretty much verbatim, so it should work just the same as the original blocks do.
It was working before but that's possibly something for me to look at though...
Edit : Yeah works fine here - also works with the original blocks deactivated, so it's not that.
Keith, did you also change anything else ?
Your gonna laugh, but it's working now.
It really confuses me. I didn't change anything from before (I was working outside).
I'm gonna watch it over the next couple of days and I'll get back with you guys.
:D well things like that do happen sometimes...fingers crossed as I can't think of what would cause it.
lol, I'll do it then.. Topic Moved!