News:

Wondering if this will always be free?  See why free is better.

Main Menu

nneonneo's Shoutbox

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

Previous topic - Next topic

pongsak

QuoteThis code causes problems for forums which either don't use the usual location (pongsak, this applies to you too because you did not put the shoutbox in the usual header location) or which use custom themes.

I've seen it but don't get any error when i shrink main user bar, sb in info area 's collapse too. It's nice, i think.
smf 1.1.2 with dilbermc themes.
> 50 mods installed.

nneonneo

#981
@pongsak: Excellent :)

As for the shrinking: if you like it, that's fine :)

@porcelainprincess: I've sent you a message.
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!

vno

#982
Thanks to nneonneo again for a very cool mod. I am now quite satisfied with it's appearance on my  TP's right php block.

My shoutbox now looks like this (from admin's view):

Quote
        History   Commands
          ExtendedHistory
          ShowAdminLinks
         ReturnToShoutbox
_________________________
              Date , Time
Username: message message
_________________________

I also modded so Guests can not shout nor able to see the message's typing content unless they login.


So to those that are using Tinyportal and want to implement nneonneo's shoutbox into a side block instead of the center... Here is my "newbie" instruction.

PLEASE BE ADVISED: Use my instructions only IF you want your shoutbox to appear like mine and you're not holding me responsible for any error occurs during your testing.  :)

I never had a success installing this mod using admin's Package Uploading. All get a "Loading...." but nothing showed up.

To get it to work initially, I had to install it manually. Thus, I am using a custom theme. Therefore, installing it manually is required anyway. :)

Installing it manually is not hard at all. You just need to be patient and do a step at a time.  The best way to add/edit a file/folder on your website root directory is by using an FTP software, such as CuteFTP.

Anyway... here we go....

STEP 1:::: You need to upload the "yshout" folder onto your forum main web directory.

STEP 2:::: You need to add a string of codes into your  theme's index.template.php file. Open up your theme's index.template and look for this code (note: you can use ctrl-F):

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';


Once you have located the code above, you need add this following string of codes right below it:

// YSHOUT HERE
global $boardurl;
echo '
<script src="',$boardurl,'/yshout/js/prototype.js" type="text/javascript"></script>
<script src="',$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
<script src="',$boardurl,'/yshout/js/behaviour.js" type="text/javascript"></script>
<script src="',$boardurl,'/yshout/js/domFunction.js" type="text/javascript"></script>
<script type="text/javascript">

var myfunc = new domFunction(function()
{
',empty($options['collapse_header']) ? 'loadChat();':'','
}, { "yshout":"id"});
var board_url = "', $boardurl, '";

</script>
<script src="',$boardurl,'/yshout/js/yshout.js?Jul222007" type="text/javascript"></script>
<script type="text/javascript">var shoutFile = "home.txt";</script>
<style type="text/css">
#yshout {
font-size: 10px;
}
#yshout p {
margin: 0 0 0; /* Top Bottom Linespacing */
}
.shout-invalid {
background: #FFFDD1;
}
#yshout fieldset {
border: none;
}
#yshout em {
font-style: normal;
}
#yshout p {
line-height: 1;
margin-top: 0;
}
#yshout {
overflow: hidden;
}
#yshout .shout-timestamp {
font-weight: normal;
color: #000;
}
#yshout .adminlink {
font-size: 6pt;
color: #141414;
}
#forum-name, #shout-text, #shout-button {
font-size: 9px;
margin: 0;
padding: 0;
}
#yshout #forum-name {
color: #666666;
width: 70px;
margin-right: 5px;
}
#yshout #shout-text {
color: #000000;
width: 310px;
margin-right: 5px;
}
#yshout #shout-button {
width: 55px;
}
#shouts .owner a {
color: #F00;
}
#shouts .moderator a {
color: #00F;
}
</style>';
// YSHOUT END

That's ALL you need to do with your theme's index.template.php

STEP 3:::: You're almost done! Hang tight and take a deep breathe! :) Now you need to add another string of codes into your theme's languages/modifications.english.php file. In this file, open it up for editing. This time, you really don't have to find anything. All you have to do is just add the following string of codes. To make it more easier for you, in that file... scroll to the bottom of the page and you will see this "?>" ... without the quotes. Just right above that, add this string of codes:

// ---- Begin modification - nneonneo's Shoutbox ----
$txt['yshout_shoutbox'] = 'Shout Box';
$txt['yshout_loading'] = '...loading shoutbox...';
$txt['yshout_rp_banned'] = "Sorry, you've been banned from the shoutbox.";
$txt['yshout_no_guests'] = 'Sorry, you must be logged in to use the shoutbox!';
$txt['yshout_ban_conf'] = 'Ban Confirmation';
$txt['yshout_select_mode'] = 'Select Ban Mode:';
$txt['yshout_rp'] = 'Reading and Posting';
$txt['yshout_p'] = 'Posting only';
$txt['yshout_error'] = 'ERROR: ';
$txt['yshout_no_user'] = 'User not found.';
$txt['yshout_del_success'] = 'Shout deleted.';
$txt['yshout_no_action'] = 'Nothing to do.';
$txt['yshout_history'] = 'History';
$txt['yshout_commands'] = 'Commands';
$txt['yshout_exthistory'] = 'ExtendedHistory';
$txt['yshout_hide'] = 'Hide';
$txt['yshout_show'] = 'Show';
$txt['yshout_admlinks'] = 'AdminLinks';
$txt['yshout_return'] = 'ReturnToShoutbox';
$txt['yshout_p_banned'] = 'You are banned from posting.';
$txt['yshout_banned'] = 'Banned';
$txt['yshout_shout_button'] = 'Shout!';
$txt['yshout_banlist_caption'] = 'Shout Box Bans (click to unban)';
$txt['yshout_ip_bans'] = 'IP Bans for ';
$txt['yshout_username_bans'] = 'Username Bans for ';
$txt['yshout_ban_type_error'] = 'use /banuser or /banip!';
$txt['yshout_ban_mode_error'] = 'Must have mode argument.';
$txt['yshout_imp_slash_error'] = 'Prefix shout with "/" (slash character)! See "/help impersonate" for details.';
$txt['yshout_imp_uname_error'] = 'No username given!';
$txt['yshout_imp_max4_error'] = 'Maximum 4 arguments!';
$txt['yshout_cmd_reference'] = 'Command Reference';
$txt['yshout_cmdlist'] = array(
'/help' => ' [command]: Help on a command, or all if no command is specified.',
'/return' => ': Go back to the Shout Box.',
'/pi' => ' [digits]: What is the value of pi to the nth digit?',
'/me' => ' <message>: Emotes the message (e.g. <font color="red"> * Nathaniel likes dogs</font>)');
$txt['yshout_cmdlistadmin'] = array(
'/clear' => ': Completely empty the Shout Box.',
'/help' => ' [command]: Help on a command, or all if no command is specified.',
'/return' => ': Go back to the Shout Box.',
'/banlist' => ': List all bans currently in place. Unban the users by clicking on their names.',
'/banuser' => ' <mode> <username>: Ban a user by name. You should use the user\'s real username, otherwise the ban can be evaded. Mode can be "u" to unban, "rp" for read and post bans, or "p" for a post ban.',
'/banip' => ' <mode> <IP>: Ban a user by IP. Mode can be "u" to unban, "rp" for read and post bans, or "p" for a post ban.',
'/impersonate' => ' <user> [userlevel] [ip] [userid] /[shout text]: Impersonate a user. Shout text must be prefixed by a "/" or else it will fail.<blockquote>
<user>: Username to use<br />
[userlevel]: User Level to use. 0=normal, 1=mod, 2=admin<br />
[ip]: IP address to use, as 1.2.3.4<br />
[userid]: User ID from forum, to fix profile link</blockquote>',
'/lock' => ' <message>: Lock the shoutbox for maintenance with the specified message.',
'/unlock' => ': Release the shoutbox from maintenance.');
$txt['yshout_maintenance'] = 'Locked';
$txt['yshout_lock_arg_error'] = 'You need to specify a reason for maintenance!';
$txt['yshout_lock_changed'] = 'Changed maintenance reason to "%s".';
$txt['yshout_lock_success'] = 'Locked shoutbox for maintenance with reason "%s".';
$txt['yshout_unlock_already'] = 'Failed to unlock: shoutbox isn\'t locked!';
$txt['yshout_unlock_success'] = 'Successfully unlocked shoutbox.';
// ---- End modification - nneonneo's Shoutbox ----

You're done with this step. You have 2 more steps to go! :D

STEP 4:::: Go back to the "yshout" folder in your forum's web root directory that you uploaded earlier. Open up that folder and you will see a "yshout.php" file. You need to edit this file so your shoutbox will appear as like mine. This is the easiest part! All you have to do is delete everything you see in this file and copy/paste mine onto yours. Here's mine... pre-modded:

<?php
// Version 1.09
// Editable Options (see yshout/js/yshout.js for more options)
// Set the maximum amount of lines to be displayed at a time
$max_lines = 12;

// Sets the directory to which to log
$logDir = "chats";

// Should we use GZip compression? If you are having trouble with the shoutbox, set this to false.
$gzipCompression=true;

// Guest usage. Set to false if you don't want guests to use the shoutbox: they will not be able to read it or post to it.
$allowGuests=true;

// Automatic Guest Usernames: should they be able to choose their own usernames?
// Set to some string (a prefix) if you want to disable guest choice of username
// Set to false if you want to allow guests to choose a username
$autoGuestName=false;//'guest-';

// Command options.
// If this is set to false, all typed commands are disabled.
// Admin functions, via admin links, are still available.
$allowCommands=true;

// If this is set to false, guests will be denied access to commands.
$guestCommands=true;

// How long should the script wait for the chats to update? (in seconds)
// If this is set to 0 the script will not wait at all,
// but this will be very detrimental to performance.
// Make sure this is less than the maximum script execution time
// on your server, or the shoutbox will never update.
$updateTimeout=10;

// User-defined array of commands to block.
// Example: $bannedCommands=Array('/impersonate');
// Note that since SMF recognizes /me by default, it can't be blocked.
$bannedCommands=Array();

// How many characters will be permitted in each shout.
$maxShoutChars=125;

// How many characters will be permitted in the username.
// This does not apply to SMF registered usernames.
$maxUsernameChars=25;

/* Documentation
Functions
Command Implementation:
doMsg(string $msg)
Causes the shoutbox to be replaced with $msg until they
use /return (useful for making error messages, etc.)
processCommand(string $text)
Process an admin command. If this function fails to find
a match, it defaults to the user commands.
processUserCommand(string $text)
Process a user command. This function attempts to match
against all known commands. If a valid command match
isn't found, the function will return false and the
shout ("command") will be displayed as a regular shout.
makeShout(string $text)
Produce a shout as if it was from the current user, but
having only a datestamp (and no profile link, etc)
help(string $command - default '')
Allows users to get help on a command. Use <arg> to
denote required arguments and [arg] to denote optional
ones. Note that all <> must be entered as < and >
or they will not work.
Make sure to add an entry in this function for any new
commands.
Shouting:
checkDir(string $logDir)
Check the target directory to make sure it exists.
checkName(string $chatFile)
Check the filename for invalidities.
readChat(string $chatFile,string $logDir)
Dump the contents of the chat file to the client. If the
client is viewing a special message or command, then
readChat simply executes that command or prints the
message back on screen (this command/message is stored
in $_SESSION['readingCmd'])
truncateChat(string $chatFile,string $logDir,integer $max_lines)
Move the first line of a file from the chat file to the
history as long as the chat file exceeds the set
maximum.
writeLine(string $chatFile, string $logDir, string $newText, array $user)
Write a shout to the chat file. $user is an SMF user
session array which determines the username and rank of
the poster.
writeBanList()
Write the current ban list to _banlist.php which is
require'd by this script at the beginning. This allows
for "dynamic" ban lists.
history()
Show the history file in a neat, formatted HTML style.
preg_timeformat(array $matches)
Function used to replace matched <timeval=[UNIX time offset]> with formatted times
as per SMF's timeformat function. Called through preg_replace_callback.
Important Globals
$_SESSION
readingCmd
The command (if it starts with /) or the message to be
read back to the user instead of the normal shoutbox
stuff.
$_GET
n
Used by the history() function to determine the # of
history lines to output.
help
If this is set, the shoutbox will output a full HTML
help message (using help()). Use as a standalone page.
history
If this is set, the shoutbox will output a full HTML
history page (with history()). Use as a standalone page.
banid
For the administrator's ban link: this is passed as the user
ID of the member to be banned.
delete
For deleting shouts; this is a string in the form
datecode | ip (this is the format used in the <em title>
unban
Username/identifier to unban (used by /banlist)
file
File to read for history and delete functions (will be checked)
$_POST
file
Chat file to use. Will be checked for bad characters.
reqtype
What function to carry out (shout, refresh, init)
shout
If reqtype is shout, then this is the shout to be made.
$_SERVER
REMOTE_ADDR
Used for $ip to determine their IP address.
Global Variables
$ban_ips_readpost,$ban_ips_post,$ban_names_readpost,$ban_names_post
Ban variables. _ips or _names is the ban criteria (IP
address or username) while _readpost or _post is the ban
severity (banned from reading+posting or just posting)
$chatFile,$logDir
These determine the location of the chat file.
$chatFile comes from $_POST['file'] while $logDir is hardcoded.
$user
SMF user data array, gleaned from ssi_welcome as a hack.
This determines a lot of things about the user (like the username and status)
$max_lines
Maximum number of lines to have in the shoutbox. Used by truncateChat.
$ip
User's IP address. Gathered from $_SERVER['REMOTE_ADDR'].
$reqType
Request type; see $_POST['reqtype'].
Super-Duper Command Implementation
To add a command, first decide whether this command is *user* or
*admin/mod* level.
The general format of a command is "/command <reqargs>
[optargs]".
Commands are processed in processCommand or processUserCommand.
The former is for admin/mod commands, and the latter is for users.
Processing begins by parsing the args and then running through a
long switch/case block. In this block, you will add your command code.
Your code should begin with a "case '/commandname':"  and end with a
return true; statement.
The two things you will have access to locally are $args and
$cmd. $args is a string containing all the arguments passed, and $cmd is
the exact command used. For example, with the command "/foo bar baz",
$cmd will be "/foo" and $args will be "bar baz". This will be handled by
the "case '/foo':" statement.
Globally, any of the superglobals are available, plus any
globals. All globals are declared already so there is no need to declare
them on your own.
To make a message appear on the client's shoutbox, set the
variable $_SESSION['readingCmd'] to $text (which is the main argument
for the processing function). This causes the exact text of the command
to be reparsed every time the user requests the shoutbox data, and your
information will be returned instead of the regular shouts.
Alternately, the doMsg function allows you to automatically set
a message that will stay up until they use /return.
Remember that whenever your function needs to exit, it must do
so with "return true;" so that the calling function will know not to
"shout" the command.
*/

session_start();
require(
dirname(__FILE__) . "/../SSI.php");
require_once(
$sourcedir . '/Subs-Post.php');
require(
"_banlist.php");
if (!isset(
$maintenance)) $maintenance=false;
$defaultEncoding=(empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']);
header('Content-type: text/html; charset='.$defaultEncoding);

$ip = $_SERVER['REMOTE_ADDR'];
$max_lines+=1;
$user=ssi_welcome('nothing'); // ssi_welcome only does something IF the parameter is 'echo'; otherwise the user data is returned!
loadUserSettings();
loadTheme();
ssi_logOnline('nothing'); // don't want echo, so just use a nonexistant output method
function preg_timeformat($matches)
{
// format: <timeval=(value)>
return '<center>'.timeformat(intval($matches[1]), true).'</center><br />';
}

if (
in_array($ip, $ban_ips_readpost) || in_array($user['username'], $ban_names_readpost) || in_array($user['name'], $ban_names_readpost))
die($txt['yshout_banned']); // exit;

if (!$user['is_logged'])
{
if(!$allowGuests)
die($txt['yshout_no_guests']);
if($autoGuestName!==false)
$user['username']=$user['name']=$autoGuestName.substr(md5($ip),0,4);
elseif(isset($_POST['username']))
$_COOKIE['username']=$user['username']=$user['name']=$_POST['username'];
elseif(isset($_COOKIE['username']))
$user['username']=$user['name']=$_COOKIE['username'];
}

// Do not edit below this line unless you know what you are doing
if(isset($_GET["history"]))
{
history();
exit;
}

if(isset(
$_GET["help"]))
{
help();
exit;
}

if(isset(
$_GET['banid']))
{
if (!isset($_GET['mode']))
{
global $boardurl;
doMsg(<<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<base href="
$boardurl/">
<head>
<meta http-equiv="content-type" content="text/html; charset=
$defaultEncoding" />
<title>
{$txt['yshout_ban_conf']}</title>
</head>
<body>
<h1>
{$txt['yshout_select_mode']}</h1>
<a href="javascript:ajaxGet('banid=
{$_GET['banid']}&amp;mode=rp');">{$txt['yshout_rp']}</a>
<br />
<a href="javascript:ajaxGet('banid=
{$_GET['banid']}&amp;mode=p');">{$txt['yshout_p']}</a>
</body>
</html>
EOF
);
exit;
}
if ($user['is_admin'] || $user['is_mod'])
{
if(!is_numeric($_GET['banid']))
{
// guest banning?
// ban by IP, since that's what will be listed for banning...

$oldread=isset($_SESSION['readingCmd'])?$_SESSION['readingCmd']:NULL;
doBan('ban_ips_',$_GET['mode'],$_GET['banid']);
if($oldread==NULL) unset($_SESSION['readingCmd']);
else $_SESSION['readingCmd']=$oldread;
exit;
}
if(loadMemberData(Array($_GET['banid']),false,'minimal')===false)
{
doMsg($txt['yshout_error'].$txt['yshout_no_user']);
exit;
}
$oldread=isset($_SESSION['readingCmd'])?$_SESSION['readingCmd']:NULL;
doBan('ban_names_',$_GET['mode'],$user_profile[$_GET['banid']]['memberName']);
if($oldread==NULL) unset($_SESSION['readingCmd']);
else $_SESSION['readingCmd']=$oldread;
}
exit;
}

if(isset(
$_GET['delete']))
{
if ($user['is_admin'] || $user['is_mod'])
{
global $logDir,$chatFile;
$chatFile=isset($_GET['file'])?$_GET['file']:"home.txt";
$chatFile = checkName($chatFile);
$chatPath = "$logDir/$chatFile";
$fileContents = '';

if (file_exists($chatPath))
$fileContents = file_get_contents($chatPath);
$fileContents=preg_replace('/<p[^>]*><em title="'.str_replace('|','\|',$_GET['delete']).'">.+\n/','',$fileContents);
$handle = fopen($chatPath, "w");
fputs($handle, $fileContents);
fclose($handle);
echo $txt['yshout_del_success'];
}
exit;
}

if(isset(
$_GET['unban']))
{
if ($user['is_admin'] || $user['is_mod'])
{
$oldread=isset($_SESSION['readingCmd'])?$_SESSION['readingCmd']:NULL;
doBan('ban_'.$_GET["type"].'s_','u',$_GET['unban']);
if($oldread==NULL) unset($_SESSION['readingCmd']);
else $_SESSION['readingCmd']=$oldread;
}
exit;
}

if(!isset(
$_POST["file"]) || !isset($_POST["reqtype"]))
die($txt['yshout_no_action']);

$chatFile = checkName($_POST["file"]);
$reqType = $_POST["reqtype"];

switch(
$reqType) {
case "init":
if($gzipCompression) ob_start("ob_gzhandler"); // GZip for everything BUT the 404 header
echo '<div style="text-align: center; margin-top: 5px; "><a href="javascript:goTo(\'file=',checkName($chatFile),'&amp;history\')">',$txt['yshout_history'],'</a>&nbsp&nbsp&nbsp;<a href="javascript:goTo(\'help\')">',$txt['yshout_commands'],'</a></div>';
if($user['is_admin'] || $user['is_mod'])
{
echo '<div style="text-align: center; margin-top: 5px; "><a href="javascript:goTo(\'file=',checkName($chatFile),'&amp;history&amp;n=\'+prompt(\'How far back?\',200))">',$txt['yshout_exthistory'],'</a></div>';
if(!isset($_COOKIE['yShout_hideadmlinks']))

echo '<div style="text-align: center; margin-top: 5px; "><a href="javascript:set_cookie(\'yShout_hideadmlinks\',\'true\',3600*24*365);delete_cookie(\'yShout_open\');loadChat();">',$txt['yshout_hide'],$txt['yshout_admlinks'],'</a></div>';

else
echo '<div style="text-align: center; margin-top: 5px; "><a href="javascript:delete_cookie(\'yShout_hideadmlinks\');delete_cookie(\'yShout_open\');loadChat();">',$txt['yshout_show'],$txt['yshout_admlinks'],'</a></div>';
echo '<div style="text-align: center; margin-top: 5px; "><a href="javascript:autoShout(\'/return\');">',$txt['yshout_return'],'</a></div>';
}
echo '<div id="shouts">';
echo readChat($chatFile, $logDir);
echo '</div>';
if (in_array($ip, $ban_ips_post) || in_array($user['username'], $ban_names_post) || in_array($user['name'], $ban_names_post))
echo '
<form id="shout-form" action="#">
<fieldset>
<input id="forum-name" style="color: #666666;" maxlength="25" value="'
,$user['name'], '" type="text" disabled="true" />
<input id="shout-text" style="color: #666666;" maxlength="125" value="'
,$txt['yshout_p_banned'],'" type="text" disabled="true" />
<input id="shout-button" type="button" value="'
,$txt['yshout_banned'],'" disabled="true" />
</fieldset>
</form>'
;

elseif(!
$user['is_logged']) echo 'LOGIN to shout...';

elseif (!$user['is_admin'] && !$user['is_mod'] && $maintenance!==false)
echo '
<form id="shout-form" action="#">
<fieldset>
<input id="forum-name" style="color: #666666;" maxlength="'
,$maxUsernameChars,'" value="',$user['name'], '" type="text" disabled="true" />
<input id="shout-text" style="color: #666666;" maxlength="'
,$maxShoutChars,'" value="',$maintenance,'" type="text" disabled="true" />
<input id="shout-button" type="button" value="'
,$txt['yshout_maintenance'],'" disabled="true" />
</fieldset>
</form>'
;
else
{
echo '<form id="shout-form" action="#">
<fieldset>'
;
if (!$user['is_logged'] && $autoGuestName===false)
echo '
<input id="forum-name" style="color: #666666;" maxlength="'
,$maxUsernameChars,'" value="',$user['name'], '" type="text" />';
else
echo '
<input id="forum-name" style="color: #666666;" maxlength="'
,$maxUsernameChars,'" value="',$user['name'], '" type="text" disabled="true" />';
echo '
<input id="shout-text" style="color: #666666;" maxlength="'
,$maxShoutChars,'" value="" type="text" />
<input id="shout-button" type="button" value="'
,$txt['yshout_shout_button'],'" />
</fieldset>
</form>'
;
}
if($gzipCompression) ob_end_flush();
break;

case "shout":

if(!
$user['is_logged']) break;

if (in_array($ip, $ban_ips_post) || in_array($user['username'], $ban_names_post) || in_array($user['name'], $ban_names_post)) break;
if (!$user['is_admin'] && !$user['is_mod'] && $maintenance!==false) break;
$shoutText = $_POST["shout"];
if($shoutText[0]=='/' && $allowCommands)
{
if($user['is_admin'] || $user['is_mod'])
{
if(processCommand($shoutText)) break;
}
elseif($user['is_logged'] || $guestCommands)
{
$shoutText=substr($shoutText,0,$maxShoutChars);
if(processUserCommand($shoutText)) break;
}
}
$shoutName = $user['name']; //$_POST["name"];

writeLine($chatFile, $logDir, $shoutText, $user);
truncateChat($chatFile, $logDir, $max_lines);
refreshChats(true);
break;

case "refresh":
refreshChats(false);
break;
case "autoshout":
if($user['is_admin'] || $user['is_mod'])
processCommand($_POST["shout"]);
break;
}

function
doMsg($msg)
{
echo $msg; // tell user
$_SESSION['readingCmd']=$msg; // make sure user keeps seeing this message; see readChat
}

function
processCommand($text) {
global $reqType, $chatFile, $logDir, $max_lines, $ip, $user, $bannedCommands, $txt, $maintenance;
global $ban_ips_readpost, $ban_ips_post, $ban_names_readpost, $ban_names_post;
if($text[0]!='/') return false; // no slash, no service
$data=explode(' ',$text,2); // "2" means to make the first "word" separated from the rest
$cmd=$data[0]; // first word is the cmd. No cmds can have spaces, duh!
$args=(isset($data[1])?$data[1]:''); // are there even any arguments?
if(in_array($cmd,$bannedCommands)) return false;
switch($cmd) {
case "/clear":
for($a=0;$a<$max_lines;$a+=1) truncateChat($chatFile,$logDir,0); // truncate $max_lines times, each approaching 0. This assumes that there aren't any shouts past $max_lines.
return true;
case "/return": // I'm done reading
unset($_SESSION['readingCmd']);
echo readChat($chatFile, $logDir);
return true;
case "/lock":
if ($args=='')
{
doMsg($txt['yshout_error'].$txt['yshout_lock_arg_error']);
return true;
}
if($maintenance !== false)
doMsg(sprintf($txt['yshout_lock_changed'],$args));
else
doMsg(sprintf($txt['yshout_lock_success'], $args));
$maintenance = $args;
writeBanList();
return true;
case "/unlock":
if($maintenance === false)
{
doMsg($txt['yshout_error'].$txt['yshout_unlock_already']);
return true;
}
$maintenance = false;
writeBanList();
doMsg($txt['yshout_unlock_success']);
return true;
case "/banlist": // who's banned?
$_SESSION['readingCmd']=$text;
$temp=Array();
echo '<table>
<caption>'
,$txt['yshout_banlist_caption'],'</caption>';
echo '<tr><td>',$txt['yshout_ip_bans'],$txt['yshout_rp'],'</td><td>';
$temp=Array();
foreach($ban_ips_readpost as $i)
$temp[]="<a href=\"javascript:ajaxGet('unban=$i&type=ip');\">$i</a>";
echo implode($temp,','),'</tr>';
echo '<tr><td>',$txt['yshout_ip_bans'],$txt['yshout_p'],'</td><td>';
$temp=Array();
foreach($ban_ips_post as $i)
$temp[]="<a href=\"javascript:ajaxGet('unban=$i&type=ip');\">$i</a>";
echo implode($temp,','),'</tr>';
echo '<tr><td>',$txt['yshout_username_bans'],$txt['yshout_rp'],'</td><td>';
$temp=Array();
foreach($ban_names_readpost as $i)
$temp[]="<a href=\"javascript:ajaxGet('unban=$i&type=name');\">$i</a>";
echo implode($temp,','),'</tr>';
echo '<tr><td>',$txt['yshout_username_bans'],$txt['yshout_p'],'</td><td>';
$temp=Array();
foreach($ban_names_post as $i)
$temp[]="<a href=\"javascript:ajaxGet('unban=$i&type=name');\">$i</a>";
echo implode($temp,','),'</tr>';
echo '</table>';
return true;
case "/ban": // need to be more specific!
doMsg($txt['yshout_error'].$txt['yshout_ban_type_error']);
return true;
case "/banuser": // go away, we don't like you!
case "/banip":
$type=($cmd=='/banip')?'ban_ips_':'ban_names_'; // prefixes for vars
$ar=explode(' ',$args,2); // true argument array. the "2" ensures that we cut only once: mode can't have spaces but user can.
if(count($ar)!=2) // whoops: only one argument?
{
doMsg($txt['yshout_error'].$txt['yshout_ban_mode_error']);
return true;
}
$mode=$ar[0]; // set up vars
$id=$ar[1];
doBan($type,$mode,$id);
return true;
case "/impersonate": // lets pwn some n00bs!
// <user> [userlevel] [ip] [userid] /[shout text]
$slashpos=strpos($args,' /'); // use ' /' as a separator, so we can see how many args came before
if($slashpos===false) // no shout? invalid formatting?
{
doMsg($txt['yshout_error'].$txt['yshout_imp_slash_error']);
return true;
}
$shout=substr($args,$slashpos+2);
$ar=explode(' ',substr($args,0,$slashpos));
$name='';
$userlevel=0;
$userid=0;

switch(count($ar)) // how many args did we get?
{
case 0: // no args--what are you doing?
doMsg($txt['yshout_error'].$txt['yshout_imp_uname_error']);
return true;
case 4: // reverse order to save space: we just set them from the back!
$userid=intval($ar[3]);
case 3:
$ip=$ar[2]; // corrupt the global >:D
case 2:
$userlevel=intval($ar[1]);
case 1:
$name=html_entity_decode($ar[0]);
break;
default:
doMsg($txt['yshout_error'].$txt['yshout_imp_max4_error']); // just so they know that we only have 4 params
return true;
}
$ip.='.'; // to set off the impersonated msgs
$fakeuser=array('id'=>$userid,'name'=>$name,'is_admin'=>($userlevel==2)?1:0,'is_mod'=>($userlevel==1)?1:0,'is_logged'=>($userlevel==-1)?0:1); // fake SMF $user array
writeLine($chatFile,$logDir,$shout,$fakeuser); // do it, write the line
truncateChat($chatFile, $logDir, $max_lines); // make sure to scroll it, or bad things will happen
echo readChat($chatFile, $logDir); // update admin's display
return true;
default: // it wasn't a command, n00b!
return processUserCommand($text);
}
return false;
}

function
processUserCommand($text) {
global $reqType, $chatFile, $logDir,$max_lines, $ip,$ban_ips_readpost,$ban_ips_post,$ban_names_readpost,$ban_names_post,$user,$bannedCommands,$func;
if($text[0]!='/') return false; // no slash, no service
$data=explode(' ',$text,2); // "2" means to make the first "word" separated from the rest
$cmd=$data[0]; // first word is the cmd. No cmds can have spaces, duh!
$args=(isset($data[1])?$data[1]:''); // are there even any arguments?
if(in_array($cmd,$bannedCommands)) return false;
switch($cmd) {
case "/help":
if(empty($args)) help();
elseif($args[0]!='/') help('/'.$args);
else help($args);
$_SESSION['readingCmd']=$text;
return true;
case "/return": // I'm done reading
unset($_SESSION['readingCmd']);
echo readChat($chatFile, $logDir);
return true;
case "/pi":
$s_pi='141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609';
$n=5;
if($args!='') $n=intval($args);
$res=($n==0)?"PI IS EXACTLY 3!":'3.'.substr($s_pi,0,$n-1).(substr($s_pi,$n-1,1)+(substr($s_pi,$n,1)>=5?1:0));
// all that nasty little bit does is add the first n-2 chars, then add the last digit and increment if rounding is necessary.
makeShout($res);
return true;
case "/me":
checkDir($logDir);

$chatFile = checkName($chatFile);

$chatPath = "$logDir/$chatFile";

$newText = $args.' ';
$newText = $func['htmlspecialchars'](stripslashes($newText), ENT_QUOTES);
$newText = str_replace(array("[list]","[center]","[left]","[right]"),"",$newText); // kill some BBCode--these tags are useless and can be abused
preparsecode($newText); // gah, sanitize input!!
$newText = parse_bbc($newText); // w00t!
censorText($newText);
$shoutName=$user['name'];
$userID=$user['id'];
$writeText = "<p><em title=\"".time()." | $ip\"><span class=\"shout-timestamp\">[<timeval=".time().">]</span><font color=\"red\"> * $shoutName</em> $newText</p></font>\n";
$handle = fopen($chatPath, "a");
if($handle===false) die("File error (processing /me); aborted");
$failcount=0;
while( !flock($handle, LOCK_EX) ) // just IN CASE two ppl write to it at once
{
usleep(50000);
$failcount++;
if($failcount > 20) die('Write error (processing /me); aborted'); // one second
}
fwrite($handle, $writeText);
flock($handle, LOCK_UN);
fclose($handle);
truncateChat($chatFile, $logDir, $max_lines);
refreshChats(true);
return true;
default:
return false;
}
return false;
}

function
doBan($type,$mode,$id)
{
global $ban_ips_readpost,$ban_ips_post,$ban_names_readpost,$ban_names_post,$txt;
switch($mode)
{
case 'u': // nice guy
$r=$type.'readpost'; // need to search both ban arrays. Search this one first...
$index=array_search($id,$$r); // where is my little banned user?
if($index===false)
{
$r=$type.'post'; // ...and this one second on failure.
$index=array_search($id,$$r);
if($index===false) // whoops, both searches failed!
{
doMsg($txt['yshout_error'].'Couldn\'t find user to unban!');
return false;
}
}
array_splice($$r,$index,1); // cut the 1 element loose with splice. $$r is used because $r is the string variable denoting the target array.
doMsg("Success: unbanned $id.");
break;
case 'rp':
array_push(${$type.'readpost'},$id); // easy, huh!
doMsg("Success: banned $id from reading and posting.");
break;
case 'p':
array_push(${$type.'post'},$id);
doMsg("Success: banned $id from posting.");
break;
default:
doMsg($txt['yshout_error']."Invalid mode $mode! Use only 'u', 'rp' or 'p'!");
return false;
}
writeBanList(); // write the final report
return true;
}

function
makeShout($text) {
global $chatFile,$logDir,$user,$max_lines;

writeLine($chatFile, $logDir, $text, $user);
truncateChat($chatFile, $logDir, $max_lines);
refreshChats(true);
}

function
refreshChats($force=false) {
global $chatFile,$logDir,$user,$max_lines,$gzipCompression,$updateTimeout;
$time=file_exists("$logDir/$chatFile")?filemtime("$logDir/$chatFile"):0;
$start_time=time();
session_commit(); // so that future session requests succeed
while(!$force && (time() - $start_time < $updateTimeout) && $time && ($time==filemtime("$logDir/$chatFile")))
{
sleep(1);
clearstatcache();
}
if($gzipCompression) ob_start("ob_gzhandler");
echo readChat($chatFile, $logDir);
if($gzipCompression) ob_end_flush();
}

function
checkDir($logDir) {
if (!is_dir($logDir))
mkdir($logDir);
}

function
checkName($chatFile) {
$ret = $chatFile;
$ret = str_replace('/', '', $chatFile);
return $ret;
}

function
readChat($chatFile, $logDir) {
global $user;
if(isset($_SESSION['readingCmd']))
{
$c=$_SESSION['readingCmd'];
if($c[0]!='/') echo $c; // doMsg was used. Don't use doMsg with a slash unless you know what you're doing ;)
else
{
if($user['is_admin'] || $user['is_mod']) processCommand($_SESSION['readingCmd']); // execute the same command so the user gets to keep reading the message w/o interruption.
else processUserCommand($_SESSION['readingCmd']);
}
return ' ';
}
$chatFile = checkName($chatFile);
$chatPath = "$logDir/$chatFile";

$chatText = "";

if (file_exists($chatPath))
$chatText = file_get_contents($chatPath);
if ($user['is_admin'] || $user['is_mod'])
{
if (!isset($_COOKIE['yShout_hideadmlinks']))
{
$chatText = preg_replace('/<em title="(\\d+) \| ([^"]+)"><span class="shout-timestamp">\[<timeval=(\d+)>\]<\/span> ([^<])/','<em title="\\1 | \\2"><span class="shout-timestamp">[<timeval=\\3>]</span>&nbsp;<a href="javascript:ajaxGet(\'banid=\\2\')"><span class="adminlink">ban</span></a>&nbsp;\\4',$chatText);
$chatText = preg_replace('/<em title="(\\d+ \| [^"]+)"><span class="shout-timestamp">\[<timeval=(\d+)>\]<\/span>/','<em title="\\1"><span class="shout-timestamp">[<timeval=\\2>]</span>&nbsp;<a href="javascript:ajaxGet(\'file='.$chatFile.'&amp;delete=\\1\')"><span class="adminlink">del</span></a>&nbsp;',$chatText);
$chatText = preg_replace('/<a href="index\.php\\?action=profile;u=(\\d+)">/','<a href="javascript:ajaxGet(\'banid=\\1\')"><span class="adminlink">ban</span></a>&nbsp;<a href="index.php?action=profile;u=\\1">',$chatText);
}
}

else
{
$chatText = preg_replace('/<em title="(\d+) \| [0-9.]+"><span class="shout-timestamp">/','<em title="\\1 | logged"><span class="shout-timestamp">',$chatText);
}
$chatText=preg_replace_callback("/\[<timeval=(\d+)>\]/","preg_timeformat",$chatText);
return str_replace("\n","\n<hr>",$chatText.' '); // hack: totally empty responses can break some browsers
}

// truncateChat function based on one written by Travis Roman (http://mapleglobal.mine.nu/)

function truncateChat($chatFile, $logDir, $max_lines) {
$chatFile = checkName($chatFile);
$chatPath = "$logDir/$chatFile";
$fileContents = '';

if (file_exists($chatPath))
$fileContents = file_get_contents($chatPath);

$lines = explode("\n", $fileContents);

if(count($lines) > $max_lines) {
$newText = substr($fileContents, strpos($fileContents, "\n") + 1);
$handle = fopen($chatPath, "w");
fputs($handle, $newText);
fclose($handle);

 // History
$oldText = substr($fileContents, 0, strpos($fileContents, "\n") + 1);
$handle = fopen("$logDir/history.$chatFile", "a");
fputs($handle, $oldText);
fclose($handle);
}
}

function
writeLine($chatFile, $logDir, $newText, $user) {
global $ip,$func;
checkDir($logDir);

$chatFile = checkName($chatFile);

$chatPath = "$logDir/$chatFile";

// $ip = $_SERVER['REMOTE_ADDR']; // impersonate >:D
$newText .= " ";
$newText = $func['htmlspecialchars'](stripslashes($newText), ENT_QUOTES);
$newText = str_replace(array("[list]","[center]","[left]","[right]"),"",$newText); // kill some BBCode--these tags are useless and can be abused
preparsecode($newText); // gah, sanitize input!!
$newText = parse_bbc($newText); // w00t!
censorText($newText);
// $newText = preg_replace("(http:\/\/(.+?) )is", "<a href=\"http://$1\" target=\"_blank\">http://$1</a> ", $newText);

$p_class = "";

if($user['is_admin']) $p_class = ' class="owner"';
if($user['is_mod']) $p_class = ' class="moderator"';
if(!$user['is_logged']) $p_class = ' class="guest"';
$shoutName=$user['name'];
$userID=$user['id'];
$writeText="<p$p_class><em title=\"".time()." | $ip\"><span class=\"shout-timestamp\">[<timeval=".time().">]</span> ";
if($user['is_logged'])
$writeText.="<a href=\"index.php?action=profile;u=$userID\">$shoutName</a>";
else
$writeText.="$shoutName";
$writeText.=":</em> $newText</p>\n";
$handle = fopen($chatPath, "a");
$failcount=0;
if($handle===false) die('File error (writeLine); aborted');
while( !flock($handle, LOCK_EX) ) // just IN CASE two ppl write to it at once
{
usleep(50000);
$failcount++;
if($failcount > 20) die('Write error (writeLine); aborted'); // one second
}
fwrite($handle, $writeText);
flock($handle, LOCK_UN);
fclose($handle);
}

function
help($command='')
{
global $user,$defaultEncoding,$txt;
$cmdlist=$txt['yshout_cmdlist'];

$cmdlistadmin=$txt['yshout_cmdlistadmin'];
if($user['is_admin'] || $user['is_mod'])
$cmdlist=array_merge($cmdlist,$cmdlistadmin);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<base href="/advforums/">
<head>
<meta http-equiv="content-type" content="text/html; charset=<?php echo $defaultEncoding ?>" />
<title><?php echo $txt['yshout_cmd_reference']; ?></title>
</head>
<body>
<?php
if($command=='')
{
echo '<h1>',$txt['yshout_shoutbox'],' ',$txt['yshout_commands'],'</h1>';
foreach($cmdlist as $cmd=>$desc)
{
echo "$cmd$desc<br />\n";
}
}
else
{
if(isset($cmdlist[$command])) echo "$command{$cmdlist[$command]}<br />\n";
else echo "$command not found";
}
?>
</body>
</html>
<?php
}

function
writeBanList() // generate our dynamic ban list, which is 'require'd at the start of this script
{
global $ban_ips_readpost,$ban_ips_post,$ban_names_readpost,$ban_names_post,$maintenance;
$writeText = "<?php\n"; // php header
$writeText .= '$ban_ips_readpost = '.var_export($ban_ips_readpost,true).";\n"; // bans
$writeText .= '$ban_ips_post = '.var_export($ban_ips_post,true).";\n";
$writeText .= '$ban_names_readpost = '.var_export($ban_names_readpost,true).";\n";
$writeText .= '$ban_names_post = '.var_export($ban_names_post,true).";\n";
$writeText .= '$maintenance = '.var_export($maintenance,true).";\n";
$writeText .= '?>'; // end tag
$handle = fopen("_banlist.php", "w");
if($handle===false) die('File error (writeBanList); aborted');
$failcount=0;
while( !flock($handle, LOCK_EX) ) // just IN CASE two ppl write to it at once
{
usleep(50000);
$failcount++;
if($failcount > 20) die('Write error (writeBanList); aborted'); // one second
}
fwrite($handle, $writeText);
flock($handle, LOCK_UN);
fclose($handle);
}

function history()
{
global $logDir,$boardurl,$gzipCompression,$defaultEncoding,$txt,$user;
if (!$user['is_logged'])
{
    echo '<h3>Shoutbox history available to logged in users only!</h3>';
    return;
}
checkDir($logDir);

$chatFile=isset($_GET['file'])?$_GET['file']:"home.txt";
$chatFile = checkName($chatFile);

$chatPath = "$logDir/$chatFile";
$n=250;
if(isset($_GET['n'])) $n=intval($_GET['n']); // integers only!
if($gzipCompression) ob_start("ob_gzhandler");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<base href="<?php echo $boardurl,'/'; ?>">
<head>
<meta http-equiv="content-type" content="text/html; charset=<?php echo $defaultEncoding ?>" />
<title><?php echo $txt['yshout_shoutbox'],' ',$txt['yshout_history']; ?></title>
<style type="text/css">
#yshout {
font-size: 8px;
font-style: normal;
FONT-FAMILY:  arial, helvetica, verdana, sans-serif;
}
#yshout p {
margin: 0 0 0; /* Top Bottom Linespacing */
}
.shout-invalid {
background: #FFFDD1;
}
#yshout fieldset {
border: none;
}
#yshout em {
font-style: normal;
}
#yshout p {
line-height: 1;
margin-top: 0;
}
#yshout {
overflow: hidden;
}
#yshout .shout-timestamp {
font-weight: normal;
color: #ffaa00;
            text-align: center;
}
#yshout .adminlink {
font-size: 8pt;
color: #c00000;
}
#forum-name, #shout-text, #shout-button {
font-size: 10px;
margin: 0;
padding: 0;
}
#yshout #forum-name {
color: #666666;
width: 70px;
margin-right: 5px;
}
#yshout #shout-text {

color: #000000;
width: 140px;
margin-right: 5px;
}
#yshout #shout-button {
width: 60px;
}
#shouts .owner a {
color: #F00000;
}
#shouts .moderator a {
color: #00000F;
}
</style>';
</head>
<body>
<h1><?php echo $txt['yshout_shoutbox'],' ',$txt['yshout_history']; ?></h1>
<div id="yshout">
<div id="shouts">
<?php
global $user;
require_once("class.tail.php");
$mytail = new tail("$logDir/history.$chatFile");
$mytail->setGrep(".*");
$mytail->setNumberOfLines($n);
$text=$mytail->output(PLAIN).file_get_contents("$logDir/$chatFile");
if(!($user['is_admin'] || $user['is_mod']))
$text = preg_replace('/<em title="(\d+) \| [0-9.]+"><span class="shout-timestamp">/','<em title="\\1 | logged"><span class="shout-timestamp">',$text);
echo preg_replace_callback("/<timeval=(\d+)>/","preg_timeformat",$text);
?>
</div>
</div>
</body>
</html>
<?php
if(
$gzipCompression) ob_end_flush();
exit;
}
?>


That's it for this step. Let's move to the final step:

STEP 5:::: Assuming you did not skip a step and everything was done correctly, go to your forum and inside TP's "manage block" panel,  create a Left or Right "php" block. Inside that block you need to add this code:

echo '<div id="yshout"></div>';

That's it!!! You're pretty much done. Now if you want to change the color of the time/date stamp and text, you need to go back to your theme's index.template.php and edit them there.

Good luck and Happy testing! :D

Thanks again nneonneo ... couldn't have done it without you! ;)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

In addition:

If you want to add a scrollbar on your block, in your theme's index.template.php, add this:

#yshout #shouts {
overflow: auto;
                        width: 165px;       /* the width you want to display */
height: 200px;     /* the height you want to display */
}


before:

#yshout {


If you want to reverse the message display... say newest on top instead of bottom, in your yshout folder, open up your yshout.php file:
Find

$chatText=preg_replace_callback("/\[<timeval=(\d+)>\]/","preg_timeformat",$chatText);


Right after that, add this:

$chatText=implode("\n", (array_reverse(explode ( "\n", $chatText ))));

SinnerSaint

#983
Thank you so much neoneo for the fix. My shoutbox can now display the history and other links at the top.

Anyway, I have a new problem with regards to the smiley mod of pongsak. I followed all steps carefully and put the codes correctly, however, I still got no luck running it. I have this error that prevents my forum from loading:

Parse error: syntax error, unexpected '<' in .../Themes/Black_Day/index.template.php on line 305

296:
297:          // But, let's always show minutes - Time wasted here: 0 minutes ;).
298:          echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
299:       }
300:
301:       // YSHOUT HERE
302:       echo '
303:                      <br /><b>Shout Box</b><br /><br />
304:                      <div id="yshout"', empty($options['collapse_header']) ? '>' : ' style="display: none;">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>';

