Yet Another Global Announcements Mod (YAGAM)

Started by Nibogo, February 11, 2009, 12:47:15 AM

Previous topic - Next topic

aw06

Noticed something with this mod ...

When i check announcement log .. i see it showing some regular people as moderators .... anybody else notice this ?
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Bruno36

Quote from: Bruno36 on May 18, 2010, 01:56:23 PM
Goodnight!

There is a bug, the ad is truncate
and When I click on CONVERT INTO ANNOUNCEMENT I am redirected to a blank page

Bruno36 the French
SMF 2.0.9

Bruno36

Bruno36 the French
SMF 2.0.9

vika.vedy

1. Native SMF announcement function doesn't work with the mod installed. :( Too bad.
Sometimes I just need to create regular announcement topic and display it in the "Announcement" section under other regular topics.

2. Converting topic into announcement totally doesn't work :(  There is ever no such action in Announcements.php .

3. And there are some minor errors when previewing new announcement (action=announcements;sa=addverify):
QuoteNotice: Undefined index: admin_menu_name in .../forum/Sources/Announcements.php  on line 72

Notice: Undefined index: admin_menu_name in .../forum/Sources/Announcements.php on line 73

Notice: Undefined index: title in .../forum/Sources/Announcements.php on line 98

Nibogo

Right now I have a lot of work in my paid products, I'm creating two new products and additionally I'm working pretty hard in my duties as Apprentice of the Customization Team so please be patient, this is one of the mod that I really care about and I'll update it when I have time btw this mod ISN'T going to be paid.

nurg

Hola

me sale este error podeis ayudarme

http://www......com/index.php?dummy=1;action=announcement;aid=4;;a=announcement;aid=4
Aplicar filtro: Mostrar sólo los mensajes de error con este mensaje
2: Division by zero
Aplicar filtro: Mostrar sólo los errores de este archivo
Archivo: /var/www/vhosts/........com/httpdocs/Sources/Subs.php
Línea: 688

Gracias
VISITA MI FORO SMF
Si quieres que te instale un foro SMF no dudes en contactarme.


Kindred

Although official support for this mod is to be found only on SMFPacks.com, locking the thread here is not appropriate.

Thread unlocked. If you have information to post, assisting other members, all is good.
If you wish official support, please visit the support site, as indicated by the mod author.

http://www.smfpacks.com/index.php?topic=136.0
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

petesky

Is it possible to add a feature autohide from usergroups which are not eval to the group for which i created the announcement ?

Kindred

Quote from: Kindred on October 08, 2010, 01:44:05 PM

If you wish official support, please visit the support site, as indicated by the mod author.

http://www.smfpacks.com/index.php?topic=136.0
feature requests should go there.   I unlocked this so that the community could provide suppot for bugs

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PraveerD

Hello all,

I asked this question on SMFPack

" I am using this MOD on my forum running SMF 2 RC3. I installed this MOD using package manager. But when I make a global announcement, it does not get displayed on my forum. And also when I click logs it shows me the message that global announcement does not exist "

And got this in reply from the author

" You must manually insert the code added by this mod in templates in your theme "

What does this mean? I should ass all the codes in the default theme or the theme I am currently using. I am using Mobile theme.

Regards
Praveer

Kindred

you must manually install any nmod which edits a template file into all of your custom themes. SMF 1.x only installs mods into the default theme...  and 2.0 only installs into additional themes if they are installed before the mods.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PraveerD

Thanks for your reply. So according to what you said, I have to manually insert only the codes for template edits in the theme I am using i.e I have to add only the the codes mentioned for the templates in the templates of my theme. Have I got what you said correct?

Kindred

yes. Any template file which your theme does not specify will fall through to use the default version
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PraveerD

There's an edit for MessageIndex.template.php

Its written to find this code

foreach ($context['topics'] as $topic)
{
// Is this topic pending approval, or does it have any posts pending approval?
if ($context['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked'])
$color_class = 'stickybg locked_sticky';
// Sticky topics should get a different color, too.
elseif ($topic['is_sticky'])
$color_class = 'stickybg';
// Locked topics get special treatment as well.
elseif ($topic['is_locked'])
$color_class = 'lockedbg';
// Last, but not least: regular topics.
else
$color_class = 'windowbg';

// Some columns require a different shade of the color class.
$alternate_class = $color_class . '2'; 


But on my theme theres some additional codes in between which are not mentioned. Heres the portion of the code mentioned to edit, of my theme's MessageIndex.template.php


  foreach ($context['topics'] as $topic)
{
// Do we want to seperate the sticky and lock status out?
if (!empty($settings['separate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
if (!empty($settings['separate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));

// Is this topic pending approval, or does it have any posts pending approval?
if ($context['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
// Sticky topics should get a different color, too.
elseif ($topic['is_sticky'] && !empty($settings['separate_sticky_lock']))
$color_class = 'windowbg3';
// Last, but not least: regular topics.
else
$color_class = 'windowbg';

// Some columns require a different shade of the color class. 



The edit is to replace the above code with this code


   // YAGAM starts here with the bars
    $announcement_bar = false;
        $normal_bar = false;
    $sticky_bar = (isset($modSettings['yagam_admin_sticky_bar'])) ? false : true;

        if (!empty($context['announcements'])){
foreach($context['announcements']  as $announcement)
        {        
// Check permission and current board
$permission_groups = explode(',',$announcement['permissions']);        
            $allowed_boards = explode(',', $announcement['id_boards']);
   
// Lets Add the Global Announcement Bar only with the permission and the board = 0 or current board
if ((in_array($board_info['id'], $allowed_boards) || $announcement['id_boards'] == 0) && ((count(array_intersect($user_info['groups'], $permission_groups)) !== 0) || $context['user']['is_admin']) && !$announcement_bar){
            echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '" style="padding:6px 4px;"><b>'.$txt['yagam_admin'].'</b></td></tr>';
            $announcement_bar = true;
            }

    // You can see this if you have permission , the right board or admin
            if (((in_array($board_info['id'], $allowed_boards)) || $announcement['id_boards'] == 0) && ((count(array_intersect($user_info['groups'], $permission_groups)) !== 0) || $context['user']['is_admin']))
                {
echo '
<tr>
<td class="windowbg2 icon1 yagam">
<img src="', $settings['images_url'], '/topic/normal_post.gif" alt="" />
</td>
<td class="windowbg2 icon2 yagam">
<img src="', $settings['images_url'], '/post/exclamation.gif" alt="" />
</td>
<td  class="subject windowbg yagam">
    <a href="',$scripturl,'?action=announcements;aid=',$announcement['id_announcement'],'"><strong>',$announcement['title'], '</strong></a>
    <p class="smalltext">', $txt['started_by'], ' <a href="'.$scripturl.'?action=profile;u=',$announcement['author'], '" ', (!empty($modSettings['MemberColorLinkInstalled'])) ? 'style="color: '.$announcement['online_color'].';"' : '', '>',$announcement['real_name'], '</a></p>
</td>
<td class="stats yagam">
    ', ($announcement['can_comment'] == '1') ? ''.$announcement['comment_total'].' ' . $txt['replies'] : '--', '<br />
',$announcement['views'], ' ' . $txt['views']. '
    </td>
<td class="windowbg2 lastpost yagam">
'.$txt['yagam_created'].' : ',timeformat($announcement['date']), '
</td>';
if (allowedTo('yagam_manage') && !empty($options['display_quick_mod']))
echo '<td class="windowbg2 moderate yagam" width="5%"><a href="',$scripturl,'?action=announcements;sa=edit;aid=',$announcement['id_announcement'],'" title="'.$txt['yagam_edit'].'"><img src="'.$settings['images_url'].'/buttons/modify.gif" alt="',$txt['yagam_edit2'], '"></a>
<a href="',$scripturl,'?action=announcements;sa=deleteverify;aid=',$announcement['id_announcement'],'" title="'.$txt['yagam_remove'].'" onclick="return confirm(\''.$txt['yagam_remove_verify'].'\')"><img src="'.$settings['images_url'].'/buttons/delete.gif" alt="',$txt['yagam_remove2'], '"></a>
</td>';
echo'</tr>';      
}
}
}

foreach ($context['topics'] as $topic)
{
// Is this topic pending approval, or does it have any posts pending approval?
if ($context['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked'])
$color_class = 'stickybg locked_sticky';
// Sticky topics should get a different color, too.
elseif ($topic['is_sticky'])
$color_class = 'stickybg';
// Locked topics get special treatment as well.
elseif ($topic['is_locked'])
$color_class = 'lockedbg';
// Last, but not least: regular topics.
else
$color_class = 'windowbg';

// Some columns require a different shade of the color class.
$alternate_class = $color_class . '2';

// Add the sticky bar
if ($topic['is_sticky'] && !$sticky_bar && (!empty($modSettings['yagam_admin_sticky_bar']))){
            echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '" style="padding:8px 4px;"><b>'.$txt['yagam_sticky_bar'].'</b></td></tr>';
            $sticky_bar = true;
            }

// The Normal Bar Added by YAGAM
            if (!$normal_bar && ((($announcement_bar || $sticky_bar) && !$topic['is_sticky']) || ($announcement_bar && !$topic['is_sticky'] && !empty($modSettings['yagam_admin_sticky_bar'])) || ($announcement_bar && !$sticky_bar && empty($modSettings['yagam_admin_sticky_bar'])) || ($announcement_bar && !$sticky_bar))){
            echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '" style="padding:8px 4px;"><b>'.$txt['yagam_topics'].'</b></td></tr>';
            $normal_bar = true;
            }   


Please tell me the edited code. Do I replace the additional codes or leave theme as it is. Please help.

Praveer

Kindred

Quote from: Kindred on October 08, 2010, 01:44:05 PM
If you wish official support, please visit the support site, as indicated by the mod author.

http://www.smfpacks.com/index.php?topic=136.0

Maybe someone else can help, but I suggest for custom code edits, that you check out the official support site.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PraveerD

Ok I will post it there. But still if anyone can help, then he is most welcome. Thanks Kindred for your honest reply.

DirtRider

I need some help with this please. I get the following error but now cannot find the code to do this edit  :'(

   Replace    ./Themes/core/MessageIndex.template.php    Test failed

Find
foreach ($context['topics'] as $topic) { // Is this topic pending approval, or does it have any posts pending approval? if ($context['can_approve_posts'] && $topic['unapproved_posts']) $color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg'; // We start with locked and sticky topics. elseif ($topic['is_sticky'] && $topic['is_locked']) $color_class = 'stickybg locked_sticky'; // Sticky topics should get a different color, too. elseif ($topic['is_sticky']) $color_class = 'stickybg'; // Locked topics get special treatment as well. elseif ($topic['is_locked']) $color_class = 'lockedbg'; // Last, but not least: regular topics. else $color_class = 'windowbg'; // Some columns require a different shade of the color class. $alternate_class = $color_class . '2';

Replace
// YAGAM starts here with the bars $announcement_bar = false; $normal_bar = false; $sticky_bar = (isset($modSettings['yagam_admin_sticky_bar'])) ? false : true; if (!empty($context['announcements'])){ foreach($context['announcements'] as $announcement) { // Check permission and current board $permission_groups = explode(',',$announcement['permissions']); $allowed_boards = explode(',', $announcement['id_boards']); // Lets Add the Global Announcement Bar only with the permission and the board = 0 or current board if ((in_array($board_info['id'], $allowed_boards) || $announcement['id_boards'] == 0) && ((count(array_intersect($user_info['groups'], $permission_groups)) !== 0) || $context['user']['is_admin']) && !$announcement_bar){ echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '" style="padding:6px 4px;"><b>'.$txt['yagam_admin'].'</b></td></tr>'; $announcement_bar = true; } // You can see this if you have permission , the right board or admin if (((in_array($board_info['id'], $allowed_boards)) || $announcement['id_boards'] == 0) && ((count(array_intersect($user_info['groups'], $permission_groups)) !== 0) || $context['user']['is_admin'])) { echo ' <tr> <td class="windowbg2 icon1 yagam"> <img src="', $settings['images_url'], '/topic/normal_post.gif" alt="" /> </td> <td class="windowbg2 icon2 yagam"> <img src="', $settings['images_url'], '/post/exclamation.gif" alt="" /> </td> <td class="subject windowbg yagam"> <a href="',$scripturl,'?action=announcements;aid=',$announcement['id_announcement'],'"><strong>',$announcement['title'], '</strong></a> <p class="smalltext">', $txt['started_by'], ' <a href="'.$scripturl.'?action=profile;u=',$announcement['author'], '" ', (!empty($modSettings['MemberColorLinkInstalled'])) ? 'style="color: '.$announcement['online_color'].';"' : '', '>',$announcement['real_name'], '</a></p> </td> <td class="stats yagam"> ', ($announcement['can_comment'] == '1') ? ''.$announcement['comment_total'].' ' . $txt['replies'] : '--', '<br /> ',$announcement['views'], ' ' . $txt['views']. ' </td> <td class="windowbg2 lastpost yagam"> '.$txt['yagam_created'].' : ',timeformat($announcement['date']), ' </td>'; if (allowedTo('yagam_manage') && !empty($options['display_quick_mod'])) echo '<td class="windowbg2 moderate yagam" width="5%"><a href="',$scripturl,'?action=announcements;sa=edit;aid=',$announcement['id_announcement'],'" title="'.$txt['yagam_edit'].'"><img src="'.$settings['images_url'].'/buttons/modify.gif" alt="',$txt['yagam_edit2'], '"></a> <a href="',$scripturl,'?action=announcements;sa=deleteverify;aid=',$announcement['id_announcement'],'" title="'.$txt['yagam_remove'].'" onclick="return confirm(\''.$txt['yagam_remove_verify'].'\')"><img src="'.$settings['images_url'].'/buttons/delete.gif" alt="',$txt['yagam_remove2'], '"></a> </td>'; echo'</tr>'; } } } foreach ($context['topics'] as $topic) { // Is this topic pending approval, or does it have any posts pending approval? if ($context['can_approve_posts'] && $topic['unapproved_posts']) $color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg'; // We start with locked and sticky topics. elseif ($topic['is_sticky'] && $topic['is_locked']) $color_class = 'stickybg locked_sticky'; // Sticky topics should get a different color, too. elseif ($topic['is_sticky']) $color_class = 'stickybg'; // Locked topics get special treatment as well. elseif ($topic['is_locked']) $color_class = 'lockedbg'; // Last, but not least: regular topics. else $color_class = 'windowbg'; // Some columns require a different shade of the color class. $alternate_class = $color_class . '2'; // Add the sticky bar if ($topic['is_sticky'] && !$sticky_bar && (!empty($modSettings['yagam_admin_sticky_bar']))){ echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '" style="padding:8px 4px;"><b>'.$txt['yagam_sticky_bar'].'</b></td></tr>'; $sticky_bar = true; } // The Normal Bar Added by YAGAM if (!$normal_bar && ((($announcement_bar || $sticky_bar) && !$topic['is_sticky']) || ($announcement_bar && !$topic['is_sticky'] && !empty($modSettings['yagam_admin_sticky_bar'])) || ($announcement_bar && !$sticky_bar && empty($modSettings['yagam_admin_sticky_bar'])) || ($announcement_bar && !$sticky_bar))){ echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '" style="padding:8px 4px;"><b>'.$txt['yagam_topics'].'</b></td></tr>'; $normal_bar = true; }
http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kindred

remember.... Most mods are designed to install only into the default theme. Some of them may work, using auto-install on 2.0 and custom themes... but some of the time, the custom theme will be different enough that you will have to manually find the similar code (not matching, since, if it matched, the autoinstaller would work)

So, if you're having trouble with the core theme, I suggest that you try using just the default (curve) theme with 2.0 for now.


regarding your post of code....   how ever you copied that, it removed all of the line breaks, which means it near impossible to read anything more than 1-2 lines)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: