News:

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

Main Menu

Yet Another Global Announcements Mod (YAGAM)

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

Previous topic - Next topic

Lady Night Owl

No because even with the rate that topic mod uninstalled, I still get the same error when I edit an announcement from the message index.

I think the rate that topic mod clashed with your mod as far as the template - an aesthetic irritant only, it wasn't generating errors in the log.
Running SMF 2.0.1

AlenNS

Quote from: NIBOGO on March 06, 2009, 12:50:16 PM
Quote from: AlenNS on March 05, 2009, 06:49:53 PM
Quote from: drhamad on March 05, 2009, 01:51:02 PM
uh wow, that's a bit much
Yes, but I wrote in this message what I have done and it is probably the main reason for this error.
Ićve manuall added diveder for stickies.
But I don't know how to write that code to work fine. :(

http://www.simplemachines.org/community/index.php?topic=292270.msg1962053#msg1962053

I will check that too
Thank you. :)

I've solved problem with Rate it mod. You have to manually add <td class="windowbg2 rating">
                  ',$announcement['rating'], '
               </td>

pariofdreamz



Nothing is IMPOSSIBLE in this world as IMPOSSIBLE itself says I M POSSIBLE

drhamad

FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

pariofdreamz

i know but i don't like that one as it doesn't work properly with my site


Nothing is IMPOSSIBLE in this world as IMPOSSIBLE itself says I M POSSIBLE

Özgür

This is turkish translations for Rev4
Modifications.turkish.php add line

// YAGAM - Admin and MessageIndex Strings - Çeviri rocKayseri
$txt['yagam_admin'] = 'Genel Duyurular';
$txt['yagam_sticky_bar'] = 'Önemli Konular';
$txt['yagam_topics'] = 'Normal Konular';
$txt['yagam_created'] = 'Oluşturulma';
$txt['yagam_remove_verify'] = 'Bu duyuruyu silmek istediğinize emin misiniz?';
$txt['whoall_announcements'] = 'Genel Duyururulari görebilir';
$txt['permissionname_yagam_manage'] = 'Genel duyurulari yönetebilir';
$txt['permissionhelp_yagam_manage'] = 'Bunu seçerseniz üyeler genel duyurulari düzenleyebilirler.';
$txt['permissionname_yagam_comment'] = 'Genel duyurulara yorum ekleyebilir';
$txt['permissionhelp_yagam_comment'] = 'Bu izin üyelerin genel duyurulara yorum yapabilmelerini sağlar.';
$txt['yagam_edit2'] = 'Düzenle';
$txt['yagam_edit'] = 'Duyuruyu Düzenle';
$txt['yagam_remove'] = 'Duyuruyu Sil';
$txt['yagam_remove2'] = 'Sil';
$txt['yagam_admin_add'] = 'Genel Duyuru Ekle';
$txt['yagam_admin_settings'] = 'Genel Duyuru Ayarları';
$txt['yagam_version'] = 'Genel Duyuru Sürüm';
So Long


Özgür

NIBOGO you should be change prettyurls-filters.php.
yagam filter should be

// YAGAM Filter
function pretty_yagam_filter($urls)
{
   global $boardurl, $scripturl;

   // Let's Add Announcements
   $pattern = '~' . $scripturl . '(.*)action=announcements;aid=([^;]+)~S';
   $replacement = $boardurl . '/announcements/$2/$3';
   $replacement .= (strpos($replacement, '?') === false ? '?' : ';') . (isset($PHPSESSID[0]) ? $PHPSESSID[0] : '') . ';' . (isset($sesc[0]) ? $sesc[0] : '') . (isset($fragment[0]) ? $fragment[0] : '');
   foreach ($urls as $url_id => $url)
      if (!isset($url['replacement']))
         if (preg_match($pattern, $url['url']))
            $urls[$url_id]['replacement'] = preg_replace($pattern, $replacement, $url['url']);  
   return $urls;
}


This line

$replacement .= (strpos($replacement, '?') === false ? '?' : ';') . (isset($PHPSESSID[0]) ? $PHPSESSID[0] : '') . ';' . (isset($sesc[0]) ? $sesc[0] : '') . (isset($fragment[0]) ? $fragment[0] : '');

- announcements edit, delete or some links seem like "same" and not work (if we enable announcements filter)
And
.../announcements/;sa=edit;aid=6 not work
.../announcements/?sa=edit;aid=6 work fine.
So Long

Lady Night Owl

Quote from: AlenNS on March 06, 2009, 05:03:56 PM

I've solved problem with Rate it mod. You have to manually add <td class="windowbg2 rating">
                  ',$announcement['rating'], '
               </td>

Sweet, which file though and where do I add it? MessageIndex.template.php? Thanks!
Running SMF 2.0.1

AlenNS

Sorry, I forgot to write that.  :-[ :)

Yes, in MessageIndex.template.php

// You can see this if you have permission and the ga is enable or you are the admin
                if ((ltrim($board_announcement) == $board_info['id'] || $announcement['id_boards'] == 0) &&
($announcement_permission == true || $context['user']['is_admin']))
                {
echo '
<tr class="windowbg2">
<td class="windowbg2 icon1">
<img src="', $settings['images_url'], '/topic/normal_post.gif" alt="" />
</td>
<td class="windowbg2 icon2">
<img src="', $settings['images_url'], '/post/exclamation.gif" alt="" />
</td>
<td  class="subject ', $windowclass, '">
<b><a href="',$scripturl,'?action=announcements;sa=view;id=',$announcement['id_announcement'],'">',
$announcement['title'], '</a></b><br />
</td>
<td class="windowbg2 rating">
',$announcement['rating'], '
</td>
<td class="windowbg2 starter">
<a href="'.$scripturl.'?action=profile;u=',$announcement['author'], '">',$announcement['real_name'], '</a>
</td>
<td class="windowbg replies">';
if ($announcement['can_comment'] == '1')
echo''.$announcement['comment_total'].'';
else
    echo'--';
echo'</td>
<td class="windowbg views">
',$announcement['views'], '
</td>
<td class="windowbg2 lastpost">
'.$txt['yagam_created'].': ',timeformat($announcement['date']), '
</td>';
if (allowedTo('yagam_manage') && !empty($options['display_quick_mod']))
echo '<td class="windowbg2 moderate"><a href="',$scripturl,'?action=announcements;sa=edit;id=',
$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;id=',$announcement['id_announcement'],'"
title="'.$txt['yagam_remove'].'"><img src="'.$settings['images_url'].'/buttons/delete.gif" alt="',
$txt['yagam_remove2'], '"></a>
</td>';
echo'</tr>';

edi67

Great work NIBOGO, i installed REV4 everything seems to be ok, i love the Sticky function as you promised, all ok perfect for now, i will check future error log if there will be.

Perfect work GRAZIE NIBOGO i will attach italian translation soon. ;)
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Nibogo

ozgur remember that the rev4 is an alpha version and have a lot of bugs

Quote from: edi67 on March 08, 2009, 12:26:38 PM
Great work NIBOGO, i installed REV4 everything seems to be ok, i love the Sticky function as you promised, all ok perfect for now, i will check future error log if there will be.

Perfect work GRAZIE NIBOGO i will attach italian translation soon. ;)

Glad to hear that :)

Quote from: Lady Night Owl on March 06, 2009, 04:06:34 PM
No because even with the rate that topic mod uninstalled, I still get the same error when I edit an announcement from the message index.

I think the rate that topic mod clashed with your mod as far as the template - an aesthetic irritant only, it wasn't generating errors in the log.

Obviouslly I was talking about the template issue ;)

edi67

hi NIBOGO this is the only one error that i see in error log for now:

8: Undefined variable: stickybar
File: /home/crazyzone/data/www/crazyzone.biz/Themes/default/MessageIndex.template.php (main sub template - eval?)
Riga: 319


Message.index.template.php
Quote// Add the sticky bar
         if($topic['is_sticky'] && !$stickybar && (!empty($modSettings['yagam_sticky_bar'])) && $announcement_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>';

i wrote in bold the line 319


well may be the solution is add this :    $stickybar = false;
before:            foreach($context['topics'] as $topic)

begin in this way: $stickybar = false;
            foreach($context['topics'] as $topic)


but i found another little error:

if you have announcement, sticky topic and normal topic the bar is visible and ok
if you have announcement and normal topic the bar is visible ok
but if you have sticky topic and normal topic WITHOUT annuncenement the bar between Stiky/normal topic is not present , not visible
you can correct this and make the bar visible too

thx friend
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Lady Night Owl

Hmm, can't view announcements at all now.

Yes, they are enabled and yes the permissions are all set.

I get this error.


/index.php?action=announcements;sa=view;id=1
8: Undefined index: announcement_no_selected
File: /Sources/Errors.php
Line: 193
Running SMF 2.0.1

Nibogo

Quote from: Lady Night Owl on March 09, 2009, 04:53:53 PM
Hmm, can't view announcements at all now.

Yes, they are enabled and yes the permissions are all set.

I get this error.


/index.php?action=announcements;sa=view;id=1
8: Undefined index: announcement_no_selected
File: /Sources/Errors.php
Line: 193


You should change the id=1 to aid=1

I have fixed that bug in the last release


@edi67: I will fix all that bugs for the next release , you know of that is an alpha version so you have errors everywhere. I have to work on a lot of mods so be patient everybody I hope release the RC1 the next week ;)

AlenNS

Quote from: AlenNS on March 06, 2009, 05:03:56 PM
Quote from: NIBOGO on March 06, 2009, 12:50:16 PM
Quote from: AlenNS on March 05, 2009, 06:49:53 PM
Quote from: drhamad on March 05, 2009, 01:51:02 PM
uh wow, that's a bit much
Yes, but I wrote in this message what I have done and it is probably the main reason for this error.
Ićve manuall added diveder for stickies.
But I don't know how to write that code to work fine. :(

http://www.simplemachines.org/community/index.php?topic=292270.msg1962053#msg1962053

I will check that too
Thank you. :)
Hi, NIBOGO, did you look at my problem? :)
If not, I hope you will have some time soon. :)



drhamad

NIBOGO, I'm noticing this in my error log:
Quotehttp://www.taurusdrivers.com/index.php?action=admin;area=logs;sa=errorlog;desc
8: Undefined index: yagam_admin_add
File: /home/ffc/public_html/Sources/Admin.php
Line: 308
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Advertisement: