News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

nneonneo's Shoutbox

Started by nneonneo, December 26, 2006, 06:58:11 PM

Previous topic - Next topic

nneonneo

@lucky_jan: Oh yes. You need to change one
@session_start(); // restart session, so updates to $_SESSION are applied
to
//@session_start(); // restart session, so updates to $_SESSION are applied
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

lucky_jan

you mean i replace this forst code in to second ?

lucky_jan

@nneonneo : i do your trick but this time...

now this error was coming on shout box

Quote

Warning: fopen(yshout/chats/home.txt) [function.fopen]: failed to open stream: Permission denied in /home/ncmlnet/public_html/stayhere/yshout/yshout.php on line 699
File error (writeLine); aborted


lucky_jan

please @nneonneo : you can do input shoutbox code in my files my forrum file in attachment please enter the shoutbox code into it i m very thank ful to u.

install AdvSB_1.22.zip   mod version ok ??


Adish - (F.L.A.M.E.R)

Aarg aarrrg! :P


8: Undefined index: is_sbmod
File: /home/skywise/public_html/forum/yshout/yshout.php
Line: 113

What seems to have gone wrong ? its in the error log.

nneonneo

@lucky_jan: Actually, now it is easy: just use "chmod" to change the file permissions on chats/ and all files in chats/ to 755 or 777 or 666.

@F.L.A.M.E.R: is_sbmod should be set on line 89 or thereabouts. Does that show up when you use history?
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

lucky_jan

sir what is ( "chmod"  )   ???
how i can chnage permission please tel me prosigure plzz

Adish - (F.L.A.M.E.R)

nope, doesnt show up when its in history. I acutally dunno the source as i just came in and saw in the error log. Sorry for being less informative.. but thats how it is though....

nneonneo

@lucky_jan: There's a how-to here: http://www.stadtaus.com/en/tutorials/chmod-ftp-file-permissions.php

@F.L.A.M.E.R: Does it appear very often, or just once?
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

tommys67

Quote from: nneonneo on December 03, 2008, 02:21:52 PM
@tommys67: For a permanent scrollbar, you can try "overflow-y: scroll;" instead of "overflow: auto;".

Oh, Snap!  That put a scroll bar in place as advertised, but it's...empty.  Can't seem to scroll the history from the shout box itself.

I also need to find the "History" code to get that wider.

After that - it's absolutely perfect.

Thank you very much!

nneonneo

Oh! You wanted to see more history? Increase $maxLines in yshout/settings.php.

* nneonneo slaps forehead
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

tommys67

Quote from: nneonneo on December 03, 2008, 04:23:53 PM
Oh! You wanted to see more history? Increase $maxLines in yshout/settings.php.

* nneonneo slaps forehead

No need to slap the forehead, sir...  You're the programmer - we are just amatuers (well, I am at least!)

I think I've got it.  I'll check back if I have other questions.

My users LOVE this.

Thank you!

Adish - (F.L.A.M.E.R)

well, i saw like 10 of them. Thats mostly within 12 hours of time.

zlolz

Quote from: dav on November 05, 2008, 09:44:01 PM
NEW PROBLEM!!!

Getting connection problems after I installed shoutbox

Error: Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

Been happening a few times in like 25mins. like 2 or 3 times.. its weird.

Hello, I have the same problem. I have installed the chat in my forum:

Connection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

also happens in the chat demo,    After leaving several messages error:

http://nneonneo.net46.net/smf2/ [nofollow]

Savvra

Just wanted to say thanks nneonneo!  Your help was quick and solved my problems asap!  Keep up the great work!

madman71

nneonneo,

Im running your shoutbox ver 1.14b and i've been running for quite some time.  I recently upgraded from a shared host to a VPS server.  Since then there is only a history log that ends on Nov. 24.  The shout box can not seem to keep chat logs older than 24 hours.  For example, once we hit midnight tonight, all of today's chats will not show up in the history log. All we see are in the history logs are pre Nov. 24.  Im presuming that something went bad during this  server migration.  Could this be a permission thing do you think?

Since im having issues with installing any new packages I think it might be a permission thing.

Any suggestions on what to look for?


You can see what i mean with the missing dates in this screen shot:


nneonneo

@zlolz: My webhosting is not very powerful, so they have set the connection limit quite low. That's why it sometimes won't work -- if too many simultaneous refreshes happen, it dies. This is not usually a problem on paid hosting :P

@madman71: chmod chats/history.home.txt to 755, 777, 666 or 644 (your host should say what is appropriate, and which one works is up to the setup of your host). The problem (I am assuming) is that the history file isn't writable.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

fext

#4577
Quote from: nneonneo on November 26, 2008, 06:28:53 PM
This is a how-to for making the shoutbox notify on new topics or posts (with thanks to Gaugenstien for the idea and natefish for suggesting improvements).

For shoutbox versions 1.21 or lower, make this change:
In yshout/yshout.php, find
session_write_close(); // so that future session requests succeed
$heartBeatSent=false;
if(!$forceRefresh)
{
while((time() - $start_time < $updateTimeout) && ($time==filemtime($chatPath)))
{
usleep($updatePeriod*1000);
// heartbeat - check connection to ensure client is still connected
echo ' ';
flush();
ob_flush();
$heartBeatSent=true;
clearstatcache();
}
}
@session_start(); // restart session, so updates to $_SESSION are applied

and replace by
$heartBeatSent=false;
if(!$forceRefresh)
{
session_write_close(); // so that future session requests succeed
while((time() - $start_time < $updateTimeout) && ($time==filemtime($chatPath)))
{
usleep($updatePeriod*1000);
// heartbeat - check connection to ensure client is still connected
echo ' ';
flush();
ob_flush();
$heartBeatSent=true;
clearstatcache();
}
@session_start(); // restart session, so updates to $_SESSION are applied
}


Edit Post.php.
For SMF 1.1.x, find
if ($newTopic)
notifyMembersBoard();
elseif (empty($_REQUEST['msg']))
sendNotifications($topic, 'reply');

and change it to
if ($newTopic) {
notifyMembersBoard();
// YSHOUT TOPIC NOTIFICATION
$res = db_query("
SELECT
b.name
FROM ({$db_prefix}boards AS b)
WHERE b.ID_BOARD = $board", __FILE__, __LINE__);
$row = mysql_fetch_assoc($res);
if($row) $boardName = $row['name'];
ob_start();
global $context,$scripturl,$topic;
include_once('yshout/yshout.php');
makeShout('New Topic in board [url='.$scripturl.'?board='.$board.']'.html_entity_decode($boardName).'[/url]: [url='.$scripturl . '?topic=' . $topic . '.new#new'.']'.html_entity_decode($_POST['subject']).'[/url]');
ob_end_clean();
// YSHOUT TOPIC NOTIFICATION END
}
elseif (empty($_REQUEST['msg'])) {
sendNotifications($topic, 'reply');
// YSHOUT REPLY NOTIFICATION
ob_start();
global $context,$scripturl;
include_once('yshout/yshout.php');
makeShout('New reply: [url='.$scripturl . '?topic=' . $topic . '.new;topicseen#new'.']'.html_entity_decode($_POST['subject']).'[/url]');
ob_end_clean();
// YSHOUT REPLY NOTIFICATION END
}


For SMF 2.0, change
if ($newTopic)
{
$notifyData = array(
'body' => $_POST['message'],
'subject' => $_POST['subject'],
'name' => $user_info['name'],
'poster' => $user_info['id'],
'msg' => $msgOptions['id'],
'board' => $board,
'topic' => $topic,
);
notifyMembersBoard($notifyData);
}
elseif (empty($_REQUEST['msg']))
{
// Only send it to everyone if the topic is approved, otherwise just to the topic starter if they want it.
if ($topic_info['approved'])
sendNotifications($topic, 'reply');
else
sendNotifications($topic, 'reply', array(), $topic_info['id_member_started']);
}

to
if ($newTopic)
{
$notifyData = array(
'body' => $_POST['message'],
'subject' => $_POST['subject'],
'name' => $user_info['name'],
'poster' => $user_info['id'],
'msg' => $msgOptions['id'],
'board' => $board,
'topic' => $topic,
);
notifyMembersBoard($notifyData);
// YSHOUT TOPIC NOTIFICATION
$res = $smcFunc['db_query']('','SELECT b.name
FROM ({db_prefix}boards AS b)
WHERE b.ID_BOARD = {int:board}', array('board' => $board));
$row = $smcFunc['db_fetch_assoc']($res);
if($row) $boardName = $row['name'];
ob_start();
global $context,$scripturl;
include_once('yshout/yshout.php');
makeShout('New Topic in board [url='.$scripturl.'?board='.$board.']'.html_entity_decode($boardName).'[/url]: [url='.$scripturl . '?topic=' . $topic . '.new#new'.']'.html_entity_decode($_POST['subject']).'[/url]');
ob_end_clean();
// YSHOUT TOPIC NOTIFICATION END
}
elseif (empty($_REQUEST['msg']))
{
// Only send it to everyone if the topic is approved, otherwise just to the topic starter if they want it.
if ($topic_info['approved']) {
sendNotifications($topic, 'reply');
// YSHOUT REPLY NOTIFICATION
ob_start();
global $context,$scripturl;
include_once('yshout/yshout.php');
makeShout('New reply: [url='.$scripturl . '?topic=' . $topic . '.new;topicseen#new'.']'.html_entity_decode($_POST['subject']).'[/url]');
ob_end_clean();
// YSHOUT REPLY NOTIFICATION END
}
else
sendNotifications($topic, 'reply', array(), $topic_info['id_member_started']);
}


Hey Neo,

As you know I had some issues getting this to work so i reverted to using v1.21.

I recently tried to upgrade to v1.22 and it works fine now. Question is how do i now impliment the above feature as the code  in the first block differs from that in the 1.22 yshout.php file.

Also if I leave the yshout.php file as it is but change the Post.php file it returns an error - any suggestions?

madman71

Quote from: nneonneo on December 04, 2008, 05:46:45 PM
@zlolz: My webhosting is not very powerful, so they have set the connection limit quite low. That's why it sometimes won't work -- if too many simultaneous refreshes happen, it dies. This is not usually a problem on paid hosting :P

@madman71: chmod chats/history.home.txt to 755, 777, 666 or 644 (your host should say what is appropriate, and which one works is up to the setup of your host). The problem (I am assuming) is that the history file isn't writable.


Thanks Neo,

Permissions was the prob. thanks

Final60

Hey guys how can i get rid of the "Shout Box" text above menu links?

Advertisement: