TinyPortal

Development => Block Codes => Topic started by: shadowclash1 on March 27, 2009, 06:23:30 AM

Title: [Block] Show Nneonneo's Shoutbox in a block
Post by: shadowclash1 on March 27, 2009, 06:23:30 AM
Hi there. I have TinyPortal on my SMF 1.1.8 Forums.

What I have done is added a upper panel block added (PHP CODE) - the code for nneonneo's shoutbox. I have checked all the boxes so that guests, ungrouped members, moderators and global moderators can see the box...However I have found out that only Admin's can see the box....Normal members can't? Can someone please help me on how to let normal members see this box please? All help will be appreciated thanks.
(If you need to know my theme is overview by dzinerstudio - and the only mods im using is TP and the shoutbox)

Below is the code I used to insert Nneonneo's shoutbox in an upper panel block


// YSHOUT HERE - shoutbox code
  global $txt,$context,$boarddir;
  if(allowedTo('yshout_view'))
  {
     echo '<br /><b>',$txt['yshout_shoutbox'],'</b><br /><br />';
     echo '<div id="yshout">';
     include_once($boarddir.'/yshout/yshout.php');
     echo '</div>';
  }
  elseif($context['user']['is_guest'])
     echo $txt['yshout_no_guests'];
// YSHOUT END - shoutbox code
Title: Re: Shoutbox Not Appearing
Post by: G6Cad on March 27, 2009, 08:02:45 AM
Thats not our thing to support, you have to ask the people that made that shoutbox to help you out.
We only support our own shoutbox thats included in TP
Title: Re: Shoutbox Not Appearing
Post by: jpacs29 on September 06, 2009, 09:17:17 AM
For the sake of using TP :D try the codes below, i just finished tweaking this codes and it works fine during my testing. this code is designed on the right or left block of your tp themes. Hope this can help you....

on your theme index.template.php
Find this


// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';


add after this code



// YSHOUT HERE - <head> code
global $boardurl,$shoutFile;
$shoutFile='home';
$scripturlparsed = parse_url($scripturl);
$scriptpath=isset($scripturlparsed['path'])?$scripturlparsed['path']:'/';
$args='';
foreach($_GET as $key => $value) // passthrough $_GET
$args.='&'.urlencode($key).'='.urlencode($value);
echo '
<script src="',$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
<script src="',$boardurl,'/yshout/settings.js" type="text/javascript"></script>
<script type="text/javascript"><!-- // --><![CDATA[
window.onload=function(){loadChat();};
var shoutFile="',$shoutFile,'";
var yshout_php="',$scriptpath,'?yshout',$args,'";
// ]]></script>
<script src="',$boardurl,'/yshout/js/yshout.js?July062008" type="text/javascript"></script>
<style type="text/css">
#yshout {
font-size: 11px;
overflow: 170px;
}
#yshout #yshout-toollinks { /* tool links (History, Commands, etc.) */
}
#yshout #shouts { /* main shouts area */
}
#yshout .shout { /* one shout */
margin: 0 0 0; /* Top Bottom Linespacing */
line-height: 1;
}
#yshout .shout-timestamp {
font-style: normal;
font-weight: normal;
}
#yshout .shout-adminlinks { /* del and ban buttons */
font-size: 6pt;
color: #141414;
}
#yshout #shout-form {
margin: 1px;
padding: none;
}
#yshout #shout-form fieldset {
border: 1px;
}
#yshout #forum-name {
width: 70px;
margin-right: 5px;
}
#yshout #shout-text {
width: 150px;
margin-right: 5px;
}
#yshout #shout-button {
width: 55px;
}
#yshout .shout-invalid { /* invalid shout (shout textbox) */
background: #FFFDD1;
}
</style>';
// YSHOUT END - <head> code




create a PHP block on the left or right of your TP and put this code



// YSHOUT HERE - shoutbox code
global $txt,$context,$boarddir;
if(allowedTo('yshout_view'))
{
echo '<br /><b>:: CHAT RIGHT HERE ::</b><br /><br />';
echo '<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>';
}
elseif($context['user']['is_guest'])
echo $txt['yshout_no_guests'];
// YSHOUT END - shoutbox code



by the way try to check your group permission