function postNewShout() { if(userinfo['userid'] == 'false') { alert('Guests cannot shout.'); } else { var shoutboxcontentsub = document.getElementById('shoutboxcontentsub'); if(shoutboxcontentsub) { var message = prompt('Please input your shout message.', ''); if(message !== null) { var message_url = server_address + '?tm=' + new Date().getTime() + '&useradmin=' + urlencode(userinfo['useradmin']) + '&forum_url=' + urlencode(forum_url()) + '&username=' + urlencode(userinfo['username']) + '&userid=' + urlencode(userinfo['userid']) + '&message=' + urlencode(message); var shoutboxmessageframe = document.getElementById('shoutboxmessageframe'); if(!shoutboxmessageframe) { shoutboxcontentsub.parentNode.innerHTML += ''; } else { shoutboxmessageframe.src = message_url; } } } } } function refreshShoutbox(pagenumb) { var shoutboxcontentsub = document.getElementById('shoutboxcontentsub'); if(shoutboxcontentsub) { var message_url = forum_url() + 'index.php?act=Reg&CODE=image&updateshoutbox=yes'; if(pagenumb || pagenumb === 0) { message_url += '&nst=' + pagenumb; } var shoutboxmessageframe = document.getElementById('shoutboxmessageframe'); if(!shoutboxmessageframe) { shoutboxcontentsub.parentNode.innerHTML += ''; } else { shoutboxmessageframe.src = message_url; } } } function shoutboxEmotes() { var shoutboxcontentsub = document.getElementById('shoutboxcontentsub'); var x = self.shoutboxemotes.document.getElementsByTagName('IMG'); for(var i = 0;i < x.length;i++) { var img = x[i].src; var code = x[i].parentNode.href.split('javascript:add_smilie("')[1].split('")')[0]; shoutboxcontentsub.innerHTML = unescape(escape(shoutboxcontentsub.innerHTML).replace(RegExp(escape(code), 'g'), '')); } } function function_exists(function_name) { if(typeof(window[function_name]) == 'function') { return true; } else { return false; } } function get_query(propname, string, novaluereturn) { if(novaluereturn === undefined) { var novaluereturn = false; } if(!string) { var string = window.location.href; } string = '&' + string.substring(string.indexOf('index.php') + 10, string.length); var value = novaluereturn; if(string.match('&' + propname + '=')) { value = string.split('&' + propname + '=')[1]; if(value.match('&')) { value = value.split('&')[0]; } } return urldecode(value); } function forum_url() { var string = window.location.href.toString(); if(string.match('index.php')) { string = string.split('index.php')[0]; } if(string.charAt(string.length - 1) != '/') { string += '/'; } return string; } function get_cookie(cookie_name) { if(document.cookie.match(cookie_name + '=')) { var cookie_value = document.cookie.split(cookie_name + '=')[1]; if(cookie_value.match(';')) { cookie_value = cookie_value.split(';')[0]; } return unescape(cookie_value); } else { return false; } } function set_cookie(cookie_name, cookie_value, cookie_length) { if(cookie_length === undefined) { var cookie_length = new Date(new Date().getTime() + (60 * 60 * 60 * 24 * 32 * 1000)).toGMTString(); } var string = cookie_name + '=' + escape(cookie_value) + '; expires=' + cookie_length; document.cookie = string; } function del_cookie(cookie_name) { set_cookie(cookie_name, '', 0); } function print_r(array, return_value, tabcount) { var result = ''; if(!tabcount) { var tabcount = 0; } tabcount++; if(typeof(array) == 'object') { result += 'Array (\n'; for(var array_name in array) { for(var i = 0;i < tabcount;i++) { result += '\t'; } var array_value = array[array_name]; var subresult = ''; if(typeof(array_value) == 'object') { if(1 == 2) { subresult += print_r(array_value, true, tabcount); } else { subresult += 'Array'; } } else { subresult += array_value; } result += '[' + array_name + '] => ' + subresult + '\n'; } } else { result += array; } for(var i = 0;i < tabcount - 1;i++) { result += '\t'; } if(typeof(array) == 'object') { result += ')\n'; } if(return_value) { return result; } else { document.write(result); } } function print_pre(array, return_value) { var result = '
' + print_r(array, true) + '
'; if(return_value) { return result; } else { document.write(result); } } function changeShoutbox(returnopstatus, returnvalue) { if(!returnopstatus) { var returnopstatus = false; } var shoutboxstatus = true; var cookie_name = escape(forum_url()) + 'shoutboxstats'; if(get_cookie(cookie_name) == 'hide') { shoutboxstatus = false; } if(returnopstatus) { if(returnvalue) { return shoutboxstatus; } else { if(shoutboxstatus) { return 'Hide Shoutbox'; } else { return 'Show Shoutbox'; } } } else { if(shoutboxstatus) { set_cookie(cookie_name, 'hide'); } else { del_cookie(cookie_name); } window.location = window.location; } } function urlencode(string) { return escape(string.toString().replace(/\+/g, '%2B')); } function urldecode(string) { string = string.toString().replace(/\+/g, ' '); while(string.match('%2B')) { string = string.replace('%2B', '+'); } return unescape(string); } if(!server_address) { var server_address = 'http://redepsilekt.byethost9.com/shoutbox/'; } var userinfo = new Array(); userinfo['username'] = 'false'; userinfo['userid'] = 'false'; userinfo['useradmin'] = 'false'; var userlinks = document.getElementById('userlinks'); if(userlinks) { var x = userlinks.rows[0].cells[0].getElementsByTagName('A'); for(i = 0;i < x.length;i++) { var possible_userid = get_query('showuser', x[i].href); var possible_href = forum_url() + 'index.php?'; var possible_s = get_query('s', x[i].href); if(possible_s !== false) { possible_href += '&s=' + possible_s; } possible_href += '&showuser=' + possible_userid; if(x[i].parentNode.tagName == 'STRONG' && possible_userid !== false && x[i].href == forum_url() + 'index.php?' + get_query('s', x[i].href, '', '&s=', '&') + 'showuser=' + possible_userid) { userinfo['username'] = x[i].innerHTML; userinfo['userid'] = possible_userid; } else if(x[i].href == forum_url() + 'admin.php' && x[i].innerHTML == 'Admin CP' && x[i].parentNode.tagName == 'B') { userinfo['useradmin'] = true; } } } if(get_query('updateshoutbox') == 'yes') { document.write(''); } else { var shoutboxcontent = document.getElementById('shoutboxcontent'); var string = ''; string += '
'; string += '
' + changeShoutbox(true) + 'Shoutbox
'; string += ''; string += '
 
'; string += '
'; if(shoutboxcontent) { shoutboxcontent.innerHTML = string; if(changeShoutbox(true, true)) { document.getElementById('shoutboxcontentsub').style.display = 'block'; document.write(''); setTimeout('if(!function_exists(\'shoutboxwasloaded\')) {document.getElementById(\'shoutboxcontentsub\').innerHTML = \'
Your shoutbox server could not be contacted.
\';}', 10000); } } }