Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Code Requests
  • Completed Requests
  • [Completed] [ZB] Announcement System
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
  • Pages:
  • 1
  • 2
[Completed] [ZB] Announcement System
Tweet Topic Started: Oct 25 2009, 08:39 PM (807 Views)
RedBldSandman Oct 26 2009, 04:22 PM Post #11
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
Would this Announcement Updater have to be compatible with IE? The way IE does everything is totally mucking up the RegExps!
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
Reid Oct 26 2009, 06:24 PM Post #12
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
RedBldSandman
Oct 26 2009, 04:22 PM
Would this Announcement Updater have to be compatible with IE? The way IE does everything is totally mucking up the RegExps!
Yes. Although, I'm not sure that IE will muck up regexps - I have a feeling it would be something else.
The Resource Board
Offline Profile Goto Top
 
RedBldSandman Oct 26 2009, 10:39 PM Post #13
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
Reid
Oct 26 2009, 06:24 PM
RedBldSandman
Oct 26 2009, 04:22 PM
Would this Announcement Updater have to be compatible with IE? The way IE does everything is totally mucking up the RegExps!
Yes. Although, I'm not sure that IE will muck up regexps - I have a feeling it would be something else.
It's the way in which it does IDs, classes etc. which are causing the problem. IE doesn't surround them in quotes, so, for example, it's
Code:
 
<div id=Announcement>...</div>
When you grab its HTML instead of
Code:
 
<div id="Announcement">...</div>
It even changes the order of the attributes, so
Code:
 
<a href="http://zbcode.com" title="ZBCode">
could become
Code:
 
<a title=ZBCode href=http://zbcode.com>
Both of which are really annoying when doing Regular Expressions to match the exact html xD



I'm just gonna match it all a different way now, should be much simpler too :D
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
RedBldSandman Oct 27 2009, 01:29 PM Post #14
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
Finished it, the way I've done it is much simpler now :P

Add in this piece of code anywhere in your Board Template:
Code:
 
<script type="text/javascript">
var admin_id = "ADMIN_MEMBER_ID"
</script><script type="text/javascript" src="http://z3.ifrm.com/344/71/0/f454011/AnnoucementUpdaterV7.js">
/*
*** Announcement System by RedBldSandman of ZBCode.com
*** May be edited and redistributed freely
*** Just please keep this Copyright intact
*/
</script>
Just change the variable admin_id to the member id of the admin you wish to be able to use the updater.

Then, put this in to the Above the Board part of the Board template:
Code:
 
<div id="Announcement" style="display:none;"></div><div id="Announcement_End" style="display:none;"></div>
The Announcement will be put in to the div#Announcement automatically using the updater. Do not edit this little bit of code, or the whole thing will muck up :P

You can style the #Announcement box in the CSS like so:
Code:
 
#Announcement {
width:100%%;
text-align:center;
margin:5px 0;
padding:5px;
}
To make it look however you wish :D Then just the 'Update Announcement' link which should appear on the chosen Admin's Submenu! Absolutely anything can go inside, I've tried to leave it as customisable as possible by not restricting its layout so go wild! Any problems or changes, just let me know :D
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
Reid Oct 27 2009, 03:20 PM Post #15
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
Ah, that won't work on boards with custom domains thanks to the fact that the admin CP resolves as a zetaboards.com domain.. but oh well.

But jeez, you went all out on this code. I just wanted a simple announcement system, not something super huge and complex. xD

Thanks though. :)
The Resource Board
Offline Profile Goto Top
 
RedBldSandman Oct 27 2009, 03:36 PM Post #16
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
No problem, I felt like making a proper announcement system instead of a tiny thing :P

I can adapt it for custom domains if you like, it would just involve one more variable needing to be set in the starting bit :D
Edited by RedBldSandman, Oct 27 2009, 03:41 PM.
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
Reid Oct 27 2009, 03:45 PM Post #17
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
Nah that's cool. If I ever feel the need to use a custom domain I'll just write the script myself. Haha.

Thanks again. :)
The Resource Board
Offline Profile Goto Top
 
RedBldSandman Oct 27 2009, 03:51 PM Post #18
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
True :P No problem, it was fun filling a request like this as my first Coding Staff request :D

You're welcome.
See? We can read thoughts too. ;)

Your request has been completed, and we're moving it to the correct forum. We hope it works for you; if it doesn't, feel free to post another request topic in the requests forum. Just remember: read the rules first!

Thanks,
The ZBCode Staff
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Completed Requests · Next Topic »
Locked Topic
  • Pages:
  • 1
  • 2

Track Topic · E-mail Topic Time: 2:27 PM Jul 11
Hosted for free by ZetaBoards · Privacy Policy