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 WheelGuy » Thu Apr 19, 2007 7:39 am

:goodideasign: I would like to have the announcements to "scroll" instead of having such a large box when several lines. I looked at the 'old' News Block Mod, that I was using, but I couldn't figure out how that one did it.
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby lefty » Thu Apr 19, 2007 11:07 am

WheelGuy, thanks for helping out.

I would like to have the announcements to "scroll" instead of having such a large box when several lines


The easiest way of accomplishing that would be to add a bbcode mod to your forum that does the scrolling. I have seen that used at another forum and it worked together with the announcement centre mod.

:fluester:
Would you mind upload an avatar guys :thumbsup:
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 Apr 19, 2007 2:12 pm

lefty wrote:WheelGuy, thanks for helping out.

The easiest way of accomplishing that would be to add a bbcode mod to your forum that does the scrolling. I have seen that used at another forum and it worked together with the announcement centre mod.
:fluester:

No problem. If I can share what little I know.  Do you what the 'particular' mod that was used?

lefty wrote:Would you mind upload an avatar guys :thumbsup:


:tongeout: You happy now?  :cheer:
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby lefty » Thu Apr 19, 2007 6:00 pm

Do you what the 'particular' mod that was used?

I am not sure I think it was part of the Advanced BBcode box or whatever it is called. There is a scrolling bbcode mod on phpbbhacks somewhere though...

If I come across it again I will let you know.

You happy now?

Very ! Thanks very much :worship:
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 cwxtra » Thu Apr 19, 2007 7:14 pm

Thanks wheelguy...that was an easy change  :thumbsup:

Lefty....  :fluester: I will try to get a pic of myself posted as soon as I can.

I just want to say (again) That this MOD is perfect for what I need. My forum is for a local sports park that has 3 different leagues playing there. Each league has it's own executive that make decisions about if games will be cancelled due to bad weather. All i had to do was create one forum about the field conditions...then locked it to moderators posting only...and now just need to assign special privs to those people. I set this mod to display the last post of that forum...Once they post that a game will be cancelled it will appear in the announcement. HOW EASY WAS THAT  :cheer:  :goodideasign:  :cheer:

cwxtra
cwxtra
Newbie/Neuling
 
Posts: 6
Joined: Thu Apr 19, 2007 5:57 am

Postby cwxtra » Thu Apr 19, 2007 7:20 pm

3000 pics on my computer and not one of me :rotfl2: ....I will get a pic of me for an avatar as soon as I can
cwxtra
Newbie/Neuling
 
Posts: 6
Joined: Thu Apr 19, 2007 5:57 am

Postby lefty » Thu Apr 19, 2007 8:09 pm

hey cwxtra,

thanks, glad it is useful. must admit, didnt think i would use that last feature myself as much as i am doing it...

have to thank noworyz over at phpmodders for the suggestion :)

3000 pics on my computer and not one of me lol ....I will get a pic of me for an avatar as soon as I can


thanks  :thumbsup:
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 cwxtra » Fri Apr 20, 2007 10:47 pm

OK....next question...
How can i get the announcement to appear on my main page (outside of phpBB)? I would think that I just have to link a text box. But where would I link it to?

Cheers
cwxtra
Newbie/Neuling
 
Posts: 6
Joined: Thu Apr 19, 2007 5:57 am

Postby WheelGuy » Sat Apr 21, 2007 4:35 am

cwxtra wrote:OK....next question...
How can i get the announcement to appear on my main page (outside of phpBB)? I would think that I just have to link a text box. But where would I link it to?
Cheers


I am wanting to do the same thing. I may be going about it all wrong, but I believe that it would require a seperate php file outside of the forum. I have gotten as far as connecting to my database, but can't seem to extract and/or display the info.
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby lefty » Sat Apr 21, 2007 11:39 pm

There is a mod that already does that I think. When i find it I can link it here and you can see whether this will help you figure it out.

I was not going to inlcude any of this in my mod at this stage though as I am not quite sure how right now ... but I am also pretty sure it would require a new php file...
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 Apr 23, 2007 4:49 pm

lefty wrote:
I would like to have the announcements to "scroll" instead of having such a large box when several lines

The easiest way of accomplishing that would be to add a bbcode mod to your forum that does the scrolling. I have seen that used at another forum and it worked together with the announcement centre mod.


Just a "note"... after finally deciding to look and test, I got the scroll working without bbcode by the following changes:
Code: Select all
<!-- 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 -->
<!-- BEGIN guest_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">{GUEST_ANNOUNCEMENTS_LEFTY74}</p></span></td>
  </tr>
</table><br />
<!-- END guest_announcement_displayed -->

Changed to :
Code: Select all
<!-- 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"><marquee align="middle" behavior="scroll" direction="up" height="30" scrolldelay="100" scrollamount="2" loop="true" onmouseover="this.stop()" onmouseout="this.start()">{SITE_ANNOUNCEMENTS_LEFTY74}</marquee></span></td>
  </tr>
</table><br />
<!-- END announcement_displayed -->
<!-- BEGIN guest_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"><marquee align="middle" behavior="scroll" direction="up" height="30" scrolldelay="100" scrollamount="2" loop="true" onmouseover="this.stop()" onmouseout="this.start()">{GUEST_ANNOUNCEMENTS_LEFTY74}</marquee></span></td>
  </tr>
</table><br />
<!-- END guest_announcement_displayed -->
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby lefty » Mon Apr 23, 2007 5:17 pm

nice work wheelguy  :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 WheelGuy » Mon Apr 23, 2007 8:41 pm

lefty wrote:nice work wheelguy  :happysmerk:


Bad part is, it was actually "staring me in the face" from a mod I replaced.  :oops:

Still working on displaying the announcements "outside" of the forum though...  :moody:  I'm just now starting to learn php, so it's sorta difficult. Not giving up just yet though.  :scared3:
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby sk1nf234k » Thu Apr 26, 2007 5:21 am

Hi, am trying to get this mod to work... but am facing a SQL error using easymod. Initially the whole .txt file was messed up without orders and I actually tidy the whole file up but at the 3rd stage, it shows the following:

Code: Select all
SQL PROCESSING ERROR:
No SQL alterations will be performed. However, you may skip SQL processing, continue installing the MOD, and deal with the SQL manually

The following error occured:

Error:
Unknown SQL command ";", statement: 1

SQL:


This is what I have in my install.txt

Code: Select all
#
#-----[ SQL ]------------------------------------------



CREATE TABLE `phpbb_announcement_centre` (
 `announcement_desc` varchar(255) NOT NULL default '',
 `announcement_value` text NOT NULL,
 PRIMARY KEY  (`announcement_desc`));
 

INSERT INTO phpbb_announcement_centre (announcement_desc, announcement_value) VALUES('announcement_text', '[size=18][color=red][b]Change your announcements via your admin panel.   :) [/b][/color][/size]');

INSERT INTO phpbb_announcement_centre (announcement_desc, announcement_value) VALUES('announcement_status', '1');

INSERT INTO phpbb_announcement_centre (announcement_desc, announcement_value) VALUES('announcement_access', '1');

INSERT INTO phpbb_announcement_centre (announcement_desc, announcement_value) VALUES('announcement_guest_text', '[size=18][color=blue][b]Change your guest announcements via your admin panel.   :) [/b][/color][/size]');

INSERT INTO phpbb_announcement_centre (announcement_desc, announcement_value) VALUES('announcement_guest_status', '1');
INSERT INTO phpbb_announcement_centre (announcement_desc, announcement_value) VALUES('announcement_text_draft', '[size=18][color=red][b]Preview in the ACP   :) [/b][/color][/size]');

INSERT INTO phpbb_announcement_centre (announcement_desc, announcement_value) VALUES('announcement_mod_version', 'v1.2.0');
INSERT INTO phpbb_announcement_centre (announcement_desc, announcement_value) VALUES('announcement_forum_id', '');

INSERT INTO phpbb_announcement_centre (announcement_desc, announcement_value) VALUES('announcement_topic_id', '');
INSERT INTO phpbb_announcement_centre (announcement_desc, announcement_value) VALUES('announcement_forum_topic_first_latest', '1');


This error I get when I click on announcement in ACP
Code: Select all
phpBB : Critical Error

Could not query announcement information in admin_announcement_centre

DEBUG MODE

SQL Error : 1146 Table 'cstrike_phpb1.ANNOUNCEMENTS_LEFTY74_TABLE' doesn't exist

SELECT * FROM ANNOUNCEMENTS_LEFTY74_TABLE

Line : 38
File : admin_announcement_centre.php



Could someone be kind enough to help me out on this issue? Btw I do not know how to insert/ create mysql stuffs. Many thanks in advance. Cheers
sk1nf234k
Newbie/Neuling
 
Posts: 1
Joined: Thu Apr 26, 2007 5:16 am

Postby lefty » Thu Apr 26, 2007 11:02 am

hi,  
Initially the whole .txt file was messed up without orders and I actually tidy the whole file up

in what way was it messed up? i have tested it numerous times with easymod without a problem, even on modded boards.

do you use phpbb_ as your database table prefix?

Anyway, to execute the sql instructions, go to phpmyadmin, go to the forum database, there should be an SQL button somewhere, click that, a textbox should appear, just paste the lines of code (with your prefix) in the textbox and press go. (that's the quick explanation, i am sure you find better ones on phpbb.com)

if you still have issues, hit me up on msn as this might be easier, once we have resolved the problem i or you can report here what the problem was and the solution to it if someone comes across the same problem.

:fluester:
btw, all i am asking from you is to upload an avatar of urself.
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 Apr 26, 2007 9:21 pm

lefty wrote:There is a mod that already does that I think. When i find it I can link it here and you can see whether this will help you figure it out.

I was not going to inlcude any of this in my mod at this stage though as I am not quite sure how right now ... but I am also pretty sure it would require a new php file...


I am actually VERY close now to have it accomplished so that not only can you display this mod on your main site, but other stats etc as well...  :cheer:  

 However it will require a little editing and changing the website file "index.php or html" to a .tpl .
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby WheelGuy » Fri Apr 27, 2007 5:37 pm

:thinking:
 Good news is, I do have this done to show the announcements and a couple other things (if desired) on the main page.
 Bad news is, it only works on 1 page. Also, if that page is a php file with other code, the coding on that page won't work.    :rant2:
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby lefty » Fri Apr 27, 2007 8:42 pm

did you have a look at fetchall? If not, maybe that could give you an idea.
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 » Sun Apr 29, 2007 2:23 pm

lefty wrote:did you have a look at fetchall? If not, maybe that could give you an idea.


Thanks for that link. I had not even seen that. I did download it and take a look though. Even though the instructions on how to use it are not very good, I managed to figure it out. Depending on the info you want to "fetch", you have to call up a different function file(mod). It has a few already there, but if you have other info, such as this Announcement, you have to create your own function file.
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby lefty » Mon Apr 30, 2007 1:30 am

do you have it on your website? i would be interested to have a look at it in action :)
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 Apr 30, 2007 3:10 am

lefty wrote:do you have it on your website? i would be interested to have a look at it in action :)


No I do not, not at this time. The major thing I want is the announcements/news, but I am having a little difficulty creating a function. If you like though, I could set it up so you could see their "sample" page thing. It shows the stats etc on one page, but could be used seperately.
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby lefty » Mon Apr 30, 2007 9:07 am

Sorry, I must have misunderstood, thought you had it running.
If you like though, I could set it up so you could see their "sample" page thing.


I have seen their samples before, no need to set it up :wink:
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 » Wed May 02, 2007 3:42 pm

Would it be possible to get the "order" in which your mod get's the announement info? I know in php, the script has to run in a certain order to produce final output. I hope this is understandable of what I'm asking. Hoping it will help me to create the function needed to place the announcement on the main website page.
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

Postby lefty » Wed May 02, 2007 5:26 pm

i hope i know what you mean, look for the if else statements that are in the index.php changes of the mod instructions. Should hopefully make sense.
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 3:42 am

Yeah I got an idea. However I ended up going a different route after losing 50% of the hair I had...  :rotfl2:   I am proud to say though, my task was accomplished.. :cheer:  
You will need to go into your forums admin panel-> configuration , make sure the cookie "Path" (not cookie name) is set to  / .
Code: Select all
//Copy and paste the code below at top of EACH page before <html><head>CODE</head> that you   //want the announcements to show. With exception to the <?php echo ?> statement.
// Place the <?php echo $announcement_text or $guest_announcement_text; ?> |-------| //where you want the announcement to show. I'm sure no need to explain difference in the //two variables. If so, just ask.

<?php
define('IN_PHPBB', true);
$phpbb_root_path = './phpBB2/';    // This may need to be changed for your phpBB root
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'language/lang_english/lang_main.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

//BEGIN ACP Site Announcement Centre by lefty74
//
// ACP Site Announcement Centre Smilies Pass & BBCode
//
$announcement_centre_config['announcement_text']= smilies_pass($announcement_centre_config['announcement_text']);
$announcement_text_uid = make_bbcode_uid();
$announcement_centre_config['announcement_text']= bbencode_first_pass( $announcement_centre_config['announcement_text'], $announcement_text_uid );
$announcement_centre_config['announcement_text']= bbencode_second_pass ( $announcement_centre_config['announcement_text'], $announcement_text_uid );
$announcement_centre_config['announcement_text']= str_replace("\n", "\n<br />\n", $announcement_centre_config['announcement_text']);

$announcement_centre_config['announcement_guest_text']= smilies_pass($announcement_centre_config['announcement_guest_text']);
$announcement_guest_text_uid = make_bbcode_uid();
$announcement_centre_config['announcement_guest_text'] = bbencode_first_pass( $announcement_centre_config['announcement_guest_text'], $announcement_guest_text_uid );
$announcement_centre_config['announcement_guest_text'] = bbencode_second_pass ( $announcement_centre_config['announcement_guest_text'], $announcement_guest_text_uid );
$announcement_centre_config['announcement_guest_text'] = str_replace("\n", "\n<br />\n", $announcement_centre_config['announcement_guest_text']);

$announcement_guest_text = $announcement_centre_config['announcement_guest_text'];

// get the post information in case last topic or forum has been entered
if ( !$announcement_centre_config['announcement_forum_id'] == '' ||  !$announcement_centre_config['announcement_topic_id'] == '')
{
    if ( !$announcement_centre_config['announcement_forum_id'] == '')
    {
    $where = 'p.forum_id = ' . $announcement_centre_config['announcement_forum_id'];
    }
    elseif ( !$announcement_centre_config['announcement_topic_id'] == '')
    {
    $where = ('p.topic_id = ' . $announcement_centre_config['announcement_topic_id']);
    }
   
    if ( $announcement_centre_config['announcement_forum_topic_first_latest'] == ANNOUNCEMENTS_LEFTY74_FORUM_TOPIC_FIRST )
    {
    $order = 'ASC';
    }
    elseif ( $announcement_centre_config['announcement_forum_topic_first_latest'] == ANNOUNCEMENTS_LEFTY74_FORUM_TOPIC_LATEST )
    {
    $order = 'DESC';
    }
                   
            $sql = "SELECT p.post_id, p.forum_id, p.topic_id, pt.*
            FROM " . POSTS_TABLE . ' as p, ' . POSTS_TEXT_TABLE . " as pt
            WHERE ". $where ."
            AND p.post_id = pt.post_id
            ORDER BY p.post_id ". $order ." LIMIT 1";
            
         if (!($result = $db->sql_query($sql)))
         {
            message_die(GENERAL_ERROR, 'Error in getting announcement post', '', __LINE__, __FILE__, $sql);
         }

         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'];
         }
}
else
{
$announcement_text = $announcement_centre_config['announcement_text'];
}   

// 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
?>

<?php echo $announcement_text or $guest_announcement_text; ?> // Place this where you want the announcement to show. Also use the $ varibale of the text you want to use.


The results can be viewed in action by following the link in my signature.
WheelGuy
Forum Member
 
Posts: 20
Joined: Thu Apr 19, 2007 7:27 am
Location: Townsend, Tn USA

PreviousNext

Return to my MODS & support

Who is online

Users browsing this forum: No registered users and 1 guest

cron