ACP Site Announcement Centre v1.2.3

my MODS validated or going for validation at phpbb.com. Please note that support has ended for phpbb2 mods
MODs die schon überprüft wurden oder eingereichte MODs zur Überprüfung auf phpbb.com. Support für phpbb2 mods wurde eingestellt.

Postby lefty » Thu May 03, 2007 5:26 pm

great job wheelguy!!  :thumbsup:

do you actually use these switches in your html?
Code: Select all
// who sees the announcements
if ( $announcement_centre_config['announcement_status'] == ANNOUNCEMENTS_LEFTY74_SHOW_YES )
{
if( $announcement_centre_config['announcement_access'] == ANNOUNCEMENTS_LEFTY74_SHOW_ADM && $userdata['user_level'] == ADMIN )
{
  $template->assign_block_vars('announcement_displayed', array());
}
else if ( $announcement_centre_config['announcement_access'] == ANNOUNCEMENTS_LEFTY74_SHOW_MOD && ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) )
{
  $template->assign_block_vars('announcement_displayed', array());
}
else if ( $announcement_centre_config['announcement_access'] == ANNOUNCEMENTS_LEFTY74_SHOW_REG && $userdata['session_logged_in'] )
{
  $template->assign_block_vars('announcement_displayed', array());
}
else if ( $announcement_centre_config['announcement_access'] == ANNOUNCEMENTS_LEFTY74_SHOW_ALL )
{
  $template->assign_block_vars('announcement_displayed', array());
}
else if (  $announcement_centre_config['announcement_guest_status'] == ANNOUNCEMENTS_LEFTY74_GUEST_YES && !$userdata['session_logged_in'] && !$announcement_centre_config['announcement_access'] == ANNOUNCEMENTS_LEFTY74_SHOW_ALL )
{
  $template->assign_block_vars('guest_announcement_displayed', array());
}
}
else
{
$template->assign_block_vars('announcement_not_displayed', array());
}
//END ACP Site Announcement Centre by lefty74
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Postby WheelGuy » Thu May 03, 2007 5:34 pm

:birthdayparty:   Nope, no switches had to be done. Just change the file extension to .php instead of .htm or .html .
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby lefty » Sat May 05, 2007 10:01 am

Since you do not use switches, you might want to include the announcement text in the if clauses as if I see it correctly at the moment you get the text on the main page regardless whether you set it to admin or mod only etc.

Just a thought, great you got it to work though.
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Post time on announcements

Postby lefty » Sat May 05, 2007 1:05 pm

