TinyPortal

Development => Support => Topic started by: mmholt on November 20, 2010, 05:31:20 AM

Title: Trick to getting shoutbox to appear?
Post by: mmholt on November 20, 2010, 05:31:20 AM
I have tried everything i can think of. I had it showing up for a little while, but it looked really bad and I removed the block it was in. Now that I'm ready to work on it again, I can't get it to show up no matter what I've tried. Here's my site info:

Link to my site: http://nwoclan.net
SMF version: SMF 1.1.12
TP version: TP 1.101
Default Forum Language: English
Theme name and version: Aa_New_Damage_v2_tp98
Browser Name and Version: Chrome, latest stable release on Ubuntu
Mods installed: Auto Embed Video/Audio Clips, Treasury, Favicon, YouTube BBCode
Related Error messages: none

What I would like to have is the shoutbox showing either in the right panel above my Ventrilo banner, or in a lower panel beneath the article on my frontpage.

I considered uninstalling TP and reinstalling, but I was afraid I would lose all of my settings if I did that. Can anyone please advise?
Title: Re: Trick to getting shoutbox to appear?
Post by: IchBin on November 20, 2010, 05:34:50 AM
I'm assuming you created a TPModule type block and selected the shoutbox in the block settings?
Title: Re: Trick to getting shoutbox to appear?
Post by: mmholt on November 20, 2010, 05:52:28 AM
Quote from: IchBin on November 20, 2010, 05:34:50 AM
I'm assuming you created a TPModule type block and selected the shoutbox in the block settings?

That's what I kept trying to do but the TPShout radio button did not appear in the block settings. I've since cleared my browser's cache and it now shows up and I can see the shout box. But...

The shouts don't show up in the bubbles. I'd really like to get rid of the expand/collapse buttons in the shoutbox. And my error log is filling up with messages like "8: Undefined index: centerbar
File: /home/themrs/webapps/nwo/forums/Themes/default/languages/TPShout.english.php (main_above sub template - eval?)
Line: 491"

I'm fairly competent at fiddling around with my theme code, but I haven't touched the TP code at all. I could really use some advice.
Title: Re: Trick to getting shoutbox to appear?
Post by: mmholt on November 20, 2010, 06:13:58 AM
Also, is it normal that clicking the Shout button takes me away from my frontpage to the forum? I'd rather post the shout and stay on the front page if I can. Sorry for so many questions.
Title: Re: Trick to getting shoutbox to appear?
Post by: ZarPrime on November 20, 2010, 12:33:24 PM
Quote from: mmholt on November 20, 2010, 05:52:28 AM
The shouts don't show up in the bubbles. I'd really like to get rid of the expand/collapse buttons in the shoutbox. And my error log is filling up with messages like "8: Undefined index: centerbar
File: /home/themrs/webapps/nwo/forums/Themes/default/languages/TPShout.english.php (main_above sub template - eval?)
Line: 491"

I'm fairly competent at fiddling around with my theme code, but I haven't touched the TP code at all. I could really use some advice.

First of all, you've indicated at least 3 different errors here ...

1.  The shouts don't show up in the bubbles.

2.  my error log is filling up with messages like "8: Undefined index: centerbar
File: /home/themrs/webapps/nwo/forums/Themes/default/languages/TPShout.english.php (main_above sub template - eval?)
Line: 491"

3.  is it normal that clicking the Shout button takes me away from my frontpage to the forum?

As for number 1 above, I can't see the Shoutbox on your site.  I'ts probably not viewable to guests.  If you mean that the Shoutbox bubbles are white and it appears that there is no text in them, this is an effect of using a dark theme.  There actually is text in them.  It's just that the text is pretty much the same color as the bubbles.  However, this can be fixed.  Take a look at this linked topic, especially the last 2 posts in the topic by Maxx --> http://www.tinyportal.net/index.php?topic=32443.0

As for number 2 above, this error indicates that you are using a theme that was specifically designed to work with TinyPortal version 0.9.8, an older version.  That version of TinyPortal required special edits to themes in order to work properly with TinyPortal.  This is no longer the case with the latest TinyPortal.  The latest TP will now work properly without the special theme edits.  The fix is either to stop using the theme you are using (find another non TP 0.98 theme) or find the theme author to see if he has a version of this theme that is not for TP 0.98.

On number 3, this issue has been fixed in the latest version of TinyPortal.  If posting a shout redirects you to the Forum, then perhaps something is not installed correctly.  You may need to go through the manual install if this is still happening to make sure everything is installed correctly.

ZarPrime
Title: Re: Trick to getting shoutbox to appear?
Post by: mmholt on November 20, 2010, 04:46:43 PM
Thank you so much for the detailed explanation. You don't see the shoutbox because I removed it until I can get it to work correctly. I've already contacted the theme author and his is not interested in updating the theme. Since that theme is sort of our "brand" I will try to figure out the necessary modifications to remove the TP-specific code.

As for the problem with the Shout button redirecting away from the front page, I thought I did have the latest version. I didn't have any errors during the install. To do a manual install, do I need to uninstall first? If so, will I lose all of my settings?
Title: Re: Trick to getting shoutbox to appear?
Post by: ZarPrime on November 20, 2010, 04:56:47 PM
No, no reason to uninstall what you already have.  Rather than doing that, go ahead and fix the issue with the Shoutbox bubble colors first and get it back up on your site.  After that, try it out and if it still redirects to the Forum BoardIndex when you post a shout, come on back here, and we'll tell you how to manually check to make sure everything is installed correctly.

