|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
The shoutbox has been a problem for some sites in that it was perceived to be causing issues on boards ranging from small 'hiccups' to 'catastrophic whatever'. Some people suggested the idea of opening the shoutbox in it's own window.. Hence the 'naked shoutbox' is born: Steps to implement: create a new file called nakedshout.tpl past the following into it: {* Script Version 7.2.1 *} {* SD - Mod: The naked shoutbox is born! *}
<html> <head> <link rel="stylesheet" href="{$stylesheet}" type="text/css" /> <script type="text/javascript" src="{$config.BASE_URL}/ubb_js/ubb_jslib.js"></script> <script type="text/javascript" src="{$config.BASE_URL}/ubb_js/shoutbox.js"></script> <script language="javascript" type="text/javascript"> var confirmText = "{$lang.CONFIRM}"; var notLogged = "{$lang.NO_SHOUT}";
var baseurl = "{$config.BASE_URL}"; var fullurl = "{$config.FULL_URL}"; var imagedir = "{$style_array.general}"; var myUid = '{$myid}'; // Don't get excited, you can't exploit this :D var submitClicked = "{$lang.SUBMIT_CLICKED}"; </script> <title>Naked Shout - powered by UBB.threads™</title> </head> <body>
<table width="810px" height="610px" cellpadding="0" cellspacing="0" border="0"> <tr><td> {$tbopen} <tr> <td class="tdheader">{$lang.SHOUT_BOX}</td> </tr> <tr> <td class="alt-1"> <div id="shout_box" style="height:600px; width: 800px; overflow:auto;"> <div id="shout_content" style="height: 584px;"> </div> </div> <form name="shoutbox" method="post" action = "" onsubmit="shoutit();return false;"> <div align="center"> <span id="shout_field"> <input type="text" name="shoutbody" size="80" class="form-input" maxlength="255" value="" onenter="shoutit()" /> </span> <span id="sending_field" style="display:none"> Sending... </span> <br /> <input type="button" name="shoutbutton" value="{$lang.SHOUT_IT}" class="form-button" onclick="shoutit()" /> <input type="reset" value="{$lang.RESET_IT}" class="form-button" /> </div> <div id="shout_uid" style="display:none;"> Delete this shout?<input type="button" class="form-button" id="del_yes" value="Yes" /><input type="button" class="form-button" id="del_no" value="No" /> </div> </form> </td> </tr> {$tbclose}
</td></tr></table> <script type="text/javascript">getShouts(0);</script> </body> </html> upload to /templates/default directory Step 1 - Done! create a new file called nakedshout.inc.php paste the following into it: <?php
if(!defined("UBB_MAIN_PROGRAM")) exit;
function &page_nakedshout_gpc () { return array( "input" => "", "wordlets" => "" , "user_fields" => "", "regonly" => 1, "admin_only" => 0, "admin_or_mod" => 0, ); } function &page_nakedshout_run () { global $style_array,$smarty,$user,$in,$ubbt_lang,$config,$forumvisit,$visit,$dbh,$var_start,$var_eq,$var_sep,$var_extra; extract($in, EXTR_OVERWRITE | EXTR_REFS); $smarty_data = array(); define('NO_WRAPPER',1); $stylesheet = "{$config['BASE_URL']}/styles/{$style_array['css']}";
$smarty_data = array( "stylesheet" => $stylesheet, "myid" => $user['USER_ID'], );
return array( "header" => array ( "title" => "", "refresh" => 0, "user" => $user, "Board" => "", "bypass" => 0, "onload" => "", "breadcrumb" => "", ), "template" => "nakedshout", "data" => & $smarty_data, "footer" => false, "location" => "", ); } ?>
upload to /scripts dir.. Then you can decide to put a link to it anywhere you want. I chose to add it to the header.tpl and make it part of 'My Stuff' menu, but you can do whatever you want. the header.tpl code is: {* SD - Mod (My Shouts) *} <tr><td class="popup_menu_content"> <a href="{$config.BASE_URL}/ubbthreads.php{$var_start}ubb{$var_eq}nakedshout" target="_blank">My Shoutbox</a> </td></tr>
added after the 'My Posts' stuff. the KEY thing to note is the URL. namely http://yourboard/url/ubbthreads.php?ubb=nakedshout (add target="_blank", if you want a new window) and you are done. Notes: - you can disable your shoutbox in the portal and this will still run fine.
- feel free to change the .tpl heights and widths to your liking. i made mine a large window
- you can also edit /ubbt_js/shoutbox.js and change the update frequency to less than 30secs.. find:
function startTimer(){ shoutTimer = setTimeout("getShouts()",30000); } and change the 30000 to whatever number of milliseconds you want. ie: if you want 5seconds, the number will be 5000.
Keep in mind of the burden on your board. Most shoutboxes aren't too lively, so i had no problem setting it to 5secs 
Oh and here's some screenies (note: livewell is just a lang file for my favorite customer - Mitch P !): ![[Linked Image]](http://sirdude.com/screenies/my-shoutbox.jpg) and ![[Linked Image]](http://sirdude.com/screenies/my-shoutbox1.jpg) and ![[Linked Image]](http://sirdude.com/screenies/my-shoutbox2.jpg) upload all files and *poof* done! enjoy, SD
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
whoopsie. just ignore the 'Bash' and the extra check box stuff in the screenie. i stripped it out of the .tpl for you, so no worries. that is for another modification.. Push (new member) is the author of that feature and it's really quite neat. there are a couple more tweaks that i might post here later. namely, /me and right click wallops. i already have the /me colorizing going on and the wallops (trout slams etc) can be added later.. enjoy 
|
|
|
|
Joined: Feb 2002
Posts: 2,286
Veteran
|
Veteran
Joined: Feb 2002
Posts: 2,286 |
Thanks  Looking forward to the other features  BTW - what is/are bash, Wallops etc.?
Fans Focus - Focusing on Fans of Sport (Okay - mainly football (the British variety at the moment - but expanding all the time....)
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
wallop is : click on user name and slap them with a trout or whatever bash is : if there is a sequence of shouts that seem funny together, you can check the checkboxes and hit the 'Bash' button. That saves it as a post to a special 'Bash forum' for time immemorial. examples of bash are: ![[Linked Image]](http://sirdude.com/screenies/bash7.jpg) and ![[Linked Image]](http://sirdude.com/screenies/bash1.jpg) and ![[Linked Image]](http://sirdude.com/screenies/bash2.jpg) and ![[Linked Image]](http://sirdude.com/screenies/bash3.jpg) and ![[Linked Image]](http://sirdude.com/screenies/bash4.jpg) and ![[Linked Image]](http://sirdude.com/screenies/bash5.jpg) and ![[Linked Image]](http://sirdude.com/screenies/bash6.jpg) The idea came from the website, http://bash.org, where IRC and IM conversation snippets are saved to be rated and read for future..
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
hmm.. will this work as a guestbook? May need to allow guest posting and a way to add their name to it.
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
you mean the shoutbox would be a seperate page, where the shouts get logged to some DB table ?
or am i missing your idea ?
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
I think so  Someone was asking for a guestbook on their site. I've never used one so... 
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
I have found that most "available" guestbook scripts SUCK!, so I made my own on www.realmhq.com lol... I had needs no one catered to (both a captcha with the ability to approve entries, which one would think would be simple)
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
That looks good gizzy 
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
Dankie <3...
I used to use a paid solution on it, but their captcha wasn't worth the zend encoded container it came in... It never worked, always let spam in, etc...
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
well, giz just take your form (nice form btw) and threads-ize it. just add a table ubbt_GUESTBOOK and modify it to sit in the middle of the portal page ? modify ubbthreads.php to slam that puppy in, instead of the feeder forum topics or above them.. makes sense ? a giz-guestbook mod!! ? weird how a naked shoutbox thread turns into a giz-guestbook.. 
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
'eh, doesn't motivate me... Feel free to gank my forms though lol..
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
..er /me looks up 'gank' if you mean sending me the code.. i can shoehorn it in. if not, i'm too lazy to view source / copy... you have the form handy in some format 
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
oui, free giz-guestbook! or make it a paid mod, let us play with it 
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
lol the form is there, it's called "view source" sd  ... as for a paid mod, i suppose, when i get some time, i could attempt to work on something... i'd have to see how rick handles the captcha... it'd likely be a ubbthreads.php/ubb/giz-guestbook page  ... I really haven't dabbled in the cp at all in ubb.t7 so not sure where to start there...
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
did you read that i'm too lazy to 'view source' ?  sheeesh help a brotha out here.
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
lol, it'd be the same form weather i emailed it to you or you viewed source; just the one is faster 
|
|
|
|
Joined: Nov 2003
Posts: 329
Beta Tester
|
Beta Tester
Joined: Nov 2003
Posts: 329 |
Great work Naked Shout box.
I wonder if this could be the solution to my forums hanging when shout box is enabled.
Personally i prefer that members are registered to shout in the box.
Those BASH comments were sooooo funny, i hope that it becomes stock, i really do pmsl.
BOOM 7.6.+ rocks....
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
that's the main reason this puppy got written -- the forum 'hang' and this only allows registered users to use the shout box, btw 
|
|
|
|
Joined: Nov 2003
Posts: 329
Beta Tester
|
Beta Tester
Joined: Nov 2003
Posts: 329 |
Quality Stuff  This thread is now on my watch list for when i can find a little time to give it a go 
BOOM 7.6.+ rocks....
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
Great! I was working on this one myself as a chatbox on the site. I like copy/paste more then typing, so thanks 
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
you're welcome,
i'm going to be adding shout-header, shout-footer, for those that want to do a little customising.
also will add time to the line, rather than in the hover.
also will be adding 'whos online in the shoutbox' -- basically a list of users who currently have the 'naked shoutbox' open.. (like IRC does)
and will be adding one click (two actually) theme switching for the shoutbox.. (if peeps likey, i'll port the theme switcher over to threads as a mod)
bleh, that's all for now.. oh and there are a couple bug fixes in the common shoutbox.js code too, that i'll post over here.
|
|
|
|
Joined: Nov 2003
Posts: 329
Beta Tester
|
Beta Tester
Joined: Nov 2003
Posts: 329 |
Give that man a cigar >> SD
Sounds like one of the most exciting addons we have had in ages. Watching with baited intrest.
< Hate the way he makes it sound O so easy >
Great work mate.
BOOM 7.6.+ rocks....
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
A few suggestions from me wanting it as a chatbox: - Have the cursor in the input field after sending a shout and when you load the page.
- Opening times. Open between time X and time Y, if you're in in that timeslot, you can stay.
Somehow setting specific chat times helps getting it more busy and fun - Max people online, to keep serverload acceptable.
- Ban from chat.
- Shoutbox now wordwraps words bigger then 20 characters. For the naked shoutbox this is a bit short.
Last edited by blaaskaak; 08/21/2007 1:48 PM.
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
okies.. all easy, except opening times.. which is medium.. i'll see what i can do.. i have the code open on the operating table, so i might poke around a bit, before closing her up 
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
:mumble: i did some groundwork on UBB.Guestbook; but my wife came home while I was working on the script lol... I have the wordlets file and the view/sign templates done, have to do one for the "sign complete" page then work on the script a bit... Wonder what'd be fair to charge :x...
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
make a guestbook thread, when you're done.. this one is for naked shoutbox stuff 
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
haha, you and allen went off on a tangient, figured i'd mention that i've been giving it thought  ... Though i plan to make my own thread, when i have something to show  ...
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
shoooo fly shooo  random musing mode.... idea! had to write it down before putting down for the nite.. the protocol should not only be JSON (leaner), but also only return changes, based upon either last shout id or time.. the way process control does it.. this cuts the xmlhttprequest traffic size down considerably. also, the ajax server(s) should be one file, so that it has a better chance of staying in the php cache as a unit. also easier to maintain one piece of ajaxshoutserver.php code.. drawback.. added branching in the server file.. minimal (imo) weird idea.. add proxy capability for cross-site / multiple joined shouts in one.. ie site1 + site2 .... siten all serving up to same shout UI.. keep in mind: load! convert fully to yui.. add effects for new shouts.. fade in.. etc.. not sure yet.. global / personalized wallop menus.. menus need to be ul, li and NOT table, tr, td! longer history for shouts.. ie ability to search back further than just 30 or whatever.. urls, imgs.. admin cpanel for FULL setup and customization... possible full page reload interval, so adverts get more hits.. colorized names, like in showflat.. admin, mod, whatever.. dynamic resizing with handles, using yui.. set mode -v  bleh.. that's it.. brain dump over ..
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
Go put your computer together, so you can send me your old one :x...
|
|
|
|
Joined: Nov 2003
Posts: 329
Beta Tester
|
Beta Tester
Joined: Nov 2003
Posts: 329 |
with all them idea's how can you sleep lol
BOOM 7.6.+ rocks....
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
You should see inside my head... I have once, and it's quite crazy 
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
dude, no need to see INSIDE.. the outside speaks for itself 
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
hehe.. giz is EVERYWHERE today 
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
we is built into everything!
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
ok, i've complete overhauled it to use new javascript. this is essentially standalone and only shares with ubbthreads on the user DB side of things as well as to grab the styles. sooo, you don't have to worry about upgrades trashing this. the new javascript (ajax) is much more efficient by using JSON as the transport format. formerly it took 14K to fill a shoutbox and now it takes 4K. i've pushed the load of ALL of the formatting to the client, using DOM instead of burdening the php server code. so this is less of a strain on the server itself. i almost have it done, but will at least leave you with a typical screenie.. ![[Linked Image]](http://sirdude.com/screenies/ubbt/shouts.jpg) the lower right side is a space that you can put your own content into.. ads, logo, whatever.. i showed the ajax 'bashing..' 'sending..' reveals here, but they are normally hidden and come into play on an async call begin. the 2 columns of buttons on the left allow a user to select rows (1st one) for subsequent 'Bash'.. the 2nd column is the same as the delete [x] is now.. selection gives feedback in a different highlight color, like phpmyadmin does for rows.. the upper right hand side is a current tally of who's online in the shoutbox.. configurable in the admin cpanel.. i will wrap it up soon, but it ain't ready for prime time yet.. til then... patience  ps: and thanks to Rick!! for the wonderful style from which to use as an excellent look/feel.
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
Lol, that's a great start man... Looks awesome...
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
til then... patience  I'm running out of 
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
Enthusiast
Joined: Nov 2003
Posts: 482 |
hehe.. well you want kick + ban, max online limit ? (i will leave out the start/stop times as you can figure a way to deal with that manually -- ie make the link not work or have a default screen -- for now)
also, i'm using a decay algorithm that offloads the server and it's kinda not right yet.
basically, if you are just idling in the chat window, your delay between async xmlHTTPRequests decays to a longer time (to a limit of course).. this offloads the server load..
when you start chatting or doing things in the chat window, the decay is restored to the 'fast' value (configurable)
i will get a prototype up tomorrow or next day for you to play with.
once caveat.. php 5, so i can use the zend built in json_encode routine (very fast).
if you MUST have php4, then there is a workaround, but i don't recommend. (slower and in php code vs compile c)
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 417
Joined: November 2001
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|