I was asked whether it would be possible to show the post time when posts are selected for the announcements. Since there might be more who could be interested in this you can try the following:


Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT p.post_id,
#
#-----[ INLINE FIND ]------------------------------------------
#
p.post_id,
#
#-----[ INLINE AFTER, ADD ]------------------------------------------
#
p.post_time,
#
#-----[ FIND ]------------------------------------------
#
         if ($row = $db->sql_fetchrow($result))
         {
            
            $row['post_text']   = smilies_pass($row['post_text']);
            $row['post_text']   = bbencode_first_pass( $row['post_text'], $row['bbcode_uid'] );
            $row['post_text']   = bbencode_second_pass ( $row['post_text'], $row['bbcode_uid'] );
            $row['post_text']   = str_replace("\n", "\n<br />\n", $row['post_text']);
            $announcement_text = $row['post_text'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
         if ( $row['post_time'] )
         {
         $announcement_date = $lang['Posted'] . ': ' . create_date('D M d, Y g:i a', $row['post_time'], $board_config['board_timezone']) . '</br></br>' ;
         }
         else
         {
         $announcement_date = '';
         }

#
#-----[ FIND ]------------------------------------------
#
   'GUEST_ANNOUNCEMENTS_LEFTY74' => $announcement_guest_text,
#
#-----[ AFTER, ADD ]------------------------------------------
#
   'ANNOUNCEMENT_DATE' => $announcement_date,
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN announcement_displayed -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
  <tr>
     <th class="thCornerL" height="25" nowrap="nowrap">&nbsp;{L_ANNOUNCEMENT}&nbsp;</th>
  </tr>
  <tr>
     <td class="row1" width="100%"><span class="gen"><p align="center">{SITE_ANNOUNCEMENTS_LEFTY74}</p></span></td>
  </tr>
</table><br />
<!-- END announcement_displayed -->
#
#-----[ REPLACE WITH ]------------------------------------------
#
<!-- BEGIN announcement_displayed -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
  <tr>
     <th class="thCornerL" height="25" nowrap="nowrap">&nbsp;{L_ANNOUNCEMENT}&nbsp;</th>
  </tr>
  <tr>
     <td class="row1" width="100%"><span class="gen"><p align="center"><span class="gensmall">{ANNOUNCEMENT_DATE}</span>{SITE_ANNOUNCEMENTS_LEFTY74}</p></span></td>
  </tr>
</table><br />
<!-- END announcement_displayed -->
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Post time on announcements

Postby wads24 » Sun May 06, 2007 1:54 am

thanks lefty, that works great!!!  i used easymod, and had to make a few changes, so if anyone wants the above code that is easymod friendly...

Code: Select all
##############################################################
## MOD Title: ACP Site Announcement Centre - ADD ON - ADD DATE TO POST
## MOD Author: lefty74 < lefty@lefty74.com > (Heiko Carstens) http://www.lefty74.com
## MOD Description: ADDS DATE TO ANNOUNCEMENT
## MOD Version: 1.2.0
##
## Installation Level: Easy
## Installation Time: 14 minutes
## Files To Edit: index.php
##   templates/subSilver/index_body.tpl
##   
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
            $sql = "SELECT p.post_id, p.forum_id, p.topic_id, pt.*
#
#-----[ IN-LINE FIND ]------------------------------------------
#
p.post_id,  
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
p.post_time,
#
#-----[ FIND ]------------------------------------------
#
         if ($row = $db->sql_fetchrow($result))
         {
            
            $row['post_text']   = smilies_pass($row['post_text']);
            $row['post_text']   = bbencode_first_pass( $row['post_text'], $row['bbcode_uid'] );
            $row['post_text']   = bbencode_second_pass ( $row['post_text'], $row['bbcode_uid'] );
            $row['post_text']   = str_replace("\n", "\n<br />\n", $row['post_text']);
            $announcement_text = $row['post_text'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
        if ( $row['post_time'] )
        {
        $announcement_date = $lang['Posted'] . ': ' . create_date('D M d, Y g:i a', $row['post_time'], $board_config['board_timezone']) . '</br></br>' ;
        }
        else
        {
        $announcement_date = '';
        }

#
#-----[ FIND ]------------------------------------------
#
   'GUEST_ANNOUNCEMENTS_LEFTY74' => $announcement_guest_text,
#
#-----[ AFTER, ADD ]------------------------------------------
#
   'ANNOUNCEMENT_DATE' => $announcement_date,
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN announcement_displayed -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
  <tr>
     <th class="thCornerL" height="25" nowrap="nowrap">&nbsp;{L_ANNOUNCEMENT}&nbsp;</th>
  </tr>
  <tr>
     <td class="row1" width="100%"><span class="gen"><p align="center">{SITE_ANNOUNCEMENTS_LEFTY74}</p></span></td>
  </tr>
</table><br />
<!-- END announcement_displayed -->
#
#-----[ REPLACE WITH ]------------------------------------------
#
<!-- BEGIN announcement_displayed -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
  <tr>
     <th class="thCornerL" height="25" nowrap="nowrap">&nbsp;{L_ANNOUNCEMENT}&nbsp;</th>
  </tr>
  <tr>
     <td class="row1" width="100%"><span class="gen"><p align="center"><span class="gensmall">{ANNOUNCEMENT_DATE}</span>{SITE_ANNOUNCEMENTS_LEFTY74}</p></span></td>
  </tr>
</table><br />
<!-- END announcement_displayed -->

#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
wads24
Newbie/Neuling
 
Posts: 4
Joined: Sun May 06, 2007 1:36 am

Postby lefty » Sun May 06, 2007 2:13 am

Thanks for making it easymod friendly  :thumbsup:

and I am glad this is what you were after. :)
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Postby wads24 » Sun May 06, 2007 2:24 am

lefty wrote:Thanks for making it easymod friendly  :thumbsup:

and I am glad this is what you were after. :)


thanks for the mod... i appreciate it...
wads24
Newbie/Neuling
 
Posts: 4
Joined: Sun May 06, 2007 1:36 am

Postby lefty » Mon May 07, 2007 9:41 pm

Updated to version 1.2.1

Code: Select all
##
## 2007-05-07 - Version 1.2.1
##      - Bug fixes (forgot two closing tags) in announcement_centre_config_body.tpl
##         added two fields so the Announcement Block Titles can be customised

lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Postby WheelGuy » Mon May 21, 2007 4:56 am

Please don't shoot me just yet lefty.. lol ...

I know you just made a bug fix in the current version, but I'm curious. Have you or are you planning to "remake" this mod for the finally released phpBB3 RC1?
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby lefty » Mon May 21, 2007 11:33 am

Please don't shoot me just yet lefty.. lol ...

I know you just made a bug fix in the current version, but I'm curious. Have you or are you planning to "remake" this mod for the finally released phpBB3 RC1?

Hi,
I have to admit I have only looked briefly at the code for phpBB3 and got seriously confused so I am not even sure I am capable of porting this mod to phpbb3.

If I do get familiar enough with the code I will certainly look into it though if there is enough interest but currently I am lacking the time and the courage  :scared3: to familiarise myself with phpbb3 at the moment.
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Postby WheelGuy » Mon May 21, 2007 1:26 pm

lefty wrote:Hi,
I have to admit I have only looked briefly at the code for phpBB3 and got seriously confused so I am not even sure I am capable of porting this mod to phpbb3.

If I do get familiar enough with the code I will certainly look into it though if there is enough interest but currently I am lacking the time and the courage  :scared3: to familiarise myself with phpbb3 at the moment.


lol .... I know what you mean. The coding is quite different. Even just creating a style is wild.
Speaking for myself and the other admins at my forum, we like your mod. Even though I'm not "php savvy", I will be glad to do what I can.
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby lefty » Mon May 21, 2007 9:54 pm

:thanx: for the offer, I might get back to you on that one :)
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Postby CrashDaddy » Sat Jun 02, 2007 1:15 pm

Hi Lefty!  I registered here to tell you about this trouble I was having getting your too-good-to-be-true mod to work, when at the last minute I asked myself if I had really install it the way you said, or did I change one tiny thing.  

...turned out I had changed two 'tiny things'... :fluester:

It works great. Thank you! Image
Are pix allowed on sigs?
Image
CrashDaddy
Newbie/Neuling
 
Posts: 1
Joined: Sat Jun 02, 2007 12:37 pm
Location: Joplin

Postby lefty » Sat Jun 02, 2007 1:45 pm

that's great  :thumbsup:

I am glad you like it  :happysmerk:
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Postby RussKaos » Mon Jun 04, 2007 11:44 pm

Hi Lefty,

Firstly, I'd like to say thanks for making a great Mod like this. I've been using it for quite a few months now and it's great for making my users aware of stuff.

Ok I've recently had to setup my forum again after my registration page broke so I started a fresh (kept my old database etc so didn't lose much just means I have to redo the Mods).