ZarPrime
Title: Re: Trick to getting shoutbox to appear?
Post by: mmholt on November 20, 2010, 10:58:40 PM
Quote from: ZarPrime on November 20, 2010, 04:56:47 PM
No, no reason to uninstall what you already have.  Rather than doing that, go ahead and fix the issue with the Shoutbox bubble colors first and get it back up on your site.  After that, try it out and if it still redirects to the Forum BoardIndex when you post a shout, come on back here, and we'll tell you how to manually check to make sure everything is installed correctly.

Thanks so much. I've changed the color of the bubble and put the shoutbox on our frontpage. It still redirects to the board index when a shout is posted. I've enabled guest shouts for now if you want to see it.

Once I get this redirection sorted out, there are some tweaks I would like to make, if they are possible and allowed:

- I want to make the input box wider
- I want to expand the edit controls and smileys, show them each on one line and remove the expand/collapse buttons
- I want to remove the avatar that shows above each shout
- I want to show the username and date/time on one line above the shout

If edits like that are possible and permitted, please point me in the direction of the right file(s) and I will probably be able to figure out what to do.

Thanks again for all your help.
Title: Re: Trick to getting shoutbox to appear?
Post by: mmholt on November 22, 2010, 01:02:48 AM
Wow, this is a lot easier than I expected. I have managed to do everything I wanted to do, except the Shout button still redirects to the forum instead of staying on the frontpage, and I couldn't figure out how to get the name and date/time on the same line. That last bit is minor and if I can't do it, oh well. But I have to find a solution to the redirecting to the forum page.
Title: Re: Trick to getting shoutbox to appear?
Post by: WillyP on November 22, 2010, 04:34:12 AM
Putting the text on one line should be pretty easy, You can do it in the css file by adding 'display:inline to both the h4 the name is in and to the div class smalltext the date is in.  The only problem with that is of course is that h4 and smalltext is used elsewhare, and so you might have something out of place somewhere else.  So to get just the shout box do like this in Themes/default/tpshout.css
under .tp_shoutavatar h4{ (line 49) add:

display:inline;


Then add a new style declaration to style.css in your theme after line 522:


.tp_shoutavatar .smalltext{
display:inline;
}
Title: Re: Trick to getting shoutbox to appear?
Post by: ZarPrime on November 22, 2010, 03:04:07 PM
mmholt,

The reason that you are redirected to the Forum BoardIndex when making a shout is probably because you are using mod rewrite (otherwise none as queryless urls's).  This is a setting on your SMF Admin Features and Options page called something like "Search engine friendly URLs".  If you De-select that option, your Shoutbox will likely work correctly.  The code that controls this in TP is ...


// if using mod rewrite, go to forum
if(!empty($modSettings['queryless_urls']))
redirectexit('action=forum');
else
redirectexit(strip_tags($_POST['tp-shout-url']),false,true);
}


I will have to ask Ichbin if removing this is safe.  It was likely put in there to avoid conflicts with SMF Mods that rewite url's, like pretty url's, etc.

Ichbin, could you comment?

ZarPrime
Title: Re: Trick to getting shoutbox to appear?
Post by: mmholt on November 22, 2010, 03:12:48 PM
@WillyP - thanks a bunch, that worked great!

@ZarPrime - you were right, turning off that setting made the button work as expected.

Thank you guys so, so much. I really appreciate all the help. We didn't choose TinyPortal because we were using SMF - we chose SMF so we could use TinyPortal. I think it is an awesome product and I really appreciate all that you guys do for us.
Title: Re: Trick to getting shoutbox to appear?
Post by: IchBin on November 22, 2010, 05:30:59 PM
Thanks mmholt. If you'd like to, you can keep that setting on for friendly URL's. The code above that Zarprime posted is the culprit for the problem. You can just change it to this I believe.
Find this code in tp-files/tp-modules/TPShout/Sources/TPShout.php
// if using mod rewrite, go to forum
if(!empty($modSettings['queryless_urls']))
redirectexit('action=forum');
else
redirectexit(strip_tags($_POST['tp-shout-url']),false,true);


Replace with this:
        redirectexit(strip_tags($_POST['tp-shout-url']),false,true);
Title: Re: Trick to getting shoutbox to appear?
Post by: ZarPrime on November 26, 2010, 03:15:29 PM
Ichbin,

Again, I'm not sure why that was put in there for Mod Rewrite.  The same line is above on line 192 in the same file ...


if(empty($_POST['tp-shout-name']) && !$context['user']['is_logged'])
redirectexit(strip_tags($_POST['tp-shout-url']),false,true);

   $memID=-1;
   if($context['user']['is_logged'])
{

   $shout_name = '<a href="'.$scripturl.'?action=profile;u='.$context['user']['id'].'"';
$memID=$context['user']['id'];
if(!empty($context['TPortal']['usercolor']))
$shout_name .=' style="color: '. $context['TPortal']['usercolor'] . '"';

$shout_name .= '>'.$context['user']['name'].'</a>';
}
   $shout_time=time();
  // register the IP and userID, if any
$ip=$user_info['ip'];
if($shout!='')
  tp_query("INSERT INTO " . $tp_prefix . "shoutbox (value1,value2,value3,type,value4, value5) VALUES('". mysql_real_escape_string($shout)."','".$shout_time."','".$shout_name."','shoutbox','".$ip."',".$memID.")", __FILE__, __LINE__);
}
// if using mod rewrite, go to forum
if(!empty($modSettings['queryless_urls']))
redirectexit('action=forum');
else
redirectexit(strip_tags($_POST['tp-shout-url']),false,true);
}


Maybe that whole Mod Rewrite routine could be removed without problems.  I don't know.

ZarPrime
Title: Re: Trick to getting shoutbox to appear?
Post by: IchBin on November 26, 2010, 04:10:53 PM
Bloc said he had his reason at one time. That's all I know. :)