Welcome, Guest. Please Login or Register.
May 13, 2024, 10:47:06 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Done 1.5.2] Ultimate Shoutbox v.1.1 « previous next »
Pages: [1] 2 3 Reply Ignore Print
Author Topic: [Done 1.5.2] Ultimate Shoutbox v.1.1  (Read 6534 times)
haase
Full Member
***
Posts: 224


Do you feel lucky?

[Done 1.5.2] Ultimate Shoutbox v.1.1
« on: April 30, 2003, 12:21:34 AM »
Reply with quote

***please do not post in this thread.  Please refer to the version 1.3 thread***

First of all, let me just say that I was creating this at the same time that 3DGuy was doing his, and it's done, so I figured I'd just give everyone a second option.

Is it better than his?  No, not at all.
Is it different?  VERY

What makes this different is that it basically uses all the code already built into YaBB SE.  Other than the shout.php file itself, there aren't any additional includes.  It uses the same smilies and UBBC tags, the same security and everything.  There are also several options for setting up your shoutbox that are put into the "Installed Mods and Settings" page.

You can view the shoutbox (and test it out) HERE!  There you will also find a downloads link at the top of the page that will give you access to the mod itself.

Here's the scoop straight from the mod fileCurrent Version: 1.1
1. Security Fix: HTML or PHP tags entered by user no longer crash the shoutbox.
2. embedded links now work
3. now call shoutbox by <yabb shout> tag

version 1.0:
1. Chiani's Magic Make Long Words Short Words Recipe
2. Josh Darnell's Famous ShoutBox Marquee Add-on
3. Now sporting the following permissions options:
  members only
  admins only
  everyone
4. Fully Integrated Control Panel in the Intalled Mods page.

version 0.2:
1. Delete function doublechecks that you are an administrator before proceeding
2. Smilies activated
3. YaBBC functions work
(note: smilies and YaBBC functions must be entered manually, there are no buttons for them)
4. Ability to modify number of shouts returned
5. Select whether you want the shouts to be decending or ascending
6. Censor activated


version 0.1:
Original Version


This is your basic shoutbox.  Your registers users type in a message and click shout.  Guests on your
site (if you give them access to the block) will type in their name, email address and message before
clicking shout.

The format of each 'shout' is Date, Name, Message.  If a registered user posts a shout, their name
becomes a link to their profile.  If a guest posts a shout, their name is a mailto: to the email
address they entered.

For administrators, there is also a delete button next to each individual shout.

The following validation rules have been included:
1. Guest does not enter username, receives error page
2. Guest does not enter valid email address, receives error page
3. Guest or user sumbits shout without changing default text, receives error page

Instructions.

1. Upload shoutdb.php into your board directory and run it (be sure to delete it afterwards).
2. Install from this mod file manually or using boardmod
3. Upload shout.php into your sources dir.
4. Upload deleteshout.gif to your Skin/YaBBImages directories
5. Anywhere in your template (or in a block if you are using PfaBB) include the <yabb shout> tag.  
6. Go into the Pre-installed Yabb SE page and check appropriate settings
7. Type in a message and click Shout!

NOTE: If you are upgrading from version 1.0 and you do not need the <yabb shout> tag, all you
need to do is upload the new shout.php file.  If you would like the tag, only edit the Subs file
below.


and here is a picture of the Mod Settings section:

« Last Edit: May 22, 2003, 12:11:08 AM by greghaase » Logged
haase
Full Member
***
Posts: 224


Do you feel lucky?

Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #1 on: April 30, 2003, 01:35:27 AM »
Reply with quote

I just discovered a small error in the shoutdb.php file.  There was a typo in the validation, so that even if the table is created correctly in the database, you'll still get an error.

This is now fixed, so you should only experience the issue if you grabbed the file between now and when I originally posted about an hour ago.

If you do get the error, verify that the table shoutbox appears in your yabbse database.  If the table is there, then the file installed correctly.  

Sorry about that.
Logged
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #2 on: April 30, 2003, 03:58:19 AM »
Reply with quote

Looks awesome.  Do you really need the temporary table though?  Why can't you just do ORDER BY id instead of ORDER BY id DESC?
Logged