305: <div class="smalltext" style="padding-left:25px;"><a href="javascript:collapse1.slidedown()">Open Smiley</a> | <a href="javascript:collapse1.slideup()">Close</a>';

306:                      require('mymod/smiley.php');
307:                      loadSmileys();
308:                   echo '
309:                      <div id="smiley_pic">';



I will really appreciate it if you can help me fix this.

Currently, I reverted to my old index.template.php so that I can use my forum. But whenever I try to upload the index.template.php in the zip file, the error message above appears.

Thank you so much in advance.
SinnerSaint

nneonneo

#984
See the code <br /><br /><br /><br /></div>';?

Remove the '; at the end.
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!

hotrod007

#985
Still lovin it!.  great Job nneoooeo!!.  Been able to add some things to it from all the great info here. and you timely responses.  My hats off to you.

Wondering if I can make it blend in better on my forum..  Background and border?

also. I have it  guest false. Did see you must register to be able to use the shout box.  now I just see..  loading shout box.?

www.njsaltwaterfisherman.com/forums   ( footer area)

nneonneo

Ah, this infamous bug.

As a guest, if you visit
http://njsaltwaterfisherman.com/forums/
you will see the message, but if you visit
http://www.njsaltwaterfisherman.com/forums/
you will not see it. How to fix? You either
a) tell users the first URL, not the second
b) fix your forum URL in server settings
c) force board_url to be "/forums" instead (probably ideal).