Today I reinstalled your Mod and I noticed it was different to the older version I was running (thought I had the newest ;)) anyway I've got the Mod working great BUT the smilies no longer seem to work. They worked fine back in the old version but for some reason they arent showing up.

I assume its path related?

I wondered if anyone else was having this problem and how to maybe go about fixing it. I'm guessing it's probably something I've done wrong but I've checked back through the changes and can't see anything wrong.

Thanks for any help anyone can give to me.

Regards

Russ
Attachments
announce.JPG
screenshot from the admin panel
RussKaos
Newbie/Neuling
 
Posts: 3
Joined: Mon Jun 04, 2007 11:27 pm
Location: UK, Brighton

Postby RussKaos » Tue Jun 05, 2007 12:23 am

Hi Lefty,

Thanks for such a quick reply.

The exact line that I use is below.

Code: Select all
$repl[] = '<img src="'. $path . $board_config['smilies_path'] . '/' . $smilies[$i]['smile_url'] . '" alt="' . $smilies[$i]['emoticon'] . '" border="0" />';


Does that look right? This was the part I kept examining but couldn't find anything wrong with it.
RussKaos
Newbie/Neuling
 
Posts: 3
Joined: Mon Jun 04, 2007 11:27 pm
Location: UK, Brighton

Postby lefty » Tue Jun 05, 2007 12:25 am

