[MODDB] Site Warning - 0.4.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Get Involved
User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

[MODDB] Site Warning - 0.4.0

Post by A_O_C »

Well, I picked up a book and started working on my own MOD for phpBB. So here it goes...



MOD Title: Site Warning MOD
MOD Description: This MOD adds an ACP-configurable site-wide warning to the top of your board. You can display differennt messages for guests and registered users.
MOD Version: 0.4.0

phpBB Version: 3.0.1
Styles: prosilver
Translations: English

MOD Format: MODX
MOD Download: site_warning_0-4-0.rar

Demo Board: http://www.itbasement.org
Demo Username: N/A
Demo Password: N/A

Feature List:
  • Show different warnings to guests and registered users
  • Choose different colors for each site warning
  • Allow site warning to link to page on your board (index.php, for example)
  • if SITE_LINK is left blank, no url parsing occurs (thanks Brf)
  • show current data in fields when clicking SITE WARNING in ACP
Credit goes to someone101 for the phpBB2 version of this MOD. I dont think I will be taking feature requests, but if anybody encounters any errors other than the ones posted above, please post them here. Also, please note, I work 50 - 60 hours a week, so bear with me if I dont get back to you right away. Thanks.

MOD History:
2008-06-15 version 0.1.0
  • initial release
2008-06-16 version 0.2.0
  • fix: no url parsing if SITE_LINK and/or SITE_LINK_GUEST are left blank
2008-06-16 version 0.3.0
  • MODX 1.2.0 compliant
  • fix: current data in DB shows when navigating to ACP > SITE WARNING
  • rewrite: adm/style/site_warning_config.html
  • rewrite: includes/acp/acp_site_warning.php
  • added variables: language/en/mods/info_site_warning.php
2008-06-16 version 0.4.0
  • replaced corrupted file
Last edited by A_O_C on Mon Jun 23, 2008 2:06 pm, edited 6 times in total.

User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: [ALPHA] Site Warning

Post by A_O_C »

subsliver2 instructions:



OPEN:

Code: Select all

styles/subsilver2/template/overall_header.html
FIND:

Code: Select all

<a name="top"></a>
AFTER, ADD:

Code: Select all

		<!-- IF S_USER_LOGGED_IN -->
			<div id="header_error" style="position:absolute;font-family:arial,sans-serif;background:{SITE_COLOR};color:white;font-size:12px;top:0;left:0;"><!-- IF SITE_LINK --><a href="{SITE_LINK}" style="color:white"><!-- ENDIF -->&nbsp;{SITE_WARNING}&nbsp;</a></div>
		<!-- ELSE -->
			<div id="header_error" style="position:absolute;font-family:arial,sans-serif;background:{SITE_COLOR_GUEST};color:white;font-size:12px;top:0;left:0;"><!-- IF SITE_LINK_GUEST --><a href="{SITE_LINK_GUEST}" style="color:white"><!-- ENDIF -->&nbsp;{SITE_WARNING_GUEST}&nbsp;</a></div>
		<!-- ENDIF -->
Last edited by A_O_C on Thu Jul 17, 2008 2:59 am, edited 1 time in total.

User avatar
^[GS]^
Registered User
Posts: 274
Joined: Sun Aug 06, 2006 10:59 pm
Location: Argentina
Contact:

Re: [ALPHA] Site Warning

Post by ^[GS]^ »

good ^^

User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: [ALPHA] Site Warning

Post by A_O_C »

version 0.2.0 released

to update from 0.1.0 to 0.2.0:
OPEN:

Code: Select all

styles/prosilver/template/overall_header.html
FIND:

Code: Select all

		<!-- IF S_USER_LOGGED_IN -->
			<div id="header_error" style="position:absolute;font-family:arial,sans-serif;background:{SITE_COLOR};color:white;font-size:12px;top:0;left:0;"><a href={SITE_LINK} style="color:white">&nbsp;{SITE_WARNING}&nbsp;</a></div>
		<!-- ELSE -->
			<div id="header_error" style="position:absolute;font-family:arial,sans-serif;background:{SITE_COLOR_GUEST};color:white;font-size:12px;top:0;left:0;"><a href={SITE_LINK_GUEST} style="color:white">&nbsp;{SITE_WARNING_GUEST}&nbsp;</a></div>
		<!-- ENDIF -->
REPLACE WITH:

Code: Select all

		<!-- IF S_USER_LOGGED_IN -->
			<div id="header_error" style="position:absolute;font-family:arial,sans-serif;background:{SITE_COLOR};color:white;font-size:12px;top:0;left:0;"><!-- IF SITE_LINK --><a href="{SITE_LINK}" style="color:white"><!-- ENDIF -->&nbsp;{SITE_WARNING}&nbsp;</a></div>
		<!-- ELSE -->
			<div id="header_error" style="position:absolute;font-family:arial,sans-serif;background:{SITE_COLOR_GUEST};color:white;font-size:12px;top:0;left:0;"><!-- IF SITE_LINK_GUEST --><a href="{SITE_LINK_GUEST}" style="color:white"><!-- ENDIF -->&nbsp;{SITE_WARNING_GUEST}&nbsp;</a></div>
		<!-- ENDIF -->