Doing c) requires that you edit index.template.php: change
var board_url = "', $boardurl, '";
to
var board_url = "/forums";
and that should fix the problem.
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!

husam

hey nneonneo,

can you help me installing this sbox to a custom skin?

no one wants to help me here. :(

brianjw

I will be happy to help you. :)

Assuming you already have the mod installed please include the following file and some word of where you would like this to appear.

Include the file "index.template.php", depending on the theme you want you will find it in "/Themes/theme_name/". *please attach file*

And provide a somewhat detailed description on where you would like the shoutbox to appear.

Brianjw

husam

thanks brianjw

but no, the mod is not installed yet, I'm having problems using upload package, im on windows server, so I cant set the chmod permission.

so I want to install manually. :o lol

can ya help ?

husam

I have to wait another day now. *sigh*

nneonneo

Installing manually: upload the whole yshout folder from the package into forum root, make modifications to Modifications.<language>.php as noted on the main mod page and finally make the modifications to the custom theme(s).
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!

brianjw

Quote from: husam on August 31, 2007, 08:11:56 PM
I have to wait another day now. *sigh*
Why is that? Anyway I am logging off right now so attach that file and give descriptive location by tomorrow evening. NOTE: I am in eastern time, currently it is 8:31:02 PM

husam

#993
Quote from: brianjw on August 31, 2007, 08:31:02 PM
Quote from: husam on August 31, 2007, 08:11:56 PM
I have to wait another day now. *sigh*
Why is that? Anyway I am logging off right now so attach that file and give descriptive location by tomorrow evening. NOTE: I am in eastern time, currently it is 8:31:02 PM

nah cause most users reply back after days, slow support here.

husam


brianjw


husam

I need someone to tell me how to install this MANUALLY!

thats what I've been bumping for the last 4 days

and no one really cares to support

brianjw

Nneonneo told you part of it above. The rest of it to manually install is looking in the xml file and reading the docs. Please don't yell....

husam

#998
I'm not yelling! lol

TBH I didn't notice his post, but I didn't understand what he wanted me to do.

so I need a step by step tut, or sum1 modify my files.

***READ your PMs brianjw

nneonneo

Quote from: nneonneo on August 31, 2007, 08:24:56 PM
Installing manually: upload the whole yshout folder from the package into forum root, make modifications to Modifications.<language>.php as noted on the main mod page and finally make the modifications to the custom theme(s).
In steps:
1) Upload yshout folder from package into forum root
2) Make modifications to Modifications.<language>.php as noted on the main mod page
3) Make modifications to custom theme(s) as noted on main mod page (two little pieces of code to insert)
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!

Advertisement: