Welcome, Guest. Please Login or Register.
May 13, 2025, 01:48:29 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  |  Mod Ideas and Creation  |  Announcments in all boards! « previous next »
Pages: [1] 2 Reply Ignore Print
Author Topic: Announcments in all boards!  (Read 1381 times)
Nonya
Beta Tester
Sr. Member
****
Posts: 375


YaBBse Developer Wannabe!

ICQ - 172862020nonya69rs@hotmail.com WWW
Announcments in all boards!
« on: April 06, 2003, 10:44:53 AM »
Reply with quote

Hello peeps,
I don't know if there a mod like this but i tho it'd be great if we've something like this!  ;)
Logged

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


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Announcments in all boards!
« Reply #1 on: April 06, 2003, 06:59:10 PM »
Reply with quote

Global stickies, you mean?

The problem is this would SIGNIFICANTLY slow down your board.... this is because...

SELECT something
FROM somewhere
WHERE ID_BOARD=$board
ORDER BY isSticky DESC, posterTime DESC

Is a lot faster than...

SELECT something
FROM somewhere
WHERE ID_BOARD=$board
  OR isSticky=2
ORDER BY isSticky DESC, posterTime DESC

Because OR is VERY VERY VERY slow.

However, it's really simple to do....

-[Unknown]
Logged
Nonya
Beta Tester
Sr. Member
****
Posts: 375


YaBBse Developer Wannabe!

ICQ - 172862020nonya69rs@hotmail.com WWW
Re:Announcments in all boards!
« Reply #2 on: April 07, 2003, 12:11:14 AM »
Reply with quote

is there any way to make it in a right way so its not gonna slow down the board  :-\
Logged

David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:Announcments in all boards!
« Reply #3 on: April 07, 2003, 12:22:22 AM »
Reply with quote

I'd make a new table and then you can do things like set a date range for them to be shown and choose which boards and such.
Logged

king_killa
Full Member
***
Posts: 132


king killa big wheela cat peela

WWW
Re:Announcments in all boards!
« Reply #4 on: April 07, 2003, 12:28:43 AM »
Reply with quote

I have no idea if this would work but, What if all the sticky feature did was make the last post time = to the current time, therefore making it always on top.
Logged

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


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Announcments in all boards!
« Reply #5 on: April 07, 2003, 12:32:59 AM »
Reply with quote

Quote from: David on April 07, 2003, 12:22:22 AM
I'd make a new table and then you can do things like set a date range for them to be shown and choose which boards and such.

This would be even slower!

Unless.... the announcement was shown on every page of the message index... which doesn't make sense, imho.

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


I'm not a llama!

WWW
Re:Announcments in all boards!
« Reply #6 on: April 07, 2003, 12:47:39 AM »
Reply with quote

Quote from: [Unknown] on April 07, 2003, 12:32:59 AM
Quote from: David on April 07, 2003, 12:22:22 AM
I'd make a new table and then you can do things like set a date range for them to be shown and choose which boards and such.

This would be even slower!

Unless.... the announcement was shown on every page of the message index... which doesn't make sense, imho.

-[Unknown]
I wouldn't try and combine it into one query.  Have one query for announcements and then keep the same normal query for threads.
Logged

old dan
Full Member
***
Posts: 191


Make music, not war.

WWW
Re:Announcments in all boards!
« Reply #7 on: April 07, 2003, 12:48:27 AM »
Reply with quote

I'm assuming you want to be able to write one post and have it displayed on all the boards, right? If that's the case, like David said, build a new table. Then add a field to the post form, hidden from everyone cept the administrator and click that to make a global announcement. Then instead of writing it to the current board it would write it to your global announcement table. And in messageindex add the code to call the info from the global anouncement table and display it before the regular messages. Wouldn't be that hard, I might do this for my board. Several details to work out first.......
Logged

People who drink lite beer don't like the taste of beer; they just like to pee a lot
old dan
Full Member
***
Posts: 191


Make music, not war.

WWW
Re:Announcments in all boards!
« Reply #8 on: April 07, 2003, 12:51:38 AM »
Reply with quote

Quote from: [Unknown] on April 06, 2003, 06:59:10 PM
Global stickies, you mean?

The problem is this would SIGNIFICANTLY slow down your board.... this is because...

SELECT something
FROM somewhere
WHERE ID_BOARD=$board
ORDER BY isSticky DESC, posterTime DESC

Is a lot faster than...

SELECT something
FROM somewhere
WHERE ID_BOARD=$board
  OR isSticky=2
ORDER BY isSticky DESC, posterTime DESC

Because OR is VERY VERY VERY slow.

However, it's really simple to do....

-[Unknown]

why would anyone do that? I have used isSticky to make announcement posts and don't use OR in a mysql statement. Much simpler and faster to just use a if

if (isSticky == 2)
display this
Logged

People who drink lite beer don't like the taste of beer; they just like to pee a lot
Nonya
Beta Tester
Sr. Member
****
Posts: 375


YaBBse Developer Wannabe!

ICQ - 172862020nonya69rs@hotmail.com WWW
Re:Announcments in all boards!
« Reply #9 on: April 07, 2003, 12:59:28 AM »
Reply with quote

i think this mod going to be helpful for all the forum's admins

so they can post thier forum's rules so everyone can see this rules when he browsing any board.

and we can make this announcment related by period so it can be disactive for some day.

Sorry for that bad explain  :-\


Logged

Nonya
Beta Tester
Sr. Member
****
Posts: 375


YaBBse Developer Wannabe!

ICQ - 172862020nonya69rs@hotmail.com WWW
Re:Announcments in all boards!
« Reply #10 on: April 07, 2003, 01:01:20 AM »
Reply with quote

Quote from: David on April 07, 2003, 12:22:22 AM
you can do things like set a date range for them to be shown and choose which boards and such.

Thats what i'm trying to say  :P
Logged

Nonya
Beta Tester
Sr. Member
****
Posts: 375


YaBBse Developer Wannabe!

ICQ - 172862020nonya69rs@hotmail.com WWW
Re:Announcments in all boards!
« Reply #11 on: April 07, 2003, 01:04:01 AM »
Reply with quote

Quote from: old dan on April 07, 2003, 12:48:27 AM
I'm assuming you want to be able to write one post and have it displayed on all the boards, right? If that's the case, like David said, build a new table. Then add a field to the post form, hidden from everyone cept the administrator and click that to make a global announcement. Then instead of writing it to the current board it would write it to your global announcement table. And in messageindex add the code to call the info from the global anouncement table and display it before the regular messages. Wouldn't be that hard, I might do this for my board. Several details to work out first.......
Dan Could you explain lil more please  ;)
Logged

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


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Announcments in all boards!
« Reply #12 on: April 07, 2003, 03:54:35 AM »
Reply with quote

Quote from: old dan on April 07, 2003, 12:51:38 AM
Quote from: [Unknown] on April 06, 2003, 06:59:10 PM
Global stickies, you mean?

The problem is this would SIGNIFICANTLY slow down your board.... this is because...

SELECT something
FROM somewhere
WHERE ID_BOARD=$board
ORDER BY isSticky DESC, posterTime DESC

Is a lot faster than...

SELECT something
FROM somewhere
WHERE ID_BOARD=$board
  OR isSticky=2
ORDER BY isSticky DESC, posterTime DESC

Because OR is VERY VERY VERY slow.

However, it's really simple to do....

-[Unknown]

why would anyone do that? I have used isSticky to make announcement posts and don't use OR in a mysql statement. Much simpler and faster to just use a if

if (isSticky == 2)
display this

Your way would not be global - one board only.... that is, the OR would allow for a sticky on any ID_BOARD.

I suppose you could say:
if ($start == 0)
{
  SELECT subject, mem.memberName, mem.realName, posterTime
  FROM {$db_prefix}announcements
  WHERE stickyTime < " time() . "
  ORDER BY posterTime
  $maxdisplay -= mysql_num_rows();
}

But that would QUITE POSSIBLY be even slower than using an OR.... it's an entire new query!  And, most people only use the first page anyway!

And, yes, yes of course it would be in the post... javascript could even be used to achieve a half decent effect... that is,

[  ] Make this a global sticky for [ xxx      ] days.

Where the length (0 for forever, whatever) is disabled until you tick the box.

Then just have post2 wite to the table.... or set isSticky to 2, either way.

-[Unknown]
Logged
old dan
Full Member
***
Posts: 191


Make music, not war.

WWW
Re:Announcments in all boards!
« Reply #13 on: April 07, 2003, 04:12:39 AM »
Reply with quote

Quote from: [Unknown] on April 07, 2003, 03:54:35 AM

Your way would not be global - one board only.... that is, the OR would allow for a sticky on any ID_BOARD.

-[Unknown]

yes, using isSticky set to 2 would only allow the post to be an announcement post on the board it was written. I've done that. And it works fine, however, Nonya wants a global announcement mod. I really think it will be more involved and will probably need more than using isSticky and adding a query. As you have pointed out, that would be slower. And except for intimate moments, faster is better. ;D
Logged

People who drink lite beer don't like the taste of beer; they just like to pee a lot
old dan
Full Member
***
Posts: 191


Make music, not war.

WWW
Re:Announcments in all boards!
« Reply #14 on: April 07, 2003, 04:18:42 AM »
Reply with quote

Quote from: Nonya on April 07, 2003, 01:04:01 AM

Dan Could you explain lil more please  ;)

First create a truncated member table like this:

CREATE TABLE announcement (
ID_MSG int(11) NOT NULL auto_increment,
ID_MEMBER int(11) NOT NULL default '0',
subject tinytext,
posterName tinytext NOT NULL,
posterEmail tinytext,
posterTime bigint(20) default NULL,
posterIP tinytext NOT NULL,
body text,
icon tinytext

then in post.php add a field $isannouncepost and if that is checked on the form it would be true. Then when you write the post if $isannouncepost  is true

if ($isannouncepost)
 mysql_query (
   INSERT INTO announcement
   yadda yadda yadda);

Then in messageindex, before you start writing the posts and after the heading

 mysql_query (
   SELECT yadda yadda yadda from announcement)

put it into variables and then echo it

echo "
 <tr>
 <td class=\"windowbg\" valign=\"middle\" align=\"center\" width=\"6%\">
  <img src=\"$imagesdir/announce.gif\" alt=\" \"></td>
 <td class=\"windowbg\" valign=\"middle\" align=\"center\" width=\"4%\">
  <img src=\"$imagesdir/$micon.gif\" alt=\" \" border=\"0\" align=\"middle\"></td>
 <td class=\"windowbg2\" valign=\"middle\" width=\"48%\">
  <b>Announcement: </b><a href=\"$cgi;action=display;threadid=$mnum\">$msub</a></td>
 <td class=\"windowbg2\" valign=\"bottom\" colspan=\"2\">
  $mname</td>
 <td class=\"windowbg2\" valign=\"bottom\" width=\"14%\">
  $views
 </td>
</tr>";

*note - this above code is from my own announcement mod which is board specific.


As long as you don't have bunches of announcements it shouldn't degrade performance too much, if at all. There are several things that could be added to, this is just a bare bones outlook. :) Any more explanation and I just might as well write it. ;)
« Last Edit: April 07, 2003, 05:33:03 PM by old dan » Logged

People who drink lite beer don't like the taste of beer; they just like to pee a lot
Pages: [1] 2 Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Announcments in all boards! « 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.118 seconds with 20 queries.