I used a modified version of Mini User Cp to show shoutbox in my first page (front page).
When I have the shoutbox module (from Tinyportal) enabled, the snippet shows the shoutbox too.
But when I disable the shoutbox module, the shoutbox from the snippet vanishes too! :idiot2: :o
I use SMF 1.1.7 and TP 0.9.8.
Am I doing something wrong??
In a php bloc i use this code:
<?php
#############Mini User Cp #############################
//////In phpbox within TinyPortal Block using the following code/////////////
global $context, $settings, $options, $scripturl, $txt, $user_info, $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;" />';
$bullet3 = '<img src="'.$settings['images_url'].'/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet4 = '<img src="'.$settings['images_url'].'/tpgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet5 = '<img src="'.$settings['images_url'].'/tpmodule2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
echo '
<style type="text/css"><!--
.shadetabs{
padding: 1px 0;
margin-left: 0;
margin-top: 1px;
margin-bottom: 0;
font-size: 9px;
font-weight:bold;
list-style-type: none;
text-align: center; /*set to left, center, or right to align the menu as desired*/
}
.shadetabs li{
display: inline;
font-weight:bold;
margin: 0;
}
.shadetabs li a{
text-decoration: none;
font-weight:bold;
padding: 2px 5px;
margin-right: 2px;
border: 1px solid #404040;
background-image: url('.$settings['images_url'].'/shade.png);
background-position: top left;
background-repeat: repeat-x;
}
.shadetabs li a:visited{
font-weight:bold;
}
.shadetabs li a:hover{
text-decoration: none;
font-weight:bold;
}
.shadetabs li.selected{
position: relative;
top: 0px;
font-weight: bold;
}
.shadetabs li.selected a{ /*selected main tab style */
background-image: url('.$settings['images_url'].'/shadeactive.png);
background-position: top left;
background-repeat: repeat-x;
font-weight: bold;
}
.shadetabs li.selected a:hover{ /*selected main tab style */
text-decoration: none;
font-weight: bold;
}
.tabcontentstyle{ /*style of tab content oontainer*/
border: 0px solid gray;
margin-bottom: 0px;
margin-top: 15px;
padding: 0px;
}
.tabcontent{
display:none;
}
@media print {
.tabcontent {
display:block!important;
}
}
--></style>
<script language="JavaScript" type="text/javascript">
//** Tab Content script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Last updated: Nov 8th, 06
var tabpersistencestorm=1 //enable tab persistence via session only cookies, so selected tab is remembered?
////NO NEED TO EDIT BELOW////////////////////////
var stormtabcontentIDs=new Object()
function stormexpandcontent(linkobj){
var ulid=linkobj.parentNode.parentNode.id //id of UL element
var ullist=document.getElementById(ulid).getElementsByTagName("li") //get list of LIs corresponding to the tab contents
for (var i=0; i<ullist.length; i++){
ullist[i].className="" //deselect all tabs
if (typeof stormtabcontentIDs[ulid][i]!="undefined") //if tab content within this array index exists (exception: More tabs than there are tab contents)
document.getElementById(stormtabcontentIDs[ulid][i]).style.display="none" //hide all tab contents
}
linkobj.parentNode.className="selected" //highlight currently clicked on tab
document.getElementById(linkobj.getAttribute("rel")).style.display="block" //expand corresponding tab content
svselectedtabcontentid(ulid, linkobj.getAttribute("rel"))
}
function stormexpandtab(tabcontentid, tabnumber){ //interface for selecting a tab (plus expand corresponding content)
var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber]
if (thetab.getAttribute("rel"))
stormexpandcontent(thetab)
}
function svtabcontentids(ulid, relattribute){// save ids of tab content divs
if (typeof stormtabcontentIDs[ulid]=="undefined") //if this array doesn\'t exist yet
stormtabcontentIDs[ulid]=new Array()
stormtabcontentIDs[ulid][stormtabcontentIDs[ulid].length]=relattribute
}
function svselectedtabcontentid(ulid, selectedtabid){ //set id of clicked on tab as selected tab id & enter into cookie
if (tabpersistencestorm==1) //if persistence feature turned on
StormsetCookie(ulid, selectedtabid)
}
function stormgetullistlinkbyId(ulid, tabcontentid){ //returns a tab link based on the ID of the associated tab content
var ullist=document.getElementById(ulid).getElementsByTagName("li")
for (var i=0; i<ullist.length; i++){
if (ullist[i].getElementsByTagName("a")[0].getAttribute("rel")==tabcontentid){
return ullist[i].getElementsByTagName("a")[0]
break
}
}
}
function storminitializetabcontent(){
for (var i=0; i<arguments.length; i++){ //loop through passed UL ids
if (tabpersistencestorm==0 && StormgetCookie(arguments[i])!="") //clean up cookie if persist=off
StormsetCookie(arguments[i], "")
var clickedontab=StormgetCookie(arguments[i]) //retrieve ID of last clicked on tab from cookie, if any
var ulobj=document.getElementById(arguments[i])
var ulist=ulobj.getElementsByTagName("li") //array containing the LI elements within UL
for (var x=0; x<ulist.length; x++){ //loop through each LI element
var ulistlink=ulist[x].getElementsByTagName("a")[0]
if (ulistlink.getAttribute("rel")){
svtabcontentids(arguments[i], ulistlink.getAttribute("rel")) //save id of each tab content as loop runs
ulistlink.onclick=function(){
stormexpandcontent(this)
return false
}
if (ulist[x].className=="selected" && clickedontab=="") //if a tab is set to be selected by default
stormexpandcontent(ulistlink) //auto load currenly selected tab content
}
} //end inner for loop
if (clickedontab!=""){ //if a tab has been previously clicked on per the cookie value
var culistlink=stormgetullistlinkbyId(arguments[i], clickedontab)
if (typeof culistlink!="undefined") //if match found between tabcontent id and rel attribute value
stormexpandcontent(culistlink) //auto load currenly selected tab content
else //else if no match found between tabcontent id and rel attribute value (cookie mis-association)
stormexpandcontent(ulist[0].getElementsByTagName("a")[0]) //just auto load first tab instead
}
} //end outer for loop
}
function StormgetCookie(Name){
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return ""
}
function StormsetCookie(name, value){
document.cookie = name+"="+value //cookie value is domain wide (path=/)
}
// --></script>';
echo '
<ul id="maintab" class="shadetabs">
<li class="selected"><a href="#" rel="tcontent7">Shoutbox</a></li>
<li class="selected"><a href="#" rel="tcontent1">ΜÎλοÏ,</a></li>
<li><a href="#" rel="tcontent2">ΣÏ,,αÏ,,ισÏ,,ικά</a></li>';
// 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_linkmanager','tp_teampage','tp_gallery')))
{
echo '<li><a href="#" rel="tcontent3">Tools</a></li>';
}
echo '
<li><a href="#" rel="tcontent4">ÎÎα</a></li>
</ul>
<div class="tabcontentstyle">
<div id="tcontent1" class="tabcontent">';
echo'
<div class="smalltext">';
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 '<br />'.$bullet.'IP: '.$user_info['ip'];
// 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=viewmembers;sa=browse;type=approve">'.$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>
<br />'.$bullet.'<a href="', $scripturl,
'?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</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'] . $txt['tp-acronymdays'];
echo $context['user']['total_time_logged_in']['hours'] . $txt['tp-acronymhours'];
echo $context['user']['total_time_logged_in']['minutes'] .$txt['tp-acronymminutes'];
}
}
// Otherwise they're a guest - so politely ask them to register or login.
else{
echo '
', $txt['welcome_guest'], '<br />'.$bullet.'IP LOGGED: '.$user_info['ip'].'<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>';
}
echo '</div>
</div>';
echo'<div id="tcontent2" class="tabcontent">
<div class="smalltext" style="font-family: verdana, arial, sans-serif;">';
if(isset($context['TPortal']['userbox']['stats']))
// members stats
echo '
<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['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'] , '
<br />'.$bullet.$txt['tp-latest']. ': <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '"><b>',
$modSettings['latestRealName'], '</b></a>';
if(isset($context['TPortal']['userbox']['stats_all']))
// more stats
echo '
<hr /><img src="'.$settings['images_url'].'/icons/info.gif" style="margin: 0;" align="bottom" alt="" />
<a href="'.$scripturl.'?action=stats"><b>'.$txt['tp-stats'].'</b></a>
<br />'.$bullet.$txt[489].': '.$modSettings['totalMessages']. '
<br />'.$bullet. $txt[490].': '.$modSettings['totalTopics']. '
<br />'.$bullet.$txt['tp-mostonline-today'].': '.$modSettings['mostOnlineToday'].'
<br />'.$bullet.$txt['tp-mostonline'].': '.$modSettings['mostOnline'].'';
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.$txt['tp-users'].': '.$online['num_users'];
echo '<br />'.$bullet.$txt['tp-guests'].': '.$online['guests'];
echo '<br />'.$bullet.$txt['tp-total'].': '.$online['total_users'].'<hr />
<div style="width: 100%; ' , $online['num_users']>14 ? 'height: 23ex;overflow: auto;' : '' ,'">';
foreach($online['users'] as $user){
echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo '<br />';
}
echo '</div>';
}
echo '</div>
</div>';
echo'<div id="tcontent3" class="tabcontent">
<div style="padding: 5px;" class="smalltext"><p style="margin: 0; padding: 0 0 .5ex 0;">';
// 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_linkmanager','tp_teampage','tp_gallery')))
{
echo '<img src="'.$settings['images_url'].'/tpoptions.gif" style="margin: 0;" align="absbottom" alt="" />
<b>'.$txt['tp-tools'].'</b></p>';
// can we submit an article?
if($context['TPortal']['can_submit_article']==1 && !allowedTo('tp_articles'))
echo $bullet4.'<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a><br />';
// upload a file?
if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager'))
echo $bullet4.'<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a><br />';
// tpadmin checks
if (allowedTo('tp_settings'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=settings">' .
$txt['permissionname_tp_settings'] . '</a><br />';
if (allowedTo('tp_blocks'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=blocks">' .
$txt['permissionname_tp_blocks'] . '</a><br />';
if (allowedTo('tp_articles'))
{
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=articles">' .
$txt['permissionname_tp_articles'] . '</a><br />';
// any submissions?
if($context['TPortal']['submitcheck']['articles']>0)
echo $bullet4.$bullet3.'<a href="' . $scripturl . '?action=tpadmin;sa=submission"><b>'
. $context['TPortal']['submitcheck']['articles'] . ' ' .$txt['tp-articlessubmitted'] . '</b></a><br />';
}
if (allowedTo('tp_dlmanager'))
{
echo $bullet4.'<a href="' . $scripturl . '?action=tpmod;dl=admin">' .
$txt['permissionname_tp_dlmanager'] . '</a><br />';
// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo $bullet4.$bullet3.'<a href="' . $scripturl .
'?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a><br />';
}
/*
if (allowedTo('tp_gallery'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpmod;show=admin">' .
$txt['permissionname_tp_gallery'] . '</a><br />';
if (allowedTo('tp_teampage'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpmod;team=admin">' .
$txt['permissionname_tp_teampage'] . '</a><br />';
if (allowedTo('tp_linkmanager'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpmod;link=admin">' .
$txt['permissionname_tp_linkmanager'] . '</a><br />';
*/
}
echo '</div>
</div>';
echo '<div id="tcontent4" class="tabcontent">';
// is it a number?
//if(!is_numeric($context['TPortal']['recentboxnum']))
$context['TPortal']['recentboxnum']='20';
// leave out the recycle board, if any
if(isset($modSettings['recycle_board']))
$bb=array($modSettings['recycle_board']);
else
$bb=array();
$what=ssi_recentTopics($num_recent = $context['TPortal']['recentboxnum'], $bb, $output_method = 'array');
// Output the topics
$counter=1; $cmax=count($what);
echo '
<div style="width: 100%; overflow: auto; height: 30ex;">';
foreach($what as $w){
echo '
<div class="smalltext"><a href="'.$w['href'].'">'.$w['short_subject'].'</a></div>
<div class="smalltext">', $txt[525], ' <b>', $w['poster']['link'], '</b></div>
<div class="smalltext">';
if(!$w['new'])
echo '<a href="'.$w['href'].'"><img border="0" src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif"
alt="new" /></a> ';
echo '['.$w['time'].']
</div>';
if($counter != $cmax)
echo '<hr />';
$counter++;
}
echo '
</div>
</div>';
echo '<div id="tcontent5" class="tabcontent">
<form accept-charset="', $context['character_set'], '" action="', $scripturl, '?action=search2" method="post" style="padding: 0; text-align:
center; margin: 0; margin-bottom: 5px;">
<br /><input type="text" name="search" value="" style="width: 85%;" /><br />
<input type="submit" name="submit" value="', $txt[182], '" style="width: 90%; margin: 4px;" /><br /><span class="smalltext">
<a href="', $scripturl, '?action=search;advanced">', $txt['smf298'], '</a></span>
<input type="hidden" name="advanced" value="0" />
</form>
</div>
<div id="tcontent6" class="tabcontent">';
$temaid=explode(',',$context['TPortal']['temaer']);
$temanavn=explode(',',$context['TPortal']['temanames']);
$temapaths=explode(',',$context['TPortal']['temapaths']);
if(isset($context['TPortal']['querystring']))
$tp_where=$context['TPortal']['querystring'];
else
$tp_where='action=forum;';
if($tp_where!='')
$tp_where .=';';
// remove multiple theme=x in the string.
$tp_where=preg_replace("'theme=[^>]*?;'si", "", $tp_where);
if(sizeof($temaid)>1){
echo '<form name="jumpurl1" onSubmit="return jumpit()" style="padding: 0; margin: 0; text-align: center;">
<select style="width: 100%; margin: 5px 0px 5px 0px;" size="1" name="jumpurl2"
onChange="check(this.value)">';
for($a=0 ; $a<(sizeof($temaid)) ; $a++){
echo '<option value="'.$temaid[$a].'" ', $settings['theme_id'] == $temaid[$a] ? 'selected' : '' ,'>'.substr($temanavn[$a],0,20).'</option>';
}
echo '</select><br /><input style="margin: 5px 0px 5px 10px;" type="button" value="'.$txt['tp-changetheme'].'" onClick="jumpit()">
<input type="hidden" value="'.htmlspecialchars($scripturl .
'?'.$tp_where.'theme='.$settings['theme_id']).'" name="jumpurl3">
<div style="width: 95%; overflow: hidden;">
<img align="center" src="'.$settings['images_url'].'/thumbnail.gif" alt="" id="chosen"
name="chosen" />
</div>
</form>
<script type="text/javascript" language="Javascript">
var themepath=new Array()';
for($a=0 ; $a<(sizeof($temaid)) ; $a++){
echo '
themepath['.$temaid[$a].'] = "'.$temapaths[$a].'/thumbnail.gif"
';
}
echo '
function jumpit(){
window.location=document.jumpurl1.jumpurl3.value
return false
}
</script>
<script type="text/javascript">
function check(icon)
{
document.chosen.src= themepath[icon]
document.jumpurl1.jumpurl3.value = \'' . $scripturl . '?'. $tp_where.'theme=\' + icon
}
</script>';
}
else
echo $txt['tp-nothemeschosen'];
echo '</div>
<div id="tcontent7" class="tabcontent">';
global $context, $settings, $options, $scripturl, $txt, $modSettings;
// Show the shoutbox, takes settings from tpadmin
if(isset($context['TPortal']['querystring']))
$tp_where=$context['TPortal']['querystring'];
else
$tp_where='';
if(!isset($context['TPortal']['shoutbox']))
$context['TPortal']['shoutbox']='';
if($context['TPortal']['shoutbox_usescroll']=='1')
echo '
<div id="marqueecontainer" onmouseover="copyspeed=pausespeed" onmouseout="copyspeed=marqueespeed">
<div id="vmarquee" class="smalltext" style="text-align: left;position: absolute; width: 98%;">
'.$context['TPortal']['shoutbox'].'
</div>
</div>';
else
echo '
<table cellpadding="0" align="center" width="100%" cellspacing="0" style="table-layout: fixed;">
<tr><td><div class="smalltext" style="width: 99%; height: '.$context['TPortal']['shoutbox_height'].'px; overflow: auto;">', $context['TPortal']['shoutbox'], '</div></td>
</tr>
</table>';
// show archives
if($context['TPortal']['show_shoutbox_archive']>0){
echo '
<div style="text-align: center; margin-top: 5px; " class="smalltext"><a href="',$scripturl,'?action=tpmod;sa=shoutbox;shouts='.$context['TPortal']['show_shoutbox_archive'].'">',$txt['tp-showshouts'],' ',$context['TPortal']['show_shoutbox_archive'],'</a></div>';
}
echo '
<form accept-charset="', $context['character_set'], '" class="smalltext" style="padding: 0; margin: 0; margin-top: 8px; text-align: center;" name="tp-shoutbox" action="'.$scripturl.'?action=tpmod;id=shout" method="post">';
if(($context['TPortal']['guest_shout']) || (!$context['TPortal']['guest_shout'] && !$context['user']['is_guest'])){
echo '<textarea class="smalltext" name="tp-shout" style="width: 80%;margin-top: 1ex; height: 50px;" wrap="auto"></textarea><br />';
echo '<input style="margin-top: 4px;" class="smalltext" type="submit" name="shout_send" value="'.$txt['shout!'].'">';
}
if($context['user']['is_guest'] && $context['TPortal']['guest_shout'])
echo '<br /><input style="margin-top: 4px;" size="20" class="smalltext" type="text" name="tp-shout-name" value="'.$txt['tp-guest'].'">';
else
echo '<input type="hidden" name="tp-shout-name" value="'.$context['user']['name'].'">
';
echo '<input name="tp-shout-url" type="hidden" value="'.htmlspecialchars($tp_where).'"><input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
echo '</div>
</div>
<script type="text/javascript">
//Start Tab Content script for UL with id="maintab" Separate multiple ids each with a comma.
storminitializetabcontent("maintab")
</script>';
?>
All I get when I have the original shoutbox disabled ( from Tiny Portal 0.9.8 ) is that:
(in attached picture)
Thank you in advance! :)
Offcourse it will not show if you dissable it, I dont get what you are trying to do
OK, I will try to explain... ::)
When I have BOTH shoutbox module (the original from TP) AND the above script enabled in the -lets say - left panel of the front page, then I have TWO working instances of the shoutbox.
If I disable (from the admin panel) the original shoutbox module (from TP) only, and I leave enabled the above snippet (which includes the code for the TP shoutbox), then the shoutbox vanishes from there too, leaving only the text input box...
(see attached image from my previous post...)
And that is normal, no bug or error as the code from the shoutbox block works that way.
If you just wat to have one shoutbox, then use it like a normal shoutbox in a block, you cant have the same shoutbox working at the same time for diffrent parts of your forum
Sorry but I think that you miss my point.
The snippet above includes the code for the shoutbox copied from the original php file from TP.
If I have shoutbox enabled in my front page, the original that come as a call function from within TP (as a shoutbox bloc) then my script above work perfect and there are TWO shoutboxes in my first page (one from the shoutbox bloc and another one from my script that includes the code for shoutbox).
If I delete the shoutbox bloc (yes, the one that comes with TP as a shoutbox bloc) then, there should be ONE working left, the one in my script.
But it doesnt happen, and that is the strange thing, since it seems "broken", showing only the text input box and not the messages...
Quote from: dimdom on December 12, 2008, 04:05:11 PM
I do get what you are saying, but you dont understand what im trying to explain.
IF you have a script of your own, thats a copy of the same code used in tp for the same shoutbox, offcourse they will show 2 shoutboxes as you made a clone of the shoutbox with the code you show us here.
As they are clones, the functions will also be cloned, turn one off and both will be gone, and turn one on, and both will show.
Same code will offcourse both show and function the same.
You cant use your code you have, that will just
clone whats allready in tp
Ahh, now I see what you mean...
I feel totaly :uglystupid2: :uglystupid2: :uglystupid2:
Thank you for your patience.
Any smart way to have shoutbox enabled but not showing in front end (in order just to be shown through my snippet)?
You should be able to set the block to show for diffrent actions and parts of the site in the blocks visual options,.
Laborate a bit with that and see if you can get it like you want or near what you want
G6, let me drop in here for just a minute. I saw his his post on TPM about this issue.
I use the mini CP on my production site but I don't use the code for the shoutbox in it. I no longer have TP 0.98 on my production site so I can't test the code. However, if I remember correctly, the shoutbox wasn't a module in 0.98 like it is in the 1.0x versions. This is probably why the shoutbox is not showing in his mini user CP when there is no Shoutbox block.
Dimdom, I have a suggestion for you to try. If the shoutbox is only showing in the mini user CP when another shoutbox block is enabled go ahead and have it setup like this, but go into the Admin Panel for the Shoutbox block and turn off access to all groups. Both will still be visible to you as Admin, but it might allow everybody else to see just the one in the mini user CP
If that doesn't work, then I have a question for you. Are you using the right panel? If not, you could setup the right panel to show the Shoutbox block and then hide the right panel for all areas. This might enable the Shoutbox in your mini user CP to continue working.
ZarPrime
Quoteyou could setup the right panel to show the Shoutbox block and then hide the right panel for all areas. This might enable the Shoutbox in your mini user CP to continue working.
Thank you zarprime, that did the trick, but since I use the right panel, it is only a temporary solution.
Quote from: dimdom on December 12, 2008, 05:56:38 PM
Thank you zarprime, that did the trick, but since I use the right panel, it is only a temporary solution.
Dimdom, no problem, I'm glad it solved the problem, at least temporarily. ;)
If and when you update your TP to 1.0.x, there are additional panel types available, "top" and "bottom", "upper" and "lower". The center panel in 0.98 became the upper panel in the newer versions.
G6, thanks for allowing me to help.
ZarPrime
QuoteG6, thanks for allowing me to help.
Why shouldent i ? Im just glad to see members jumping in with the help they can where they can , good work Zar :up: :)
The reason for this behavior is simply that TP 0.9.8 checks if you are using a true shoutbox type of block, then and only then: loads the shouts. If you then just use the code(which only render the shouts, not collecting them) TP will NOT read that as needing to collect them in the first place.
The way around that is several..but the easiest is perhaps to disable the check and simply fetch shouts on every call. Since you are using the rather intensive mini user CP anyway, it should make no big difference.To do that open TPortal.php and find this:
// get x number of shouts
// set context info for profile shouts hide
$context['TPortal']['profile_shouts_hide'] = empty($context['TPortal']['profile_shouts_hide']) ? '0' : '1';
$context['TPortal']['usercolor']='';
if(isset($using_shoutbox) || (isset($_GET['sa']) && $_GET['sa']=='shoutbox'))
Change that to:
// get x number of shouts
// set context info for profile shouts hide
$context['TPortal']['profile_shouts_hide'] = empty($context['TPortal']['profile_shouts_hide']) ? '0' : '1';
$context['TPortal']['usercolor']='';
$using_shoutbox = true;
if(isset($using_shoutbox) || (isset($_GET['sa']) && $_GET['sa']=='shoutbox'))
QuoteSince you are using the rather intensive mini user CP anyway
Bloc, your solution sounds more ...permanent.
Is it going to increase the load (calls to database) even if I have not set the shoutbox to show anywhwere else except the Mini user CP (which is shown only in the front page)?
QuoteIf and when you update your TP to 1.0.x
ZarPrime, I dont indend to switch to 1.0 since my site is heavily depended on Tiny Portal and since I have a heavily modified 1.1.7 SMF script.
As long as the switching to the newer version is too complicated and the benefits for doing that doesnt seem so clear yet...
Tiny Portal 0.9.8 is an excellent script and the 1.0 version has to give a big fight with its ancestor in order to win the battle...
I will reconsider when SMF 2 and Tiny Portal 1 will be released in stable versions, fully working together...
G6, thank you once again for your help.
$context['TPortal']['usercolor']='';By the way, the color of the membergroups does not change to my shoutbox but that is probably because I have installed the mod "membergroups legend color" (or something like that) AFTER starting use the shoutbox. If i remeber well I have to make a change in the sql tables of shoutbox in order to show the colors, but this is another discussion I guess...
Than you guys! :)
PS:
I have saved the entire Mini user CP script as a php file named
infopanel.php which I placed in the Sources directory and I use the below code in a php block to call it:
// Declare the globals to call the main file
global $sourcedir;
// And Call the file
require_once($sourcedir . '/infopanel.php');That is, because when you use the script as it is in a php block, it breaks the edit function of the block...
so this is solved, dimdom?? :o
Quote from: SmokyBlue on December 13, 2008, 12:54:40 PM
so this is solved, dimdom?? :o
Partly, yes.
I used the method that ZarPrime suggested.
ok.. just checking ;)