sorry, realised i was looking at the wrong code and deleted it. didnt realise though that you were already replying... sorry.

Can you try to reupload the admin/admin_announcement_centre.php please.
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Postby RussKaos » Tue Jun 05, 2007 12:29 am

lefty wrote:sorry, realised i was looking at the wrong code and deleted it. didnt realise though that you were already replying... sorry.

Can you try to reupload the admin/admin_announcement_centre.php please.


Done...overwrote the copy that was already there and still got the same problem. :(
RussKaos
Newbie/Neuling
 
Posts: 3
Joined: Mon Jun 04, 2007 11:27 pm
Location: UK, Brighton

Postby lefty » Tue Jun 05, 2007 12:33 am

RussKaos wrote:
lefty wrote:sorry, realised i was looking at the wrong code and deleted it. didnt realise though that you were already replying... sorry.

Can you try to reupload the admin/admin_announcement_centre.php please.


Done...overwrote the copy that was already there and still got the same problem. :(


Hmm, the only time I had a similar problem was when I edited the following line in admin/admin_announcement_centre.php

Code: Select all
               'SMILEY_IMG' => '../' . $board_config['smilies_path'] . '/' . $smile_url,


This should normally work as is unless your admin folder is not one folder down the root folder....
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Postby lefty » Tue Jun 05, 2007 12:47 am

I am assuming the smilies work fine when writing a post?
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Postby holass » Wed Jun 13, 2007 12:05 am

I install this mod but in my index.php page there is this error

Code: Select all
Fatal error: Cannot redeclare load_bbcode_template() (previously declared in /home/grrdvoc/public_html/foro/includes/bbcode.php:45) in /home/grrdvoc/public_html/foro/includes/bbcode.php on line 43


I need help please.
holass
Newbie/Neuling
 
Posts: 4
Joined: Wed Jun 13, 2007 12:03 am

Postby lefty » Wed Jun 13, 2007 12:20 am

holass wrote:I install this mod but in my index.php page there is this error

Code: Select all
Fatal error: Cannot redeclare load_bbcode_template() (previously declared in /home/grrdvoc/public_html/foro/includes/bbcode.php:45) in /home/grrdvoc/public_html/foro/includes/bbcode.php on line 43


I need help please.

you probably have a mod installed that calls includes/bbcode.php already in the index.php page. remove the second one of the two.
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Postby holass » Wed Jun 13, 2007 12:36 am

Thank you very much. The problem is that there are two sentences in the index.php

include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);

Only I have delete one of them. Thank you very much.
Last edited by holass on Wed Jun 13, 2007 9:05 am, edited 1 time in total.
holass
Newbie/Neuling
 
Posts: 4
Joined: Wed Jun 13, 2007 12:03 am

Postby holass » Wed Jun 13, 2007 12:46 am

There are another error. When I pick in the Preview there is a error

Code: Select all
Warning: Cannot modify header information - headers already sent by (output started at /home/grrdvoc/public_html/foro/includes/template.php(127) : eval()'d code:1) in /home/grrdvoc/public_html/foro/includes/functions.php on line 842


Any suggestion?
holass
Newbie/Neuling
 
Posts: 4
Joined: Wed Jun 13, 2007 12:03 am

Postby lefty » Wed Jun 13, 2007 11:58 pm

holass wrote:There are another error. When I pick in the Preview there is a error

Code: Select all
Warning: Cannot modify header information - headers already sent by (output started at /home/grrdvoc/public_html/foro/includes/template.php(127) : eval()'d code:1) in /home/grrdvoc/public_html/foro/includes/functions.php on line 842


Any suggestion?

hi, you probably have all your css data in teh admin/page_header.php. I would recommend uploading the admin_announcement_centre.php in the contribution folder.
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

PreviousNext

Return to my MODS & support

Who is online

Users browsing this forum: No registered users and 1 guest

cron