[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #3 on: April 30, 2003, 05:03:29 AM »
Reply with quote

Quote from: David on April 30, 2003, 03:58:19 AM
Looks awesome.  Do you really need the temporary table though?  Why can't you just do ORDER BY id instead of ORDER BY id DESC?

Because he keeps all shouts in the table.

IMHO, it would be better to delete from and then select....

-[Unknown]
Logged
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #4 on: April 30, 2003, 05:18:17 AM »
Reply with quote

Yeah, seems like on the insert it should delete one.  Then the same number will stay in there.
Logged

[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #5 on: April 30, 2003, 05:27:19 AM »
Reply with quote

Quote from: David on April 30, 2003, 05:18:17 AM
Yeah, seems like on the insert it should delete one.  Then the same number will stay in there.

ie...

//Now we're ready to insert the shout   
   $result=MYSQL_QUERY("INSERT INTO {$db_prefix}shoutbox (name, displayname, message,time,email) VALUES ('$HTTP_POST_VARS[name]', '$HTTP_POST_VARS[displayname]', '$message','$time','$HTTP_POST_VARS[email]')");

   // Find and delete old shouts.
  $result = mysql_query("
     SELECT count(id)
     FROM {$db_prefix}shouts");
  list ($shoutcount) = mysql_fetch_row($result);
  mysql_free_result($result);

   mysql_query("
     DELETE FROM {$db_prefix}shouts
     ORDER BY id ASC
     LIMIT " . ($shoutcount - $GLOBALS['modSettings']['shoutlimit']));

header("Location: index.php");
}


By the by, what's with the HYPER use of temporary variables?  Afraid of the modSettings array? :P

-[Unknown]
Logged
haase
Full Member
***
Posts: 224


Do you feel lucky?

Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #6 on: April 30, 2003, 10:51:36 AM »
Reply with quote

I'm not sure what you two are getting at.  Because I allow the admin to set how many shouts are returned to the screen, I can't just have on delete everytime another one is added.

The temporary table is only used when you return your shouts in ascending order...  otherwise it uses the normal order by DESC in the original query.  I did a lot of research on this, and this seemed like the best way to do it.  According to a lot of people use of a temp table is quicker than any alternative PHP processing that could be done.

About the hyper use of temp variables, I don't claim to be an expert coder.  I see what I need and I code it.

If this mod really bugs you, then don't use it.  Jeez...  I can't believe I put this out and you two just tore it up.  It works, it's very slim compared to some other shoutboxes out there, and it uses most of the same settings as the rest of the code, e.g. smilies, censor, UBBC, etc.

And no comment about the array splice...  that was quite a difficult bit of coding.
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #7 on: April 30, 2003, 11:05:55 AM »
Reply with quote

Didn't mean to 'tear it apart'... just trying to be helpful and give suggestions.  I even provided working code that would remove the need for a temporary table and yet make it work just as well!

Regardless, my apologies.  I didn't mean any offence.

-[Unknown]
Logged
haase
Full Member
***
Posts: 224


Do you feel lucky?

Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #8 on: April 30, 2003, 12:42:03 PM »
Reply with quote

Sorry...  read that thread about 5 minutes after waking up...  probably not a good idea.  Anyway, thanks for the delete fix...  I'll probably put that into my next version directly.

But I have to ask, is there something tabboo or horrible about using temporary tables...  they're created in memory and they are dropped right after they're used.  We're talking about sticking in the memory only milliseconds.  I seemed like a fairly common practice, why not use it?

But I must say, if you were really trying to be helpful, smarta$$ comments such as
QuoteBy the by, what's with the HYPER use of temporary variables?  Afraid of the modSettings array?
would take a slightly more helpful tone, such as
QuoteInstead of creating a temporary variable for each setting, do this

And by the by I'm still waiting for an example of the "modSettings array".  I didn't bump into anything that looked like that in the source code, or I would have used it.  Perhaps this is the "$GLOBALS['modSettings']['shoutlimit']" code that you used in your fix?
« Last Edit: April 30, 2003, 12:59:41 PM by greghaase » Logged
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #9 on: April 30, 2003, 02:34:26 PM »
Reply with quote

Sorry if I came across the wrong way, was trying to give a suggesstion.  Seems logical that if you get the data in one way and you are using a DESC, then to get it in the other order don't use the DESC.  I've never used temporary tables and thus am infamiliar with them, they just seem like quite a bit of overhead on an active forum.
Logged

oldiesmann
YaBB God
*****
Posts: 577


Jesus died for your sins... Have you thanked him?

oldiesmann@oldiesmann.us WWW
Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #10 on: April 30, 2003, 03:03:04 PM »
Reply with quote

Looks interesting... Just put it on my Lycos board (at the bottom, right before the copyright tag)... Don't really like it as much as the other one though... However, I will leave it there so others can compare the two.

http://members.lycos.co.uk/oldiesmann/yabbse/index.php - my "mod test" board - If you have a mod to test, contact me and I'll do it for you! ;D
Logged

"I've sinned greatly, but Christ's for real, baby
It's a wonder He saved me and just didn't hate me
So won't you tell Him "Save me"
Please stand up, please stand up, please stand up..." - J. Jackson (More Info)
haase
Full Member
***
Posts: 224


Do you feel lucky?

Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #11 on: April 30, 2003, 03:25:23 PM »
Reply with quote

Quote from: David on April 30, 2003, 02:34:26 PM
Sorry if I came across the wrong way, was trying to give a suggesstion.  Seems logical that if you get the data in one way and you are using a DESC, then to get it in the other order don't use the DESC.  I've never used temporary tables and thus am infamiliar with them, they just seem like quite a bit of overhead on an active forum.

Right...  but if you just get the shouts in ascending order, you'll only get the first X number of shouts instead of the last X number of shouts.  If you have 42 shouts in the database, and pull them in ascending order, you'll get the first 10 everytime (assuming 10 is your limit).  If someone adds shout #43, it will still just pull the first ten.  You MUST sort them in descending order if you want to get the most current ones.  The temporary table exists only until the next query.  There has been statistical proof that using temporary tables takes less memory and processing than doing any kind of array manipulation in PHP or anything other program to get the shouts in the correct order.  So I have to believe that using a temporary table isn't much overhead at all - probably less than 1k of memory that is used for a few milliseconds.

Of course this really doesn't matter now, because [unknown]'s code will work perfectly to limit the number of shouts in the table to the amount that the admin specifies.
« Last Edit: April 30, 2003, 03:26:29 PM by greghaase » Logged
oldiesmann
YaBB God
*****
Posts: 577


Jesus died for your sins... Have you thanked him?

oldiesmann@oldiesmann.us WWW
Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #12 on: April 30, 2003, 04:41:16 PM »
Reply with quote

So, what happens to the old shouts?
« Last Edit: April 30, 2003, 05:03:26 PM by oldiesmann » Logged

"I've sinned greatly, but Christ's for real, baby
It's a wonder He saved me and just didn't hate me
So won't you tell Him "Save me"
Please stand up, please stand up, please stand up..." - J. Jackson (More Info)
haase
Full Member
***
Posts: 224


Do you feel lucky?

Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #13 on: April 30, 2003, 05:50:51 PM »
Reply with quote

Currently, they just sit there in the database.  I think I need a paradigm shift.  I currently hold a day job in an environment where we're required by law to keep old data around.  In the next version I will include the [unknown] fix to delete old shouts.
Logged
oldiesmann
YaBB God
*****
Posts: 577


Jesus died for your sins... Have you thanked him?

oldiesmann@oldiesmann.us WWW
Re:[Done 1.5.2] Ultimate Shoutbox v.1.1
« Reply #14 on: April 30, 2003, 05:55:07 PM »
Reply with quote

Well, why not add on to that by giving the forum admin more options as to what to do with older shouts? They could choose to automatically delete older shouts or have them go to a "shout archive" where they wouldn't get deleted and then let others view the older shouts by having a link to the "archive"
Logged

"I've sinned greatly, but Christ's for real, baby
It's a wonder He saved me and just didn't hate me
So won't you tell Him "Save me"
Please stand up, please stand up, please stand up..." - J. Jackson (More Info)
Pages: [1] 2 3 Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Done 1.5.2] Ultimate Shoutbox v.1.1 « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.049 seconds with 20 queries.