• Who's in Chat for Pro_Portal
  • Uploader:leefish
#1
This is a pro_portal block that shows who is in chat

Assumptions:

Your chat is located as so: www . yoursite/(path to forum if site is in sub-directory)/chat/

Requirements

For the pro_portal block to work then you will need to have the AjaxChat installed on your board.


Installing to ProPortal:

When you add the ajax_chat block, put this in the block settings
block_title = <a href="http://www.yoursite.com/forums/chat">Chat</a>
Use Custom Block Template = NO
Block File: ajaxchat

Screenshots
Who's in Chat for Pro_Portal Screenshot Who's in Chat for Pro_Portal Screenshot  
Download link
Filesize 1.03 KB | File Name WhoIsInAJAXChat.rar | # of Downloads 59
File Updated 18-03-2012

Comments
#41 16-03-2012 
Ok, please try this:

Code:
if (!defined("IN_PORTAL")) {
    die("<div style=\"border:1px solid #CC0000; padding:3px; margin:0; font-family:Tahoma; width:250px; font-size:12px;\"><strong>Error:</strong> This file cannot be viewed directly!</div>");
}


$query = $db->query("SELECT * FROM ajax_chat_online");

$chatcount=0;
while($row = $db->fetch_array($query))
{
   $chatcount++;
   $chatuID=$row['userID'];
   $chatName=$row['userName'];

  

   // If your forum is located anywhere other than:

Copy paste over the top.
The site don't jive? PRESS F5 Flower

#42 16-03-2012 
  • Yin
 
Thank you, that worked like a charm! Big Grin I'll be disabling the guest permissions now.

#43 16-03-2012 
Yes, I will update the existing file with this new version, thanks for testing and working with me on this.
The site don't jive? PRESS F5 Flower

#44 17-03-2012 
Another (hopefully quick) question:

Is there a way to make the shoutbox on the portal visible only to certain users? As it is now, guests can view the shoutbox.
Yin, proud to be a member of LeeFish since Mar 2012.
And proud to be the owner of Atlas Productions - Cavern Of Creativity!

#45 17-03-2012 
Conditional templates. - The plugin from ZingaBurga, you can make an IF statement around the shoutbox.

Code:
<if $mybb->usergroup['gid'] == 1 then>
guest stuff
<else>
Shoutbox HTML
</if>

full code (simplified)

Code:
<if $mybb->usergroup['gid'] != 1 then>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" width="100%" class="tborder">
<thead>
<tr>
<td class="thead">
<div class="expcolimage">
<img src="{$theme['imgdir']}/collapse{$collapsedimg['shoutbox']}.gif"
id="shoutbox_img" class="expander" alt="[-]" title="[-]" />
</div>
<div><strong>Shoutbox</strong></div>
</td>
</tr>
</thead>
<tbody style="{$collapsed['shoutbox_e']}" id="shoutbox_e">
<tr>
<td class="trow1"><div style="width:100%;"><?php echo getShoutBoxContent(); ?></div>
</td>
</tr>
</tbody>
</table>
<br />
</if>
The site don't jive? PRESS F5 Flower

#46 17-03-2012 
Thank you!
I think that plug in disables the php tags in templates, so the shoutbox never shows. Also, the condition works, but then the layout gets screwed for guests.

Ok, I had replaced the php in templates plugin that I had with the conditionals in template plug in. That's what happened. Now that I put the php in templates plugin back in, it works, but the layout is still messed up. Only for guests.
Yin, proud to be a member of LeeFish since Mar 2012.
And proud to be the owner of Atlas Productions - Cavern Of Creativity!

#47 17-03-2012 
I made it into a block - see attached


I will do some more work to make it a proper block if I can so the portal edits are not needed.

But right now, this is better for layouts, but still needs that portal.php edit, but not the proportal template edit.
The site don't jive? PRESS F5 Flower

#48 17-03-2012 
Old template to revert all changes

Code:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
</head>
<body>
{$header}
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td valign="top" width="{$proportal->settings['leftcolwidth']}" style="padding-right:{$proportal->settings['verticalspace']}px">
{$leftblocks}
</td>
<td valign="top">
{$centerblocks}
</td>
<td valign="top" width="{$proportal->settings['rightcolwidth']}" style="padding-left:{$proportal->settings['verticalspace']}px">
{$rightblocks}
</td>
</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td align="center" width="100%" class="smalltext"><a href="http://www.promybb.com/" target="_blank">Pro Portal 1.0</a> &copy; 2010 <a href="http://atopal.com/" target="_blank">Adnan TOPAL</a></td>
</tr>
</table>
{$footer}
</body>
</html>
The site don't jive? PRESS F5 Flower

#49 17-03-2012 
Just wanted to say thanks for helping me again Big Grin And I'm sorry for all the trouble it took to get this thing working on my site.
Yin, proud to be a member of LeeFish since Mar 2012.
And proud to be the owner of Atlas Productions - Cavern Of Creativity!

#50 18-03-2012 
No problems - it is actually a lot better now, easier to install and place on the page.

I have removed that attachment and will update this upload and add a new one
The site don't jive? PRESS F5 Flower


Sorry, that is a members only option