SimplePortal
Support => English Support => Topic started by: MazdaClubTR on November 11, 2009, 05:35:02 AM
-
I was trying the shoutbox option and wanted to try th shoutbox to be used as a chat . So I put it in the reverse order and realised that when reverse order is set the users viewer see the first few messages in the box rather than the last post. You are forced to scroll down.
Is it possible to make it go to last post ?
P.S. Although I have set the versions of SMF and SP in my profile forum warns me to change it..
-
<script language="Javascript" type="text/javascript"><!-- // --><![CDATA[';
<script language="Javascript" type="text/javascript"><!-- // --><![CDATA[';
if ($shoutbox['reverse'])
echo '
var objDiv = document.getElementById("shouts_', $shoutbox['id'], '");
objDiv.scrollTop = objDiv.scrollHeight;';
-
When I do that I get a theme parse error..
-
Can you attach your '/Themes/default/PortalShoutbox.template.php' file?
-
I tried that code and no parse error, however the scroll bar now starts in the middle, not starting at the bottom yet but on the upside it's halfway there :)
-
Can you attach your '/Themes/default/PortalShoutbox.template.php' file?
Here's a copy of my PortalShoutbox.template.php if this will help.
I'm using SMF forum 2.0 RC2 and SP 2.3.1 (for some reason this does not want to show up on my profile)
Any help with this would be very greatly appreciated. :nervous-happy:
-
@Ardd0
Try the attached file.
@MazdaClubTR,
Could you please attach your file?
-
Hi Nathaniel
Sorry for late response but due to some other problem (not anything related to SP ) I had to uninstall SP from test site.
I will try it again as soon as I reinstall.
-
Hi Nathaniel,
I reinstalled SP and tried it. This time it works but the newest shout doesnt shift the old ones up even auto refresh is set. You have to refresh the whole page.
-
I forgot that another few edits are required for that:
var shoutbox_id, updated, error, warning, shout, id, author, time, timeclean, delete_link, body, is_me, new_body = '';
var shoutbox_id, updated, error, warning, reverse, shout, id, author, time, timeclean, delete_link, body, is_me, new_body = '';
warning = XMLDoc.getElementsByTagName("smf")[0].getElementsByTagName("warning")[0].childNodes[0].nodeValue;
warning = XMLDoc.getElementsByTagName("smf")[0].getElementsByTagName("warning")[0].childNodes[0].nodeValue;
reverse = XMLDoc.getElementsByTagName("smf")[0].getElementsByTagName("reverse")[0].childNodes[0].nodeValue;
setInnerHTML(document.getElementById('shouts_' + shoutbox_id), new_body);
setInnerHTML(document.getElementById('shouts_' + shoutbox_id), new_body);
if (reverse != 0)
document.getElementById('shouts_' + shoutbox_id).scrollTop = document.getElementById('shouts_' + shoutbox_id).scrollHeight;
else
document.getElementById('shouts_' + shoutbox_id).scrollTop = 0;
<warning>', !empty($context['SPortal']['shoutbox']['warning']) ? htmlspecialchars($context['SPortal']['shoutbox']['warning']) : 0, '</warning>';
<warning>', !empty($context['SPortal']['shoutbox']['warning']) ? htmlspecialchars($context['SPortal']['shoutbox']['warning']) : 0, '</warning>
<reverse>', !empty($context['SPortal']['shoutbox']['reverse']) ? 1 : 0, '</reverse>';
-
Thanks, I will try that as soon as possible..
-
Thanks, I will try that as soon as possible..
Any updates on this issue? Did you manage to apply the edits and get this to work properly?
-
@Ardd0
Try the attached file.
@MazdaClubTR,
Could you please attach your file?
Sorry for the late reply I just got back to that. THANKS for the help with this :) I'll try the attached file and the other edits as well.
The oddest thing is that the original edit worked for the shoutbox in the admin section but no other...go figure.
-
Thanks, I will try that as soon as possible..
Any updates on this issue? Did you manage to apply the edits and get this to work properly?
I tried all the edits and there is improvement the scroll bar goes to and stays at the bottom when you send a shout but still starts roughly in the center when the page is loaded, I used the attachment you sent as well as the portal.js edits
here's the URL of my site http://www.hypercrites.org
you are welcome to any kind of acess that would help just let me know and I'll set you up :)
-
Any updates on this issue? Did you manage to apply the edits and get this to work properly?
Sorry for the late reply Nathaniel but I had to stop testing SP cause of the following problem. With the same banners I dont have the issue at all on my production site.
http://simpleportal.net/index.php?topic=4070.0
-
This workaround graciously provided by a friend seems to have solve the problem of the scroll bar starting in the center when a page is loaded, it now snaps to the bottom and shows the newest post. I used this in conjunction with the edits you have provided and it seems a viable workaround.
In the PortalShoutbox.template.php
this
if ($shoutbox['reverse'])
echo '
var objDiv = document.getElementById("shouts_', $shoutbox['id'], '");
objDiv.scrollTop = objDiv.scrollHeight;';
was changed to this
if ($shoutbox['reverse'])
echo 'sp_refresh_shout('.$shoutbox['id'].');';
I have tested this with both Firefox and IE and it seems to work well in both.
-
I, unfortunately, don't have time to go over all the posts; so do we have anyone here having problems or is this issue solved?
-
I'm not sure if this fix produced the secondary problem: snapping to only the first two lines of the last shout instead of the end of the last shout; that's a problem that ensued after one of the fixes that was tried. I'll have to yank Ardd's chain on that first, I think.
-
I, unfortunately, don't have time to go over all the posts; so do we have anyone here having problems or is this issue solved?
You can mark this one resolved as far as I am concerned I posted the fix for this and the addition of an audible alert as a package here http://simpleportal.net/index.php?topic=4350.0
Thanks for looking in on this you bring a really good vibe here :)
-
I guess I'll keep this open until MazdaClubTR verifies the issue is fixed.
-
Thanks Sinan,
You better mark it as solved. I had to stop testing.
Sorry for the late reply Nathaniel but I had to stop testing SP cause of the following problem. With the same banners I dont have the issue at all on my production site.
http://simpleportal.net/index.php?topic=4070.0
-
Okay, did.
For others having issues; please start a new topic.