User avatar
darkonia
Registered User
Posts: 1901
Joined: Tue May 13, 2008 1:10 pm
Location: Munich, Germany
Contact:

Re: [ALPHA] Site Warning

Post by darkonia »

is it the same like the anouncement center?
MMOG-Heaven - Das Gaming Portal
Community bedeutet Gleichgesinnte finden - MMOG-Heaven ist Deine Community! Von Spielern für Spieler bietet Dir dieses Portal genau das, was ein Spieler braucht. Bleibe ständig informiert, finde die neuesten MMORPGs, oder suche die frischesten News aus der Welt des Online Gamings - dieses und vieles mehr erwartet Dich auf MMOG-Heaven.

User avatar
alecrust
Registered User
Posts: 348
Joined: Thu Mar 27, 2008 11:24 am
Location: London, UK
Contact:

Re: [ALPHA] Site Warning

Post by alecrust »

Right. Thanks for this MOD it works great. Couple things though:

- I'd quite like a "Settings have been saved" message after I press submit in the ACP.
- In the ACP it doesn't show the current setting of the site warning. The fields are always blank.
- It should be more obvious how to specify the colours. Just a little "e.g. #CCCCCC" would do.

Apart from that a great MOD :)

User avatar
alecrust
Registered User
Posts: 348
Joined: Thu Mar 27, 2008 11:24 am
Location: London, UK
Contact:

Re: [ALPHA] Site Warning

Post by alecrust »

Actually I couldn't help but make a few changes of my own which I'll share with you and I hope you implement them:

To overall_header.html:

Code: Select all

<!-- IF S_USER_LOGGED_IN -->
  	<div id="header_error" style="position:absolute;top:0;left:0;background:{SITE_COLOR};color:#fff;padding:3px;"><!-- IF SITE_LINK --><a href="{SITE_LINK}" title="{SITE_WARNING}" style="color:#fff;"><!-- ENDIF -->{SITE_WARNING}</a></div>
  <!-- ELSE -->
  	<div id="header_error" style="position:absolute;top:0;left:0;background:{SITE_COLOR_GUEST};color:#fff;padding:3px;"><!-- IF SITE_LINK_GUEST --><a href="{SITE_LINK_GUEST}" title="{SITE_WARNING_GUEST}" style="color:#fff;"><!-- ENDIF -->{SITE_WARNING_GUEST}</a></div>
  <!-- ENDIF -->

User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: [ALPHA] Site Warning

Post by A_O_C »

darkonia wrote:is it the same like the anouncement center?
yes - and no. the announcement center adds a "forum like area spanning the whole width of the board. this adds a bar at the top left. see the demo board. ;)
alecrust wrote:- I'd quite like a "Settings have been saved" message after I press submit in the ACP.
- In the ACP it doesn't show the current setting of the site warning. The fields are always blank.
- It should be more obvious how to specify the colours. Just a little "e.g. #CCCCCC" would do.
1. ill look into that
2. you missed this part in the announcement:
A_O_C wrote:TO DO LIST:
  • show current data in fields when clicking SITE WARNING in ACP
3. ill add that to the language files
alecrust wrote:Actually I couldn't help but make a few changes of my own which I'll share with you and I hope you implement them:

To overall_header.html:

Code: Select all

<!-- IF S_USER_LOGGED_IN -->
<div id="header_error" style="position:absolute;top:0;left:0;background:{SITE_COLOR};color:#fff;padding:3px;"><!-- IF SITE_LINK --><a href="{SITE_LINK}" title="{SITE_LINK}" style="color:#fff;"><!-- ENDIF -->{SITE_WARNING}</a></div>
<!-- ELSE -->
<div id="header_error" style="position:absolute;top:0;left:0;background:{SITE_COLOR_GUEST};color:#fff;padding:3px;"><!-- IF SITE_LINK_GUEST --><a href="{SITE_LINK_GUEST}" title="{SITE_LINK_GUEST}" style="color:#fff;"><!-- ENDIF -->{SITE_WARNING_GUEST}</a></div>
<!-- ENDIF -->
the only change i see here is the color or the text and the replacement of font-size:12px;top:0;left:0; with padding:3px;

i made the font color white because its easily read against almost any background color (except white, of course).

User avatar
alecrust
Registered User
Posts: 348
Joined: Thu Mar 27, 2008 11:24 am
Location: London, UK
Contact:

Re: [ALPHA] Site Warning

Post by alecrust »

I have made more improvements here. If you cannot see the vast changes please compare them side-by-side:

Code: Select all

<!-- IF S_USER_LOGGED_IN -->
  	<!-- IF SITE_LINK --><div id="header_error" style="position:absolute;top:0;left:0;background:{SITE_COLOR};color:#fff;padding:3px;"><a href="{SITE_LINK}" title="{SITE_WARNING}" style="color:#fff;">{SITE_WARNING}</a></div><!-- ENDIF -->
  <!-- ELSE -->
  	<!-- IF SITE_LINK_GUEST --><div id="header_error" style="position:absolute;top:0;left:0;background:{SITE_COLOR_GUEST};color:#fff;padding:3px;"><a href="{SITE_LINK_GUEST}" title="{SITE_WARNING_GUEST}" style="color:#fff;">{SITE_WARNING_GUEST}</a></div><!-- ENDIF -->
  <!-- ENDIF -->
Among other things, it did not pass W3C Validation which I have fixed. I also removed forcing the font-family to be Arial, I believe it should be the same as the rest of the site.

User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: [ALPHA] Site Warning

Post by A_O_C »

alecrust wrote:I have made more improvements here. If you cannot see the vast changes please compare them side-by-side:

Code: Select all

<!-- IF S_USER_LOGGED_IN -->
  	<!-- IF SITE_LINK --><div id="header_error" style="position:absolute;top:0;left:0;background:{SITE_COLOR};color:#fff;padding:3px;"><a href="{SITE_LINK}" title="{SITE_WARNING}" style="color:#fff;">{SITE_WARNING}</a></div><!-- ENDIF -->
  <!-- ELSE -->
  	<!-- IF SITE_LINK_GUEST --><div id="header_error" style="position:absolute;top:0;left:0;background:{SITE_COLOR_GUEST};color:#fff;padding:3px;"><a href="{SITE_LINK_GUEST}" title="{SITE_WARNING_GUEST}" style="color:#fff;">{SITE_WARNING_GUEST}</a></div><!-- ENDIF -->
  <!-- ENDIF -->
Among other things, it did not pass W3C Validation which I have fixed. I also removed forcing the font-family to be Arial, I believe it should be the same as the rest of the site.
that code doesnt work for me... :?

anyway, i will have an update in then next couple of hours.

User avatar
parasolx
Registered User
Posts: 146
Joined: Wed Apr 23, 2008 8:52 am
Location: Malaysia
Name: Hadafi

Re: [ALPHA] Site Warning

Post by parasolx »

Great mod... but here can i give some opinion to this mod. Why don't you make the warning message being fixed at the top of the side. Here is the example code i give:

at the:
style="position: absolute; left: 0px; top: 0px;..."

changed with:
style="position: fixed; left: 0px; top: 0px; ..."

this will make the warning message have a static position at the top whatever the user is scrolling the page...

Thanks... please send any comment and feedback to me..

User avatar
alecrust
Registered User
Posts: 348
Joined: Thu Mar 27, 2008 11:24 am
Location: London, UK
Contact:

Re: [ALPHA] Site Warning

Post by alecrust »

How do you mean it doesn't work? In what way does it not work?

I strongly suggest you implement my changes. I do know what I'm talking about you know :)

User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: [ALPHA] Site Warning

Post by A_O_C »

alecrust wrote:I strongly suggest you implement my changes. I do know what I'm talking about you know :)
never said you didnt ;)
alecrust wrote:How do you mean it doesn't work? In what way does it not work?
the warning doesnt show up on my board. even made sure i refreshed the templates and purged the cache.

User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: [ALPHA] Site Warning

Post by A_O_C »

parasolx wrote:at the:
style="position: absolute; left: 0px; top: 0px;..."

changed with:
style="position: fixed; left: 0px; top: 0px; ..."

this will make the warning message have a static position at the top whatever the user is scrolling the page
i thought about this. as an admin, i dont want to annoy potential users (or my currents ones, for that matter), by having the warning message scroll with them. i will test out this bit of code, and add it as an optional add-on if people are interested.

User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: [ALPHA] Site Warning

Post by A_O_C »

version 0.3.0 released

to update from 0.2.0 to 0.3.0:
COPY:

Code: Select all

root\adm\style\site_warning_config.html
to

Code: Select all

adm\style\site_warning_config.html


COPY:

Code: Select all

root\includes\acp\acp_site_warning.php
to

Code: Select all

includes\acp\acp_site_warning.php


COPY:

Code: Select all

root\language\en\mods\info_site_warning.php
to

Code: Select all

language\en\mods\info_site_warning.php


unless there are any other issues, this will be the one submitted to the DB in about a week.

Locked

Return to “[3.0.x] MODs in Development”