News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Global Announcements

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

Previous topic - Next topic

slackerpunk

Quote from: razorblitz07 on August 27, 2007, 07:21:29 PM
Umm, I just created a Global Announcement (installed successfully) but the GA won't come up at the top of the forum sections.  Why is this?

thats what I noticed also

fenyullow

hi, TrueSatan, thanks, that works well. Hopefully Jay will let us know the position issue.

TrueSatan

My pleasure...at least it's more usable for you now. I think Jay may be very busy so be patient regarding the position issue please.

brelwit

I have successfully installed this Global Announcement mod and have tested posting a record.  But I am experiencing Javascript Errors that can be found in the bottom Status Bar and the Announcement Icon does not work too.

First JavaScript Error experienced when I access the "Add GA" page:

Line: 207
Char: 6
Error: Expected identifier, string or number
Code: 0
URL: http://localhost/tabletopwars2007/bb/index.php?action=globalAnnouncementsAdmin;sa=add


Then when I select an Announcement Icon from the dropdown combo field, the ff. Javascript error happens:

Line: 236
Char: 1
Error: Object expected
Code: 0
URL: http://localhost/tabletopwars2007/bb/index.php?action=globalAnnouncementsAdmin;sa=add


I checked the code of the "GlobalAnnouncementsAdmin.template.php" file and the "Add GA" web page and found out the ff. suspicious codes:

The "$icon['is_last'] ? '' : ','" entry in line 141 seem to have error as the generated html codes does not remove the last comma (,) from the last icon file path (just before the "}") which is the "wink" portion.

For the Announcement Icon error, I found out that the code that automatically selects the chosen dropdown option is missing.  I mean the ff. code is not there so any option selected does nothing:

, $icon['value'] == $context['icon'] ? ' selected="selected"' : ''

I tired fixing this but couldnt successfully do it.  Can anybody help me? Thanks!

fenyullow

Quote from: TrueSatan on August 28, 2007, 05:19:13 PM
My pleasure...at least it's more usable for you now. I think Jay may be very busy so be patient regarding the position issue please.

I think I figure it out myself. Here is what I did:

1, Open "$themedir/MessageIndex.template.php"
2, Find code
// Global Announcements...
if (isset($context['globalAnnouncements']) && count($context['globalAnnouncements']) != 0)
{
echo '
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' : '', '>
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr>
<td colspan="7" class="titlebg">置顶公告</td>
<tr>
<tr>
<td class="catbg3" width="9%" colspan="2"></td>
<td class="catbg3">', $txt[70], '</td>
<td class="catbg3" width="14%">', $txt[109], '</td>
<td class="catbg3" width="4%" align="center">', $txt[110], '</td>
<td class="catbg3" width="4%" align="center">', $txt[301], '</td>
<td class="catbg3" width="22%">Time</td>
</tr>';

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

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


3, Movee them after (very beginning)
echo '
<div style="margin-bottom: 2px;"><a name="top"></a>', theme_linktree(), '</div>';


4, Save and upload. Bann, works.

Tick

I am getting a undefined index error for : title.    IT has something to do with the fact that the text is not showing up in the admin panel in the title part of the Global announcements section.  I have verified that all the proper strings are in the language file.  Here is a screenshot. 

JayBachatero

Need to add the language string to Modifications.english.php.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Tick

QuoteI have verified that all the proper strings are in the language file.
Yep I did that already.  I have double checked again and it is there.

Tick


TrueSatan

Please check to see that in ACP>Server Settings your forum language is set to English and not English utf8 and see if that fixes it.

Tick

Yep that was also checked.  That is what is so strange.   I have went over all of the normal "fixes" for an problem like  this but it does not fix.

TrueSatan

The only time I've see this mod fail and the normal fixes not put it right was when the server in use had incorrect settings such that what it claimed was CHMOD 777 etc wasn't and the file ownership rights were wrong...it's a long shot but that's the only thing that springs to my mind.

If you were to try it on an otherwise empty and fresh test forum and it failed there it would be a strong pointer to server issues...not a great help I know.

Tick

Yes it is very strange indeed.  I did check all the file permissions and all was 777.  I have checked every file that the mod affects and all seem to be right.  The mod is working fine it just gives off the error in the error log.   Hopefully someone may have an answer for me on this.


bassmadrigal

#373
I have been looking into this mod and decided to install it, however I do not have the particular lines you mention to look for in index.template.php and MessageIndex.template.php

I have put the files in a zip and have it here
<link removed>

If you could look over it and give me some pointers, it'd be a great help to me.

Thanks
Jeremy

EDIT: After many (and I mean many) trial and errors, I got it to work.

Tidea

Is there a place where we can check to allow users to comment on the global announcmenet?

TrueSatan

Sorry no...it's an announcement rather than a normal forum posting so if you want to allow comments you might be better just posting a new topic in a standard forum and/or using the newsletter system to notify members.

jossanaijr

I must confess I did not check all 19 pages...
Is it possible to move an announcement from the Global Announcements board to another board?  If yes, how?  If no, could this be an update?

TrueSatan

 You can repost it obviously but other than that the GA is a self contained system not like other boards so such functions aren't available...it isn't a board so much as an announcement area.

jossanaijr

Quote from: TrueSatan on October 03, 2007, 09:58:51 PM
You can repost it obviously but other than that the GA is a self contained system not like other boards so such functions aren't available...it isn't a board so much as an announcement area.
Ok, thanks.  But it will be nice not lose all replies after you decide it must be removed from the announcement area...

TrueSatan

???? You can't reply to a GA anyway so what replies would be lost?

Advertisement: