Yet Another Global Announcements Mod (YAGAM)

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

Previous topic - Next topic

drhamad

No one except admins is able to view my announcements in RC3 for some reason.  Everyone else just gets "An Error has occured!"

Also, it doesn't seem to be saving groups that have permissions to access it, besides Guests and Regular Members.
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

Nibogo

Quote from: drhamad on June 02, 2009, 08:45:55 PM
No one except admins is able to view my announcements in RC3 for some reason.  Everyone else just gets "An Error has occured!"

Also, it doesn't seem to be saving groups that have permissions to access it, besides Guests and Regular Members.

Please try with the version attached

drhamad

Thanks.

I will note so far that this step in ManagePermissions.php seems to be out of order:
Quote
Find:
   $permissionList = array(
      'membergroup' => array(
Add After:
      
         'yagam_comment' => array(false, 'general', 'view_basic_info'),

Edit:
OK I just went through yagam_manual_edit.html

The only difference I found between that and RC3 was in SSI.php.  Unless you just haven't updated yagam_manual_edit.html and the actual installer is different?
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


drhamad

Quote from: NIBOGO on June 03, 2009, 11:10:12 PM
The yagam_manual_edit.html was released for YAGAM v2.0 RC1 or RC2 so is not updated

Ahhhhhh well then, I might not even be on RC3, since I'm pretty sure I used that to install YAGAM 2 in the first place (after RC3 was released).

I'll have to try with the regular install file tomorrow.
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

zidlicky

I'm looking for a global announcement mod for 1.1.9. Will you be releasing a mod for this version? I only see 2 mods available in SMF and none for 1.1.9. Any ideas while we wait for a stable v2.0? Thanks.

Nibogo

Quote from: zidlicky on June 06, 2009, 03:08:50 AM
I'm looking for a global announcement mod for 1.1.9. Will you be releasing a mod for this version? I only see 2 mods available in SMF and none for 1.1.9. Any ideas while we wait for a stable v2.0? Thanks.


Please read the topic, there is already a mod for 1.1.x

Redryder

Quote from: drhamad on June 02, 2009, 08:45:55 PM
No one except admins is able to view my announcements in RC3 for some reason.  Everyone else just gets "An Error has occured!"

Also, it doesn't seem to be saving groups that have permissions to access it, besides Guests and Regular Members.

I seem to be having the same problem is there a fix?

drhamad

Quote from: NIBOGO on June 02, 2009, 09:39:45 PM
Quote from: drhamad on June 02, 2009, 08:45:55 PM
No one except admins is able to view my announcements in RC3 for some reason.  Everyone else just gets "An Error has occured!"

Also, it doesn't seem to be saving groups that have permissions to access it, besides Guests and Regular Members.

Please try with the version attached

No joy.  That version IS saving what groups have access, but it's still returning "An error occured" when the groups try to view it.
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

Nibogo

I don't have a lot of time so please try this and tell me if this works:

Open your /Sources/AnnouncementsView.php and

FIND:

while ($row = $smcFunc['db_fetch_assoc']($dbresult)){
        $announcement = array(
            'title' => $row['title'],
            'id_announcement' => $row['id_announcement'],
            'time' => timeformat($row['date']),
                'author' => $row['author'],
                        'views' => $row['views'],
            'real_name' => $row['real_name'],
                        'content' => $row['content'],
            'can_comment' => $row['can_comment'],
                        'comment_total' => $row['comment_total'],           
        );
    }
    $smcFunc['db_free_result']($dbresult);   

    // Permission!
    $permissions = explode(',',$row['permissions']);       
    $announcement_permission = count(array_intersect($user_info['groups'], $permissions)) == 0 ? false : true;
    $context['announcement'] = $announcement;
   
    // You can't see this you need the permission and the admin always can
    if ($announcement_permission == false && !$user_info['is_admin'])
        fatal_lang_error('announcement_no_permission', false);


REPLACE WITH:

while ($row = $smcFunc['db_fetch_assoc']($dbresult)){
        $announcement = array(
            'title' => $row['title'],
            'id_announcement' => $row['id_announcement'],
            'time' => timeformat($row['date']),
                'author' => $row['author'],
                        'views' => $row['views'],
            'real_name' => $row['real_name'],
                        'content' => $row['content'],
            'can_comment' => $row['can_comment'],
                        'comment_total' => $row['comment_total'],           
        );
    }
    $smcFunc['db_free_result']($dbresult);
        $context['announcement'] = $announcement;   

    // Permission!
    $permissions = explode(',',$context['announcement']['permissions']);       
    $announcement_permission = count(array_intersect($user_info['groups'], $permissions)) == 0 ? false : true;   
   
    // You can't see this you need the permission and the admin always can
    if ($announcement_permission == false && !$user_info['is_admin'])
        fatal_lang_error('announcement_no_permission', false);

Özgür

So Long

drhamad

With that edit I'm getting a parse error ("Parse error: syntax error, unexpected T_STRING in /home/ffc/public_html/Sources/AnnouncementView.php on line 51").  I don't have time to look at it now to figure out why, I'll try tonight.

Something else I'll throw out there as an idea:  could it be that we have outdated versions of the database?  Have things changed in YAGAM's database format?  I tried running db_yagam.php but it just gives me an error.
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

Redryder

Quote from: NIBOGO on June 07, 2009, 10:43:47 PM
I don't have a lot of time so please try this and tell me if this works:

Open your /Sources/AnnouncementsView.php and

FIND:

while ($row = $smcFunc['db_fetch_assoc']($dbresult)){
        $announcement = array(
            'title' => $row['title'],
            'id_announcement' => $row['id_announcement'],
            'time' => timeformat($row['date']),
                'author' => $row['author'],
                        'views' => $row['views'],
            'real_name' => $row['real_name'],
                        'content' => $row['content'],
            'can_comment' => $row['can_comment'],
                        'comment_total' => $row['comment_total'],           
        );
    }
    $smcFunc['db_free_result']($dbresult);   

    // Permission!
    $permissions = explode(',',$row['permissions']);       
    $announcement_permission = count(array_intersect($user_info['groups'], $permissions)) == 0 ? false : true;
    $context['announcement'] = $announcement;
   
    // You can't see this you need the permission and the admin always can
    if ($announcement_permission == false && !$user_info['is_admin'])
        fatal_lang_error('announcement_no_permission', false);


REPLACE WITH:

while ($row = $smcFunc['db_fetch_assoc']($dbresult)){
        $announcement = array(
            'title' => $row['title'],
            'id_announcement' => $row['id_announcement'],
            'time' => timeformat($row['date']),
                'author' => $row['author'],
                        'views' => $row['views'],
            'real_name' => $row['real_name'],
                        'content' => $row['content'],
            'can_comment' => $row['can_comment'],
                        'comment_total' => $row['comment_total'],           
        );
    }
    $smcFunc['db_free_result']($dbresult);
        $context['announcement'] = $announcement;   

    // Permission!
    $permissions = explode(',',$context['announcement']['permissions']);       
    $announcement_permission = count(array_intersect($user_info['groups'], $permissions)) == 0 ? false : true;   
   
    // You can't see this you need the permission and the admin always can
    if ($announcement_permission == false && !$user_info['is_admin'])
        fatal_lang_error('announcement_no_permission', false);


I wanted to try that but could not find the file.

I see why it was not installed. I removed the package and looked at zip no file was in it. looked for and found my copy of 2.0 not rc3 it had the file in it so I uploaded and installed that package it went well except the file still was not there nor was view template one. The package installer does not even list the files being installed.

Any I put them in sources and theme Dir like they should have been still no go. So I did the above changes still a no go.

While doing this I saw that your LAN call function was incorrect I believe.

yagam_no_permission should be there right.

Anyway that shows the error that I should have view permission. Now where do I find that it is not under permissions? looked in defult theme for it I do not see it listed only the comment permission for it is.

Redryder

Anyone found a solution yet to above?

It would be nice to have this working.

Italian81

I get this instead of a video playing


Black Eyed Peas "I Gotta Feeling" (External Embedding Disabled)

What does this mean?   I have everything enabled in AEVA and I am using SMF 1.9  please help friends :)

Redryder

Quote from: NIBOGO on June 07, 2009, 10:43:47 PM
I don't have a lot of time so please try this and tell me if this works:

Open your /Sources/AnnouncementsView.php and

FIND:

while ($row = $smcFunc['db_fetch_assoc']($dbresult)){
        $announcement = array(
            'title' => $row['title'],
            'id_announcement' => $row['id_announcement'],
            'time' => timeformat($row['date']),
                'author' => $row['author'],
                        'views' => $row['views'],
            'real_name' => $row['real_name'],
                        'content' => $row['content'],
            'can_comment' => $row['can_comment'],
                        'comment_total' => $row['comment_total'],           
        );
    }
    $smcFunc['db_free_result']($dbresult);   

    // Permission!
    $permissions = explode(',',$row['permissions']);       
    $announcement_permission = count(array_intersect($user_info['groups'], $permissions)) == 0 ? false : true;
    $context['announcement'] = $announcement;
   
    // You can't see this you need the permission and the admin always can
    if ($announcement_permission == false && !$user_info['is_admin'])
        fatal_lang_error('announcement_no_permission', false);


REPLACE WITH:

while ($row = $smcFunc['db_fetch_assoc']($dbresult)){
        $announcement = array(
            'title' => $row['title'],
            'id_announcement' => $row['id_announcement'],
            'time' => timeformat($row['date']),
                'author' => $row['author'],
                        'views' => $row['views'],
            'real_name' => $row['real_name'],
                        'content' => $row['content'],
            'can_comment' => $row['can_comment'],
                        'comment_total' => $row['comment_total'],           
        );
    }
    $smcFunc['db_free_result']($dbresult);
        $context['announcement'] = $announcement;   

    // Permission!
    $permissions = explode(',',$context['announcement']['permissions']);       
    $announcement_permission = count(array_intersect($user_info['groups'], $permissions)) == 0 ? false : true;   
   
    // You can't see this you need the permission and the admin always can
    if ($announcement_permission == false && !$user_info['is_admin'])
        fatal_lang_error('announcement_no_permission', false);



Try this....

First change it back to the orginal code that you posted above.


Once you have done that replace the original code:

while ($row = $smcFunc['db_fetch_assoc']($dbresult)){
         $announcement = array(
             'title' => $row['title'],
             'id_announcement' => $row['id_announcement'],
             'time' => timeformat($row['date']),
                 'author' => $row['author'],
                         'views' => $row['views'],
             'real_name' => $row['real_name'],
                         'content' => $row['content'],
             'can_comment' => $row['can_comment'],
                         'comment_total' => $row['comment_total'],           
         );
     }
     $smcFunc['db_free_result']($dbresult);   

     // Permission!
     $permissions = explode(',',$row['permissions']);       
     $announcement_permission = count(array_intersect($user_info['groups'], $permissions)) == 0 ? false : true;
     $context['announcement'] = $announcement;
     
     // You can't see this you need the permission and the admin always can
     if ($announcement_permission == false && !$user_info['is_admin'])
         fatal_lang_error('announcement_no_permission', false);


With this instead:

while ($row = $smcFunc['db_fetch_assoc']($dbresult)){
         $announcement = array(
             'title' => $row['title'],
             'id_announcement' => $row['id_announcement'],
             'time' => timeformat($row['date']),
                 'author' => $row['author'],
                         'views' => $row['views'],
             'real_name' => $row['real_name'],
                         'content' => $row['content'],
             'can_comment' => $row['can_comment'],
                         'comment_total' => $row['comment_total'],
                    'permissions' => $row['permissions'],             
         );
     }
     $smcFunc['db_free_result']($dbresult);   

     // Permission!
     $permissions = explode(',',$row['permissions']);       
     $announcement_permission = count(array_intersect($user_info['groups'], $permissions)) == 0 ? false : true;
     $context['announcement'] = $announcement;
     
     // You can't see this you need the permission and the admin always can
     if ($announcement_permission == false && !$user_info['is_admin'])
         fatal_lang_error('announcement_no_permission', false);



I added  'permissions' => $row['permissions'], under 'comment_total' => $row['comment_total'],

It now is working for me.

drhamad

Redryder, that's not doing it for me either... getting
QuoteParse error: syntax error, unexpected T_STRING in /home/ffc/public_html/Sources/AnnouncementView.php on line 51
where line 51 is the $announcement = array( line

while ($row = $smcFunc['db_fetch_assoc']($dbresult)){
         $announcement = array(
             'title' => $row['title'],
             'id_announcement' => $row['id_announcement'],
             'time' => timeformat($row['date']),
                 'author' => $row['author'],
                         'views' => $row['views'],
             'real_name' => $row['real_name'],
                         'content' => $row['content'],
             'can_comment' => $row['can_comment'],
                         'comment_total' => $row['comment_total'],
                    'permissions' => $row['permissions'],             
         );
     }
     $smcFunc['db_free_result']($dbresult);   
 
     // Permission!
     $permissions = explode(',',$row['permissions']);       
     $announcement_permission = count(array_intersect($user_info['groups'], $permissions)) == 0 ? false : true;
     $context['announcement'] = $announcement;
     
     // You can't see this you need the permission and the admin always can
     if ($announcement_permission == false && !$user_info['is_admin'])
         fatal_lang_error('announcement_no_permission', false);
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

Nibogo

Please everybody just modify this:

FIND:

while ($row = $smcFunc['db_fetch_assoc']($dbresult)){
        $announcement = array(
            'title' => $row['title'],
            'id_announcement' => $row['id_announcement'],
            'time' => timeformat($row['date']),
                'author' => $row['author'],
                        'views' => $row['views'],
            'real_name' => $row['real_name'],
                        'content' => $row['content'],
            'can_comment' => $row['can_comment'],
                        'comment_total' => $row['comment_total'],           
        );
    }
    $smcFunc['db_free_result']($dbresult);   

    // Permission!
    $permissions = explode(',',$row['permissions']);       
    $announcement_permission = count(array_intersect($user_info['groups'], $permissions)) == 0 ? false : true;
    $context['announcement'] = $announcement;
   
    // You can't see this you need the permission and the admin always can
    if ($announcement_permission == false && !$user_info['is_admin'])
        fatal_lang_error('announcement_no_permission', false);


Replace with:

while ($row = $smcFunc['db_fetch_assoc']($dbresult)){
        $announcement = array(
            'title' => $row['title'],
            'id_announcement' => $row['id_announcement'],
            'time' => timeformat($row['date']),
            'author' => $row['author'],
            'views' => $row['views'],
            'real_name' => $row['real_name'],
            'content' => $row['content'],
            'can_comment' => $row['can_comment'],
            'comment_total' => $row['comment_total'],     
        );
    }
    $smcFunc['db_free_result']($dbresult);   

    // Permission!
    $permissions = explode(',',$row['permissions']);       
    $announcement_permission = count(array_intersect($user_info['groups'], $permissions)) == 0 ? false : true;
    $context['announcement'] = $announcement;
   
    // You can't see this you need the permission and the admin always can
    if ($announcement_permission == false || !$user_info['is_admin'])
        fatal_lang_error('announcement_no_permission', false);

Nibogo

YAGAM v2.0 FINALLY RELEASED!!!
Folks! Finally I can say of YAGAM v2.0 has been released, as you know a lot of things has been implemented in this version, a lot of changes the only way to check all the new features is installing the mod.

There is no upgrade package because there is a lot of changes in files, database, strings so you just have to uninstall the last version and install this new one.

The Changelog doesn't has all the changes do it in the version, the code has been improved and optimized and there is new integration with two popular mods, Pretty Urls and Member Color Link.

Please report any error in this thread or the issue tracker. Please consider donate to YAGAM project, requires a lot of my free time to develop this version so any help is more than welcome ;) You can donate to nibogo2[at]gmail[dot]com

Enjoy It!

Changelogs:


Version 2.0 [Big Upgrade] - June 23, 2009
- A lot of changes in all the code, structure and files, too many changes to be listed here.
- Fixed more bugs.
- Added Sort Options based on the Same Topics Sort Options .
- Added Support for Member Color Link Mod on MessageIndex.
- Added Announcement Log (View who see the Announcement).
- Added Force Users to Read Announcement after Login.
- Added some improvements to the linktree and Pages Title.
- Cleaned the code of the MessageIndex Edit.
- Fixed some minor additional bugs.
- Added Global Announcements Settings with some options.
- Added Support for Sticky Topics Bar with Global Announcements and Normal Topic.
- Pretty Urls Support.
- Changed the Panel Administration now with the SMF Admin Section Layout.
- Added YAGAM Version Panel.
- Added SSI Functions with Announcement 'ssi_announcement(5)' and random announcement 'ssi_random_announcement()'.
- Much more, So many things to be included in this changelog

Özgür

This version still have permission problem. (I have clean install.)
So Long

Advertisement: