Global Announcements

Started by JayBachatero, August 15, 2006, 02:39:18 PM

Previous topic - Next topic

Angelotus

Hi there,

This is a great mod! Thanks for that!
I have a small question. I assume this is the code used in messageindex.template.php to make the announcement to appear:
// Global Announcements...
   if (isset($context['globalAnnouncements']) && count($context['globalAnnouncements']) != 0)
   {
      echo '<div class="tborder"><table class="collapse">
                  <tr>
               <td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '" class="catbg7">Globale Mededelingen</td>
            <tr>
            ';

         // Loop through the Global Announcements
         foreach ($context['globalAnnouncements'] as $globalAnnouncement)
         {
            echo '
            <tr>
               <td class="forum_bg4" align="center">
                  <img src="', $settings['images_url'], '/post/' .$globalAnnouncement['ga']['icon']. '.gif" alt="" />
               </td>
               <td class="forum_bg4" align="center">
                  <img src="', $settings['images_url'], '/post/exclamation.gif" alt="" />
               </td>
               <td ' ,$globalAnnouncement['ga']['enabled'] == 0 ? 'style="background-color: #e9e9e9; color: #8d8d8d;"' : 'class="forum_bg4"', '>
                  <a href="' ,$globalAnnouncement['ga']['href'], '" >', $globalAnnouncement['ga']['subject'], '</a>
               </td>
               <td class="forum_bg4">
                  ', $globalAnnouncement['member']['link'], '
               </td>
               <td align="center" class="forum_bg4">
                  --
               </td>
               <td align="center" class="forum_bg4">
                  ', $globalAnnouncement['ga']['views'], '
               </td>
               <td class="forum_bg4" colspan="', empty($options['display_quick_mod']) ? '1' : '2', '">
                  ', $globalAnnouncement['ga']['time'], '
               </td>
            </tr>';
         }

      echo '</table></div>';
   }


What changes do I have to make to make the announcements appear also in the boardindex template? If I use code above it doesn't do anything.

mikekearn

I am having the same problem as vinston84; I got a message saying it installed successfully, and it told me I could go and make a global announcement, but it doesn't show up in my admin panel, and when I clicked the link, there was a page for it but I couldn't do anything. I am using the default theme, with SMF version 1.1.5.

Here are links to a few screens to show you what I mean:
Image 1 [nofollow]
Image 2 [nofollow]

Angelotus

I guess you have to add manually the language files.

mikekearn

How do I manually add the language files?

Angelotus

You have to unzip the package local. Then search for these files
- GlobalAnnouncementsAdmin.english.php
Upload this file via ftp to the language folder of your theme.

Second of all edit you Modifications.english.php of your theme
At this to the end:
//Global Announcements adminIndex text strings.
$txt['global_announcements_admin'] = 'Global Announcements';
$txt['global_announcements_mods'] = 'Mods';
$txt['whoallow_globalAnnouncementsAdmin'] = 'Managing the <a href="' . $scripturl . '?action=globalAnnouncementsAdmin">Global Announcements</a>.';
$txt['whoall_globalAnnouncements'] = 'Viewing a Global Announcement';


In help.english.php add this to the end

$helptxt['global_announcements_enable'] = 'This will override the local enable/disable setting for Global Announcements and enable it or disable it';


in ManagePermissions.english.php
add this in the end
//Global Announcements permissions.
$txt['permissionname_global_announcements_admin'] = 'Manage Global Announcements';
$txt['permissionhelp_global_announcements_admin'] = 'If you enable this permission for this membergroup they will be allowed to add, edit, delete Global Announcements';


and in Errors.english.php add
$txt['cannot_calendar_view'] = 'Sorry, but you are not allowed to view the calendar.';
]]></search>
<add><![CDATA[
$txt['cannot_global_announcements_admin'] = 'Sorry, you\'re not allowed to admin the Global Announcements area.';


These are the english files offcourse. You can edit your language files the same way, maybe wanna translate it ;)

mikekearn

I did everything you said, add the GlobalAnnouncementsAdmin.english.php file, and checked the modifications to all the other files (they were all modified already, exactly as you described). Since the one file didn't come up with a warning as to being overwritten when I uploaded it to my server, I checked the other files, and found out that GlobalAnnouncementsAdmin.template.php and GlobalAnnouncements.template.php also weren't in correctly, but the files that didn't go into my Themes folder (the ones in Sources) were all in place.

However, the only change was to make my admin panel show a link to the GA page, and nothing else. From this [nofollow] to this [nofollow].

What could cause there to be nothing on the actual page? Is there something else that I need to add/change?

Angelotus

Have you already tried to go through  the install procedure manually?

mikekearn

I tried that once, going through and manually editing all the files, but when I got to the ga_install.php section, I was stumped, and didn't know how to run SQL queries. I then was told to just upload that file to my server and go to it in my browser, but it gives me a list of errors about passwords, so I went back to trying to install it the normal way, and still can't get it to work.

Angelotus

Running the sql queries isn't that hard.
Have you got phpmyadmin?
Log on to your dbase, press the SQL button, insert the code and run. That will install the necessary fields (if not already excist offcourse).

mikekearn

I tried running the SQL myself, but it just gave me an error every time, like so: image 5 [nofollow]. Like I said, I don't know anything about SQL, so I'm not really sure I'm doing it right, but what I gathered was opening up phpMyAdmin, inserting the code listed, and hitting "GO" and that's it. If there is something I'm missing, I don't know what it is.

Angelotus

You have to replace

{$db_prefix}

into your database prefix (standard it is set to smf_ )

Then try running it again.

mikekearn

I did that, and now all the SQL things went fine except the last one, which gave an error: "#1060 - Duplicate column name 'gaOrder' "

The GA page on my Admin section still looks exactly the same as before [nofollow].

Thanks, by the way, for all the help you've given. It may not have worked so far, but I'm at least a lot closer than I was! I think... :-\

Angelotus

That last error I also received. Search this topic and you find that many more people have encountert that message. Shouldn't be a problem though.

Quick question: what language do you use as admin? Is that english? and are you 100% sure that you have edit all the necessary language files for this mod?
I ask you this because if I look at your screenshot it appears this mod is working, only not all the language strings are there...

mikekearn

That was the problem! Thank you so much! I thought I was using English, but apparently I was using English-UTF8, which I guess is something different? I don't know how that happened, but it works now, so again, thank you very much!

Angelotus

It is different indeed! Your welcome!

Vinspire

Am wondering if this mod work wif  SMF 2.0 Beta 3.1 Public ?

Angelotus


smile80

How can I enter in Global announcement. menu? Where should I write announcement?


Thanks

mikekearn

If you have installed it completely and correctly (which took me a while ::)) you just click your "Admin" section and it should be on the very bottom of the left-hand sidebar, under the heading "Mods", saying "Global Announcements". Click that, and it'll take you to the Global Announcements section, where you can post them. Cheers!

smile80

I do not have heading Mods... I installed this mod, and I followed link to post GA. It works, but I cannot find icon for it....

My forum is based on default skin..... Maybe I should edit some stuff?

Thanks!

hxxp:img231.imageshack.us/my.php?image=44989664yf1.jpg [nonactive]

Advertisement: